From 7481f43685dcb69d9269951fe2edb9140e86124b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 20 Jul 2002 15:11:50 +0000 Subject: [PATCH] * lib/am/progs.am (install-%DIR%PROGRAMS, uninstall-%DIR%PROGRAMS): Always strip the directory part before applying $(transform), even for nobase_ targets. * lib/am/scripts.am (install-%DIR%SCRIPTS, uninstall-%DIR%SCRIPTS): Likewise. * tests/nobase.test: Use --program-prefix while testing nobase support. --- ChangeLog | 10 ++++++++++ Makefile.in | 11 +++++++---- lib/Automake/Makefile.in | 1 + lib/Makefile.in | 1 + lib/am/Makefile.in | 1 + lib/am/progs.am | 13 +++++++++---- lib/am/scripts.am | 17 ++++++++++------- tests/nobase.test | 22 +++++++++++----------- 8 files changed, 50 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83b3f855c..2cd149636 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-07-20 Alexandre Duret-Lutz + + * lib/am/progs.am (install-%DIR%PROGRAMS, uninstall-%DIR%PROGRAMS): + Always strip the directory part before applying $(transform), + even for nobase_ targets. + * lib/am/scripts.am (install-%DIR%SCRIPTS, uninstall-%DIR%SCRIPTS): + Likewise. + * tests/nobase.test: Use --program-prefix while testing nobase + support. + 2002-07-19 Alexandre Duret-Lutz * tests/dirname.test: Delete. We don't define _AM_DIRNAME anymore. diff --git a/Makefile.in b/Makefile.in index 463ad0fbf..ef5e4232d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,6 +52,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBS = @LIBS@ LN = @LN@ +LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -160,9 +161,8 @@ install-binSCRIPTS: $(bin_SCRIPTS) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ if test -f $$d$$p; then \ - f="`echo $$f|sed '$(transform)'`"; \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ @@ -171,8 +171,7 @@ install-binSCRIPTS: $(bin_SCRIPTS) uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - f="`echo $$f|sed '$(transform)'`"; \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done @@ -735,6 +734,10 @@ maintainer-check: automake aclocal echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \ exit 1; \ fi + @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*autoupdate'; then \ + echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \ + exit 1; \ + fi @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*automake'; then \ echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \ exit 1; \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 8781e3525..30674e58b 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -52,6 +52,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBS = @LIBS@ LN = @LN@ +LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ diff --git a/lib/Makefile.in b/lib/Makefile.in index 5e17ebbb0..c23fd0974 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -52,6 +52,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBS = @LIBS@ LN = @LN@ +LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 48cbafb43..c16f247d1 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -52,6 +52,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBS = @LIBS@ LN = @LN@ +LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ diff --git a/lib/am/progs.am b/lib/am/progs.am index b923e7f1c..66eecdf7f 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -43,8 +43,11 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS) ## Compute basename of source file. Unless this is a nobase_ target, we ## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo', ## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'. -?BASE? p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ +## However in all cases $(transform) applies only to the basename, +## so we have to strip the directory part. + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ +## Prepend the directory part if nobase_ is used. +?!BASE? f=`echo "$$p1" | sed 's|[^/]*$$||'`"$$f"; \ ## Note that we explicitly set the libtool mode. This avoids any ## lossage if the install program doesn't have a name that libtool ## expects. @@ -66,8 +69,10 @@ if %?INSTALL% uninstall-%DIR%PROGRAMS: @$(NORMAL_UNINSTALL) @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ -?BASE? f=`echo "$$f" | sed -e 's,^.*/,,'`; \ +## Remove any leading directory before applying $(transform). + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ +## Prepend the directory part if nobase_ is used. +?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \ rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \ done diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 9d4ea7ba0..b99ba6860 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -36,13 +36,15 @@ install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS) @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ ## A file can be in the source directory or the build directory. if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ ## If the _SCRIPTS variable has an entry like foo/bar, install it as ## $(destdir)/bar, not $(destdir)/foo/bar. The user can make a ## new dir variable or use a nobase_ target for the latter case. -?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ - if test -f $$d$$p; then \ - f="`echo $$f|sed '$(transform)'`"; \ +## However in all cases $(transform) applies only to the basename, +## so we have to strip the directory part. + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ +## Prepend the directory part if nobase_ is used. +?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \ echo " $(%DIR%SCRIPT_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ $(%DIR%SCRIPT_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \ else :; fi; \ @@ -59,9 +61,10 @@ if %?INSTALL% uninstall-%DIR%SCRIPTS: @$(NORMAL_UNINSTALL) @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ -?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ - f="`echo $$f|sed '$(transform)'`"; \ +## Remove any leading directory before applying $(transform). + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ +## Prepend the directory part if nobase_ is used. +?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \ rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \ done diff --git a/tests/nobase.test b/tests/nobase.test index 898f9d6af..97655b3e3 100755 --- a/tests/nobase.test +++ b/tests/nobase.test @@ -47,22 +47,22 @@ test-install-data: install-data test -f inst/foo/sub/nobase.dat test ! -f inst/foo/nobase.dat test -f inst/foo/base.dat - test ! -f inst/foo/sub/nobase.sh - test ! -f inst/foo/base.sh - test ! -f inst/foo/sub/nobase$(EXEEXT) - test ! -f inst/foo/base$(EXEEXT) + test ! -f inst/foo/sub/pnobase.sh + test ! -f inst/foo/pbase.sh + test ! -f inst/foo/sub/pnobase$(EXEEXT) + test ! -f inst/foo/pbase$(EXEEXT) test ! -f inst/foo/sub/libnobase.a test ! -f inst/foo/libbase.a test ! -f inst/foo/sub/libnobase.la test ! -f inst/foo/libbase.la test-install-exec: install-exec - test -f inst/foo/sub/nobase.sh - test ! -f inst/foo/nobase.sh - test -f inst/foo/base.sh - test -f inst/foo/sub/nobase$(EXEEXT) - test ! -f inst/foo/nobase$(EXEEXT) - test -f inst/foo/base$(EXEEXT) + test -f inst/foo/sub/pnobase.sh + test ! -f inst/foo/pnobase.sh + test -f inst/foo/pbase.sh + test -f inst/foo/sub/pnobase$(EXEEXT) + test ! -f inst/foo/pnobase$(EXEEXT) + test -f inst/foo/pbase$(EXEEXT) test -f inst/foo/sub/libnobase.a test ! -f inst/foo/libnobase.a test -f inst/foo/libbase.a @@ -93,7 +93,7 @@ libtoolize $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure --prefix `pwd`/inst +./configure --prefix `pwd`/inst --program-prefix=p $MAKE $MAKE test-install-data -- 2.47.2