From 8c9f415b59a95d76c0addba84101adbc3080f214 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 7 Sep 2008 10:43:33 +0200 Subject: [PATCH] Enhance cleaning of programs in libtool mode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/am/progs.am (clean-%DIR%PROGRAMS) [?LIBTOOL?]: Fork less often, avoid removing programs twice if $(EXEEXT) is empty. * tests/nobase-libtool.test: Also test PROGRAMS, in order to exercise the code path. * THANKS: Update. Report by Toralf Förster. Signed-off-by: Ralf Wildenhues --- ChangeLog | 14 ++++++++++++-- THANKS | 1 + lib/am/progs.am | 12 +++++++----- tests/nobase-libtool.test | 9 +++++++-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5b4eb6..ede8960 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,14 @@ 2008-09-07 Ralf Wildenhues + + Enhance cleaning of programs in libtool mode. + * lib/am/progs.am (clean-%DIR%PROGRAMS) [?LIBTOOL?]: Fork less + often, avoid removing programs twice if $(EXEEXT) is empty. + * tests/nobase-libtool.test: Also test PROGRAMS, in order to + exercise the code path. + * THANKS: Update. + Report by Toralf Förster. + +2008-09-07 Ralf Wildenhues Jim Meyering Reliable multi-file install for man pages. @@ -1059,7 +1069,7 @@ * tests/libtoo10.test: New test. * tests/Makefile.am: Update. * THANKS: Update. - Report by Guillermo Ontañón. + Report by Guillermo Ontañón. 2007-08-09 Ralf Wildenhues @@ -1485,7 +1495,7 @@ * automake.in (handle_compile): Use subst, for maintainer-check. -2006-10-09 Andreas Köhler (tiny change) +2006-10-09 Andreas Köhler (tiny change) For PR automake/505: * lib/am/configure.am (am__CONFIG_DISTCLEAN_FILES): diff --git a/THANKS b/THANKS index 2b64ee8..9b98749 100644 --- a/THANKS +++ b/THANKS @@ -303,6 +303,7 @@ Thomas Gagne tgagne@ix.netcom.com Thomas Morgan tmorgan@pobox.com Thomas Schwinge tschwinge@gnu.org Thomas Tanner tanner@ffii.org +Toralf Förster toralf.foerster@gmx.de Tim Goodwin tjg@star.le.ac.uk Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Tim Van Holder tim.van.holder@pandora.be diff --git a/lib/am/progs.am b/lib/am/progs.am index cc4cf4a..24fd10f 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -92,11 +92,13 @@ clean-%DIR%PROGRAMS: ## Cleaning the `_libs/' or `.libs/' directory is done from clean-libtool. ## FIXME: In the future (i.e., when it works) it would be nice to delegate ## this task to `libtool --mode=clean'. -?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \ -?LIBTOOL? f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ -?LIBTOOL? echo " rm -f $$p $$f"; \ -?LIBTOOL? rm -f $$p $$f ; \ -?LIBTOOL? done +?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; test -n "$$list" || exit 0; \ +?LIBTOOL? echo " rm -f" $$list; \ +?LIBTOOL? rm -f $$list || exit $$?; \ +?LIBTOOL? test -n "$(EXEEXT)" || exit 0; \ +?LIBTOOL? list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ +?LIBTOOL? echo " rm -f" $$list; \ +?LIBTOOL? rm -f $$list ## ---------- ## diff --git a/tests/nobase-libtool.test b/tests/nobase-libtool.test index bb027c6..4da415b 100755 --- a/tests/nobase-libtool.test +++ b/tests/nobase-libtool.test @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure nobase_* works for libtool libraries as well. +# Make sure nobase_* works for libtool libraries and programs as well. # This is just the libtool equivalent of nobase.test, split # up for greater exposure of nobase.test. @@ -34,8 +34,12 @@ cat > Makefile.am << 'EOF' fooexecdir = $(prefix)/foo fooexec_LTLIBRARIES = sub/libbase.la nobase_fooexec_LTLIBRARIES = sub/libnobase.la +fooexec_PROGRAMS = sub/base +nobase_fooexec_PROGRAMS = sub/nobase sub_libbase_la_SOURCES = source2.c sub_libnobase_la_SOURCES = source2.c +sub_base_SOURCES = source.c +sub_nobase_SOURCES = source.c test-install-data: install-data test ! -f inst/foo/sub/libnobase.la @@ -49,13 +53,14 @@ EOF mkdir sub -cat >source2.c <<'EOF' +cat >source.c <<'EOF' int main (int argc, char *argv[]) { return 0; } EOF +cp source.c source2.c rm -f install-sh -- 2.7.4