+2025-09-03 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool: Avoid Automake error when using --create-testdir (regr. today).
+ * gnulib-tool.sh (func_emit_tests_Makefile_am): Initialize AM_CFLAGS and
+ AM_CXXFLAGS when creating a test directory.
+ * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.
+
2025-09-03 Bruno Haible <bruno@clisp.org>
gnulib-tool: In tests directories, augment AM_CFLAGS and AM_CXXFLAGS.
if ! $for_test; then
# Enable or disable warnings as suitable for the Gnulib coding style.
cflags_for_gnulib_code=" \$(GL_CFLAG_GNULIB_WARNINGS)"
+ else
+ # Make sure AM_CFLAGS is set or Automake will error when we append to it
+ # using '+='.
+ echo 'AM_CFLAGS ='
+ # Likewise for AM_CXXFLAGS.
+ if test -n "$uses_cxx"; then
+ echo 'AM_CXXFLAGS ='
+ fi
fi
# The primary place to add these options is AM_CFLAGS.
echo "AM_CFLAGS += @GL_CFLAG_ALLOW_WARNINGS@${cflags_for_gnulib_code}"
if not for_test:
# Enable or disable warnings as suitable for the Gnulib coding style.
cflags_for_gnulib_code = ' $(GL_CFLAG_GNULIB_WARNINGS)'
+ else:
+ # Make sure AM_CFLAGS is set or Automake will error when we append to it
+ # using '+='.
+ emit += 'AM_CFLAGS =\n'
+ # Likewise for AM_CXXFLAGS.
+ if uses_cxx:
+ emit += 'AM_CXXFLAGS =\n'
# The primary place to add these options is AM_CFLAGS.
emit += 'AM_CFLAGS += @GL_CFLAG_ALLOW_WARNINGS@%s\n' % (cflags_for_gnulib_code)
if uses_cxx: