source: git/m4/ax_lib_socket_nsl.m4 @ f0f0003

spielwiese
Last change on this file since f0f0003 was 6712e9, checked in by Dima Pasechnik <dimpase@…>, 6 years ago
link libraries sometimes needed by gethostbyname etc On Solaris, in particular, one needs -lsocket -lnsl in the libs to be linked against. See https://trac.sagemath.org/ticket/24611 This is taken care by this autoconf macro call.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1# ===========================================================================
2#    https://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7#   AX_LIB_SOCKET_NSL
8#
9# DESCRIPTION
10#
11#   This macro figures out what libraries are required on this platform to
12#   link sockets programs.
13#
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().
19#
20# LICENSE
21#
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>
25#
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.
30
31#serial 7
32
33AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
34AC_DEFUN([AX_LIB_SOCKET_NSL],
35[
36        AC_SEARCH_LIBS([gethostbyname], [nsl])
37        AC_SEARCH_LIBS([socket], [socket], [], [
38                AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
39                [], [-lnsl])])
40])
Note: See TracBrowser for help on using the repository browser.