summaryrefslogtreecommitdiff
path: root/source4/lib/socket/config.m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-05-01 13:39:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:29 -0500
commita4a2a4b833e7738db2282b3e5a37bc59fc0983dc (patch)
tree3ca4a311661b84470ed80bf8cafc3f3867250533 /source4/lib/socket/config.m4
parente595ede02fe9c80a88b5a7da4721c3c01808c276 (diff)
downloadsamba-a4a2a4b833e7738db2282b3e5a37bc59fc0983dc.tar.gz
samba-a4a2a4b833e7738db2282b3e5a37bc59fc0983dc.tar.bz2
samba-a4a2a4b833e7738db2282b3e5a37bc59fc0983dc.zip
r15376: Add detection of -lnsl, required for building on SUN boxes.
(This used to be commit 49bac12767ca59095ad6609a3826f7f17ddb601c)
Diffstat (limited to 'source4/lib/socket/config.m4')
-rw-r--r--source4/lib/socket/config.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index 45e5406f0c..cb593ea184 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -37,6 +37,23 @@ fi
SMB_EXT_LIB(EXT_SOCKET,[${SOCKET_LIBS}],[${SOCKET_CFLAGS}],[${SOCKET_CPPFLAGS}],[${SOCKET_LDFLAGS}])
+AC_CHECK_FUNCS(gethostbyname)
+if test x"$ac_cv_func_gethostbyname" = x"no"; then
+ AC_CHECK_LIB_EXT(nsl_s, NSL_LIBS, gethostbyname)
+ AC_CHECK_LIB_EXT(nsl, NSl_LIBS, gethostbyname)
+ AC_CHECK_LIB_EXT(socket, NSL_LIBS, gethostbyname)
+ SMB_ENABLE(EXT_NSL,YES)
+ dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here, because the value
+ dnl has been cached.
+ if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" != x"yes" &&
+ test x"$ac_cv_lib_ext_nsl_gethostbyname" != x"yes" &&
+ test x"$ac_cv_lib_ext_socket_gethostbyname" != x"yes"; then
+ AC_MSG_ERROR([no gethostbyname() function available!])
+ fi
+fi
+
+SMB_EXT_LIB(EXT_NSL,[${NSL_LIBS}],[],[],[])
+
############################################
# check for unix domain sockets
AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [