Enhance cleaning of programs in libtool mode.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 7 Sep 2008 08:43:33 +0000 (10:43 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 7 Sep 2008 08:46:31 +0000 (10:46 +0200)
* 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 <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
lib/am/progs.am
tests/nobase-libtool.test

index e5b4eb6..ede8960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
 2008-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       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  <Ralf.Wildenhues@gmx.de>
            Jim Meyering <jim@meyering.net>
 
        Reliable multi-file install for man pages.
        * 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  <Ralf.Wildenhues@gmx.de>
 
 
        * automake.in (handle_compile): Use subst, for maintainer-check.
 
-2006-10-09  Andreas Köhler  <andi5.py@gmx.net>  (tiny change)
+2006-10-09  Andreas Köhler  <andi5.py@gmx.net>  (tiny change)
 
        For PR automake/505:
        * lib/am/configure.am (am__CONFIG_DISTCLEAN_FILES):
diff --git a/THANKS b/THANKS
index 2b64ee8..9b98749 100644 (file)
--- 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
index cc4cf4a..24fd10f 100644 (file)
@@ -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
 
 
 ## ---------- ##
index bb027c6..4da415b 100755 (executable)
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# 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