]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 17.
authorBruno Haible <bruno@clisp.org>
Fri, 29 Jul 2022 21:29:23 +0000 (23:29 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 29 Jul 2022 21:29:23 +0000 (23:29 +0200)
Follow gnulib-tool change
2015-10-06  Pavel Raiskup  <praiskup@redhat.com>
gnulib-tool: fix tests of 'extensions' module

* pygnulib/GLEmiter.py (GLEmiter.preEarlyMacros): New function.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Invoke it.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

ChangeLog
gnulib-tool.py.TODO
pygnulib/GLEmiter.py
pygnulib/GLImport.py
pygnulib/GLTestDir.py

index 1ddf2822ade3f8f0428da2918706a2bed50b8d29..16119afe295becd53a975daa9bd7ffdb2a595527 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2022-07-29  Bruno Haible  <bruno@clisp.org>
 
+       gnulib-tool.py: Follow gnulib-tool changes, part 17.
+       Follow gnulib-tool change
+       2015-10-06  Pavel Raiskup  <praiskup@redhat.com>
+       gnulib-tool: fix tests of 'extensions' module
+       * pygnulib/GLEmiter.py (GLEmiter.preEarlyMacros): New function.
+       * pygnulib/GLImport.py (GLImport.gnulib_comp): Invoke it.
+       * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
+
        gnulib-tool.py: Follow gnulib-tool changes, part 16.
        Follow gnulib-tool change
        2015-09-25  Pavel Raiskup  <praiskup@redhat.com>
index bcb811b5dfe73392c77827cf1aec0b73c358c732..8f535f6897ac249be61beaf9f24ca03e1161fe49 100644 (file)
@@ -1121,19 +1121,6 @@ Date:   Sat Nov 21 14:09:15 2015 +0100
 
 --------------------------------------------------------------------------------
 
-commit 63ce1a2103dd4452f7bd5bc873a982e03ed52427
-Author: Pavel Raiskup <praiskup@redhat.com>
-Date:   Tue Oct 6 13:20:05 2015 +0200
-
-    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.
-
 commit 9bdf6c8a0cdeb13c12e4b65dee9538c5468dbe1d
 Author: Bruno Haible <bruno@clisp.org>
 Date:   Sun Aug 19 14:06:50 2012 +0200
index 8f20990f16680d35939c43b9505874895e839686..0d57b6177b93b9257352d4c76be21548fc75308c 100644 (file)
@@ -373,6 +373,31 @@ add AM_GNU_GETTEXT([external]) or similar to configure.ac.')
             emit = emit.decode(ENCS['default'])
         return emit
 
+    def preEarlyMacros(self, require, indentation, modules):
+        '''GLEmiter.preEarlyMacros(require, indentation, modules) -> string
+
+        Collect and emit the pre-early section.
+
+        require parameter can be True (AC_REQUIRE) or False (direct call).
+        indentation parameter is a string.
+        modules argument represents list of modules; every module in this list must
+          be a GLModule instance.'''
+        emit = string()
+        emit += '\n' + indentation + '# Pre-early section.\n'
+        # We need to call gl_USE_SYSTEM_EXTENSIONS before gl_PROG_AR_RANLIB.
+        # Doing AC_REQUIRE in configure-ac.early is not early enough.
+        if any(str(module) == 'extensions' for module in modules):
+            if require:
+                emit += indentation + 'AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])\n'
+            else:
+                emit += indentation + 'gl_USE_SYSTEM_EXTENSIONS\n'
+        if require:
+            emit += indentation + 'AC_REQUIRE([gl_PROG_AR_RANLIB])\n'
+        else:
+            emit += indentation + 'gl_PROG_AR_RANLIB\n'
+        emit += '\n'
+        return emit
+
     def po_Makevars(self):
         '''GLEmiter.po_Makevars() -> string
 
index c51b5036df3563cec28781fe8a00a4cb77b20de9..06c122e780d00adac82ec983f478bccb239fc77b 100644 (file)
@@ -599,9 +599,7 @@ AC_DEFUN([%s_EARLY],
   m4_pattern_allow([^gl_ES$])dnl a valid locale name
   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable\n''' % (configure_ac, macro_prefix)
-        if any(str(module) == 'extensions' for module in moduletable['final']):
-            emit += '  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])\n'
-        emit += '  AC_REQUIRE([gl_PROG_AR_RANLIB])\n'
+        emit += self.emiter.preEarlyMacros(True, '  ', moduletable['final'])
         uses_subdirs = False
         for module in moduletable['main']:
             # Test whether there are some source files in subdirectories.
index 6433a0d78c4c07f517bc1337114e531b54a23104..0a403c993f6c4795375f5d9532b4b04928f6dac7 100644 (file)
@@ -441,7 +441,7 @@ class GLTestDir(object):
                 emit += 'AC_PROG_CC\n'
                 emit += 'AC_PROG_INSTALL\n'
                 emit += 'AC_PROG_MAKE_SET\n'
-                emit += 'gl_PROG_AR_RANLIB\n\n'
+                emit += self.emiter.preEarlyMacros(False, '', modules)
                 if uses_subdirs:
                     emit += 'AM_PROG_CC_C_O\n\n'
                 snippets = list()
@@ -561,8 +561,8 @@ class GLTestDir(object):
         emit += 'm4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace\n'
         emit += 'm4_pattern_allow([^gl_ES$])dnl a valid locale name\n'
         emit += 'm4_pattern_allow([^gl_LIBOBJS$])dnl a variable\n'
-        emit += 'm4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable\n\n'
-        emit += 'gl_PROG_AR_RANLIB\n\n'
+        emit += 'm4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable\n'
+        emit += self.emiter.preEarlyMacros(False, '', modules)
         if any_uses_subdirs:
             emit += 'AM_PROG_CC_C_O\n'
         snippets = list()