Version française
Home     About     Download     Resources     Contact us    
Browse thread
Pre-processor sub-process
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] Pre-processor sub-process
Hi,

On Sun, Sep 27, 2009 at 22:58, Matthieu Dubuget
<matthieu.dubuget@gmail.com> 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