summaryrefslogtreecommitdiff
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
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)
-rw-r--r--source4/lib/basic.mk2
-rw-r--r--source4/lib/socket/config.m417
-rw-r--r--source4/lib/socket/config.mk8
-rw-r--r--source4/lib/util/config.mk2
-rw-r--r--source4/librpc/config.mk2
5 files changed, 24 insertions, 7 deletions
diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk
index 27f1f1afb9..c60e95e0c4 100644
--- a/source4/lib/basic.mk
+++ b/source4/lib/basic.mk
@@ -25,7 +25,7 @@ PRIVATE_PROTO_HEADER = netif/proto.h
OBJ_FILES = \
netif/interface.o \
netif/netif.o
-PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL
+PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL EXT_NSL
# End SUBSYSTEM LIBNETIF
##############################
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, [
diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk
index d0b19e1ecf..fc3f59b580 100644
--- a/source4/lib/socket/config.mk
+++ b/source4/lib/socket/config.mk
@@ -6,8 +6,8 @@ SUBSYSTEM = LIBSAMBA-SOCKET
OUTPUT_TYPE = INTEGRATED
OBJ_FILES = \
socket_ipv4.o
-PUBLIC_DEPENDENCIES = EXT_SOCKET
-PRIVATE_DEPENDENCIES = LIBSAMBA-ERRORS
+PUBLIC_DEPENDENCIES = EXT_SOCKET EXT_NSL
+PRIVATE_DEPENDENCIES = LIBSAMBA-ERRORS
# End MODULE socket_ipv4
################################################
@@ -18,7 +18,7 @@ SUBSYSTEM = LIBSAMBA-SOCKET
OUTPUT_TYPE = INTEGRATED
OBJ_FILES = \
socket_ipv6.o
-PUBLIC_DEPENDENCIES = EXT_SOCKET
+PUBLIC_DEPENDENCIES = EXT_SOCKET EXT_NSL
# End MODULE socket_ipv6
################################################
@@ -29,7 +29,7 @@ SUBSYSTEM = LIBSAMBA-SOCKET
OUTPUT_TYPE = INTEGRATED
OBJ_FILES = \
socket_unix.o
-PUBLIC_DEPENDENCIES = EXT_SOCKET
+PUBLIC_DEPENDENCIES = EXT_SOCKET EXT_NSL
# End MODULE socket_unix
################################################
diff --git a/source4/lib/util/config.mk b/source4/lib/util/config.mk
index a14ffb5f79..4e00e2d7e2 100644
--- a/source4/lib/util/config.mk
+++ b/source4/lib/util/config.mk
@@ -31,7 +31,7 @@ OBJ_FILES = xfile.o \
module.o
PUBLIC_DEPENDENCIES = \
LIBREPLACE LIBCRYPTO DL LIBTALLOC \
- SOCKET_WRAPPER
+ SOCKET_WRAPPER EXT_NSL
[SUBSYSTEM::PIDFILE]
PRIVATE_PROTO_HEADER = pidfile.h
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index fbc76b32a0..895caa6912 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -11,7 +11,7 @@ OBJ_FILES = \
ndr/ndr_basic.o \
ndr/ndr_string.o \
ndr/ndr_misc.o
-PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET
+PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET EXT_NSL
# End SUBSYSTEM LIBNDR
################################################