[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Failure to use -lnsl on Solaris with AC_CHECK_LIB
From: |
Russ Allbery |
Subject: |
Re: Failure to use -lnsl on Solaris with AC_CHECK_LIB |
Date: |
Tue, 30 Aug 2005 17:04:08 -0700 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.17 (linux) |
Warren Young <address@hidden> 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 (address@hidden) <http://www.eyrie.org/~eagle/>