From ae8ac3d8255a1f58e8c58bc867af901e9ed8cf47 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 3 Feb 2020 21:06:30 -0500 Subject: [PATCH] Add additional search libs for inet_ntop and inet_pton --- configure.ac | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index f91563ad..939e6a8c 100644 --- a/configure.ac +++ b/configure.ac @@ -119,8 +119,28 @@ AC_CHECK_TYPE(uint64_t, unsigned long long) AC_CHECK_PROG(doxygen, doxygen, doxygen) # check to see if libraries are needed for these functions. -AC_SEARCH_LIBS([socket], [socket]) -AC_SEARCH_LIBS([inet_pton], [nsl]) +AC_CHECK_FUNC([socket], + [], + [AC_SEARCH_LIBS([socket], [socket]) +]) + +# modern Linux provides inet_ntop in -lsocket. +# modern OS X provides inet_ntop in -lc. +# modern Solaris provides inet_ntop in -lsocket -lnsl. +# older Solaris provides inet_ntop in -lresolv. +AC_CHECK_FUNC([inet_ntop], + [], + [AC_SEARCH_LIBS([inet_ntop], [socket c nsl resolv]) +]) + +# modern Linux provides inet_pton in -lsocket. +# modern OS X provides inet_pton in -lc. +# modern Solaris provides inet_pton in -lsocket -lnsl. +# older Solaris provides inet_pton in -lresolv. +AC_CHECK_FUNC([inet_pton], + [], + [AC_SEARCH_LIBS([inet_pton], [socket c nsl resolv]) +]) AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill], -- 2.47.3