From: Gary V. Vaughan Date: Sun, 30 Oct 2011 04:03:00 +0000 (+0700) Subject: maint: dynamically strip unused scripts from libltdl Makefile. X-Git-Tag: v2.4.2.418~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c4184c38c48654e2da6728ead73314052516f6;p=thirdparty%2Flibtool.git maint: dynamically strip unused scripts from libltdl Makefile. * 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 --- diff --git a/Makefile.am b/Makefile.am index 02a659772..66d09f296 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 7ca5250e3..f3be95236 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \