]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Add additional search libs for inet_ntop and inet_pton 60/head
authorJeffrey Walton <noloader@gmail.com>
Tue, 4 Feb 2020 02:06:30 +0000 (21:06 -0500)
committerJeffrey Walton <noloader@gmail.com>
Tue, 4 Feb 2020 02:06:30 +0000 (21:06 -0500)
configure.ac

index f91563add1ec28fb3ee60c0ee4ff2dba3a32aedc..939e6a8cfd04668c0d6eee5da6e869fe6f1867f0 100644 (file)
@@ -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],