Blame confdb/ax_lib_socket_nsl.m4

Packit Service c5cf8c
# ===========================================================================
Packit Service c5cf8c
#    https://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
Packit Service c5cf8c
# ===========================================================================
Packit Service c5cf8c
#
Packit Service c5cf8c
# SYNOPSIS
Packit Service c5cf8c
#
Packit Service c5cf8c
#   AX_LIB_SOCKET_NSL
Packit Service c5cf8c
#
Packit Service c5cf8c
# DESCRIPTION
Packit Service c5cf8c
#
Packit Service c5cf8c
#   This macro figures out what libraries are required on this platform to
Packit Service c5cf8c
#   link sockets programs.
Packit Service c5cf8c
#
Packit Service c5cf8c
#   The common cases are not to need any extra libraries, or to need
Packit Service c5cf8c
#   -lsocket and -lnsl. We need to avoid linking with libnsl unless we need
Packit Service c5cf8c
#   it, though, since on some OSes where it isn't necessary it will totally
Packit Service c5cf8c
#   break networking. Unisys also includes gethostbyname() in libsocket but
Packit Service c5cf8c
#   needs libnsl for socket().
Packit Service c5cf8c
#
Packit Service c5cf8c
# LICENSE
Packit Service c5cf8c
#
Packit Service c5cf8c
#   Copyright (c) 2008 Russ Allbery <rra@stanford.edu>
Packit Service c5cf8c
#   Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
Packit Service c5cf8c
#   Copyright (c) 2008 Warren Young <warren@etr-usa.com>
Packit Service c5cf8c
#
Packit Service c5cf8c
#   Copying and distribution of this file, with or without modification, are
Packit Service c5cf8c
#   permitted in any medium without royalty provided the copyright notice
Packit Service c5cf8c
#   and this notice are preserved. This file is offered as-is, without any
Packit Service c5cf8c
#   warranty.
Packit Service c5cf8c
Packit Service c5cf8c
#serial 7
Packit Service c5cf8c
Packit Service c5cf8c
AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
Packit Service c5cf8c
AC_DEFUN([AX_LIB_SOCKET_NSL],
Packit Service c5cf8c
[
Packit Service c5cf8c
	AC_SEARCH_LIBS([gethostbyname], [nsl])
Packit Service c5cf8c
	AC_SEARCH_LIBS([socket], [socket], [], [
Packit Service c5cf8c
		AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
Packit Service c5cf8c
		[], [-lnsl])])
Packit Service c5cf8c
])