apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Rossi <bob_ro...@cox.net>
Subject Re: dbd pgsql autotools patch
Date Wed, 21 May 2008 00:26:01 GMT
On Wed, May 21, 2008 at 10:07:25AM +1000, Bojan Smojver wrote:
> On Tue, 2008-05-20 at 20:04 -0400, Bob Rossi wrote:
> > I noticed you changed everything but the AC_CHECK_LIB, do you believe
> > that is unnecessary, or are you thinking about it?
> Not required. We set LDFLAGS specifically for the test (hence the
> APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS])) and then we restore back the
> original after the test. Something like this:
>   old_libs="$LIBS"
>   old_cppflags="$CPPFLAGS"
>   old_ldflags="$LDFLAGS"
> [... test ...]
>   LIBS="$old_libs"
>   CPPFLAGS="$old_cppflags"
>   LDFLAGS="$old_ldflags"
> So, we should be all good now, as long as the latest build/dbd.m4 works
> for you on all platforms.

OK, the problem is, if you don't add the libraries to the AC_CHECK_LIB,
you end up with this,

configure:36502: gcc-sjlj -o conftest.exe -g -gstabs -Wall  -D_LARGEFILE64_SOURCE
-I.../POSTGR~1/POSTGR~1.1/include -L...POSTGR~1/POSTGR~1.1/lib
-lpgport -lm -lSecur32 -lws2_32 -lshfolder conftest.c -lpq   >&5

which still failed. That's because as you can see the -lpq went at the
end which is incorrect. If you add the libs to the AC_CHECK_LIB command,
all the other libraries go after the -lpq. Here is some documentation on
AC_CHECK_LIB from the autoconf manual,

  If linking with library results in unresolved symbols that would be resolved 
  by linking with additional libraries, give those libraries as the 
  other-libraries argument, separated by spaces: e.g., -lXt -lX11. 
  Otherwise, this macro fails to detect that library is present, because linking 
  the test program always fails with unresolved symbols. The other-libraries 
  argument should be limited to cases where it is desirable to test for one 
  library in the presence of another that is not already in LIBS. 

I hope this is helpful. Thank you for your tireless effort!

Bob Rossi

View raw message