From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B7B62BC37 for ; Mon, 28 Sep 2009 10:33:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoEAKcRwErRVdrRkGdsb2JhbACRZYhePwEBAQEJCQwHEwOqNI10AQMCBYQZBYFYhzM X-IronPort-AV: E=Sophos;i="4.44,465,1249250400"; d="scan'208";a="35126996" Received: from mail-bw0-f209.google.com ([209.85.218.209]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Sep 2009 10:33:29 +0200 Received: by bwz5 with SMTP id 5so3212257bwz.27 for ; Mon, 28 Sep 2009 01:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=Mi+iw3sRJe9q05lVavoYmcYlLAcg2VdsvkvMSeXG7AI=; b=qV/vJUcqtYeannWdgIvyjXnXXfk7uXYe8DxvZipWyZCw0DjpRupbNYPqd4s7f3aIRy YU+PXT4eorJC3iwkZv2WxajftNvLTXSJueB89XR8Rw+kbtVRl6ywqwQiM5WXqBLjHxY6 QLnCrq7leRRe8VYvjWAPBlTT1Mo61zQdbM9wA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Z6wv90MEv2jr3pC2wy3/1sMxFMC16yZSnpYu+RwV9IpxCT9+RVEdD4sSJQq9dwiruP Hu4w0a36jriEVbZUTBPtXvPHPOBZAYqYiuhMELw24T5ZEN2if87lPRdbdnXNoN1KPAu7 /Yo+SVz9xsPeF+pRisKoz9bqOJrvO2JVV3DvQ= MIME-Version: 1.0 Sender: oandrieu@gmail.com Received: by 10.204.25.152 with SMTP id z24mr2865610bkb.44.1254126809155; Mon, 28 Sep 2009 01:33:29 -0700 (PDT) In-Reply-To: <4ABFD1F4.8080606@gmail.com> References: <4ABFD1F4.8080606@gmail.com> Date: Mon, 28 Sep 2009 10:33:29 +0200 X-Google-Sender-Auth: c9dff7626f05a3e1 Message-ID: <95513600909280133i4325743nba48d1fddaa5fe50@mail.gmail.com> Subject: Re: [Caml-list] Pre-processor sub-process From: Olivier Andrieu To: matthieu.dubuget@gmail.com Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; andrieu:01 oandrieu:01 matthieu:01 dubuget:01 matthieu:01 dubuget:01 mingw:01 ocaml:01 cygwin:01 uname:01 cygwin:01 cpp:01 cpp:01 flags:01 ocamlc:01 Hi, On Sun, Sep 27, 2009 at 22:58, Matthieu Dubuget wrote: > Hello, > > I'm trying to have bin-prot compiled with mingw version of OCaml with > the original OCamlMakefile. > > This fails on my computer. > > I reproduced the problem here: > > On linux, there is no problem: > > On cygwin: > $ uname > CYGWIN_NT-5.1 > $ echo $BIN_PROT_CPP > cpp > $ echo $pp > $BIN_PROT_CPP $ARCH_FLAGS > $ ocamlc -c -verbose -pp "echo $pp && $pp" write_ml.ml > + echo $BIN_PROT_CPP $ARCH_FLAGS && $BIN_PROT_CPP $ARCH_FLAGS > "write_ml.ml" > c:\DOCUME~1\matt\LOCALS~1\Temp\camlpp8a6978 > $BIN_PROT_CPP $ARCH_FLAGS > '$BIN_PROT_CPP' n'est pas reconnu en tant que commande interne > ou externe, un programme excutable ou un fichier de commandes. > File "write_ml.ml", line 1, characters 0-1: > Error: Preprocessor error > > It seems that when the pre-processor is called, the environment is not > given to the sub-process? > > Can anybody reproduce this problem (or better: provide a solution), or > did I something bad? what ocaml-win32 port are you using exactly ? This looks like the mingw (or MSVC) port because the error message you get looks like one from CMD.EXE, the Windows shell. The cygwin port uses cygwin's sh whereas the mingw/msvc port use cmd.exe. You'll have to use cmd.exe's syntax for environment variable expansion: %BIN_PROT_CPP% I believe. HTH, -- Olivier