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: Aarno Syvänen
Subject: Re: AC_CHECK_LIB acts very strangely in Darwin
Date: Wed, 31 Aug 2005 15:39:15 +0200


On Aug 31, 2005, at 3:05 PM, Ralf Wildenhues wrote:

Hi Aarno,

* Aarno Syvänen wrote on Wed, Aug 31, 2005 at 02:45:52PM CEST:

I try to configure a product to various platforms with following case:

case "$host" in

*snip*

                if  [[ "$DONE" = 0 ]]

*snip*


When I check generated configure script, I noticed following:


*snip*

                if  [ "$DONE" = 0 ]



See what's happening?  Read up about m4 quoting:
  info Autoconf "M4 Quotation"

Short story: [ ] are quotation characters within configure.ac files.
That's one reason why many m4 macros use "test" instead for readability.

Yep, configure script has following:

for E in "MacOSX10.4u.sdk" "MacOSX10.4.0.sdk" "MacOSX10.3.9.sdk" "MacOS$
        do
                if  [ "$DONE" = 0 ]
                then
                        if [ -d "/Developer/SDKs/${E}" ]
                        then
                                DONE="1"
                                SDK="${E}"
                        fi
                fi
        done
        if [ "$SDK" = "MacOSX10.4u.sdk" ]
        then
        then
                ARCH="-arch ppc -arch i386"
echo "building for PPC and i386 architecture on MacOS X"
        fi

        if [ "$SDK" ]
        then
CFLAGS="$CFLAGS -DDARWIN=1 -L/Developer/SDKs/${SDK}/usr/ lib -I/Deve$
        else
            CFLAGS="$CFLAGS -DDARWIN=1"
        fi

If configure.in has two square brackets, configure has only one.



So, autoconf just drops the end of the case statement.


Nope, it doesn't. The stuff you are seeing is the expansion of the two
AC_CHECK_LIB macros you use.  The end of the case statement will be
after them.  Side note: if they were indeed gone, your shell would've
screamed "syntax error" or something similar and bailed out.

Yep, expect if you have *really* bad luck



If I comment out AC_CHECK_LIBS, everything is ok.


I don't think so.

Believe me, I tested. Just do
dnl AC_CHECK_LIB([c_r], [pthread_exit], [LIBS="$LIBS -lc_r"; pthread="yes"]) dnl AC_CHECK_LIB([kse], [pthread_exit], [LIBS="$LIBS -lkse"; pthread="yes"])

And you would get:

checking build system type... powerpc-apple-darwin8.2.0
checking host system type... powerpc-apple-darwin8.2.0
building for PPC and i386 architecture on MacOS X
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for bison... bison -y
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for convert... no
checking for perl... /usr/bin/perl
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for short... yes
checking size of short... 2
checking for int... yes
checking size of int... 4
checking for long... yes
checking size of long... 4
checking for long long... yes
checking size of long long... 8
checking for log in -lm... yes
checking for accept in -lsocket... no
checking for inet_ntoa in -lnsl... no
checking for inet_ntop in -lresolv... yes
checking for inet_ntop in -lbind... no
checking for pthread_exit in -lpthread... yes
checking for libiconv in -liconv... yes
checking for ANSI C header files... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking execinfo.h usability... no
checking execinfo.h presence... no
checking for execinfo.h... no
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes

And so on. Now everything is ok.



So what is the problem here ?


Look at config.log for what else might've gone wrong, it most likely is
independent of the configure.ac snippet you posted.  Post parts of
config.log if you can't figure it out.

Cheers,
Ralf







reply via email to

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