]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Fix the result of --create-testdir (regression yesterday).
authorBruno Haible <bruno@clisp.org>
Tue, 4 Feb 2025 11:00:50 +0000 (12:00 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 4 Feb 2025 11:00:50 +0000 (12:00 +0100)
* 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.

ChangeLog
gnulib-tool.sh
pygnulib/GLEmiter.py

index 5b853546353433f2c27ca985198165f397c97d84..f1b421c5059de20996da0ea0b622cc9f0406891c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-04  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        *vasnprintf: Add a stricter runtime check.
index bddd3073d621de5521065a4190e6816c9a6baecb..0fbd805ebec681cd75bfa7fc2e6e9d6089451b3b 100755 (executable)
@@ -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)"
@@ -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
index 814ccae571c0cff799b96075935b24992ccc1888..cf16dd865408eab2a279bf092397d633878ba095 100644 (file)
@@ -929,8 +929,15 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             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)
@@ -969,7 +976,13 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         # 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