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.
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)'])
## ------------------------------- ##
# 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. ##
## ---------------------- ##
## 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