1 | dnl The following test is roughl taken from the cvs sources.
|
---|
2 | dnl
|
---|
3 | dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
|
---|
4 | dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
|
---|
5 | dnl libsocket.so which has a bad implementation of gethostbyname (it
|
---|
6 | dnl only looks in /etc/hosts), so we only look for -lsocket if we need
|
---|
7 | dnl it.
|
---|
8 | AC_CHECK_FUNCS(connect)
|
---|
9 | if 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
|
---|
23 | fi
|
---|
24 |
|
---|
25 | AC_CHECK_FUNCS(gethostbyname)
|
---|
26 | if 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
|
---|
39 | fi
|
---|