+2024-03-28 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool: Drop workarounds for Automake < 1.14.
+ Reported by Collin Funk in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00384.html>.
+ * gnulib-tool.sh (func_emit_lib_Makefile_am): Emit pkgdata_DATA
+ initialization always.
+ (func_emit_tests_Makefile_am): Likewise.
+ (func_import): Don't emit 'AC_REQUIRE([AM_PROG_CC_C_O])' into
+ gnulib-comp.m4.
+ (func_create_testdir): Don't emit AM_PROG_CC_C_O into configure.ac.
+ Bump required Automake version to 1.14.
+ (func_create_megatestdir): Bump required Automake version to 1.14.
+ * pygnulib/constants.py: Update comments.
+ * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Emit pkgdata_DATA
+ initialization always. Don't return uses_subdirs.
+ (GLEmiter.tests_Makefile_am): Likewise.
+ * pygnulib/GLImport.py (GLImport.gnulib_comp): Don't emit
+ 'AC_REQUIRE([AM_PROG_CC_C_O])'.
+ (GLImport.execute): Update.
+ * pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit AM_PROG_CC_C_O
+ into configure.ac. Bump required Automake version to 1.14.
+ (GLMegaTestDir.execute): Bump required Automake version to 1.14.
+
2024-03-28 Bruno Haible <bruno@clisp.org>
pthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.
'
IFS=" "" $nl"
-# You can set AUTOCONFPATH to empty if autoconf 2.64 is already in your PATH.
+# You can set AUTOCONFPATH to empty if autoconf ≥ 2.64 is already in your PATH.
AUTOCONFPATH=
#case $USER in
# bruno )
# ;;
#esac
-# You can set AUTOMAKEPATH to empty if automake 1.11 is already in your PATH.
+# You can set AUTOMAKEPATH to empty if automake ≥ 1.14 is already in your PATH.
AUTOMAKEPATH=
-# You can set GETTEXTPATH to empty if autopoint 0.15 is already in your PATH.
+# You can set GETTEXTPATH to empty if autopoint ≥ 0.15 is already in your PATH.
GETTEXTPATH=
# You can set LIBTOOLPATH to empty if libtoolize 2.x is already in your PATH.
# Input/Output:
# - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val,dotfirst}
# list of edits to be done to Makefile.am variables
-# Output:
-# - uses_subdirs nonempty if object files in subdirs exist
func_emit_lib_Makefile_am ()
{
# When using GNU make, or when creating an includable Makefile.am snippet,
echo "noinst_HEADERS ="
echo "noinst_LIBRARIES ="
echo "noinst_LTLIBRARIES ="
- # Automake versions < 1.11.4 create an empty pkgdatadir at
- # installation time if you specify pkgdata_DATA to empty.
- # See automake bugs #10997 and #11030:
- # * https://debbugs.gnu.org/10997
- # * https://debbugs.gnu.org/11030
- # So we need this workaround.
- if grep '^pkgdata_DATA *+=' "$tmp"/allsnippets > /dev/null; then
- echo "pkgdata_DATA ="
- fi
+ echo "pkgdata_DATA ="
echo "EXTRA_DIST ="
echo "BUILT_SOURCES ="
echo "SUFFIXES ="
# Input/Output:
# - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val,dotfirst}
# list of edits to be done to Makefile.am variables
-# Output:
-# - uses_subdirs nonempty if object files in subdirs exist
func_emit_tests_Makefile_am ()
{
witness_macro="$1"
echo "check_LIBRARIES = libtests.a"
fi
fi
- # Automake versions < 1.11.4 create an empty pkgdatadir at
- # installation time if you specify pkgdata_DATA to empty.
- # See automake bugs #10997 and #11030:
- # * https://debbugs.gnu.org/10997
- # * https://debbugs.gnu.org/11030
- # So we need this workaround.
- if grep '^pkgdata_DATA *+=' "$tmp"/main_snippets "$tmp"/longrunning_snippets > /dev/null; then
- echo "pkgdata_DATA ="
- fi
+ echo "pkgdata_DATA ="
echo "EXTRA_DIST ="
echo "BUILT_SOURCES ="
echo "SUFFIXES ="
func_emit_pre_early_macros : ' ' "$final_modules"
- if ! $gnu_make && test -n "$uses_subdirs"; then
- echo " AC_REQUIRE([AM_PROG_CC_C_O])"
- fi
for module in $final_modules; do
func_verify_module
if test -n "$module"; then
modules="$main_modules"
fi
func_emit_lib_Makefile_am > "$testdir/$sourcebase/Makefile.am"
- any_uses_subdirs="$uses_subdirs"
# Create $m4base/Makefile.am.
mkdir -p "$testdir/$m4base"
use_libtests=false
destfile="$testsbase/Makefile.am"
func_emit_tests_Makefile_am "" > "$testdir/$testsbase/Makefile.am"
- any_uses_subdirs="$any_uses_subdirs$uses_subdirs"
# Create $testsbase/configure.ac.
(echo "# Process this file with autoconf to produce a configure script."
echo "AC_INIT([dummy], [0])"
func_emit_pre_early_macros false '' "$modules"
- if test -n "$uses_subdirs"; then
- echo "AM_PROG_CC_C_O"
- echo
- fi
for module in $modules; do
func_verify_module
if test -n "$module"; then
# Create Makefile.am.
(echo "## Process this file with automake to produce Makefile.in."
echo
- echo "AUTOMAKE_OPTIONS = 1.11 foreign"
+ echo "AUTOMAKE_OPTIONS = 1.14 foreign"
echo
echo "SUBDIRS = $subdirs"
echo
func_emit_pre_early_macros false '' "$final_modules"
- if test -n "$any_uses_subdirs"; then
- echo "AM_PROG_CC_C_O"
- echo
- fi
for module in $final_modules; do
if $single_configure; then
func_verify_module
# Create Makefile.am.
(echo "## Process this file with automake to produce Makefile.in."
echo
- echo "AUTOMAKE_OPTIONS = 1.11 foreign"
+ echo "AUTOMAKE_OPTIONS = 1.14 foreign"
echo
echo "SUBDIRS = $megasubdirs"
echo
return emit
def lib_Makefile_am(self, destfile: str, modules: list[GLModule], moduletable: GLModuleTable,
- makefiletable: GLMakefileTable, actioncmd: str, for_test: bool) -> tuple[str, bool]:
- '''Emit the contents of the library Makefile. Returns str and a bool
- variable which shows if subdirectories are used.
+ makefiletable: GLMakefileTable, actioncmd: str, for_test: bool) -> str:
+ '''Emit the contents of the library Makefile. Returns it as a string.
GLConfig: localpath, sourcebase, libname, pobase, auxdir, makefile_name, libtool,
macro_prefix, podomain, conddeps, witness_c_macro.
emit += 'noinst_HEADERS =\n'
emit += 'noinst_LIBRARIES =\n'
emit += 'noinst_LTLIBRARIES =\n'
- # Automake versions < 1.11.4 create an empty pkgdatadir at
- # installation time if you specify pkgdata_DATA to empty.
- # See automake bugs #10997 and #11030:
- # * https://debbugs.gnu.org/10997
- # * https://debbugs.gnu.org/11030
- # So we need this workaround.
- pattern = re.compile(r'^pkgdata_DATA *\+=', re.M)
- if pattern.findall(allsnippets):
- emit += 'pkgdata_DATA =\n'
+ emit += 'pkgdata_DATA =\n'
emit += 'EXTRA_DIST =\n'
emit += 'BUILT_SOURCES =\n'
emit += 'SUFFIXES =\n'
emit += '\t-rm -f @%s_LIBOBJDEPS@\n' % (macro_prefix)
# Extend the 'maintainer-clean' rule.
emit += 'maintainer-clean-local: distclean-gnulib-libobjs\n'
- result = tuple([emit, uses_subdirs])
- return result
+ return emit
def tests_Makefile_am(self, destfile: str, modules: list[GLModule], moduletable: GLModuleTable,
- makefiletable: GLMakefileTable, witness_macro: str, for_test: bool) -> tuple[str, bool]:
- '''Emit the contents of the tests Makefile. Returns str and a bool variable
- which shows if subdirectories are used.
+ makefiletable: GLMakefileTable, witness_macro: str, for_test: bool) -> str:
+ '''Emit the contents of the tests Makefile. Returns it as a string.
GLConfig: localpath, modules, libname, auxdir, makefile_name, libtool,
sourcebase, m4base, testsbase, macro_prefix, witness_c_macro,
single_configure, libtests.
emit += 'noinst_LIBRARIES += libtests.a\n'
else: # if not for_test
emit += 'check_LIBRARIES = libtests.a\n'
-
- # Automake versions < 1.11.4 create an empty pkgdatadir at
- # installation time if you specify pkgdata_DATA to empty.
- # See automake bugs #10997 and #11030:
- # * https://debbugs.gnu.org/10997
- # * https://debbugs.gnu.org/11030
- # So we need this workaround.
- pattern = re.compile(r'^pkgdata_DATA *\+=', re.M)
- if pattern.findall(main_snippets) or pattern.findall(longrun_snippets):
- emit += 'pkgdata_DATA =\n'
-
+ emit += 'pkgdata_DATA =\n'
emit += 'EXTRA_DIST =\n'
emit += 'BUILT_SOURCES =\n'
emit += 'SUFFIXES =\n'
emit += '\t fi; \\\n'
emit += '\tdone; \\\n'
emit += '\t:\n'
- result = tuple([emit, uses_subdirs])
- return result
+ return emit
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable\n''' % (configure_ac, macro_prefix)
emit += self.emitter.preEarlyMacros(True, ' ', moduletable['final'])
- uses_subdirs = False
- for module in moduletable['main']:
- # Test whether there are some source files in subdirectories.
- for file in module.getFiles():
- if (file.startswith('lib/') and file.endswith('.c')
- and file.count('/') > 1):
- uses_subdirs = True
- break
- if not gnu_make and uses_subdirs:
- emit += ' AC_REQUIRE([AM_PROG_CC_C_O])\n'
for module in moduletable['final']:
emit += ' # Code from module %s:\n' % str(module)
snippet = module.getAutoconfEarlySnippet()
# 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)
+ emit = 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}/'],
if gentests:
basename = joinpath(testsbase, tests_makefile_am)
tmpfile = self.assistant.tmpfilename(basename)
- emit, uses_subdirs = self.emitter.tests_Makefile_am(basename,
- self.moduletable['tests'], self.moduletable, self.makefiletable,
- '%stests_WITNESS' % macro_prefix, for_test)
+ emit = self.emitter.tests_Makefile_am(basename,
+ self.moduletable['tests'], self.moduletable, self.makefiletable,
+ '%stests_WITNESS' % macro_prefix, for_test)
with codecs.open(tmpfile, 'wb', 'UTF-8') as file:
file.write(emit)
filename, backup, flag = self.assistant.super_update(basename, tmpfile)
os.mkdir(directory)
destfile = joinpath(directory, 'Makefile.am')
if single_configure:
- emit, uses_subdirs = self.emitter.lib_Makefile_am(destfile, main_modules,
- moduletable, self.makefiletable, '', for_test)
+ emit = self.emitter.lib_Makefile_am(destfile, main_modules,
+ moduletable, self.makefiletable, '', for_test)
else: # if not single_configure
- emit, uses_subdirs = self.emitter.lib_Makefile_am(destfile, modules,
- moduletable, self.makefiletable, '', for_test)
+ emit = self.emitter.lib_Makefile_am(destfile, modules,
+ moduletable, self.makefiletable, '', for_test)
with codecs.open(destfile, 'wb', 'UTF-8') as file:
file.write(emit)
- any_uses_subdirs = uses_subdirs
# Create $m4base/Makefile.am.
directory = joinpath(self.testdir, m4base)
# Create $testsbase/Makefile.am.
destfile = joinpath(directory, 'Makefile.am')
witness_macro = '%stests_WITNESS' % macro_prefix
- emit, uses_subdirs = self.emitter.tests_Makefile_am(destfile, tests_modules, moduletable,
- self.makefiletable, witness_macro, for_test)
+ emit = self.emitter.tests_Makefile_am(destfile, tests_modules, moduletable,
+ self.makefiletable, witness_macro, for_test)
with codecs.open(destfile, 'wb', 'UTF-8') as file:
file.write(emit)
else: # if not single_configure
destfile = joinpath(directory, 'Makefile.am')
libtests = False
self.config.setLibtests(False)
- emit, uses_subdirs = self.emitter.tests_Makefile_am(destfile, modules, moduletable,
- self.makefiletable, '', for_test)
+ emit = self.emitter.tests_Makefile_am(destfile, modules, moduletable,
+ self.makefiletable, '', for_test)
with codecs.open(destfile, 'wb', 'UTF-8') as file:
file.write(emit)
# Viewed from the $testsbase subdirectory, $auxdir is different.
emit += 'AC_PROG_INSTALL\n'
emit += 'AC_PROG_MAKE_SET\n'
emit += self.emitter.preEarlyMacros(False, '', modules)
- if uses_subdirs:
- emit += 'AM_PROG_CC_C_O\n\n'
snippets = list()
for module in modules:
if str(module) in ['gnumakefile', 'maintainer-makefile']:
# Create Makefile.am.
emit = '## Process this file with automake to produce Makefile.in.\n\n'
- emit += 'AUTOMAKE_OPTIONS = 1.11 foreign\n\n'
+ emit += 'AUTOMAKE_OPTIONS = 1.14 foreign\n\n'
emit += 'SUBDIRS = %s\n\n' % ' '.join(subdirs)
emit += 'ACLOCAL_AMFLAGS = -I %s\n' % m4base
emit = constants.nlconvert(emit)
emit += 'm4_pattern_allow([^gl_LIBOBJS$])dnl a variable\n'
emit += 'm4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable\n'
emit += self.emitter.preEarlyMacros(False, '', modules)
- if any_uses_subdirs:
- emit += 'AM_PROG_CC_C_O\n'
- emit += '\n'
snippets = list()
for module in final_modules:
if single_configure:
# Create Makefile.am.
emit = '## Process this file with automake to produce Makefile.in.\n\n'
- emit += 'AUTOMAKE_OPTIONS = 1.11 foreign\n\n'
+ emit += 'AUTOMAKE_OPTIONS = 1.14 foreign\n\n'
emit += 'SUBDIRS = %s\n\n' % ' '.join(megasubdirs)
emit += 'EXTRA_DIST = do-autobuild\n'
emit = constants.nlconvert(emit)
# Define AUTOCONF minimum version
DEFAULT_AUTOCONF_MINVERSION = 2.64
-# You can set AUTOCONFPATH to empty if autoconf 2.64 is already in your PATH
+# You can set AUTOCONFPATH to empty if autoconf ≥ 2.64 is already in your PATH
AUTOCONFPATH = ''
-# You can set AUTOMAKEPATH to empty if automake 1.11 is already in your PATH
+# You can set AUTOMAKEPATH to empty if automake ≥ 1.14 is already in your PATH
AUTOMAKEPATH = ''
-# You can set GETTEXTPATH to empty if autopoint 0.15 is already in your PATH
+# You can set GETTEXTPATH to empty if autopoint ≥ 0.15 is already in your PATH
GETTEXTPATH = ''
# You can set LIBTOOLPATH to empty if libtoolize 2.x is already in your PATH
LIBTOOLPATH = ''