diff gnulib-tool @ 18114:e212f9b1ce05

gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR and ARFLAGS variables. Doing this unconditionally could break later Automake's AM_PROG_AR invocation (at least it's AC_CHECK_TOOLS call to detect correct 'ar' binary). Original purpose of the gl_PROG_AR_RANLIB was only to handle the Amsterdam Compiler Kit, so make the previous code to have effects only on ACK, and rather automatically call the Automake's AM_PROG_AR as soon as possible to decide other cases. References: http://lists.gnu.org/archive/html/bug-gnulib/2015-07/msg00001.html * m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR. Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR. If neither is possible, keep setting AR/ARFLAGS to reasonable defaults. * gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the 'extensions' module is used. * modules/extensions (configure.ac-early): Remove as this snippet is added to gnulib-comp.m4 earlier anyway.
author Pavel Raiskup <praiskup@redhat.com>
date Fri, 25 Sep 2015 11:25:03 -0700
parents 244355088b86
children ef6cdfd2e603
line wrap: on
line diff
--- a/gnulib-tool	Fri Sep 25 11:16:27 2015 -0700
+++ b/gnulib-tool	Fri Sep 25 11:25:03 2015 -0700
@@ -5195,6 +5195,15 @@
     echo "  m4_pattern_allow([^gl_ES\$])dnl a valid locale name"
     echo "  m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable"
     echo "  m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable"
+
+    # We need to call gl_USE_SYSTEM_EXTENSIONS before gl_PROG_AR_RANLIB.  Doing
+    # AC_REQUIRE in configure-ac.early is not early enough.
+    case "${nl}${final_modules}${nl}" in
+        *${nl}extensions${nl}*)
+            echo "  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])"
+            ;;
+    esac
+
     echo "  AC_REQUIRE([gl_PROG_AR_RANLIB])"
     if test -n "$uses_subdirs"; then
       echo "  AC_REQUIRE([AM_PROG_CC_C_O])"