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

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