diff options
author | Peter Rosin <peda@lysator.liu.se> | 2011-10-24 09:04:24 +0200 |
---|---|---|
committer | Peter Rosin <peda@lysator.liu.se> | 2011-10-24 09:04:24 +0200 |
commit | 91ab753b7b654934aaa34006067a92993bb53c09 (patch) | |
tree | f4c476868b45a357830f21962c6ec5eddedc6b54 /lib | |
parent | cc2202a6b0d5a7dc2f8af17e4ac2fdd3fe46d267 (diff) | |
parent | 9b5ced02fd41130d408d95808855a067eb82dd68 (diff) | |
download | automake-91ab753b7b654934aaa34006067a92993bb53c09.tar.gz |
Merge branch 'maint' into msvc
* tests/subpkg-yacc.test: Adjust to new portability requirements due
to the new AM_PROG_AR macro.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Automake/Makefile.in | 14 | ||||
-rw-r--r-- | lib/Automake/tests/Makefile.in | 6 | ||||
-rw-r--r-- | lib/Makefile.in | 14 | ||||
-rw-r--r-- | lib/am/Makefile.in | 10 | ||||
-rw-r--r-- | lib/am/data.am | 4 | ||||
-rw-r--r-- | lib/am/dejagnu.am | 20 | ||||
-rw-r--r-- | lib/am/distdir.am | 22 | ||||
-rw-r--r-- | lib/am/inst-vars.am | 18 | ||||
-rw-r--r-- | lib/am/java.am | 14 | ||||
-rw-r--r-- | lib/am/libs.am | 4 | ||||
-rw-r--r-- | lib/am/lisp.am | 8 | ||||
-rw-r--r-- | lib/am/mans.am | 8 | ||||
-rw-r--r-- | lib/am/python.am | 34 | ||||
-rw-r--r-- | lib/am/scripts.am | 4 | ||||
-rwxr-xr-x | lib/py-compile | 51 |
15 files changed, 140 insertions, 91 deletions
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index baccf7dc2..cdeeb9b2e 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -96,6 +96,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(perllibdir)" "$(DESTDIR)$(perllibdir)" DATA = $(dist_perllib_DATA) $(nodist_perllib_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ @@ -316,9 +322,7 @@ uninstall-dist_perllibDATA: @$(NORMAL_UNINSTALL) @list='$(dist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(perllibdir)" && rm -f $$files + dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir) install-nodist_perllibDATA: $(nodist_perllib_DATA) @$(NORMAL_INSTALL) test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)" @@ -336,9 +340,7 @@ uninstall-nodist_perllibDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(perllibdir)" && rm -f $$files + dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 17a2002b1..06f6ceb07 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -101,6 +101,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } # Restructured Text title and section. am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//' am__rst_section = sed 'p;s/./=/g;p;g' diff --git a/lib/Makefile.in b/lib/Makefile.in index 3b05946da..5db429b1f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -99,6 +99,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(pkgvdatadir)" "$(DESTDIR)$(scriptdir)" DATA = $(dist_pkgvdata_DATA) $(dist_script_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ @@ -288,9 +294,7 @@ uninstall-dist_pkgvdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgvdata_DATA)'; test -n "$(pkgvdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgvdatadir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgvdatadir)" && rm -f $$files + dir='$(DESTDIR)$(pkgvdatadir)'; $(am__uninstall_files_from_dir) install-dist_scriptDATA: $(dist_script_DATA) @$(NORMAL_INSTALL) test -z "$(scriptdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptdir)" @@ -308,9 +312,7 @@ uninstall-dist_scriptDATA: @$(NORMAL_UNINSTALL) @list='$(dist_script_DATA)'; test -n "$(scriptdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(scriptdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(scriptdir)" && rm -f $$files + dir='$(DESTDIR)$(scriptdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 649c1bf29..f570905ec 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -89,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(amdir)" DATA = $(dist_am_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -279,9 +285,7 @@ uninstall-dist_amDATA: @$(NORMAL_UNINSTALL) @list='$(dist_am_DATA)'; test -n "$(amdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(amdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(amdir)" && rm -f $$files + dir='$(DESTDIR)$(amdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: diff --git a/lib/am/data.am b/lib/am/data.am index 36af717f0..1817447de 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -73,9 +73,7 @@ uninstall-%DIR%%PRIMARY%: @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index 08de45c61..660050a25 100644 --- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -44,7 +44,7 @@ endif ! %?CYGNUS% .PHONY: check-DEJAGNU check-DEJAGNU: site.exp ## Life is easiest with an absolute srcdir, so do that. - srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + srcdir='$(srcdir)'; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ ## Allow this to work when expect and DejaGnu are in tree. ## Only required when --cygnus in force. @@ -72,12 +72,12 @@ check-DEJAGNU: site.exp ## Note that in the rule we don't directly generate site.exp to avoid ## the possibility of a corrupted site.exp if make is interrupted. ## Jim Meyering has some useful text on this topic. -site.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp - @echo 'set srcdir $(srcdir)' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp ## Quote the *_alias variables because they might be empty. ?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp @@ -86,9 +86,17 @@ site.exp: Makefile ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp - @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp - @test ! -f site.exp || \ - sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp +## Allow the package author to extend site.exp. + @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp diff --git a/lib/am/distdir.am b/lib/am/distdir.am index c2dd7c55a..41ff14afa 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -## 2010 Free Software Foundation, Inc. +## 2010, 2011 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 @@ -516,11 +516,23 @@ distcheck: dist ## from distcheck, so that they can be overridden by the user. .PHONY: distuninstallcheck distuninstallcheck_listfiles = find . -type f -print +## The `dir' file (created by install-info) might still exist after +## uninstall, so we must be prepared to account for it. The following +## check is not 100% strict, but is definitely good enough, and even +## accounts for overridden $(infodir). +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distuninstallcheck: -## We use -le 1 because the `dir' file (created by install-info) -## might still exist after uninstall. - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am index a49cfe934..a807f79be 100644 --- a/lib/am/inst-vars.am +++ b/lib/am/inst-vars.am @@ -15,6 +15,7 @@ ## along with this program. If not, see <http://www.gnu.org/licenses/>. 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. @@ -52,4 +53,21 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' + +## A shell code fragment to uninstall files from a given directory. +## It expects the $dir and $files shell variables to be defined respectively +## to the directory where the files to be removed are, and to the list of +## such files. +am__uninstall_files_from_dir = { \ +## Some rm implementations complain if `rm -f' is used without arguments. + test -z "$$files" \ +## At least Solaris /bin/sh still lacks `test -e', so we use the multiple +## tests below instead. We expect $dir to be either non-existent or a +## directory, so the failure we'll experience if it is a regular file +## is indeed desired and welcome (better to fail loudly thasn silently). + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } + endif %?FIRST% diff --git a/lib/am/java.am b/lib/am/java.am index 604df2229..464b70609 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -20,11 +20,13 @@ ## Building. ## ## ---------- ## +if %?FIRST% JAVAC = javac CLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT)$${CLASSPATH:+":$$CLASSPATH"} JAVAROOT = $(top_builddir) +endif %?FIRST% -class%DIR%.stamp: $(%DIR%_JAVA) +class%NDIR%.stamp: $(am__java_sources) @list1='$?'; list2=; if test -n "$$list1"; then \ for p in $$list1; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ @@ -33,7 +35,7 @@ class%DIR%.stamp: $(%DIR%_JAVA) echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) '"$$list2"; \ $(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) $$list2; \ else :; fi - echo timestamp > class%DIR%.stamp + echo timestamp > $@ ## ------------ ## @@ -44,7 +46,7 @@ if %?INSTALL% am__installdirs += "$(DESTDIR)$(%NDIR%dir)" ?EXEC?.PHONY install-exec-am: install-%DIR%JAVA ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA -install-%DIR%JAVA: class%DIR%.stamp +install-%DIR%JAVA: class%NDIR%.stamp @$(NORMAL_INSTALL) test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" ## A single .java file can be compiled into multiple .class files. So @@ -76,9 +78,9 @@ endif %?INSTALL% ## Cleaning. ## ## ---------- ## -.PHONY clean-am: clean-%DIR%JAVA -clean-%DIR%JAVA: - -rm -f *.class class%DIR%.stamp +.PHONY clean-am: clean-%NDIR%JAVA +clean-%NDIR%JAVA: + -rm -f *.class class%NDIR%.stamp ## -------------- ## diff --git a/lib/am/libs.am b/lib/am/libs.am index eec62a1f7..29f630b76 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -87,9 +87,7 @@ uninstall-%DIR%LIBRARIES: @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \ ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f "$$files" )"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% diff --git a/lib/am/lisp.am b/lib/am/lisp.am index ab45b30e6..6ffcdbfcc 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -128,12 +128,8 @@ uninstall-%DIR%LISP: list='$(%DIR%_LISP)'; \ ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc + files="$$files "`echo "$$files" | sed 's|$$|c|'`; \ + dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% diff --git a/lib/am/mans.am b/lib/am/mans.am index 66a6c7ee2..b41a94d18 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -119,9 +119,7 @@ if %?NOTRANS_MANS% ?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \ ## Extract basename of manpage, change the extension if needed. } | sed 's,.*/,,;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir) endif %?NOTRANS_MANS% if %?TRANS_MANS% ## Handle MANS without notrans_ prefix @@ -136,7 +134,5 @@ if %?TRANS_MANS% ## transform, and change the extension if needed. } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; } + dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir) endif %?TRANS_MANS% diff --git a/lib/am/python.am b/lib/am/python.am index 9424a19e6..427c95d0c 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1999, 2001, 2003, 2004, 2006, 2007, 2008, 2009 Free -## Software Foundation, Inc. +## Copyright (C) 1999, 2001, 2003, 2004, 2006, 2007, 2008, 2009, 2011 +## 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 @@ -24,6 +24,7 @@ endif %?INSTALL% ## ------------ ## if %?INSTALL% +?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile) am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON install-%DIR%PYTHON: $(%DIR%_PYTHON) @@ -52,11 +53,8 @@ if %?BASE% ## Byte-compile must be done at install time, since file times are ## encoded in the actual files. if test -n "$$dlist"; then \ - if test -z "$(DESTDIR)"; then \ - PYTHON=$(PYTHON) $(py_compile) --basedir "$(%NDIR%dir)" $$dlist; \ - else \ - PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(%NDIR%dir)" $$dlist; \ - fi; \ + $(am__py_compile) --destdir "$(DESTDIR)" \ + --basedir "$(%NDIR%dir)" $$dlist; \ else :; fi else !%?BASE% @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \ @@ -76,11 +74,8 @@ else !%?BASE% ## Byte-compile must be done at install time, since file times are ## encoded in the actual files. if test -n "$$dlist"; then \ - if test -z "$(DESTDIR)"; then \ - PYTHON=$(PYTHON) $(py_compile) --basedir "$(%NDIR%dir)" $$dlist; \ - else \ - PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(%NDIR%dir)" $$dlist; \ - fi; \ + $(am__py_compile) --destdir "$(DESTDIR)" \ + --basedir "$(%NDIR%dir)" $$dlist; \ else :; fi \ done endif !%?BASE% @@ -99,16 +94,15 @@ uninstall-%DIR%PYTHON: ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ test -n "$$files" || exit 0; \ + dir='$(DESTDIR)$(%NDIR%dir)'; \ +## Also remove the .pyc and .pyo byte compiled versions. filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \ -## This is to remove the .pyc and .pyo byte compiled versions (a bit -## of a hack). - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc || exit $$?; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$fileso ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$fileso + st=0; \ + for files in "$$files" "$$filesc" "$$fileso"; do \ + $(am__uninstall_files_from_dir) || st=$$?; \ + done; \ + exit $$st endif %?INSTALL% diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 790cb649f..346f0d3b9 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -83,9 +83,7 @@ uninstall-%DIR%SCRIPTS: ?!BASE? $(am__nobase_strip_setup); \ ?!BASE? files=`$(am__nobase_strip) \ ?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% diff --git a/lib/py-compile b/lib/py-compile index 3f9d05b60..15c834c40 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -1,10 +1,10 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-06-08.12; # UTC -# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software -# Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 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 @@ -32,28 +32,36 @@ if [ -z "$PYTHON" ]; then PYTHON=python fi +me=py-compile + +usage_error () +{ + echo "$me: $*" >&2 + echo "Try \`$me --help' for more information." >&2 + exit 1 +} + basedir= destdir= -files= while test $# -ne 0; do case "$1" in --basedir) - basedir=$2 - if test -z "$basedir"; then - echo "$0: Missing argument to --basedir." 1>&2 - exit 1 + if test $# -lt 2; then + usage_error "option '--basedir' requires an argument" + else + basedir=$2 fi shift ;; --destdir) - destdir=$2 - if test -z "$destdir"; then - echo "$0: Missing argument to --destdir." 1>&2 - exit 1 + if test $# -lt 2; then + usage_error "option '--destdir' requires an argument" + else + destdir=$2 fi shift ;; - -h|--h*) + -h|--help) cat <<\EOF Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." @@ -69,20 +77,27 @@ Report bugs to <bug-automake@gnu.org>. EOF exit $? ;; - -v|--v*) - echo "py-compile $scriptversion" + -v|--version) + echo "$me $scriptversion" exit $? ;; + --) + shift + break + ;; + -*) + usage_error "unrecognized option '$1'" + ;; *) - files="$files $1" + break ;; esac shift done +files=$* if test -z "$files"; then - echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 - exit 1 + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before |