summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-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
4 files changed, 23 insertions, 6 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