build: Fix check for resolver library on macOS.
authorJustus Winter <justus@g10code.com>
Tue, 27 Sep 2016 15:18:15 +0000 (17:18 +0200)
committerJustus Winter <justus@g10code.com>
Tue, 27 Sep 2016 15:20:01 +0000 (17:20 +0200)
* configure.ac: Check for the mangled name of 'dn_skipname' first.

Signed-off-by: Justus Winter <justus@g10code.com>
configure.ac

index b16f837..fe432e8 100644 (file)
@@ -1074,8 +1074,15 @@ if test x"$use_dns_srv" = xyes || test x"$use_dns_cert" = xyes; then
                    AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
     AC_SEARCH_LIBS(dn_expand,resolv bind,,
                    AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
-    AC_SEARCH_LIBS(dn_skipname,resolv bind,,
-                   AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no))
+
+    # macOS renames dn_skipname into res_9_dn_skipname in <resolv.h>,
+    # and for some reason fools us into believing we don't need
+    # -lresolv even if we do.  Since the test program checking for the
+    # symbol does not include <resolv.h>, we need to check for the
+    # renamed symbol explicitly.
+    AC_SEARCH_LIBS(res_9_dn_skipname,resolv bind,,
+        AC_SEARCH_LIBS(dn_skipname,resolv bind,,
+            AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no)))
 
     if test x"$have_resolver" != xno ; then