|
From: Hugh M. <das...@gm...> - 2007-07-05 10:07:02
|
Hi Keith, On 04/07/07, Keith MARSHALL wrote: > Under Cygwin, `gcc -mno-cygwin' is sufficient to ensure that the > MinGW compiler is used, in place of Cygwin's own; for C++ code, > you will also need CXX='g++ -mno-cygwin', and I guess for FORTRAN, > F77='g77 -mno-cygwin'; (I'm far from certain of the latter). I thought that gcc would normally invoke g++ with '-mno-cygwin' atuomatically, like gcc invokes g++ when needed. Is that correct? As for Fortran77, I'm not sure about that at all. > `--host=x --build=y' is the standard autoconf way to initiate a > cross-compile. The purist in me says that, if you use this method > of specifying the host compiler, then you should *not* need to use > `-mno-cygwin' at all. I did try it once upon a time[1], and IIRC, > this is in fact the case. > > Conversely, if you use CC='gcc -mno-cygwin', and friends, you should > not need `--host', (nor `host_alias'), nor `--build', IIRC. I would have thought that using the CC='gcc -mno-cygwin' would invoke MinGW, but isn't the '--host' configure option necessary to tell the compiler that it would be building for 23/64 bit Windows? > `host_alias=i686-pc-mingw32' is completely redundant here; configure > sets it internally anyway, to identically the same value as you give > with `--host'. I wasn't aware of that. Now I know. > An important point to note: if you do adopt the `--host/--build' > invocation syntax, then the value you specify with `--host' must > *exactly* match the prefix by which your MinGW tool chain is > identified, within your Cygwin file system; in Hugh's example > above, this would imply that the MinGW gcc is installed into a > PATH directory, with the name `i686-pc-mingw32-gcc.exe', (and > similarly for `i686-pc-mingw32-g++.exe', `i686-pc-mingw32-ld.exe', > etc.); on my Cygwin installation, no such tool chain exists, yet > `-mno-cygwin' does invoke the MinGW compile mode[2]. Yes. That is true. Those files with the toolchain do not exist, but Cygwin seems to default to its own set, while still invoking MinGW. Hugh |