summaryrefslogtreecommitdiff
path: root/source4/lib/replace/socket.m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-27 13:19:07 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-27 13:19:07 +0100
commitbc1a369a0ed254ede591b65756d75568c45549ea (patch)
tree9c7fdefdc1d943506752d2d4e15cd4d81f65cc42 /source4/lib/replace/socket.m4
parentb3d2a56df29b163d93c4d20efc22c523441a92e5 (diff)
parente20f1bb6dba342fcc91d3fcf28d64c7d5fd39a38 (diff)
downloadsamba-bc1a369a0ed254ede591b65756d75568c45549ea.tar.gz
samba-bc1a369a0ed254ede591b65756d75568c45549ea.tar.bz2
samba-bc1a369a0ed254ede591b65756d75568c45549ea.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts: source/build/smb_build/makefile.pm (This used to be commit c45b97c4714dd0565949732394c9c1e8eedbb99a)
Diffstat (limited to 'source4/lib/replace/socket.m4')
-rw-r--r--source4/lib/replace/socket.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/lib/replace/socket.m4 b/source4/lib/replace/socket.m4
new file mode 100644
index 0000000000..c0c8f93e81
--- /dev/null
+++ b/source4/lib/replace/socket.m4
@@ -0,0 +1,40 @@
+dnl The following test is roughl taken from the cvs sources.
+dnl
+dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
+dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+dnl libsocket.so which has a bad implementation of gethostbyname (it
+dnl only looks in /etc/hosts), so we only look for -lsocket if we need
+dnl it.
+AC_CHECK_FUNCS(connect)
+if test x"$ac_cv_func_connect" = x"no"; then
+ AC_CHECK_LIB_EXT(nsl_s, SOCKET_LIBS, connect)
+ AC_CHECK_LIB_EXT(nsl, SOCKET_LIBS, connect)
+ AC_CHECK_LIB_EXT(socket, SOCKET_LIBS, connect)
+ AC_CHECK_LIB_EXT(inet, SOCKET_LIBS, connect)
+ dnl We can't just call AC_CHECK_FUNCS(connect) here,
+ dnl because the value has been cached.
+ if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" ||
+ test x"$ac_cv_lib_ext_nsl_connect" = x"yes" ||
+ test x"$ac_cv_lib_ext_socket_connect" = x"yes" ||
+ test x"$ac_cv_lib_ext_inet_connect" = x"yes"
+ then
+ AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
+ fi
+fi
+
+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)
+ dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here,
+ dnl because the value 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_DEFINE(HAVE_GETHOSTBYNAME,1,
+ [Whether the system has gethostbyname()])
+ fi
+fi
+