summaryrefslogtreecommitdiff
path: root/gnulib-tool
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-01-08 22:10:54 +0100
committerBruno Haible <bruno@clisp.org>2022-01-08 22:10:54 +0100
commit9abc30c383303fab68aa5ed2841113876bfa90d1 (patch)
tree8b1050b533133765ab5505f65270ece184ac64a6 /gnulib-tool
parent5a6191b07d959140e35d4cadaf986148e6f26c5d (diff)
downloadgnulib-9abc30c383303fab68aa5ed2841113876bfa90d1.tar.gz
gnulib-tool: Remove all *.Po files upon distclean (regr. 2022-01-05).
Reported by Mohammad Akhlaghi <mohammad@akhlaghi.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00061.html>. * gnulib-tool (func_emit_initmacro_end): Collect the *.Po or *.Plo files to remove into an AC_SUBSTed variable gl_LIBOBJDEPS. (func_emit_lib_Makefile_am): Extend the distclean and maintainer-clean rules.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-xgnulib-tool25
1 files changed, 25 insertions, 0 deletions
diff --git a/gnulib-tool b/gnulib-tool
index a91847f55a..6f2b10cf79 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4012,6 +4012,13 @@ func_emit_lib_Makefile_am ()
echo " fi; \\"
echo " done; \\"
echo " :"
+ # Emit rules to erase .Po and .Plo files for AC_LIBOBJ invocations.
+ # Extend the 'distclean' rule.
+ echo "distclean-local: distclean-gnulib-libobjs"
+ echo "distclean-gnulib-libobjs:"
+ echo " -rm -f @${macro_prefix}_LIBOBJDEPS@"
+ # Extend the 'maintainer-clean' rule.
+ echo "maintainer-clean-local: distclean-gnulib-libobjs"
rm -f "$tmp"/allsnippets
}
@@ -4481,6 +4488,8 @@ func_emit_initmacro_start ()
# - gentests true if a tests Makefile.am is being generated,
# false otherwise
# - automake_subdir true if --automake-subdir was given, false otherwise
+# - libtool true if --libtool was given, false if --no-libtool was
+# given, blank otherwise
func_emit_initmacro_end ()
{
macro_prefix_arg="$1"
@@ -4509,9 +4518,17 @@ func_emit_initmacro_end ()
echo " AC_CONFIG_COMMANDS_PRE(["
echo " ${macro_prefix_arg}_libobjs="
echo " ${macro_prefix_arg}_ltlibobjs="
+ echo " ${macro_prefix_arg}_libobjdeps="
echo " if test -n \"\$${macro_prefix_arg}_LIBOBJS\"; then"
echo " # Remove the extension."
+ echo "changequote(,)dnl"
echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'"
+ echo " sed_dirname1='s,//*,/,g'"
+ echo " sed_dirname2='s,\\(.\\)/\$,\\1,'"
+ echo " sed_dirname3='s,^[^/]*\$,.,'"
+ echo " sed_dirname4='s,\\(.\\)/[^/]*\$,\\1,'"
+ echo " sed_basename1='s,.*/,,'"
+ echo "changequote([, ])dnl"
if $automake_subdir && ! "$2" && test -n "$sourcebase" && test "$sourcebase" != '.'; then
subdir="$sourcebase/"
else
@@ -4520,10 +4537,18 @@ func_emit_initmacro_end ()
echo " for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo \"\$i\"; done | sed -e \"\$sed_drop_objext\" | sort | uniq\`; do"
echo " ${macro_prefix_arg}_libobjs=\"\$${macro_prefix_arg}_libobjs ${subdir}\$i.\$ac_objext\""
echo " ${macro_prefix_arg}_ltlibobjs=\"\$${macro_prefix_arg}_ltlibobjs ${subdir}\$i.lo\""
+ echo " i_dir=\`echo \"\$i\" | sed -e \"\$sed_dirname1\" -e \"\$sed_dirname2\" -e \"\$sed_dirname3\" -e \"\$sed_dirname4\"\`"
+ echo " i_base=\`echo \"\$i\" | sed -e \"\$sed_basename1\"\`"
+ if test "$libtool" = true; then
+ echo " ${macro_prefix_arg}_libobjdeps=\"\$${macro_prefix_arg}_libobjdeps ${subdir}\$i_dir/\\\$(DEPDIR)/\$i_base.Plo\""
+ else
+ echo " ${macro_prefix_arg}_libobjdeps=\"\$${macro_prefix_arg}_libobjdeps ${subdir}\$i_dir/\\\$(DEPDIR)/\$i_base.Po\""
+ fi
echo " done"
echo " fi"
echo " AC_SUBST([${macro_prefix_arg}_LIBOBJS], [\$${macro_prefix_arg}_libobjs])"
echo " AC_SUBST([${macro_prefix_arg}_LTLIBOBJS], [\$${macro_prefix_arg}_ltlibobjs])"
+ echo " AC_SUBST([${macro_prefix_arg}_LIBOBJDEPS], [\$${macro_prefix_arg}_libobjdeps])"
echo " ])"
}