]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
maint: dynamically strip unused scripts from libltdl Makefile.
authorGary V. Vaughan <gary@gnu.org>
Sun, 30 Oct 2011 04:03:00 +0000 (11:03 +0700)
committerGary V. Vaughan <gary@gnu.org>
Sat, 5 Nov 2011 09:58:31 +0000 (16:58 +0700)
* configure.ac (pkgaux_scripts): Centrally maintain the complete
list of aux scripts required to build libltdl, and which need to
be installed by libtoolize --ltdl, and consequently need to be
placed in $pkgdatadir by make install.
* Makefile.am (libltdl/stamp.mk): Improved to strip the unused
scripts not listed in pkgaux_scripts without the need for manual
synchronisation.
(auxexefiles): Removed. Replaced by new pkgaux_scripts
substitution.
(install-data-local): Adjust.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Makefile.am
configure.ac

index 02a659772e497bdf27a4a93410397ea2bf090eaa..66d09f2964c54f0a35d6cf4c41a877ffed3cad5f 100644 (file)
@@ -337,12 +337,21 @@ EXTRA_DIST     += $(stamp_mk) $(lt_obsolete_m4)
 $(lt_Makefile_in): $(lt_Makefile_am) $(lt_aclocal_m4)
        $(AM_V_GEN)cd '$(ltdl_dir)' && $(AUTOMAKE) Makefile
 
+# Don't let unused scripts leak into the libltdl Makefile
 $(stamp_mk): $(lt_Makefile_in)
        $(AM_V_at)T='$(ltdl_dir)/Makefile.tmp'; \
-       '$(SED)' -e 's,config/mdate-sh,,' -e 's,config/texinfo.tex,,' \
-           -e 's,config/mkinstalldirs,,' \
-           < '$(lt_Makefile_in)' > "$$T" && \
-       mv -f "$$T" '$(lt_Makefile_in)'
+       for p in $(ltdl_dir)/config/*; do \
+         test -f "$$p" || continue; \
+         f=`echo "$$p" | $(SED) 's,^$(ltdl_dir)/,,'`; \
+         case " $(pkgaux_scripts) " in \
+           *" $$f "*) ;; \
+           *) '$(SED)' \
+                 -e 's,\(\$$([^)]*)/\)*'"$$f"'\$$,,' \
+                 -e 's,\(\$$([^)]*)/\)*'"$$f"' ,,' \
+               '$(lt_Makefile_in)' > "$$T" \
+                 && mv -f "$$T" '$(lt_Makefile_in)';; \
+         esac; \
+       done
        $(AM_V_GEN)echo stamp > '$@'
 
 lt_aclocal_m4_deps = \
@@ -421,12 +430,9 @@ $(libtoolize_1): $(libtoolize_in)
 ## Installation. ##
 ## ------------- ##
 
-# These are required by libtoolize and must be executable when installed.
 # The timestamps on these files must be preserved carefully so we install,
 # uninstall and set executable with custom rules here.
-auxexefiles    = config/compile config/config.guess config/config.sub \
-                 config/depcomp config/install-sh config/missing
-auxfiles       = $(auxexefiles) config/ltmain.sh
+auxfiles       = $(pkgaux_scripts) config/ltmain.sh
 
 # Everything that gets picked up by aclocal is automatically distributed,
 # this is the list of macro files we install on the user's system.
@@ -472,7 +478,7 @@ install-data-local: $(lt_Makefile_in)
 ## install the helper scripts
        $(mkinstalldirs) '$(DESTDIR)$(pkgdatadir)'
        $(mkinstalldirs) '$(DESTDIR)$(pkgdatadir)/config'
-       @list='$(auxexefiles)' && for p in $$list; do \
+       @list='$(pkgaux_scripts)' && for p in $$list; do \
          echo " $(INSTALL_SCRIPT) '$(ltdl_dir)/$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
          $(INSTALL_SCRIPT) "$(ltdl_dir)/$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
        done
index 7ca5250e3bc319729e61a8d269e887c0cac1d22a..f3be9523670df5b90930c5dd13d444bb52a800f9 100644 (file)
@@ -118,6 +118,13 @@ if test x"${enable_ltdl_install+set}" != xset; then
   enable_ltdl_install=yes
 fi
 
+# The list of scripts required to build libltdl, and which need to be
+# installed by libtoolize --ltdl, and consequently need to be placed in
+# $pkgdatadir by our make install rule.
+pkgaux_scripts="config/compile config/config.guess config/config.sub \
+ config/depcomp config/install-sh config/missing"
+AC_SUBST([pkgaux_scripts])
+
 # All subdirectories that are configured on demand, but that must be
 # included in the distribution.
 CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/fcdemo \