Skip to contentSkip to conversation

configure.in, wrong test for gethostbyname and libnsl

PATCH New didier . 1 participant 1 message Sep 4, 2006

Subsystems (2)
lore
Share & tools
lore

didier .

author
#0 lore raw

PATCH 1/1 configure.in, wrong test for gethostbyname and libnsl

Hi,

On a glibc system gethostbyname is in libc not libnsl

In the great autoconf tradition the patch is a copy and past from ethereal

Didier

configure.in renamed from configure.in.orig +7 -3
@@ -147,8 +147,13 @@
 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]))
@@ -172,7 +177,6 @@
     AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
 fi
 AC_SUBST(LIBSOCKET)
-AC_SUBST(LIBNSL)
 AC_SUBST(LIBCRYPT)
 AC_SUBST(LIBBSD)
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs