[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: distcheck error for .Plo files
From: |
Bruno Haible |
Subject: |
Re: distcheck error for .Plo files |
Date: |
Sat, 08 Jan 2022 22:14:52 +0100 |
Mohammad Akhlaghi wrote:
> make[2]: Leaving directory '/path/to/build/dir/_build/sub'
> rm -f config.status config.cache config.log configure.lineno
> config.status.lineno
> rm -f Makefile
> ERROR: files left in build directory after distclean:
> ./bootstrapped/lib/.deps/regex.Plo
> ./bootstrapped/lib/.deps/vasnprintf.Plo
> ./bootstrapped/lib/.deps/printf-parse.Plo
> ./bootstrapped/lib/.deps/getopt.Plo
> ./bootstrapped/lib/.deps/printf-args.Plo
> ./bootstrapped/lib/.deps/chdir-long.Plo
> ./bootstrapped/lib/.deps/fcntl.Plo
> ./bootstrapped/lib/.deps/mbrtowc.Plo
> ./bootstrapped/lib/.deps/getopt1.Plo
> ./bootstrapped/lib/.deps/asnprintf.Plo
> make[1]: *** [Makefile:2564: distcleancheck] Error 1
> make[1]: Leaving directory '/path/to/build/dir/_build/sub'
This patch should fix it.
2022-01-08 Bruno Haible <bruno@clisp.org>
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.
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 " ])"
}