aboutsummaryrefslogtreecommitdiffstats
path: root/m4/ax_lib_socket_nsl.m4
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-22 22:41:58 +0000
committerJoão Valverde <j@v6e.pt>2016-03-23 02:33:56 +0000
commit759fc8cf705fba74aabb6df59c916efe7204898a (patch)
treedb34040f10ce02d7697795609e548453577586f9 /m4/ax_lib_socket_nsl.m4
parentc57b3777f814f4f4108abcf111ee873acb60a91c (diff)
Rename 'aclocal-fallback' directory to 'm4'
Change-Id: Icac1c43264b6c6fd426d3c5146863a491b48b4ff Reviewed-on: https://code.wireshark.org/review/14569 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'm4/ax_lib_socket_nsl.m4')
-rw-r--r--m4/ax_lib_socket_nsl.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/m4/ax_lib_socket_nsl.m4 b/m4/ax_lib_socket_nsl.m4
new file mode 100644
index 0000000000..058e975157
--- /dev/null
+++ b/m4/ax_lib_socket_nsl.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_SOCKET_NSL
+#
+# DESCRIPTION
+#
+# This macro figures out what libraries are required on this platform to
+# link sockets programs.
+#
+# The common cases are not to need any extra libraries, or to need
+# -lsocket and -lnsl. We need to avoid linking with libnsl unless we need
+# it, though, since on some OSes where it isn't necessary it will totally
+# break networking. Unisys also includes gethostbyname() in libsocket but
+# needs libnsl for socket().
+#
+# LICENSE
+#
+# Copyright (c) 2008 Russ Allbery <rra@stanford.edu>
+# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 6
+
+AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
+AC_DEFUN([AX_LIB_SOCKET_NSL],
+[
+ AC_SEARCH_LIBS([gethostbyname], [nsl])
+ AC_SEARCH_LIBS([socket], [socket], [], [
+ AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
+ [], [-lnsl])])
+])