On Sun, Jan 04, 2004 at 06:04:16PM -0800, Noah Misch wrote: > 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: > http://freeware.sgi.com/howto.html#a0 > > 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.
Solaris does need libnsl for inet_ntop... this is quite risky. I think it's safer to also change the check for gethostbyname to use AC_SEARCH_LIBS. > 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. Agreed... thanks for the patch, I've added these in. joe
