1 ##### http://autoconf-archive.cryp.to/lib_socket_nsl.html
9 # This macro figures out what libraries are required on this platform
10 # to link sockets programs.
12 # The common cases are not to need any extra libraries, or to need
13 # -lsocket and -lnsl. We need to avoid linking with libnsl unless we
14 # need it, though, since on some OSes where it isn't necessary it
15 # will totally break networking. Unisys also includes gethostbyname()
16 # in libsocket but needs libnsl for socket().
24 # Copyright (c) 2005 Russ Allbery <rra@stanford.edu>
25 # Copyright (c) 2005 Stepan Kasal <kasal@ucw.cz>
26 # Copyright (c) 2005 Warren Young <warren@etr-usa.com>
28 # Copying and distribution of this file, with or without
29 # modification, are permitted in any medium without royalty provided
30 # the copyright notice and this notice are preserved.
32 AC_DEFUN([LIB_SOCKET_NSL],
34 AC_SEARCH_LIBS([gethostbyname], [nsl])
35 AC_SEARCH_LIBS([socket], [socket], [], [
36 AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],