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>
--------------------------------------------------------------------------------
-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
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
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.
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()
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()