From 3d500b2a124193e73f32a6c40d9e39b248d2a0da Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 18 Mar 2024 19:58:37 -0700 Subject: [PATCH 3/4] gnulib-tool.py: Follow gnulib-tool changes, part 67. Follow gnulib-tool change 2022-03-01 Paul Eggert Create lib/Makefile.am after gnulib-comp.m4 * pygnulib/GLImport.py (GLImport.execute): Create library makefile after creating gnulib-comp.m4. --- ChangeLog | 9 +++++++ gnulib-tool.py.TODO | 12 ---------- pygnulib/GLImport.py | 56 +++++++++++++++++++++++--------------------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20fd33b97a..fada1a3be6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-03-18 Collin Funk + + gnulib-tool.py: Follow gnulib-tool changes, part 67. + Follow gnulib-tool change + 2022-03-01 Paul Eggert + Create lib/Makefile.am after gnulib-comp.m4 + * pygnulib/GLImport.py (GLImport.execute): Create library makefile after + creating gnulib-comp.m4. + 2024-03-18 Collin Funk gnulib-tool.py: Follow gnulib-tool changes, part 66. diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO index 819cca07e6..75a51fc6b8 100644 --- a/gnulib-tool.py.TODO +++ b/gnulib-tool.py.TODO @@ -61,18 +61,6 @@ Date: Fri Jun 3 17:52:19 2022 -0700 -------------------------------------------------------------------------------- -commit 8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482 -Author: Paul Eggert -Date: Tue Mar 1 10:01:22 2022 -0800 - - Create lib/Makefile.am after gnulib-comp.m4 - - * gnulib-tool (func_import): Create library makefile after - creating gnulib-comp.m4. With --gnu-make, the latter depends on - the former. See . - --------------------------------------------------------------------------------- - commit 30459fe101541698ec704acb224946d73676750e Author: Bruno Haible Date: Thu Jun 8 15:09:31 2017 +0200 diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 937c8d42e2..84bd01ecf3 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -1184,33 +1184,6 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix self.makefiletable.editor('', 'ACLOCAL_AMFLAGS', m4base) self.makefiletable.parent(gentests, source_makefile_am, tests_makefile_am) - # Create library makefile. - basename = joinpath(sourcebase, source_makefile_am) - tmpfile = self.assistant.tmpfilename(basename) - emit, uses_subdirs = self.emitter.lib_Makefile_am(basename, - self.moduletable['main'], self.moduletable, self.makefiletable, - actioncmd, for_test) - if automake_subdir: - emit = sp.run([joinpath(DIRS['root'], 'build-aux/prefix-gnulib-mk'), '--from-gnulib-tool', - f'--lib-name={libname}', f'--prefix={sourcebase}/'], - input=emit, text=True, capture_output=True).stdout - with codecs.open(tmpfile, 'wb', 'UTF-8') as file: - file.write(emit) - filename, backup, flag = self.assistant.super_update(basename, tmpfile) - if flag == 1: - if not self.config['dryrun']: - print('Updating %s (backup in %s)' % (filename, backup)) - else: # if self.config['dryrun'] - print('Update %s (backup in %s)' % (filename, backup)) - elif flag == 2: - if not self.config['dryrun']: - print('Creating %s' % filename) - else: # if self.config['dryrun']: - print('Create %s' % filename) - filetable['added'] += [filename] - if isfile(tmpfile): - os.remove(tmpfile) - # Create po/ directory. filesystem = GLFileSystem(self.config) if pobase: @@ -1365,6 +1338,35 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix if isfile(tmpfile): os.remove(tmpfile) + # Create library makefile. + # Do this after creating gnulib-comp.m4, because func_emit_lib_Makefile_am + # can run 'autoconf -t', which reads gnulib-comp.m4. + basename = joinpath(sourcebase, source_makefile_am) + tmpfile = self.assistant.tmpfilename(basename) + emit, uses_subdirs = self.emitter.lib_Makefile_am(basename, + self.moduletable['main'], self.moduletable, self.makefiletable, + actioncmd, for_test) + if automake_subdir: + emit = sp.run([joinpath(DIRS['root'], 'build-aux/prefix-gnulib-mk'), '--from-gnulib-tool', + f'--lib-name={libname}', f'--prefix={sourcebase}/'], + input=emit, text=True, capture_output=True).stdout + with codecs.open(tmpfile, 'wb', 'UTF-8') as file: + file.write(emit) + filename, backup, flag = self.assistant.super_update(basename, tmpfile) + if flag == 1: + if not self.config['dryrun']: + print('Updating %s (backup in %s)' % (filename, backup)) + else: # if self.config['dryrun'] + print('Update %s (backup in %s)' % (filename, backup)) + elif flag == 2: + if not self.config['dryrun']: + print('Creating %s' % filename) + else: # if self.config['dryrun']: + print('Create %s' % filename) + filetable['added'] += [filename] + if isfile(tmpfile): + os.remove(tmpfile) + # Create tests Makefile. if gentests: basename = joinpath(testsbase, tests_makefile_am) -- 2.44.0