]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix errors in distclean and maintainer-clean
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 9 Oct 2024 17:02:28 +0000 (20:02 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 9 Oct 2024 17:02:28 +0000 (20:02 +0300)
The variable, LT_ARGZ_H, can be empty, which causes distclean and
maintainer-clean to error as a directory is attempted to be removed
instead of a file.

When running maintainer-clean for gnulib-tests, the .version file is
missing, which is needed by config.status, so the command will error.

* configure.ac: Update CONFIG_STATUS_DEPENDENCIES to use dotversion so
  that the .version file can be generated if needed. Add AC_SUBST for
  LT_DOLLAR_SIGN use in libltdl/ltdl.mk.
* libltdl/ltdl.mk: Add conditional to check if LT_ARGZ_H is empty.

configure.ac
libltdl/ltdl.mk

index 4b3a2082c77463e510d485ec6ae50487591fb38f..dd611b9672b3c56789e121edd814c54e45ec3de0 100644 (file)
@@ -108,7 +108,7 @@ AB_INIT([$autobuild_mode])
 
 
 dnl Make sure config.status is regenerated when the version timestamp changes
-AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/.version'])
+AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(dotversion)'])
 
 
 ## ------------------------------- ##
@@ -166,6 +166,9 @@ AC_SUBST([to_tool_file_cmd])dnl
 # Propagate --enable-aix-soname option to the testsuite.
 AC_SUBST([with_aix_soname])dnl
 
+# Avoid non-POSIX variable name
+AC_SUBST([LT_DOLLAR_SIGN],[$])dnl
+
 ## ---------------------- ##
 ## Gnulib initialisation. ##
 ## ---------------------- ##
index 1b7b8a3809a46029d62cce15b5f56560cbf5a8b4..b1ee800f6bdfde031ede08068da25856d7d75241 100644 (file)
@@ -131,7 +131,8 @@ EXTRA_DIST         += libltdl/COPYING.LIB \
 ## Gnulib Makefile.am snippets ##
 ## --------------------------- ##
 
-BUILT_SOURCES  += libltdl/libltdl/$(LT_ARGZ_H)
+# Ugly conditional for 'make maintainer-clean' when LT_ARGZ_H is empty
+BUILT_SOURCES  += @LT_DOLLAR_SIGN@(if @LT_DOLLAR_SIGN@(LT_ARGZ_H),libltdl/libltdl/@LT_DOLLAR_SIGN@(LT_ARGZ_H))
 EXTRA_DIST     += libltdl/libltdl/lt__argz_.h \
                   libltdl/lt__argz.c