From 8ea42a995e747f5a735c53771450447fa9db3476 Mon Sep 17 00:00:00 2001 From: "did447@gmail.com" Date: Fri, 13 Oct 2006 15:35:38 -0400 Subject: [PATCH] On a glibc system gethostbyname is in libc not libnsl Signed-off-by: Kevin Coffman Change configure test for gethostbyname, and properly determine whether "-lnsl" or "-lsocket" are really required. --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index a70b708..0ccc6b2 100644 --- a/configure.in +++ b/configure.in @@ -147,8 +147,13 @@ AC_BSD_SIGNALS dnl ************************************************************* dnl * Check for required libraries dnl ************************************************************* -AC_CHECK_LIB(socket, main, [LIBSOCKET="-lnsl"]) -AC_CHECK_LIB(nsl, main, [LIBNSL="-lnsl"]) +AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"])]) +AC_SUBST(LIBNSL) + +AC_CHECK_FUNC(connect, , + AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"], + AC_MSG_ERROR(Function 'socket' not found.), $LIBNSL)) + AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"]) if test "$enable_nfsv4" = yes; then AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support])) @@ -170,7 +175,6 @@ if test "$knfsd_cv_glibc2" = no; then AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"]) fi AC_SUBST(LIBSOCKET) -AC_SUBST(LIBNSL) AC_SUBST(LIBCRYPT) AC_SUBST(LIBBSD) -- 2.39.5