Mo DeJong wrote:
> After the recent changes to AC_CYGWIN and AC_MINGW32, I noticed
> a new problem.
>
> Here is a little test that would have worked with the old
> approach that tried to compile a file, but it now fails.
>
> dnl If a mingw compile is detected and cygwin.h is also found
> dnl then error out because they are trying to build with the
> dnl -mno-cygwin flag under Cygwin. It is not supported for C++.
> if test "x$MINGW32" = "xyes" &&
> test "x$ac_cv_header_sys_cygwin_h" = "xyes" ; then
>
> AC_MSG_ERROR([Unable to compile under Cygwin in Mingw mode,
> Mingw version of the stdc++ library is not available with Cygwin.
> You will need to install the native Mingw tools from
> http://www.mingw.org or compile Jikes in Cygwin native mode
> by not passing -mno-cygwin in the CXXFLAGS.])
> fi
>
This doesn't have to be true and probably won't be in the future. I
could now manually add the MinGW version of libstdc++.a to
/usr/lib/mingw/ under the Cygwin directory tree and have this library
work for the -mno-cygwin switch.
>
> The problem is that MINGW32 only gets set if $host is set
> to something that includes *mingw32*. When I compile like
> this, the host default to the detected build which is cygwin.
>
> .../configure CXXFLAGS="-g -mno-cygwin"
>
> Any ideas? I just don't see how we can detect this case
> without compiling something to see if -mno-cygwin is
> getting passed to the Cygwin version of gcc.
>
You should
CC='gcc -mno-cygwin' ../configure -host=mingw32
When using Cygwin's gcc to compile for MinGW then you are in fact cross
compiling.
Cheers,
Earnie.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com