[llvm-commits] Patch for compiling with Mingw/Cygwin
Chris Lattner
clattner at apple.com
Mon Jan 7 10:39:44 PST 2008
On Jan 7, 2008, at 8:12 AM, Alain Frisch wrote:
> The attached patch makes it possible to compile LLVM under Mingw/
> Cygwin (that is, with "gcc -mno-cygwin" under Cygwin). The only
> problem which I could not address with configure flags is that the
> tblgen tool expect Windows paths, whereas the build system uses
> Cygwin paths. The patch introduce a Gnu Make function SYSPATH which
> performs the translation if needed.
>
> Ideally, the SYSPATH variable in Makefile.config should be set by
> the configure script when given a special option (the same option
> could also set the other needed options -- see below). As I didn't
> want to play with autoconf, the current solution requires an
> explicit argument to be passed to make for the compilation.
>
> With the patch, I was able to compile with the following commands:
>
> ./configure --build=i686-pc-mingw32 CC="gcc -mno-cygwin" CXX="g++ -
> mno-cygwin" ac_cv_search_dlopen=no ac_cv_lib_dl_dlopen=no
>
> make USE_CYGPATH=1
hi Alain,
A couple of comments: You really need to add some comments in
Makefile.config.in over the stuff that sets SYSPATH to indicate what
it is used for, and probably over the TableGen = ... line in
Makefile.rules. If you don't do this, someone may break this in the
future.
Another thing: does it work to add something like this to
makefile.rules?
ifeq ($(OS),Cygwin)
USE_CYGPATH := true # Actually, it would be better to do the
syspath stuff here and remove USE_CYGPATH
endif
The issue is that I don't really want a magic make variable floating
around that people need to know to use. Maybe there is some reason
that this can't be made to work, if that's the case, please do figure
out the autoconf stuff.
Thanks!
-Chris
More information about the llvm-commits
mailing list