[bug #4302] errno is not always an extern int
[mmh] / aclocal.m4
1
2 # Originally by John Hawkinson <jhawk@mit.edu>
3 # Under Solaris, those
4 # applications need to link with "-lsocket -lnsl".  Under IRIX, they
5 # need to link with "-lnsl" but should *not* link with "-lsocket"
6 # because libsocket.a breaks a number of things (for instance,
7 # gethostbyname() under IRIX 5.2, and snoop sockets under most versions
8 # of IRIX).
9 #
10 # The check for libresolv is in case you are attempting to link
11 # statically and happen to have a libresolv.a lying around (and no
12 # libnsl.a). An example of such a case would be Solaris with
13 # BIND 4.9.5 installed.
14
15 AC_DEFUN(AC_CHECK_NETLIBS,
16 [AC_CHECK_FUNC(gethostbyname, ,
17   AC_CHECK_LIB(nsl, gethostbyname, ,
18     AC_CHECK_LIB(resolv, gethostbyname)))
19 AC_CHECK_FUNC(socket, ,
20   AC_CHECK_LIB(socket, socket))
21 ])