On Tuesday 06 of October 2015 00:42:01 Paul Eggert wrote:
> Pavel Raiskup wrote:
> > Adjusted patch re-attached.
> 
> Whoops, it looks like that patch has a problem with unicase/locale-language; 
> could you please look into it?  Here's how to reproduce it:
> 
> ./gnulib-tool --test unicase/locale-language
> 
> This eventually generates:
> 
> executing aclocal -I glm4
> configure.ac:25: warning: AC_COMPILE_IFELSE was called before 
> AC_USE_SYSTEM_EXTENSIONS
> glm4/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
> glm4/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
> configure.ac:25: the top level
> 
> Thanks.

Uh, sorry for not fixing the testsuite in f8fe25fab60e3c687a124.
The attached patch should fix this.

Pavel
>From 7838f1540f85414330a8b29c1be8e8959a32061f Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <prais...@redhat.com>
Date: Tue, 6 Oct 2015 13:20:05 +0200
Subject: [PATCH] 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.
---
 ChangeLog   |  9 +++++++++
 gnulib-tool | 45 ++++++++++++++++++++++++++++++++-------------
 2 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4f2d6ce..02d8bf8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-10-06  Pavel Raiskup  <prais...@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  <egg...@cs.ucla.edu>
 
 	unicase/locale-language: fix typo in utf-8 cookie
diff --git a/gnulib-tool b/gnulib-tool
index 47722c8..564f072 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4075,6 +4075,31 @@ func_emit_autoconf_snippets ()
   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 @@ s,//*$,/,'
     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
+    func_emit_pre_early_macros : '  ' "$final_modules"
 
-    echo "  AC_REQUIRE([gl_PROG_AR_RANLIB])"
     if test -n "$uses_subdirs"; then
       echo "  AC_REQUIRE([AM_PROG_CC_C_O])"
     fi
@@ -5822,8 +5840,9 @@ func_create_testdir ()
        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 @@ func_create_testdir ()
    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
-- 
2.5.0

Reply via email to