LoongArch: Add constraints for bit string operation define_insn_and_split's [PR114861]
[official-gcc.git] / config / ax_lib_socket_nsl.m4
blob54cad68b4c8cd8faec8f672c5b801225a5558509
1 # ===========================================================================
2 #    https://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
3 # ===========================================================================
5 # SYNOPSIS
7 #   AX_LIB_SOCKET_NSL
9 # DESCRIPTION
11 #   This macro figures out what libraries are required on this platform to
12 #   link sockets programs.
14 #   The common cases are not to need any extra libraries, or to need
15 #   -lsocket and -lnsl. We need to avoid linking with libnsl unless we need
16 #   it, though, since on some OSes where it isn't necessary it will totally
17 #   break networking. Unisys also includes gethostbyname() in libsocket but
18 #   needs libnsl for socket().
20 # LICENSE
22 #   Copyright (c) 2008 Russ Allbery <rra@stanford.edu>
23 #   Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
24 #   Copyright (c) 2008 Warren Young <warren@etr-usa.com>
26 #   Copying and distribution of this file, with or without modification, are
27 #   permitted in any medium without royalty provided the copyright notice
28 #   and this notice are preserved. This file is offered as-is, without any
29 #   warranty.
31 #serial 7
33 AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
34 AC_DEFUN([AX_LIB_SOCKET_NSL],
36         AC_SEARCH_LIBS([gethostbyname], [nsl])
37         AC_SEARCH_LIBS([socket], [socket], [], [
38                 AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
39                 [], [-lnsl])])