+2024-03-05 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Follow gnulib-tool changes, part 41.
+ Follow gnulib-tool change
+ 2018-09-03 Bruno Haible <bruno@clisp.org>
+ gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
+ * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Consider the dotfirst
+ flag.
+ (GLEmiter.tests_Makefile_am): Don't consider the dotfirst flag.
+ * pygnulib/GLImport.py (GLImport.execute): Set the dotfirst for tests.
+ * pygnulib/GLMakefileTable.py (GLMakefileTable.editor): Add optional
+ dotfirst flag to fix build order when $testsbase is a subdir of
+ $sourcebase.
+
2024-03-05 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Follow gnulib-tool changes, part 40.
--------------------------------------------------------------------------------
-commit 8b1d4a63e34f3893036d82f39c5680e845de5ddf
-Author: Bruno Haible <bruno@clisp.org>
-Date: Mon Sep 3 21:19:16 2018 +0200
-
- gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
-
- Reported by Antoine Luong <antoine.luong@c-s.fr> in
- <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00008.html>.
-
- * gnulib-tool (func_import): For the tests, set a dotfirst flag.
- (func_emit_lib_Makefile_am): Consider the dotfirst flag.
- (func_emit_tests_Makefile_am): Don't consider the dotfirst flag.
-
---------------------------------------------------------------------------------
-
commit cd58dba367a3b8ffbebb23f2099a820106197fae
Author: Bruno Haible <bruno@clisp.org>
Date: Sun Oct 29 16:57:32 2017 +0100
dictionary = makefiletable[current_edit]
if dictionary['var']:
if destfile == joinpath(dictionary['dir'], 'Makefile.am'):
- emit += '%s += %s\n' % (dictionary['var'], dictionary['val'])
+ val = dictionary['val']
+ if dictionary['var'] == 'SUBDIRS' and dictionary['dotfirst']:
+ # The added subdirectory ${val} needs to be mentioned after '.'.
+ # Since we don't have '.' among SUBDIRS so far, add it now.
+ val = f'. {val}'
+ emit += '%s += %s\n' % (dictionary['var'], val)
dictionary.pop('var')
# Define two parts of cppflags variable.
dictionary = makefiletable[current_edit]
if dictionary['var']:
if destfile == joinpath(dictionary['dir'], 'Makefile.am'):
- emit += '%s += %s\n' % (dictionary['var'], dictionary['val'])
+ val = dictionary['val']
+ if dictionary['var'] == 'SUBDIRS' and dictionary['dotfirst']:
+ # The added subdirectory ${val} needs to be mentioned after '.'.
+ # But we have '.' among SUBDIRS already, so do nothing.
+ pass
+ emit += '%s += %s\n' % (dictionary['var'], val)
dictionary.pop('var')
emit += '\nAM_CPPFLAGS = \\\n'
if makefile_am == 'Makefile.am':
testsbase_dir = os.path.dirname(testsbase)
testsbase_base = os.path.basename(testsbase)
- self.makefiletable.editor(testsbase_dir, 'SUBDIRS', testsbase_base)
+ self.makefiletable.editor(testsbase_dir, 'SUBDIRS', testsbase_base, True)
self.makefiletable.editor('', 'ACLOCAL_AMFLAGS', '-I %s' % m4base)
self.makefiletable.parent()
result = self.table[y]
return dict(result)
- def editor(self, dir, var, val):
- '''GLMakefileTable.editor(dir, var, val)
+ def editor(self, dir, var, val, dotfirst=False):
+ '''GLMakefileTable.editor(dir, var, val, dotfirst)
This method is used to remember that ${dir}Makefile.am needs to be edited
- to that ${var} mentions ${val}.'''
+ to that ${var} mentions ${val}.
+ If ${dotfirst} is non-empty, this mention needs to be present after '.'.
+ This is a special hack for the SUBDIRS variable, cf.
+ <https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html>.'''
if type(dir) is not str:
raise TypeError('dir must be a string, not %s' % (type(dir).__name__))
if type(var) is not str:
raise TypeError('var must be a string, not %s' % (type(var).__name__))
if type(val) is not str:
raise TypeError('val must be a string, not %s' % (type(val).__name__))
- dictionary = {'dir': dir, 'var': var, 'val': val}
+ if type(dotfirst) is not bool:
+ raise TypeError('dotfirst must be a bool, not %s' % (type(dotfirst).__name__))
+ dictionary = {'dir': dir, 'var': var, 'val': val, 'dotfirst': dotfirst}
self.table += [dictionary]
def parent(self):