[Omake] Cygwin toolchain using standard win32 install

Aleksey Nogin anogin at hrl.com
Tue May 29 09:58:43 PDT 2007


On 24.05.2007 12:59, Andrew Gacek wrote:

> I'm using the omake 0.9.8 on windows which I installed using the
> prepackaged msi file on the downloads page. My problem is that my
> OSTYPE is listed as Win32 even though I'm using the Cygwin toolchain
> (both for ocaml and C). Thus omake tries to compile C code using
> cl.exe instead of gcc. My workaround for this has been to begin my
> OMakeroot file with
> 
>  if $(equal $(OSTYPE), Win32)
>    OSTYPE = Cygwin
>    GCC_FOUND = true
>    GXX_FOUND = true
>    export
> 
>  open build/C
>  ...
> 
> And in my OMakefile I have
> 
>  if $(equal $(OSTYPE), Cygwin)
>    YACC = bison -by
>    LEX = flex
>    EXE = .exe
>    export
> 
>  ...
> 
> This seems rather ugly and prevents anybody from using the MS tool
> chain to compile the project. Does anybody know a better way to deal
> with this?

Andrew,

Being able to select a toolchain to use under Win32 
(MSVC/MinGW/Cygwin/etc) is a common RFE and there have been a number of 
approaches suggested for addressing this - see, for example, 
http://bugzilla.metaprl.org/show_bug.cgi?id=569 , and there is more in 
the mailing list archives.

Unfortunately, so far we have not created any "standard" way of doing 
this. However, overriding the OSTYPE variable in OMakeroot (_before_ any 
files are opened) is not that unreasonable. If you want others to be 
able to still use the MS tools, you may want to add some extra condition 
to this override - for example, add some static test verifying whether 
Cygwin stuff is in path (e.g. test for gcc), or test for some special 
environment variable (e.g. OMAKE_CYGWIN) that you would set, but others 
would not.

Note that as long as you set OSTYPE before opening any files (including 
build/Common and build/C), then you do not need to also mess with 
GCC_FOUND/YACC/LEX/EXE/etc - as long as you set OSTYPE early enough, all 
those will follow automatically.

Aleksey


-- 
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA


More information about the Omake mailing list