autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_LIB acts very strangely in Darwin


From: Stepan Kasal
Subject: Re: AC_CHECK_LIB acts very strangely in Darwin
Date: Wed, 31 Aug 2005 15:26:26 +0200
User-agent: Mutt/1.4.1i

Hello,

in general, "The Autoconf Way" is to check for feattures, not for
platform name.

For example:

>   *-cygwin*)
>     EXE_EXT=".exe"

A variable "EXEEXT" is provided automatically by Autoconf.
And the detection works also for mingw and all other platforms.

> case "$host" in
>   *-sun-solaris*)
>     CFLAGS="$CFLAGS -DSunOS=1"
>     ;;

This hack might be necessary, though.  I'm not sure what you want to achieve.
But if you are using Automake, then
        AC_SUBST([AM_CPPFLAGS], [-DSunOS=1])
might be more appropriate here.

> [...] configure acts absolutely crazy
...
> checking sys/ioctl.h usability... no
> checking sys/ioctl.h presence... yes
> configure: WARNING: sys/ioctl.h: present but cannot be compiled
> configure: WARNING: sys/ioctl.h:     check for missing prerequisite headers?
> configure: WARNING: sys/ioctl.h: see the Autoconf documentation
> configure: WARNING: sys/ioctl.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: sys/ioctl.h: proceeding with the preprocessor's result
> configure: WARNING: sys/ioctl.h: in the future, the compiler will take 
> precedence
> configure: WARNING:     ## ------------------------------------------ ##
> configure: WARNING:     ## Report this to the AC_PACKAGE_NAME lists.  ##
> configure: WARNING:     ## ------------------------------------------ ##

There is nothing crazy here.  Perhaps there are some headers have to be included
before sys/ioctl.h?  Look into config.log, to see details.

>   *-*-openbsd* | *-*-freebsd*)
>     CFLAGS="$CFLAGS -pthread"
>     ac_ext=c
> ac_cpp='$CPP $CPPFLAGS'
...
> So, autoconf just drops the end of the case statement.

No, it doesn't, the esac is somewhere below.  It just happens that the
expansion of AC_CHECK_LIB is that long.

But it seems AC_SEARCH_LIBS might be more appropriate here:
AC_SEARCH_LIBS([pthread_exit], [c_r kse], [pthread=yes])
It also modifies LIBS; see the manual for details.

HTH,
        Stepan




reply via email to

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