autoconf
[Top][All Lists]
Advanced

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

Re: gcc -mno-cygwin and autoconf 2.50


From: Ralf Corsepius
Subject: Re: gcc -mno-cygwin and autoconf 2.50
Date: Wed, 30 May 2001 10:29:37 +0200

Tim Van Holder wrote:
> 
> On 29 May 2001 23:20:26 +0200, Teun Burgers wrote:
> > Hi
> >
> > I am maintaining the configure script for
> > gnugo (http://www.fsf.org/software/gnugo/)
> >
> > Under autoconf 2.13 when you had AC_EXEEXT
> > in you configure.in you could do under cygwin
> > a mingw32 build as follows:
> >
> > env CC='gcc -mno-cygwin' ./configure
> >
> > AC_EXEEXT would set ac_cv_mingw32=yes,
> > so you were able to test for mingw32.
> >
> > For instance I had the test
> > if test $ac_cv_mingw32=yes;then
> >    LIBS="$LIBS -lwsock32"
> > fi
> >
> > Under autoconf 2.50 this does not work,
> > since ac_canonical_host will detect cygwin.
> >
> > I can work around this by writing a header
> > test for __MINGW32__
> > What do you think is the best solution to this problem?
> >
> 
> Either that, or patching config.guess so it'll detect the right
> environment to begin with.
> Problem is that you're really using Cygwin, which just happens to be
> able to behave like mingw32 - so some tests for cygwin may actually do
> the right thing.  For example, using gcc -mno-cygwin does not cause a
> change in behaviour for tools other than gcc; so if some configure.in
> checks $host for cygwinnity, it might be to decide whether it should use
> the system's sed or not - that test should behave in a cygwin-like
> fashion for you as well, regardless of whether you're generating mingw32
> code.
> 
> Of course, if you need to specify CC anyway, you might as well specify
> your host system too:
> 
>     ./configure CC='gcc -mno-cygwin' --host=i386-pc-mingw32
> 
> After all, you're basically cross-compiling, aren't you.
IMO, yes. 

However, I am not familiar with mingw, but is there a reason why the
standard autoconf approach of applying feature tests instead doesn't
work in this particular case?
I mean, applying AC_CHECK_HEADER[S], AC_CHECK_LIB[S], AC_TRY_LINK
and friends to detect a system's way to provide a certain
functionality. At least I can imagine that Teun's application needs
some networking function from wsock32 and would fail to link
otherwise, i.e. it should be link-time detectable, i.e. detectable
by AC_CHECK_FUNC or similar.

Ralf



reply via email to

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