autoconf
[Top][All Lists]
Advanced

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

AC_CHECK_LIB


From: John Poltorak
Subject: AC_CHECK_LIB
Date: Tue, 9 Oct 2001 11:57:05 +0100

Can anyone comment on the attached note which explains a discrepancy in 
the results of AC_CHECK_LIB when run on OS/2?

-- 
John

--- Begin Message --- Subject: Re: [UnixOS2] -lcposix Date: Tue, 9 Oct 2001 10:14:17 +0200 User-agent: Mutt/1.3.17i
On Mon, Oct 08, 2001 at 09:40:03PM +0200, Andreas Buening wrote:
> Okay, my last mail has lost all important info, so I'll try again:
> 
> Holger Veit wrote:
> > 
> > On Mon, Oct 08, 2001 at 04:20:02PM +0100, John Poltorak wrote:
> > [...]
> > > The config.h file produced when building SED contains this:-
> > >
> > > /* Define if you have the `cposix' library (-lcposix). */
> > > #define HAVE_LIBCPOSIX 1
> > >
> > > This is something which seems to have occurred only recently.
> > >
> > > Not sure how to trace where is gets set though...
> > 
> > There should be a test somewhere in configure which here returns
> > an incorrect result.
> 
> Yes and because it seems to be a essential problem for some of you
> I've searched for the responsible macro. And here it is:
> 
> configure.in:
> 
> Replace
> 
> AC_CHECK_LIB(cposix,strerror)
> 
> by:
> 
> AC_CHECK_FUNC([strerror])
> if test "$ac_cv_func_strerror" != "yes"; then
>   AC_CHECK_LIB(cposix,strerror)
> fi
> 
> But please don't ask me why AC_CHECK_LIB successes on OS/2 while it
> fails on Linux (both don't have a cposix).

This test is Linuxish-only, and entirely WRONG! Effectively it is based 
on the following assumption: libc does not contain strerror, whereas 
libcposix does. So the test makes a "void main(void) {strerror(); }" 
and compiles it with "$CC -o foo test.c -lcposix". 

Under Linux this will work if libcposix exists, and fail if not 
(old Linux version).

Under EMX this will return true even without an existing libcposix, because
strerror is in libc and the compile line implicitly adds a -lc, so the
above gets compiled correctly.

I'd recommend a bug report to the autoconf people.

Holger

-- 
Please update your tables to my new e-mail address: 
holger.veit$ais.fhg.de  (replace the '$' with '@'  -- spam-protection)


--- End Message ---

reply via email to

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