changeset 37804:b33224b4d6e9

gnulib-tool: fix tests of 'extensions' module This complements f8fe25fab60e3c687a124 commit. * gnulib-tool (func_emit_pre_early_macros): New function, it wraps emitting of initial gl_EARLY macros. (func_import, func_create_testdir): All dumps of gl_PROG_AR_RANLIB replaced with func_emit_pre_early_macros call.
author Pavel Raiskup <praiskup@redhat.com>
date Tue, 06 Oct 2015 13:20:05 +0200
parents bd69861b7113
children 7df3459682fe
files ChangeLog gnulib-tool
diffstat 2 files changed, 42 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Oct 06 00:46:02 2015 -0700
+++ b/ChangeLog	Tue Oct 06 13:20:05 2015 +0200
@@ -1,3 +1,12 @@
+2015-10-06  Pavel Raiskup  <praiskup@redhat.com>
+
+	gnulib-tool: fix tests of 'extensions' module
+	This complements f8fe25fab60e3c687a124 commit.
+	* gnulib-tool (func_emit_pre_early_macros): New function, it wraps
+	emitting of initial gl_EARLY macros.
+	(func_import, func_create_testdir): All dumps of gl_PROG_AR_RANLIB
+	replaced with func_emit_pre_early_macros call.
+
 2015-10-06  Paul Eggert  <eggert@cs.ucla.edu>
 
 	unicase/locale-language: fix typo in utf-8 cookie
--- a/gnulib-tool	Tue Oct 06 00:46:02 2015 -0700
+++ b/gnulib-tool	Tue Oct 06 13:20:05 2015 +0200
@@ -4075,6 +4075,31 @@
   fi
 }
 
+# func_emit_pre_early_macros require indentation modules
+# The require parameter can be ':' (AC_REQUIRE) or 'false' (direct call).
+func_emit_pre_early_macros ()
+{
+  echo
+  echo "${2}# Pre-early section."
+  if $1; then
+    _pre_early_snippet="echo \"${2}AC_REQUIRE([\$_pre_early_macro])\""
+  else
+    _pre_early_snippet="echo \"${2}\$_pre_early_macro\""
+  fi
+
+  # We need to call gl_USE_SYSTEM_EXTENSIONS before gl_PROG_AR_RANLIB.  Doing
+  # AC_REQUIRE in configure-ac.early is not early enough.
+  _pre_early_macro="gl_USE_SYSTEM_EXTENSIONS"
+  case "${nl}${3}${nl}" in
+    *${nl}extensions${nl}*) eval "$_pre_early_snippet" ;;
+  esac
+
+  _pre_early_macro="gl_PROG_AR_RANLIB"
+  eval "$_pre_early_snippet"
+  echo
+}
+
+
 # func_import modules
 # Uses also the variables
 # - mode            import or add-import or remove-import or update
@@ -5196,15 +5221,8 @@
     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])"
+    func_emit_pre_early_macros : '  ' "$final_modules"
+
     if test -n "$uses_subdirs"; then
       echo "  AC_REQUIRE([AM_PROG_CC_C_O])"
     fi
@@ -5822,8 +5840,9 @@
        echo "AC_PROG_CC"
        echo "AC_PROG_INSTALL"
        echo "AC_PROG_MAKE_SET"
-       echo "gl_PROG_AR_RANLIB"
-       echo
+
+       func_emit_pre_early_macros false '' "$modules"
+
        if test -n "$uses_subdirs"; then
          echo "AM_PROG_CC_C_O"
          echo
@@ -5936,9 +5955,9 @@
    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"
-   echo
-   echo "gl_PROG_AR_RANLIB"
-   echo
+
+   func_emit_pre_early_macros false '' "$final_modules"
+
    if test -n "$any_uses_subdirs"; then
      echo "AM_PROG_CC_C_O"
      echo