libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] maint: dynamically strip unused scripts from libltdl Makefil


From: Gary V. Vaughan
Subject: [PATCH 3/3] maint: dynamically strip unused scripts from libltdl Makefile.
Date: Mon, 31 Oct 2011 22:24:48 +0700

This is in preparation for punting maintenance of more of our code
to gnulib... and rather than keep a hard-coded list of which files
in $(aux_dir) should be installed by libtoolize for libltdl, this
patch figures out which aux_files are not part of the libltdl build
so that we can add gnulib modules in future without having to remember
to keep a file list in synch.

I'll apply this along with the other 2 in the series in 72 hours or
so pending any changes necessary due to feedback in the meantime.

* 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 <address@hidden>
---
 Makefile.am  |   24 +++++++++++++++---------
 configure.ac |    7 +++++++
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ac86f5b..d4e25cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -340,12 +340,21 @@ EXTRA_DIST     += $(stamp_mk) $(lt_obsolete_m4)
 $(lt_Makefile_in): $(lt_Makefile_am) $(lt_aclocal_m4)
        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 = \
@@ -424,12 +433,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.
@@ -475,7 +481,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 7ca5250..f3be952 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 \
-- 
1.7.7.1

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]