diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-18 22:31:45 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-18 22:31:45 +0100 |
commit | db1138c5e74d4f5b4713bf29127cb1430c5fc32e (patch) | |
tree | f57b21ab2b8721194a428c20336d058c735b62d6 /lib | |
parent | 295c5f26d0646c6f2308fea50899dd961ef87abd (diff) | |
parent | 45ffbe9f8746224daf11a3980d69b10fc0520384 (diff) | |
download | automake-db1138c5e74d4f5b4713bf29127cb1430c5fc32e.tar.gz |
Merge branch 'maint'
* maint:
install-mans: avoid spurious failure with NetBSD make
install: don't create empty dirs when an empty 'foo_PRIMARY' is used
aclocal: remove a couple of useless imports
aclocal: create local directory where to install m4 files
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/am/data.am | 11 | ||||
-rw-r--r-- | lib/am/java.am | 3 | ||||
-rw-r--r-- | lib/am/libs.am | 9 | ||||
-rw-r--r-- | lib/am/lisp.am | 8 | ||||
-rw-r--r-- | lib/am/ltlib.am | 9 | ||||
-rw-r--r-- | lib/am/mans.am | 37 | ||||
-rw-r--r-- | lib/am/progs.am | 5 | ||||
-rw-r--r-- | lib/am/python.am | 9 | ||||
-rw-r--r-- | lib/am/scripts.am | 5 | ||||
-rw-r--r-- | lib/am/texinfos.am | 25 |
10 files changed, 94 insertions, 27 deletions
diff --git a/lib/am/data.am b/lib/am/data.am index 65ee63873..98a38a832 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -27,11 +27,14 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY% install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" if %?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \ + fi; \ 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; \ @@ -46,13 +49,17 @@ if %?BASE% done else !%?BASE% @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \ echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ $(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \ diff --git a/lib/am/java.am b/lib/am/java.am index 692824ea5..6c163b56f 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -47,11 +47,12 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA 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 ## we just install all the .class files that got built into this ## directory. This is not optimal, but will have to do for now. @test -n "$(%DIR%_JAVA)" && test -n "$(%NDIR%dir)" || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"; \ set x *.class; shift; test "$$1" != "*.class" || exit 0; \ echo " $(INSTALL_DATA)" "$$@" "'$(DESTDIR)$(%NDIR%dir)/$$p'"; \ $(INSTALL_DATA) "$$@" "$(DESTDIR)$(%NDIR%dir)" diff --git a/lib/am/libs.am b/lib/am/libs.am index d66473ffb..4006bd008 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -27,7 +27,6 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" if %?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @@ -38,18 +37,24 @@ if %?BASE% else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(%NDIR%dir)" || exit $$?; } else !%?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for p in $$files; do \ if test -f "$$p"; then xfiles="$$xfiles $$p"; else :; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \ diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 21d7f4877..ba5c92a90 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -89,11 +89,15 @@ install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES) @$(NORMAL_INSTALL) ## Do not install anything if EMACS was not found. @if test "$(EMACS)" != no && test -n "$(%NDIR%dir)"; 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 \ + list='$(%DIR%_LISP)'; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ + 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?$(am__strip_dir):$(am__vpath_adj)% \ diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am index ee20a90c0..10ce7ceb7 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -27,7 +27,6 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%LTLIBRARIES install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" if %?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @@ -38,6 +37,8 @@ if %?BASE% else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \ ## 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 @@ -49,6 +50,10 @@ if %?BASE% } else !%?BASE% @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ for p in $$list; do if test -f "$$p"; then echo "$$p $$p"; else :; fi; done | \ sed '/ .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { cur = "." } \ @@ -58,7 +63,7 @@ else !%?BASE% while read dir files; do \ test -z "$$files" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \ ## Note that we explicitly set the libtool mode. This avoids any lossage ## if the program doesn't have a name that libtool expects. diff --git a/lib/am/mans.am b/lib/am/mans.am index 5c563b3e9..bfc71dc99 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -30,16 +30,24 @@ man%SECTION%dir = $(mandir)/man%SECTION% .PHONY install-man: install-man%SECTION% install-man%SECTION%: %DEPS% @$(NORMAL_INSTALL) - test -z "$(man%SECTION%dir)" || $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" if %?NOTRANS_MANS% ## Handle MANS with notrans_ prefix - @list='%NOTRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ + @list1='%NOTRANS_SECT_LIST%'; \ +?!HAVE_NOTRANS? list2=''; \ +?HAVE_NOTRANS? list2='%NOTRANS_LIST%'; \ + test -n "$(man%SECTION%dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ ## Extract all items from notrans_man_MANS that should go in this section. ## This must be done dynamically to support conditionals. -?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ ## Accept for 'man1' files like 'foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'. -?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \ + | sed -n '/\.%SECTION%[a-z]*$$/p'; \ + fi; \ ## Extract basename of manpage, change the extension if needed. } | while read p; do \ ## Find the file. @@ -65,13 +73,22 @@ if %?NOTRANS_MANS% endif %?NOTRANS_MANS% if %?TRANS_MANS% ## Handle MANS without notrans_ prefix - @list='%TRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ + @list1='%TRANS_SECT_LIST%'; \ +?!HAVE_TRANS? list2=''; \ +?HAVE_TRANS? list2='%TRANS_LIST%'; \ + test -n "$(man%SECTION%dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ ## Extract all items from notrans_man_MANS that should go in this section. ## This must be done dynamically to support conditionals. -?HAVE_TRANS? l2='%TRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \ -## Accept for 'man1' files like 'foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'. -?HAVE_TRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ +## Accept for 'man1' files like `foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'. + | sed -n '/\.%SECTION%[a-z]*$$/p'; \ + fi; \ ## Extract basename of manpage, change the extension if needed. } | while read p; do \ ## Find the file. diff --git a/lib/am/progs.am b/lib/am/progs.am index 0e2cc025d..2be8bcab4 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -23,10 +23,13 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @list='$(%DIR%_PROGRAMS)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ ## On Cygwin with libtool test won't see 'foo.exe' but instead 'foo'. ## So we check for both. diff --git a/lib/am/python.am b/lib/am/python.am index bb2748cd2..cab61294a 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -29,9 +29,12 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON install-%DIR%PYTHON: $(%DIR%_PYTHON) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" if %?BASE% @list='$(%DIR%_PYTHON)'; dlist=; list2=; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ 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; \ @@ -58,6 +61,10 @@ if %?BASE% else :; fi else !%?BASE% @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for p in $$files; do \ ## A file can be in the source directory or the build directory. diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 29e3e7815..64e093e64 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -28,10 +28,13 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)" .PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \ + fi; \ ?!BASE? $(am__nobase_strip_setup); \ for p in $$list; do \ ## A file can be in the source directory or the build directory. diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index fbc7a0533..8e75ef3b9 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -142,8 +142,11 @@ include inst-vars.am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) - test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -155,8 +158,11 @@ install-dvi-am: $(DVIS) install-html-am: $(HTMLS) @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ @@ -183,9 +189,12 @@ install-html-am: $(HTMLS) install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ for file in $$list; do \ ## Strip possible $(srcdir) prefix. case $$file in \ @@ -241,8 +250,11 @@ install-info-am: $(INFO_DEPS) install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) - test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -253,8 +265,11 @@ install-pdf-am: $(PDFS) install-ps-am: $(PSS) @$(NORMAL_INSTALL) - test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ |