--------------------------------------------------------------------------------
-commit 8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482
-Author: Paul Eggert <eggert@cs.ucla.edu>
-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 <https://bugs.gnu.org/32452#109>.
-
---------------------------------------------------------------------------------
-
commit 30459fe101541698ec704acb224946d73676750e
Author: Bruno Haible <bruno@clisp.org>
Date: Thu Jun 8 15:09:31 2017 +0200
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:
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)