[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem detecting Cygwin/Mingw compiler

From: Mo DeJong
Subject: Re: Problem detecting Cygwin/Mingw compiler
Date: Thu, 4 Jan 2001 17:00:21 -0800 (PST)

On Thu, 4 Jan 2001, Earnie Boyd wrote:

> 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
> > 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.

Well sure, it could be fixed. I just want to make sure people
don't accidently do it right now, since it is broken right now.

> > 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.

I know that, my point is that I want to error out when
the -mno-cygwin flag is passed to Cygwin's gcc. The old
compile based test worked for this case, the new one
will not unless the user provides a --host argument.
That is not very useful, since folks would be doing the
wrong thing to begin with.

Mo DeJong
Red Hat Inc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]