[Top][All Lists]

[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 16:41:34 +0200
User-agent: Mutt/1.4.1i

Hello Aarno,

> After commenting out AC_CHECK_LIB, all header checks were ok.

you mentioned it, but I missed that.

> Really crazy things are:
> checking whether we are using the GNU C compiler... no
> checking for ANSI C header files... no
> [etc.]

I missed that when I read your first mail.

When you sent the second output (to convince Ralf that commenting out
AC_CHECK_LIB fixes it), I extracted both, run diff on them...

OK, now I understand what you mean.

The reason is that you call AC_CHECK_LIB too early, and in a conditional.
AC_CHECK_LIB calls (indirectly)
And that means that the AC_PROG_CC is expanded there.
Later on, another macro calls
but AC_PROG_CC is not expanded there, because it was expanded above.
The result is that the AC_PROG_CC is skipped on all platforms except

The above explanation might sound complicated.  A quick hack which
should fix it would be to call AC_PROG_CC shortly after AC_INIT.

But a better solution might be to move the AC_CHECK_LIB calls lower,
after the basic checks.  (Those which failed when the configure was

In other words, you need to execute those two calls before the macro
which looks for pthread_exit in -lpthread.  So find out which macro does
it, and move the two AC_CHECK_LIBS calls just above this macro.

And you don't have to surround the two AC_CHECK_LIBS calls by any `case'
or `if' testing for platform name.  Just run the check.
(It will slow the script, but it's not that important.
But your script will work with future platforms which have a new name,
say "foobsd", but behave just like "freebsd".)

This is what I said: don't look at the platform name, check for the
features.  "Having libc_r" or "having libkse" is such a feature.

I understand now that my previous suggestion to use AC_SEARCH_LIBS was
not correct.  It would find the empty pthread_exit stub, which is part
of libc on some platforms.

Hope this helps,
        Stepan Kasal

reply via email to

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