|author||Jeff Morriss <firstname.lastname@example.org>||2015-02-28 22:20:07 -0500|
|committer||Jeff Morriss <email@example.com>||2015-03-03 15:02:08 +0000|
Look for and use gethostbyname() if we don't have getaddrinfo(). Fail to
configure if we can't find any name resolver (autotools only). This puts back the gethostbyname()/gethostbyname2() code removed in I3348179626e97daaddfbc89e3ed21e39915e3de4 and If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c but as a last-resort option (only if we don't have a better or more modern name resolver). As suggested/requested by Guy in https://code.wireshark.org/review/#/c/7423/ Change-Id: I706dbbd65135f47c67d3d8d88a61ad7273914c47 Reviewed-on: https://code.wireshark.org/review/7447 Petri-Dish: Jeff Morriss <firstname.lastname@example.org> Tested-by: Petri Dish Buildbot <email@example.com> Reviewed-by: Jeff Morriss <firstname.lastname@example.org>
Diffstat (limited to 'acinclude.m4')
1 files changed, 35 insertions, 8 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 6db1b966eb..2d89e2278e 100644
@@ -276,19 +276,46 @@ AC_DEFUN([AC_WIRESHARK_GETADDRINFO_LIB_CHECK],
AC_DEFINE(HAVE_GETADDRINFO, 1, [Defined if we have getaddrinfo])
+# Checks whether we need "-lnsl" to get "gethostby*()", which we use
+# in "resolv.c".
+# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
+# GNU Autoconf 2.13; the comment came from there.
+# Done by Guy Harris <email@example.com> on 2000-01-14.
+ # firstname.lastname@example.org says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # email@example.com says the Pyramid MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to firstname.lastname@example.org.
+ AC_CHECK_FUNCS(gethostbyname, ,
+ AC_CHECK_LIB(nsl, gethostbyname,
+ AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Defined if we have gethostbyname])
# Checks whether we need "-lsocket" to get "socket()", which is used
-# by libpcap on some platforms - and, in effect, "getaddrinfo()" on
-# most if not all platforms (so that it can use NIS or DNS or...
-# to look up host names).
+# by libpcap on some platforms - and, in effect, "gethostbyname()" or
+# "getaddrinfo()" on most if not all platforms (so that it can use NIS or
+# DNS or... to look up host names).
# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
# GNU Autoconf 2.13; the comment came from there.
@@ -1105,8 +1132,8 @@ AC_DEFUN([AC_WIRESHARK_ADNS_CHECK],
- AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
+ AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
],, $SOCKET_LIBS $NSL_LIBS
@@ -1136,8 +1163,8 @@ AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
- AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library])
+ AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library])