Warren Young <warren@xxxxxxxxxxx> writes: > We'd rather not explicitly add -lnsl to our autoconf test, because we're > under the impression that this is one of those things that autoconf is > supposed to handle automatically. Are we wrong? Well, Autoconf has never handled this automatically for anyone else. :) > Is there something besides explicitly adding that library to the LDFLAGS > variable that we should be doing instead? dnl The rat's nest of networking libraries. The common cases are not to dnl need any extra libraries, or to need -lsocket -lnsl. We need to avoid dnl linking with libnsl unless we need it, though, since on some OSes where dnl it isn't necessary it will totally break networking. Unisys also dnl includes gethostbyname in libsocket but needs libnsl for socket(). AC_SEARCH_LIBS([gethostbyname], [nsl]) AC_SEARCH_LIBS([socket], [socket], , [AC_CHECK_LIB([nsl], [socket], LIBS="$LIBS -lsocket -lnsl", , -lsocket)]) -- Russ Allbery (rra@xxxxxxxxxxxx) <http://www.eyrie.org/~eagle/> _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf