apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Misch <n...@cs.caltech.edu>
Subject [PATCH] Don't include extra libs on IRIX
Date Mon, 05 Jan 2004 02:04:16 GMT
Hi all,

While building CVS HEAD apr on IRIX 6.5, linker warnings accumulate in
config.log and appear following the final link command because libnsl and
libsocket include code duplicated in libc on that platform.  I propose changing
the AC_CHECK_LIB checks on nsl and socket to AC_SEARCH_LIBS checks, so we only
use those libraries if we actually _need_ them for certain functions.

You can find a brief discussion of this issue on the SGI "freeware" site:

With this patch, CVS HEAD continues to build fine for me on mips-sgi-irix6.5,
i386-unknown-freebsd4.5, and sparc-sun-solaris2.7.

I see two scenarios that could make this change unwise/incomplete:

1) Some platform does not need libnsl for gethostbyname but does need it for
another function we use.  In that case, we should test the other function in
place of or in addition to gethostbyname.

2) Some platform has a broken version of the socket functions weak-linked into
libc, but one must use -lsocket for the POSIX-compliant versions.  Is anyone
aware of such a platform?  I think the other way around is more likely, though.


diff -u -r1.560 configure.in
--- configure.in	2 Jan 2004 19:24:13 -0000	1.560
+++ configure.in	5 Jan 2004 00:40:11 -0000
@@ -457,9 +457,8 @@
 dnl It should check for LIBS being empty and set LIBS equal to the new value
 dnl without the extra " " in that case, but they didn't do that.  So, we
 dnl end up LIBS="-lm -lcrypt -lnsl  -ldl" which is an annoyance.
-AC_CHECK_LIB(nsl, gethostbyname)
 AC_SEARCH_LIBS(gethostname, nsl)
-AC_CHECK_LIB(socket, socket)
+AC_SEARCH_LIBS(socket, socket)
 AC_SEARCH_LIBS(crypt, crypt ufc)
 AC_CHECK_LIB(truerand, main)
 AC_SEARCH_LIBS(modf, m)

View raw message