Blame SOURCES/autofs-5.1.4-fix-libresolv-configure-check.patch

135b98
autofs-5.1.4 - fix libresolv configure check
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
The libresolv functions are not found by AC_CHECK_LIB() unless
135b98
they are prefixed with "__".
135b98
135b98
So change the library check to also look for __<function> during
135b98
the check.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG    |    1 +
135b98
 configure    |   41 +++++++++++++++++++++++++++++++++++++++++
135b98
 configure.in |    2 +-
135b98
 3 files changed, 43 insertions(+), 1 deletion(-)
135b98
135b98
diff --git a/CHANGELOG b/CHANGELOG
135b98
index a7bb89dc..dbfb8389 100644
135b98
--- a/CHANGELOG
135b98
+++ b/CHANGELOG
135b98
@@ -13,6 +13,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - fix monotonic_elapsed.
135b98
 - Makefiles.rules: remove 'samples' from SUBDIRS.
135b98
 - dont allow trailing slash in master map mount points.
135b98
+- fix libresolv configure check.
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
diff --git a/configure b/configure
135b98
index 2d517aac..5c8aae30 100755
135b98
--- a/configure
135b98
+++ b/configure
135b98
@@ -4821,6 +4821,47 @@ fi
135b98
 $as_echo "$ac_cv_lib_resolv_res_query" >&6; }
135b98
 if test "x$ac_cv_lib_resolv_res_query" = xyes; then :
135b98
   LIBRESOLV="-lresolv"
135b98
+else
135b98
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_query in -lresolv" >&5
135b98
+$as_echo_n "checking for __res_query in -lresolv... " >&6; }
135b98
+if ${ac_cv_lib_resolv___res_query+:} false; then :
135b98
+  $as_echo_n "(cached) " >&6
135b98
+else
135b98
+  ac_check_lib_save_LIBS=$LIBS
135b98
+LIBS="-lresolv  $LIBS"
135b98
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
135b98
+/* end confdefs.h.  */
135b98
+
135b98
+/* Override any GCC internal prototype to avoid an error.
135b98
+   Use char because int might match the return type of a GCC
135b98
+   builtin and then its argument prototype would still apply.  */
135b98
+#ifdef __cplusplus
135b98
+extern "C"
135b98
+#endif
135b98
+char __res_query ();
135b98
+int
135b98
+main ()
135b98
+{
135b98
+return __res_query ();
135b98
+  ;
135b98
+  return 0;
135b98
+}
135b98
+_ACEOF
135b98
+if ac_fn_c_try_link "$LINENO"; then :
135b98
+  ac_cv_lib_resolv___res_query=yes
135b98
+else
135b98
+  ac_cv_lib_resolv___res_query=no
135b98
+fi
135b98
+rm -f core conftest.err conftest.$ac_objext \
135b98
+    conftest$ac_exeext conftest.$ac_ext
135b98
+LIBS=$ac_check_lib_save_LIBS
135b98
+fi
135b98
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___res_query" >&5
135b98
+$as_echo "$ac_cv_lib_resolv___res_query" >&6; }
135b98
+if test "x$ac_cv_lib_resolv___res_query" = xyes; then :
135b98
+  LIBRESOLV="-lresolv"
135b98
+fi
135b98
+
135b98
 fi
135b98
 
135b98
 
135b98
diff --git a/configure.in b/configure.in
135b98
index d74775cc..4d1208f5 100644
135b98
--- a/configure.in
135b98
+++ b/configure.in
135b98
@@ -217,7 +217,7 @@ AC_SUBST(NSL_LIBS)
135b98
 NSL_CFLAGS=""
135b98
 ])
135b98
 
135b98
-AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv")
135b98
+AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv", AC_CHECK_LIB(resolv, __res_query, LIBRESOLV="-lresolv"))
135b98
 AC_SUBST(LIBRESOLV)
135b98
 
135b98
 #