diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2015-02-28 22:20:07 -0500 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2015-03-03 15:02:08 +0000 |
commit | a308aef89d5b262c9e04f51e2a695bee90446cb1 (patch) | |
tree | 70d8a3eb1a1328ab08133fbbc90ca3de1e2feb6d /acinclude.m4 | |
parent | 90706569afaa4f7fdd9b4441cf2ab8466a2ac574 (diff) |
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 <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 6db1b966eb..2d89e2278e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -276,19 +276,46 @@ AC_DEFUN([AC_WIRESHARK_GETADDRINFO_LIB_CHECK], AC_CHECK_FUNCS(getaddrinfo, , AC_CHECK_LIB(nsl, getaddrinfo, [ - NSL_LIBS="-lnsl" + NSL_LIBS="-lnsl" AC_DEFINE(HAVE_GETADDRINFO, 1, [Defined if we have getaddrinfo]) ])) AC_SUBST(NSL_LIBS) ]) # +# AC_WIRESHARK_GETHOSTBY_LIB_CHECK +# +# 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 <guy@alum.mit.edu> on 2000-01-14. +# +AC_DEFUN([AC_WIRESHARK_GETHOSTBY_LIB_CHECK], +[ + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.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 dickey@clark.net. + AC_CHECK_FUNCS(gethostbyname, , + AC_CHECK_LIB(nsl, gethostbyname, + [ + NSL_LIBS="-lnsl" + AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Defined if we have gethostbyname]) + ])) + AC_SUBST(NSL_LIBS) +]) + +# # AC_WIRESHARK_SOCKET_LIB_CHECK # # 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_CHECK_LIB(adns, adns_init, [ ADNS_LIBS=-ladns - AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library]) - have_good_adns=yes + AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library]) + have_good_adns=yes ],, $SOCKET_LIBS $NSL_LIBS ) else @@ -1136,8 +1163,8 @@ AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK], AC_CHECK_LIB(cap, cap_set_flag, [ LIBCAP_LIBS=-lcap - AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library]) - have_good_libcap=yes + AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library]) + have_good_libcap=yes ],, ) else |