From: Alexandre Duret-Lutz Date: Mon, 5 Jan 2004 21:49:09 +0000 (+0000) Subject: * lib/am/inst-vars.am: New file, define am__vpath_adj_setup, X-Git-Tag: Release-1-8b~103 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=512d3a50c8e28ecff0b550dc2ec17a3ffcf55f58;p=automake.git * lib/am/inst-vars.am: New file, define am__vpath_adj_setup, am__vpath_adj, and am__strip_dir. * lib/am/Makefile.am (dist_am_DATA): Add inst-vars.am. * lib/am/data.am, lib/am/lisp.am, lib/am/python.am, lib/am/scripts.am: Include inst-vars.am, and use $(am__vpath_adj), $(am__vpath_adj_setup), and $(am__strip_dir) in install and uninstall rules. This fixes installation of nobase_ files in VPATH setups with Sun and OSF1/Tru64 Make. * lib/am/libs.am, lib/am/ltlib.am: Include inst-vars.am, and use $(am__strip_dir) to simplify install and uninstall rules. * tests/nobase.test: Augment to check installation from VPATH builds. --- diff --git a/ChangeLog b/ChangeLog index b9f9ded1..d8a2be00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2004-01-05 Alexandre Duret-Lutz + * lib/am/inst-vars.am: New file, define am__vpath_adj_setup, + am__vpath_adj, and am__strip_dir. + * lib/am/Makefile.am (dist_am_DATA): Add inst-vars.am. + * lib/am/data.am, lib/am/lisp.am, lib/am/python.am, + lib/am/scripts.am: Include inst-vars.am, and use $(am__vpath_adj), + $(am__vpath_adj_setup), and $(am__strip_dir) in install and + uninstall rules. This fixes installation of nobase_ files in + VPATH setups with Sun and OSF1/Tru64 Make. + * lib/am/libs.am, lib/am/ltlib.am: Include inst-vars.am, and use + $(am__strip_dir) to simplify install and uninstall rules. + * tests/nobase.test: Augment to check installation from VPATH builds. + * automake.in (%transformed_files): New variable. (initialize_per_input): Reset it. (make_paragraphs): Fill %transformed_files, and define %FIRST% diff --git a/doc/stamp-vti b/doc/stamp-vti index 5fd50fa6..e89285ae 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 5 January 2004 +@set UPDATED 1 January 2004 @set UPDATED-MONTH January 2004 @set EDITION 1.8a @set VERSION 1.8a diff --git a/doc/version.texi b/doc/version.texi index 5fd50fa6..e89285ae 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 5 January 2004 +@set UPDATED 1 January 2004 @set UPDATED-MONTH January 2004 @set EDITION 1.8a @set VERSION 1.8a diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 70551020..84ff86c4 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -57,6 +57,12 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = $(DESTDIR)$(perllibdir) $(DESTDIR)$(perllibdir) dist_perllibDATA_INSTALL = $(INSTALL_DATA) nodist_perllibDATA_INSTALL = $(INSTALL_DATA) @@ -204,7 +210,7 @@ install-dist_perllibDATA: $(dist_perllib_DATA) $(mkdir_p) $(DESTDIR)$(perllibdir) @list='$(dist_perllib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(dist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f"; \ $(dist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f; \ done @@ -212,7 +218,7 @@ install-dist_perllibDATA: $(dist_perllib_DATA) uninstall-dist_perllibDATA: @$(NORMAL_UNINSTALL) @list='$(dist_perllib_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(perllibdir)/$$f"; \ rm -f $(DESTDIR)$(perllibdir)/$$f; \ done @@ -221,7 +227,7 @@ install-nodist_perllibDATA: $(nodist_perllib_DATA) $(mkdir_p) $(DESTDIR)$(perllibdir) @list='$(nodist_perllib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(nodist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f"; \ $(nodist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f; \ done @@ -229,7 +235,7 @@ install-nodist_perllibDATA: $(nodist_perllib_DATA) uninstall-nodist_perllibDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_perllib_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(perllibdir)/$$f"; \ rm -f $(DESTDIR)$(perllibdir)/$$f; \ done diff --git a/lib/Makefile.in b/lib/Makefile.in index aa6d1d3e..95b2b5a9 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -60,6 +60,12 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = $(DESTDIR)$(pkgvdatadir) $(DESTDIR)$(scriptdir) dist_pkgvdataDATA_INSTALL = $(INSTALL_DATA) dist_scriptDATA_INSTALL = $(INSTALL_DATA) @@ -179,7 +185,7 @@ install-dist_pkgvdataDATA: $(dist_pkgvdata_DATA) $(mkdir_p) $(DESTDIR)$(pkgvdatadir) @list='$(dist_pkgvdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(dist_pkgvdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgvdatadir)/$$f"; \ $(dist_pkgvdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgvdatadir)/$$f; \ done @@ -187,7 +193,7 @@ install-dist_pkgvdataDATA: $(dist_pkgvdata_DATA) uninstall-dist_pkgvdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgvdata_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(pkgvdatadir)/$$f"; \ rm -f $(DESTDIR)$(pkgvdatadir)/$$f; \ done @@ -196,7 +202,7 @@ install-dist_scriptDATA: $(dist_script_DATA) $(mkdir_p) $(DESTDIR)$(scriptdir) @list='$(dist_script_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(dist_scriptDATA_INSTALL) $$d$$p $(DESTDIR)$(scriptdir)/$$f"; \ $(dist_scriptDATA_INSTALL) $$d$$p $(DESTDIR)$(scriptdir)/$$f; \ done @@ -204,7 +210,7 @@ install-dist_scriptDATA: $(dist_script_DATA) uninstall-dist_scriptDATA: @$(NORMAL_UNINSTALL) @list='$(dist_script_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(scriptdir)/$$f"; \ rm -f $(DESTDIR)$(scriptdir)/$$f; \ done diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 59135091..bd2e70d2 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -2,7 +2,7 @@ ## Makefile for Automake lib/am. -## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003 +## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -22,10 +22,42 @@ amdir = $(pkgvdatadir)/am -dist_am_DATA = ansi2knr.am check.am clean-hdr.am clean.am compile.am \ -configure.am data.am dejagnu.am depend.am depend2.am distdir.am \ -footer.am header-vars.am header.am install.am java.am lang-compile.am \ -lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \ -mans-vars.am mans.am multilib.am program.am progs.am python.am \ -remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \ -texinfos.am yacc.am +dist_am_DATA = \ +ansi2knr.am \ +check.am \ +clean-hdr.am \ +clean.am \ +compile.am \ +configure.am \ +data.am \ +dejagnu.am \ +depend.am \ +depend2.am \ +distdir.am \ +footer.am \ +header-vars.am \ +header.am \ +install.am \ +java.am \ +lang-compile.am \ +lex.am \ +library.am \ +libs.am \ +libtool.am \ +lisp.am \ +ltlib.am \ +ltlibrary.am \ +mans-vars.am \ +mans.am \ +multilib.am \ +program.am \ +progs.am \ +python.am \ +remake-hdr.am \ +scripts.am \ +subdirs.am \ +tags.am \ +texi-vers.am \ +texibuild.am \ +texinfos.am \ +yacc.am diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index e3399231..a6f354ec 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -51,6 +51,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = $(DESTDIR)$(amdir) dist_amDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_am_DATA) @@ -120,13 +126,45 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ amdir = $(pkgvdatadir)/am -dist_am_DATA = ansi2knr.am check.am clean-hdr.am clean.am compile.am \ -configure.am data.am dejagnu.am depend.am depend2.am distdir.am \ -footer.am header-vars.am header.am install.am java.am lang-compile.am \ -lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \ -mans-vars.am mans.am multilib.am program.am progs.am python.am \ -remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \ -texinfos.am yacc.am +dist_am_DATA = \ +ansi2knr.am \ +check.am \ +clean-hdr.am \ +clean.am \ +compile.am \ +configure.am \ +data.am \ +dejagnu.am \ +depend.am \ +depend2.am \ +distdir.am \ +footer.am \ +header-vars.am \ +header.am \ +install.am \ +java.am \ +lang-compile.am \ +lex.am \ +library.am \ +libs.am \ +libtool.am \ +lisp.am \ +ltlib.am \ +ltlibrary.am \ +mans-vars.am \ +mans.am \ +multilib.am \ +program.am \ +progs.am \ +python.am \ +remake-hdr.am \ +scripts.am \ +subdirs.am \ +tags.am \ +texi-vers.am \ +texibuild.am \ +texinfos.am \ +yacc.am all: all-am @@ -166,7 +204,7 @@ install-dist_amDATA: $(dist_am_DATA) $(mkdir_p) $(DESTDIR)$(amdir) @list='$(dist_am_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(dist_amDATA_INSTALL) $$d$$p $(DESTDIR)$(amdir)/$$f"; \ $(dist_amDATA_INSTALL) $$d$$p $(DESTDIR)$(amdir)/$$f; \ done @@ -174,7 +212,7 @@ install-dist_amDATA: $(dist_am_DATA) uninstall-dist_amDATA: @$(NORMAL_UNINSTALL) @list='$(dist_am_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(amdir)/$$f"; \ rm -f $(DESTDIR)$(amdir)/$$f; \ done diff --git a/lib/am/data.am b/lib/am/data.am index 3db7e34c..b0fc1edf 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,6 +17,10 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +include inst-vars.am +endif %?INSTALL% + ## ------------ ## ## Installing. ## ## ------------ ## @@ -30,16 +34,18 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir) install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(%NDIR%dir) +?!BASE? @$(am__vpath_adj_setup) \ ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. - @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ +?!BASE? list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ +?BASE? @list='$(%DIR%_%PRIMARY%)'; 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 the _%PRIMARY% 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"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? $(am__vpath_adj) \ echo " $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \ done @@ -54,9 +60,11 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%%PRIMARY% uninstall-%DIR%%PRIMARY%: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ -?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ +?!BASE? @$(am__vpath_adj_setup) \ +?!BASE? list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ +?BASE? @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ +?BASE? f=$(am__strip_dir) \ +?!BASE? $(am__vpath_adj) \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \ rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \ done diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am new file mode 100644 index 00000000..27666001 --- /dev/null +++ b/lib/am/inst-vars.am @@ -0,0 +1,30 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 2004 Free Software Foundation, Inc. + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +if %?FIRST% +## These variables help stripping any $(VPATH) that some +## Make implementations prepend before VPATH-found files. +## The issue is discussed at length in distdir.am. +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +## Strip all directories. +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +endif %?FIRST% diff --git a/lib/am/libs.am b/lib/am/libs.am index b497cb44..9d61e0a5 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003 +## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,6 +17,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +include inst-vars.am +endif %?INSTALL% ## ----------- ## ## Variables. ## @@ -49,8 +52,8 @@ install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES) ## 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? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? f=$$p; \ echo " $(%DIR%LIBRARIES_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ $(%DIR%LIBRARIES_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \ else :; fi; \ @@ -63,7 +66,7 @@ install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES) @$(POST_INSTALL) @list='$(%DIR%_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ -?BASE? p="`echo $$p | sed -e 's|^.*/||'`"; \ +?BASE? p=$(am__strip_dir) \ ## Must ranlib after installing because mod time changes. echo " $(RANLIB) $(DESTDIR)$(%NDIR%dir)/$$p"; \ $(RANLIB) $(DESTDIR)$(%NDIR%dir)/$$p; \ @@ -81,7 +84,7 @@ if %?INSTALL% uninstall-%DIR%LIBRARIES: @$(NORMAL_UNINSTALL) @list='$(%DIR%_LIBRARIES)'; for p in $$list; do \ -?BASE? p="`echo $$p | sed -e 's|^.*/||'`"; \ +?BASE? p=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \ rm -f $(DESTDIR)$(%NDIR%dir)/$$p; \ done diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 2e754f4c..85dec947 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 +## Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,6 +17,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +include inst-vars.am +endif %?INSTALL% ## ---------- ## ## Building. ## @@ -61,13 +64,14 @@ install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES) ## Do not install anything if EMACS was not found. @if test "$(EMACS)" != no; then \ $(mkdir_p) $(DESTDIR)$(%NDIR%dir); \ +?!BASE? $(am__vpath_adj_setup) \ ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. list='$(%DIR%_LISP)'; for p in $$list; do \ ## A lisp file can be in the source directory or the build directory. if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ -?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? $(am__vpath_adj) \ echo " $(%DIR%LISP_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ $(%DIR%LISP_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \ ## Only install .elc file if it exists. @@ -90,9 +94,10 @@ uninstall-%DIR%LISP: @$(NORMAL_UNINSTALL) ## Do not uninstall anything if EMACS was not found. @if test "$(EMACS)" != no; then \ +?!BASE? $(am__vpath_adj_setup) \ list='$(%DIR%_LISP)'; for p in $$list; do \ -?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? $(am__vpath_adj) \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f $(DESTDIR)$(%NDIR%dir)/$${f}c"; \ rm -f $(DESTDIR)$(%NDIR%dir)/$$f $(DESTDIR)$(%NDIR%dir)/$${f}c; \ done; \ diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am index b9e0a03a..2dd4ce6a 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,6 +17,10 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +include inst-vars.am +endif %?INSTALL% + ## ------------ ## ## Installing. ## ## ------------ ## @@ -37,8 +41,8 @@ install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES) ## 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? f="`echo $$p | sed -e 's|^.*/||'`"; \ -?!BASE? f="$$p"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? f=$$p; \ ## Note that we explicitly set the libtool mode. This avoids any lossage ## if the program doesn't have a name that libtool expects. ## Use INSTALL and not INSTALL_DATA because libtool knows the right @@ -60,8 +64,8 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%LTLIBRARIES uninstall-%DIR%LTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \ -?BASE? p="`echo $$p | sed -e 's|^.*/||'`"; \ + @set -x; list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \ +?BASE? p=$(am__strip_dir) \ ?LIBTOOL? echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \ ?LIBTOOL? $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(%NDIR%dir)/$$p; \ ?!LIBTOOL? echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \ diff --git a/lib/am/python.am b/lib/am/python.am index b33b2193..de12d788 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. +## Copyright (C) 1999, 2001, 2003, 2004 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -16,6 +16,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +include inst-vars.am +endif %?INSTALL% ## ------------ ## ## Installing. ## @@ -30,19 +33,21 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir) install-%DIR%PYTHON: $(%DIR%_PYTHON) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(%NDIR%dir) - @list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ +?!BASE? @$(am__vpath_adj_setup) \ +?!BASE? list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ +?BASE? @list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ ## A file can be in the source directory or the build directory. if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ ## Compute basename of source file. Unless this is a nobase_ target, we ## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.py', ## not '$(DESTDIR)$(%NDIR%dir)/python/foo.py'. -?BASE? d=`echo "$$p" | sed -e 's,^.*/,,'`; \ -?!BASE? d="$$p"; \ - dlist="$$dlist $$d"; \ +?BASE? f=$(am__strip_dir) \ +?!BASE? $(am__vpath_adj) \ + dlist="$$dlist $$f"; \ ## Don't perform translation, since script name is important. - echo " $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$d"; \ - $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$d; \ + echo " $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ + $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$f; \ else :; fi; \ done; \ ## Byte-compile must be done at install time, since file times are @@ -59,10 +64,12 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%PYTHON uninstall-%DIR%PYTHON: @$(NORMAL_UNINSTALL) - list='$(%DIR%_PYTHON)'; for p in $$list; do \ -?BASE? d=`echo "$$p" | sed -e 's,^.*/,,'`; \ -?!BASE? d="$$p"; \ - rm -f $(DESTDIR)$(%NDIR%dir)/$$d; \ +?!BASE? @$(am__vpath_adj_setup) \ +?!BASE? list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ +?BASE? @list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ +?BASE? f=$(am__strip_dir); \ +?!BASE? $(am__vpath_adj); \ + rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \ ## This is to remove the .pyc and .pyo byte compiled versions (a bit ## of a hack). rm -f $(DESTDIR)$(%NDIR%dir)/$${d}c; \ diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 3134b61d..74ca10c0 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,6 +17,11 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +if %?INSTALL% +if ! %?BASE% +include inst-vars.am +endif ! %?BASE% +endif %?INSTALL% ## ------------ ## ## Installing. ## @@ -32,9 +37,12 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir) install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS) @$(NORMAL_INSTALL) $(mkdir_p) $(DESTDIR)$(%NDIR%dir) +?!BASE? @$(am__vpath_adj_setup) \ ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. - @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?!BASE? list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?BASE? @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?!BASE? $(am__vpath_adj) p=$$f; \ ## 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 \ @@ -61,7 +69,10 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%SCRIPTS uninstall-%DIR%SCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?!BASE? @$(am__vpath_adj_setup) \ +?!BASE? list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?BASE? @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \ +?!BASE? $(am__vpath_adj) p=$$f; \ ## Remove any leading directory before applying $(transform). f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ ## Prepend the directory part if nobase_ is used. diff --git a/m4/Makefile.in b/m4/Makefile.in index 0d52f8ad..7b9d5686 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -51,6 +51,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = $(DESTDIR)$(m4datadir) dist_m4dataDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_m4data_DATA) @@ -192,7 +198,7 @@ install-dist_m4dataDATA: $(dist_m4data_DATA) $(mkdir_p) $(DESTDIR)$(m4datadir) @list='$(dist_m4data_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " $(dist_m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f"; \ $(dist_m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f; \ done @@ -200,7 +206,7 @@ install-dist_m4dataDATA: $(dist_m4data_DATA) uninstall-dist_m4dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_m4data_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ + f=$(am__strip_dir) \ echo " rm -f $(DESTDIR)$(m4datadir)/$$f"; \ rm -f $(DESTDIR)$(m4datadir)/$$f; \ done diff --git a/tests/nobase.test b/tests/nobase.test index 395f7d88..d8b8e792 100755 --- a/tests/nobase.test +++ b/tests/nobase.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -38,11 +38,11 @@ fooexecdir = $(prefix)/foo foo_HEADERS = sub/base.h nobase_foo_HEADERS = sub/nobase.h -foo_DATA = sub/base.dat -nobase_foo_DATA = sub/nobase.dat +dist_foo_DATA = sub/base.dat +nobase_dist_foo_DATA = sub/nobase.dat -fooexec_SCRIPTS = sub/base.sh -nobase_fooexec_SCRIPTS = sub/nobase.sh +dist_fooexec_SCRIPTS = sub/base.sh +nobase_dist_fooexec_SCRIPTS = sub/nobase.sh fooexec_PROGRAMS = sub/base nobase_fooexec_PROGRAMS = sub/nobase @@ -122,3 +122,16 @@ $MAKE uninstall test `find inst/foo -type f -print | wc -l` = 0 $MAKE install-strip + +# Likewise, in a VPATH build. + +$MAKE uninstall +$MAKE distclean +mkdir build +cd build +../configure --prefix `pwd`/inst --program-prefix=p +$MAKE +$MAKE test-install-data +$MAKE test-install-exec +$MAKE uninstall +test `find inst/foo -type f -print | wc -l` = 0