source: branches/samba-3.2.x/source/lib/replace/socket.m4

Last change on this file was 133, checked in by Paul Smedley, 17 years ago

Update trunk to 3.2.0pre3

File size: 1.6 KB
Line 
1dnl The following test is roughl taken from the cvs sources.
2dnl
3dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
4dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
5dnl libsocket.so which has a bad implementation of gethostbyname (it
6dnl only looks in /etc/hosts), so we only look for -lsocket if we need
7dnl it.
8AC_CHECK_FUNCS(connect)
9if test x"$ac_cv_func_connect" = x"no"; then
10 AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, connect)
11 AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, connect)
12 AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, connect)
13 AC_CHECK_LIB_EXT(inet, LIBREPLACE_NETWORK_LIBS, connect)
14 dnl We can't just call AC_CHECK_FUNCS(connect) here,
15 dnl because the value has been cached.
16 if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" ||
17 test x"$ac_cv_lib_ext_nsl_connect" = x"yes" ||
18 test x"$ac_cv_lib_ext_socket_connect" = x"yes" ||
19 test x"$ac_cv_lib_ext_inet_connect" = x"yes"
20 then
21 AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
22 fi
23fi
24
25AC_CHECK_FUNCS(gethostbyname)
26if test x"$ac_cv_func_gethostbyname" = x"no"; then
27 AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, gethostbyname)
28 AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, gethostbyname)
29 AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, gethostbyname)
30 dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here,
31 dnl because the value has been cached.
32 if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" = x"yes" ||
33 test x"$ac_cv_lib_ext_nsl_gethostbyname" = x"yes" ||
34 test x"$ac_cv_lib_ext_socket_gethostbyname" = x"yes"
35 then
36 AC_DEFINE(HAVE_GETHOSTBYNAME,1,
37 [Whether the system has gethostbyname()])
38 fi
39fi
Note: See TracBrowser for help on using the repository browser.