Skip to content

Commit

Permalink
gnulib-tool: Fix the result of --create-testdir (regression yesterday).
Browse files Browse the repository at this point in the history
* gnulib-tool.sh (func_emit_lib_Makefile_am): If $for_test, revert to
the previous code.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If for_test, revert
to the previous code.
  • Loading branch information
bhaible committed Feb 4, 2025
1 parent f3550a3 commit a77e2c4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2025-02-04 Bruno Haible <[email protected]>

gnulib-tool: Fix the result of --create-testdir (regression yesterday).
* gnulib-tool.sh (func_emit_lib_Makefile_am): If $for_test, revert to
the previous code.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If for_test, revert
to the previous code.

2025-02-04 Bruno Haible <[email protected]>

*vasnprintf: Add a stricter runtime check.
Expand Down
21 changes: 18 additions & 3 deletions gnulib-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4044,8 +4044,16 @@ func_emit_lib_Makefile_am ()
fi
# Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However,
# automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@.
echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${libname}_${perhapsLT}LIBOBJS)"
echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${libname}_${perhapsLT}LIBOBJS)"
if ! $for_test; then
# When there is a ${libname}_${libext}_CFLAGS or ${libname}_${libext}_CPPFLAGS
# definition, Automake emits rules for creating object files prefixed with
# "${libname}_${libext}-".
echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${libname}_${perhapsLT}LIBOBJS)"
echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${libname}_${perhapsLT}LIBOBJS)"
else
echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
fi
echo "EXTRA_${libname}_${libext}_SOURCES ="
if test "$libtool" = true; then
echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
Expand Down Expand Up @@ -4081,7 +4089,14 @@ func_emit_lib_Makefile_am ()
# Extend the 'distclean' rule.
echo "distclean-local: distclean-gnulib-libobjs"
echo "distclean-gnulib-libobjs:"
echo " -rm -f @${macro_prefix}_${libname}_LIBOBJDEPS@"
if ! $for_test; then
# When there is a ${libname}_${libext}_CFLAGS or ${libname}_${libext}_CPPFLAGS
# definition, Automake emits rules for creating object files prefixed with
# "${libname}_${libext}-".
echo " -rm -f @${macro_prefix}_${libname}_LIBOBJDEPS@"
else
echo " -rm -f @${macro_prefix}_LIBOBJDEPS@"
fi
# Extend the 'maintainer-clean' rule.
echo "maintainer-clean-local: distclean-gnulib-libobjs"
rm -f "$tmp"/allsnippets
Expand Down
19 changes: 16 additions & 3 deletions pygnulib/GLEmiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,15 @@ def lib_Makefile_am(self, destfile: str, modules: list[GLModule], moduletable: G
emit += '%s_%s_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS) $(GL_CFLAG_ALLOW_WARNINGS)\n' % (libname, libext)
# Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However,
# automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@.
emit += '%s_%s_LIBADD = $(%s_%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, libname, perhapsLT)
emit += '%s_%s_DEPENDENCIES = $(%s_%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, libname, perhapsLT)
if not for_test:
# When there is a {libname}_{libext}_CFLAGS or {libname}_{libext}_CPPFLAGS
# definition, Automake emits rules for creating object files prefixed with
# "{libname}_{libext}-".
emit += '%s_%s_LIBADD = $(%s_%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, libname, perhapsLT)
emit += '%s_%s_DEPENDENCIES = $(%s_%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, libname, perhapsLT)
else:
emit += '%s_%s_LIBADD = $(%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, perhapsLT)
emit += '%s_%s_DEPENDENCIES = $(%s_%sLIBOBJS)\n' % (libname, libext, macro_prefix, perhapsLT)
emit += 'EXTRA_%s_%s_SOURCES =\n' % (libname, libext)
if libtool:
emit += '%s_%s_LDFLAGS = $(AM_LDFLAGS)\n' % (libname, libext)
Expand Down Expand Up @@ -969,7 +976,13 @@ def lib_Makefile_am(self, destfile: str, modules: list[GLModule], moduletable: G
# Extend the 'distclean' rule.
emit += 'distclean-local: distclean-gnulib-libobjs\n'
emit += 'distclean-gnulib-libobjs:\n'
emit += '\t-rm -f @%s_%s_LIBOBJDEPS@\n' % (macro_prefix, libname)
if not for_test:
# When there is a {libname}_{libext}_CFLAGS or {libname}_{libext}_CPPFLAGS
# definition, Automake emits rules for creating object files prefixed with
# "{libname}_{libext}-".
emit += '\t-rm -f @%s_%s_LIBOBJDEPS@\n' % (macro_prefix, libname)
else:
emit += '\t-rm -f @%s_LIBOBJDEPS@\n' % (macro_prefix)
# Extend the 'maintainer-clean' rule.
emit += 'maintainer-clean-local: distclean-gnulib-libobjs\n'
return emit
Expand Down

0 comments on commit a77e2c4

Please sign in to comment.