From unknown Tue Aug 19 10:05:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11030: should an empty "pkgdata_DATA" cause creation of $(pkgdatadir) by "make install"? Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 16 Mar 2012 22:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11030 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruno Haible Cc: Ralf.Wildenhues@gmx.de, 11030@debbugs.gnu.org, automake@gnu.org X-Debbugs-Original-Cc: Ralf Wildenhues , bug-automake@gnu.org, Automake List Received: via spool by submit@debbugs.gnu.org id=B.133193735724232 (code B ref -1); Fri, 16 Mar 2012 22:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Mar 2012 22:35:57 +0000 Received: from localhost ([127.0.0.1]:53967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8fka-0006Im-E2 for submit@debbugs.gnu.org; Fri, 16 Mar 2012 18:35:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56500) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8fkM-0006IS-LF for submit@debbugs.gnu.org; Fri, 16 Mar 2012 18:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8fGk-0001ft-Qs for submit@debbugs.gnu.org; Fri, 16 Mar 2012 18:05:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8fGk-0001fl-LD for submit@debbugs.gnu.org; Fri, 16 Mar 2012 18:05:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8fGi-0003SD-IG for bug-automake@gnu.org; Fri, 16 Mar 2012 18:05:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8fGg-0001aB-D7 for bug-automake@gnu.org; Fri, 16 Mar 2012 18:05:03 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:43745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8fGc-0001Yj-AO; Fri, 16 Mar 2012 18:04:58 -0400 Received: by werj55 with SMTP id j55so5617560wer.0 for ; Fri, 16 Mar 2012 15:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=3Gp5yMSNg+DCXFk2+m1FSLr4IvgGCgqT2M/JBBywpZM=; b=wK+TuOQZssJ1NMk7yoTI2mjYnrmL0jRvatEXkx5Qok7kD8Vuxerm9/QdPbEGUFULn6 LPOsEmBZfIjXZUhT58q852892xKJ0usgE/IJK3ZEHpg+06pr0MOoHgoRhr0n3uvDFuZC Wxj9lobujrES3blO54+CAw3x0vLbpl0hQuSoQFIXV/4l+f2TCYT6TR3Z+/i58lvyFdbo mbz6amGCw0Bnov8+47TeJgyd7XDv+fzFFi04U7qHlfg1W84G7+riBUYTNc4mzzJKjWMl uAjt4ckAUWy2v06e28ezH2ZtNx9Bs4QHa6ReHZXjoANeWeRoowIkMKn4dpkLsevDS7zI eMBQ== Received: by 10.180.14.73 with SMTP id n9mr1877662wic.16.1331935495716; Fri, 16 Mar 2012 15:04:55 -0700 (PDT) Received: from [80.116.81.66] (host66-81-dynamic.116-80-r.retail.telecomitalia.it. [80.116.81.66]) by mx.google.com with ESMTPS id t20sm3436267wiv.0.2012.03.16.15.04.53 (version=SSLv3 cipher=OTHER); Fri, 16 Mar 2012 15:04:54 -0700 (PDT) Message-ID: <4F63B903.7020506@gmail.com> Date: Fri, 16 Mar 2012 23:04:51 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <22fd0da7cd2505d3075eda89f87da153571e61ab.1331632293.git.stefano.lattarini@gmail.com> <4F5F3A15.5050009@gmail.com> <4F5F3DDF.50301@gmail.com> <2058925.ui3ChEzXpG@linuix> In-Reply-To: <2058925.ui3ChEzXpG@linuix> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi Bruno, sorry for the delay, thanks for your detailed reply. On 03/13/2012 05:47 PM, Bruno Haible wrote: > [Dropping bug-gnulib from CC.] > And now adding bug-automake. References: Original thread on bug-gnulib: Follow-up on the automake list: A related issue: > Stefano Lattarini wrote: >> So we're in a sort of a tie here: some users think that the current Automake >> behaviour is a feature (and I lean toward that position), other ones (with >> Ralf among them, apparently) believe it's a bug. Hmmm. > > The most important question in such a situation is: Can users who wish to > have the opposite behaviour get it? > > If the answer to this question is yes, then: What are the use-cases of these > two behaviours? Are they sound? How many users do they affect? > > About the first question: > > * If Automake does not create an empty directory by default, can users > get it created? > > Answer: Yes, they write a rule like this: > > installdirs-local: > $(mkdir_p) $(DESTDIR)$(pkgdatadir) > Right, with the nit s/$(mkdir_p)/$(MKDIR_P)/ (the former variable has been long-deprecated, and will be removed in automake 1.13). > * If Automake does create an empty directory by default, can users avoid > it? > > Answer: For users who generate their Makefile.am (like gnulib-tool), yes. > For users who use constructs like > > pkgdata_DATA = > if WINDOWS > pkgdata_DATA += documentation.chm > endif > if MACOS > pkgdata_DATA += bundle.nib > endif > > what is the answer? Can they write > > if WINDOWS || MACOS > Note that automake conditionals don't support conjunction nor disjunction ... > pkgdata_DATA = > if WINDOWS > pkgdata_DATA += documentation.chm > endif > if MACOS > pkgdata_DATA += bundle.nib > endif > endif > > Does this have the effect of avoiding an empty directory? > ... so this idiom wouldn't even work :-( And sadly, we have a much worse bug anyway, i.e., even this: if FALSE pkgdata_DATA = foo endif will end up creating $(pkgdata)! Issue already reported as bug#10997, and already exposed in the testsuite (see 'instdir-cond.test'). > pkgdata_DATA = > if WINDOWS > pkgdata_DATA += documentation.chm > endif > if MACOS > pkgdata_DATA += bundle.nib > endif > endif > Second question: > > * Who needs to avoid an empty installation directory? > > I think, everyone who installs files conditionally. Can be many packages. > Makes sense, once s/needs to/might need to/. > * Who needs to create an empty installation directory? > > Hmm? > I must admit this is not a common requirement ... Automake did this for a brief time (now that it requires the system acdir to be existent), but the fact that we were creating an *empty* directory kept bugging me so much that I ended up adding a README file into it anyway ... > Please fill in the remaining answers; I could only come up with partial > answers. > > Bruno > You have convinced me that this behaviour is more a bug than a feature. And since we have already seen some bug fixes in maint after 1.11.3, a fix for this issue might warrant a 1.11.4 release ... Regards, Stefano From unknown Tue Aug 19 10:05:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11030: should an empty "pkgdata_DATA" cause creation of $(pkgdatadir) by "make install"? Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Sat, 17 Mar 2012 17:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11030 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruno Haible Cc: 11030@debbugs.gnu.org, "automake-patches@gnu.org" Received: via spool by 11030-submit@debbugs.gnu.org id=B11030.13320064319401 (code B ref 11030); Sat, 17 Mar 2012 17:48:02 +0000 Received: (at 11030) by debbugs.gnu.org; 17 Mar 2012 17:47:11 +0000 Received: from localhost ([127.0.0.1]:54859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8xie-0002RX-P4 for submit@debbugs.gnu.org; Sat, 17 Mar 2012 13:47:11 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:49910) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8xiZ-0002RN-9u for 11030@debbugs.gnu.org; Sat, 17 Mar 2012 13:47:07 -0400 Received: by wibhr17 with SMTP id hr17so1919567wib.15 for <11030@debbugs.gnu.org>; Sat, 17 Mar 2012 10:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; bh=ja8Af4hhxhMvei05ugU0raIlEosExxpI6+uaahaRIBw=; b=vSXVfk4pgkduyGc4yN1fFZNCvR6h/cT7Yth2+RqktZys7B32mBaRMSBcqG/wZDA6gO +RZMQ1qoBkFAn5nQQdLCznrGiBSa9k0hfkP4sERJRmnO8WsRMZOcYnHF+AD22fsZSCNN K9b/jVW6Hk0r3a/6mubtxhP9y2JFkESTWuq5Y3hALEHs0eLmu22Fua5ApkqnA1dfDM3K I4auMOHXx8j+XLa4UBNm9yqbO/449mrMXjPfsKnlQEVM2TmVGuvBpiCmgiN1ApaHljFx sNsOQqd/sC1Vpt3p7eH0XB/FZqtn72NywmODvSxeh+vYXbfnWTnmOVXMxU1tycizBdfb MAWw== Received: by 10.216.139.12 with SMTP id b12mr4020964wej.4.1332004602516; Sat, 17 Mar 2012 10:16:42 -0700 (PDT) Received: from [80.116.81.98] (host98-81-dynamic.116-80-r.retail.telecomitalia.it. [80.116.81.98]) by mx.google.com with ESMTPS id k6sm9316473wiy.7.2012.03.17.10.16.37 (version=SSLv3 cipher=OTHER); Sat, 17 Mar 2012 10:16:40 -0700 (PDT) Message-ID: <4F64C6DF.7020100@gmail.com> Date: Sat, 17 Mar 2012 18:16:15 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <22fd0da7cd2505d3075eda89f87da153571e61ab.1331632293.git.stefano.lattarini@gmail.com> <4F5F3A15.5050009@gmail.com> <4F5F3DDF.50301@gmail.com> <2058925.ui3ChEzXpG@linuix> <4F63B903.7020506@gmail.com> In-Reply-To: <4F63B903.7020506@gmail.com> Content-Type: multipart/mixed; boundary="------------050609060106050902050401" X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------050609060106050902050401 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit [dropping automake, adding automake-patches] On 03/16/2012 11:04 PM, Stefano Lattarini wrote: > > You have convinced me that this behaviour is more a bug than a feature. > And here is a patch (for maint) that should settle the issue. I will push by tomorrow if there is no objection. Regards, Stefano --------------050609060106050902050401 Content-Type: text/x-diff; name="0001-install-don-t-create-empty-dirs-when-an-empty-foo_PR.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-install-don-t-create-empty-dirs-when-an-empty-foo_PR.pa"; filename*1="tch" >From 50a0df35cf1c4a10a9d92e0ea3e8b937b8504bf9 Mon Sep 17 00:00:00 2001 Message-Id: <50a0df35cf1c4a10a9d92e0ea3e8b937b8504bf9.1332004419.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Fri, 16 Mar 2012 23:48:53 +0100 Subject: [PATCH] install: don't create empty dirs when an empty 'foo_PRIMARY' is used Fixes automake bug#11030 and bug#10997. An empty declaration of "foo_PRIMARY" in a Makefile.am used to cause the generated install rules to create the directory $(foodir) anyway, even if nothing was to be installed there. While this could be seen as a convenient way to create a $(foodir) directory upon "make install" (respecting $(DESTDIR) settings and such), it also caused problems with conditionals; for example, an input of: if FALSE pgkdata_DATA = something endif caused the generated install rules to unconditionally create the $(pkgdatadir) directory (see automake bug#10997). Also, a user wanting to create an empty directory upon installation can easily do so with a custom install hook, as in: installdirs-local: $(MKDIR_P) $(DESTDIR)$(foodir) install-data-hook: installdirs-local On the other hand, the old behavior of "always create $(foodir), even if 'foo_PRIMARY' is empty" was harder and more tricky to override. Thus, from now on, an empty declaration of "foo_PRIMARY" will not cause the directory $(foodir) to be created upon "make install" anymore. * lib/am/data.am, lib/am/java.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am, lib/am/mans.am, lib/am/progs.am, lib/am/python.am, lib/am/scripts.am, lib/am/texinfos.am: Adjust install rules to avoid creating an installation directory if no files are actually to be installed there. * tests/instdir-empty.test: Remove, it was testing a semantic opposite to the one we now want and implement. * tests/instdir-no-empty.test: New test, check the new semantic. * tests/instdir-cond.test: Enhance. Move the still-failing part of the test ... * tests/instdir-cond2.test: ... here. * tests/list-of-tests.mk, tests/Makefile.am (XFAIL_TESTS): Update. * tests/java3.test: Adjust to avoid spurious failures. * NEWS: Update. * THANKS: Likewise. Signed-off-by: Stefano Lattarini --- NEWS | 11 ++++ THANKS | 1 + lib/am/data.am | 14 ++++-- lib/am/java.am | 6 +- lib/am/libs.am | 12 +++-- lib/am/lisp.am | 11 +++-- lib/am/ltlib.am | 12 +++-- lib/am/mans.am | 38 +++++++++---- lib/am/progs.am | 8 ++- lib/am/python.am | 9 +++- lib/am/scripts.am | 8 ++- lib/am/texinfos.am | 28 +++++++--- tests/Makefile.am | 2 +- tests/installdir.test | 36 ++++++++++++- tests/instdir-cond.test | 3 +- tests/instdir-cond2.test | 53 ++++++++++++++++++ tests/instdir-empty.test | 58 -------------------- tests/instdir-no-empty.test | 123 +++++++++++++++++++++++++++++++++++++++++++ tests/java3.test | 5 ++- tests/list-of-tests.mk | 3 +- 20 files changed, 332 insertions(+), 109 deletions(-) create mode 100644 tests/instdir-cond2.test delete mode 100644 tests/instdir-empty.test create mode 100755 tests/instdir-no-empty.test diff --git a/NEWS b/NEWS index b998ce4..f15a1b9 100644 --- a/NEWS +++ b/NEWS @@ -167,6 +167,17 @@ Bugs fixed in 1.11.0a: * Long-standing bugs: + - An empty declaration of a "foo_PRIMARY" don't cause anymore the + generated install rules to create an empty $(foodir) directory; + for example, if Makefile.am contains something like: + + pkglibexec_SCRIPTS = + if FALSE + pkglibexec_SCRIPTS += bar.sh + endif + + the $(pkglibexec) directory will not be created upon "make install". + - It is now possible for a foo_SOURCES variable to hold Vala sources together with C header files, as well as with sources and headers for other supported languages (e.g., C++). Previously, only mixing C and diff --git a/THANKS b/THANKS index 8363126..2e29d44 100644 --- a/THANKS +++ b/THANKS @@ -64,6 +64,7 @@ Christina Gratorp christina.gratorp@gmail.com Claudio Fontana sick_soul@yahoo.it Clifford Wolf clifford@clifford.at Dagobert Michelsen dam@opencsw.org +Daiki Ueno ueno@unixuser.org Dalibor Topic robilad@kaffe.org danbp danpb@nospam.postmaster.co.uk Daniel Jacobowitz drow@false.org diff --git a/lib/am/data.am b/lib/am/data.am index 1817447..98a38a8 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006, -## 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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 @@ -28,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; \ @@ -47,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 464b706..6c163b5 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1998, 1999, 2001, 2003, 2004, 2006, 2008, 2009 Free Software -## Foundation, Inc. +## Copyright (C) 1998-2012 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 @@ -48,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 29f630b..4006bd0 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006, -## 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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 @@ -28,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. @@ -39,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 0194c1b..968439f 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -## 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +## Copyright (C) 1996-2012 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 @@ -90,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 29aa00c..65210c1 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, -## 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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 @@ -28,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. @@ -39,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 @@ -50,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 = "." } \ @@ -59,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 b41a94d..b0d5335 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1998, 2001, 2003, 2004, 2006, 2008, 2009 Free Software -## Foundation, Inc. +## Copyright (C) 1998-2012 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 @@ -31,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)" \ + && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \ + || 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. @@ -66,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)" \ + && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \ + || 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 | \ + 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_TRANS? 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. diff --git a/lib/am/progs.am b/lib/am/progs.am index d39b23d..da26277 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, -## 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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,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 bb2748c..cab6129 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 346f0d3..64e093e 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -1,6 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006, 2007, -## 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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 @@ -29,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 5314dec..9190e8f 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -1,7 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -## 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1994-2012 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 @@ -143,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"; \ @@ -156,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) \ @@ -184,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 \ @@ -242,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"; \ @@ -254,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"; \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cac904..b2a8e05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,7 @@ dist-auxfile.test \ dist-auxfile-2.test \ dist-pr109765.test \ gcj6.test \ -instdir-cond.test \ +instdir-cond2.test \ java-nobase.test \ objext-pr10128.test \ pr8365-remake-timing.test \ diff --git a/tests/installdir.test b/tests/installdir.test index b09f495..2fc1285 100755 --- a/tests/installdir.test +++ b/tests/installdir.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 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 @@ -15,17 +15,47 @@ # along with this program. If not, see . # Test for PR 203. +# See also automake bug#11030. . ./defs || Exit 1 set -e +echo AC_OUTPUT >> configure.in + cat > Makefile.am << 'END' +foodir = $(datadir)/$(distdir) installdirs-local: - @echo here + $(MKDIR_P) $(DESTDIR)$(foodir) +install-data-hook: installdirs-local END $ACLOCAL $AUTOMAKE -test `grep installdirs-local Makefile.in | wc -l` -eq 3 +test `grep installdirs-local Makefile.in | wc -l` -eq 4 + +cwd=`pwd` || fatal_ "getting current working directory" + +$AUTOCONF +./configure --prefix="$cwd/inst" + +$MAKE installdirs +test -d inst/share/$me-1.0 +rm -rf inst + +$MAKE install +test -d inst/share/$me-1.0 +rm -rf inst + +./configure --prefix=/foo + +$MAKE installdirs DESTDIR="$cwd/dest" +test -d dest/foo/share/$me-1.0 +rm -rf dest + +$MAKE install DESTDIR="$cwd/dest" +test -d dest/foo/share/$me-1.0 +rm -rf dest + +: diff --git a/tests/instdir-cond.test b/tests/instdir-cond.test index 8d83f88..9cdd810 100644 --- a/tests/instdir-cond.test +++ b/tests/instdir-cond.test @@ -30,9 +30,10 @@ END : > bar cat > Makefile.am << 'END' +pkglibexec_SCRIPTS = if ENABLE_FOO pkgdata_DATA = foo -pkglibexec_SCRIPTS = bar +pkglibexec_SCRIPTS += bar endif END diff --git a/tests/instdir-cond2.test b/tests/instdir-cond2.test new file mode 100644 index 0000000..6cdc26d --- /dev/null +++ b/tests/instdir-cond2.test @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2012 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, see . + +# Check against automake bug#10997: directories holding only +# conditionally-installed files should not be created unconditionally. +# FIXME: this test tries to check that the above also hold for the +# FIXME: "installdirs" target, but that doesn't currently work :-( +# FIXME: So this test is still xfailing. +# See sister test 'instdir-cond.test' for the succeeding part. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AM_CONDITIONAL([ENABLE_FOO], [false]) +AC_OUTPUT +END + +: > foo +: > bar + +cat > Makefile.am << 'END' +pkglibexec_SCRIPTS = +if ENABLE_FOO +pkgdata_DATA = foo +pkglibexec_SCRIPTS += bar +endif +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure --prefix="`pwd`/inst" + +$MAKE installdirs +test ! -d inst || { find inst; Exit 1; } + +: diff --git a/tests/instdir-empty.test b/tests/instdir-empty.test deleted file mode 100644 index f699583..0000000 --- a/tests/instdir-empty.test +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/sh -# Copyright (C) 2012 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, see . - -# An empty "foo_PRIMARY" declaration should cause "make install" to create -# directory $(foodir). Suggested in discussion on automake bug#10997. - -. ./defs || Exit 1 - -set -e - -echo AC_OUTPUT >> configure.in - -cat > Makefile.am << 'END' -pkgdata_DATA = -libexec_SCRIPTS = -END - -$ACLOCAL -$AUTOMAKE -$AUTOCONF - -cwd=`pwd` -./configure --prefix="$cwd/inst" - -$MAKE install -test -d inst/share/$me -test -d inst/libexec -rm -rf inst - -$MAKE install-exec -test ! -d inst/share -test -d inst/libexec -rm -rf inst - -$MAKE install-data -test -d inst/share/$me -test ! -d inst/libexec -rm -rf inst - -./configure --prefix=/foo -$MAKE install DESTDIR=$cwd/dest -test -d dest/foo/share/$me -test -d dest/foo/libexec - -: diff --git a/tests/instdir-no-empty.test b/tests/instdir-no-empty.test new file mode 100755 index 0000000..cf57996 --- /dev/null +++ b/tests/instdir-no-empty.test @@ -0,0 +1,123 @@ +#! /bin/sh +# Copyright (C) 2012 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, see . + +# An empty "foo_PRIMARY" declaration should *not* cause "make install" +# to create directory $(foodir). See automake bug#10997 and bug#11030. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in < Makefile.am << 'END' +AUTOMAKE_OPTIONS = no-dependencies +mydir = $(prefix)/my +myexecdir = $(prefix)/myexec +javadir = $(prefix)/java +END + +# Write Makefile.am. +{ + + for dir in sbin bin libexec pkglibexec myexec; do + for dst in '' dist_ nodist_; do + echo "${dst}${dir}_SCRIPTS =" + done + echo "${dir}_PROGRAMS =" + done + + for dir in lib pkglib myexec my; do + echo "${dir}_LIBRARIES =" + echo "${dir}_LTLIBRARIES =" + done + + for p1 in '' notrans_; do + for p2 in '' dist_ nodist_; do + for s in '' 1 2 3 4 5 6 7 8 9; do + echo "${p1}${p2}man${s}_MANS =" + done + done + done + + for dst in '' dist_ nodist_; do + for dir in dataroot data pkgdata doc lisp my; do + echo "${dst}${dir}_DATA =" + done + for dir in include pkginclude oldinclude my; do + echo "${dst}${dir}_HEADERS =" + done + for dir in python my; do + echo "${dst}${dir}_PYTHON =" + done + for dir in info my; do + echo "${dst}${dir}_TEXINFOS =" + done + for dir in java my; do + echo "${dst}${dir}_JAVA =" + done + for dir in lisp my; do + echo "${dst}${dir}_LISP =" + done + done + +} > t + +cat t >> Makefile.am +sed 's/^/nobase_/' t >> Makefile.am +rm -f t + +cat Makefile.am # For debugging. + +# Sanity check. +grep '^oldinclude_HEADERS =' Makefile.am \ + && grep '^nodist_my_PYTHON =' Makefile.am \ + && grep '^notrans_dist_man5_MANS =' Makefile.am \ + || fatal_ "creating Makefile.am" + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +cwd=`pwd` || fatal_ "getting current working directory" + +doinst () +{ + $MAKE install install-pdf install-ps install-dvi ${1+"$@"} +} + +: > foo.sh + +./configure --prefix="$cwd/inst" +doinst +test ! -d inst || { find inst; Exit 1; } +$MAKE uninstall +doinst bin_SCRIPTS=foo.sh +test -f inst/bin/foo.sh + +./configure +doinst DESTDIR="$cwd/dest" +test ! -d dest || { find dest; Exit 1; } +$MAKE uninstall +doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh +test -f dest/usr/local/bin/foo.sh + +: diff --git a/tests/java3.test b/tests/java3.test index e1850a8..5701d8f 100755 --- a/tests/java3.test +++ b/tests/java3.test @@ -48,8 +48,11 @@ cwd=`pwd` || Exit 1 ./configure --prefix="$cwd/_inst" $MAKE $MAKE install -ls -l . _inst/java # For debugging. +ls -l . find . -name '*.class' | grep . && Exit 1 +# If we have nothing to install, we shouldn't create any installation +# directory. Related to automake bug#11030. +test ! -d _inst $MAKE uninstall $MAKE distcheck diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index b5a604c..04bd2b5 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -460,7 +460,8 @@ instdat2.test \ instdir.test \ instdir2.test \ instdir-cond.test \ -instdir-empty.test \ +instdir-cond2.test \ +instdir-no-empty.test \ instdir-java.test \ instdir-lisp.test \ instdir-ltlib.test \ -- 1.7.9 --------------050609060106050902050401-- From unknown Tue Aug 19 10:05:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11030: should an empty "pkgdata_DATA" cause creation of $(pkgdatadir) by "make install"? Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Sun, 18 Mar 2012 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11030 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruno Haible Cc: 11030@debbugs.gnu.org, "automake-patches@gnu.org" Received: via spool by 11030-submit@debbugs.gnu.org id=B11030.133205603120434 (code B ref 11030); Sun, 18 Mar 2012 07:34:02 +0000 Received: (at 11030) by debbugs.gnu.org; 18 Mar 2012 07:33:51 +0000 Received: from localhost ([127.0.0.1]:55246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9Acf-0005JV-29 for submit@debbugs.gnu.org; Sun, 18 Mar 2012 03:33:50 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:38672) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9AcT-0005JC-JA for 11030@debbugs.gnu.org; Sun, 18 Mar 2012 03:33:47 -0400 Received: by werb10 with SMTP id b10so6058776wer.3 for <11030@debbugs.gnu.org>; Sun, 18 Mar 2012 00:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=tfzYOIsUvWPCFrERkCr+OpK5cgzvwL66Q+AhUUTNss4=; b=TwP/wJTMgA+K4gOLJNyn59HpxqYx2QisacbGiW62x6ot+KVNRAtX9pGqKgq8EU5tUN +NujIfs0xN1qamPUEmD0vSYammXJHNUmRjx1lZAtIlVnZMz6q1ymmBdf5RbpEuP7g6Yj VAU2wrvsjJ0Emk2X+u/5ZEMze5HvhE13Tjka/YjHdLBouSuuPILW1TuvgzTFpTAwR/3C 67nqbvzf9givugFNmMAuTktIODyzUTelR1JfQEwyg36AY+mwNR+9FfyEzQKZfKgz/Vhd OOLGd6JzbnpOt+2h+hHK6sFAviheaO5YwEZEq0W+4CahL+4+unyjBYd6WUH2/LvLn22K yZlg== Received: by 10.180.102.102 with SMTP id fn6mr10707039wib.10.1332054193098; Sun, 18 Mar 2012 00:03:13 -0700 (PDT) Received: from [87.0.103.179] (host179-103-dynamic.0-87-r.retail.telecomitalia.it. [87.0.103.179]) by mx.google.com with ESMTPS id ff2sm22993109wib.9.2012.03.18.00.03.10 (version=SSLv3 cipher=OTHER); Sun, 18 Mar 2012 00:03:11 -0700 (PDT) Message-ID: <4F6588A6.40400@gmail.com> Date: Sun, 18 Mar 2012 08:03:02 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <22fd0da7cd2505d3075eda89f87da153571e61ab.1331632293.git.stefano.lattarini@gmail.com> <4F5F3A15.5050009@gmail.com> <4F5F3DDF.50301@gmail.com> <2058925.ui3ChEzXpG@linuix> <4F63B903.7020506@gmail.com> <4F64C6DF.7020100@gmail.com> In-Reply-To: <4F64C6DF.7020100@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 03/17/2012 06:16 PM, Stefano Lattarini wrote: > [dropping automake, adding automake-patches] > > On 03/16/2012 11:04 PM, Stefano Lattarini wrote: >> >> You have convinced me that this behaviour is more a bug than a feature. >> > And here is a patch (for maint) that should settle the issue. I will push by > tomorrow if there is no objection. > And consider the hunk below squashed in. Regards, Stefano diff --git a/HACKING b/HACKING index 5420fbc..8b5cdb9 100644 --- a/HACKING +++ b/HACKING @@ -75,6 +75,9 @@ "important" command it runs. The printed commands should be preceded by a single space. +* Ensure install rules do not create any installation directory where + nothing is to be actually installed. See automake bug#11030. + ================================================================ = Editing automake.in and aclocal.in From unknown Tue Aug 19 10:05:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11030: should an empty "pkgdata_DATA" cause creation of $(pkgdatadir) by "make install"? Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Sun, 18 Mar 2012 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11030 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruno Haible Cc: 11030@debbugs.gnu.org, "automake-patches@gnu.org" Received: via spool by 11030-submit@debbugs.gnu.org id=B11030.133210024023011 (code B ref 11030); Sun, 18 Mar 2012 19:51:02 +0000 Received: (at 11030) by debbugs.gnu.org; 18 Mar 2012 19:50:40 +0000 Received: from localhost ([127.0.0.1]:55976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9M7j-0005z4-NC for submit@debbugs.gnu.org; Sun, 18 Mar 2012 15:50:40 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:58394) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9M7h-0005yu-Gn; Sun, 18 Mar 2012 15:50:38 -0400 Received: by wibhm17 with SMTP id hm17so2739049wib.15 for ; Sun, 18 Mar 2012 12:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=IiGOWRoB+mbilnuEniEj2f8iWdlYDjtZLjr7Qh/2Buw=; b=jEeuiy3nP3zTnm1GLEz522GK/FGmZTuQw7gRgXqCio3pitLAVyax3HuQvGs1ZPARi8 dUkLVjHu3wuYjZiUZb2gNOPND/vkCIDt+TxMDrSMAJ4+dO2+n8Z/d+QXSoMx77Dfxjoz OFs7oXADNYCjeAcakb2hoBTyNw5qcn8W80/3DWneMQMRjcHp8OegdGWUBUKQI/fnIpm4 WLwGN9mVI0AJXu2A+iMJY/NF66ii/q2PuA1z1JgmWUAxik3JisOCZF2L3hEItPjZi7MP bEtgE+KSyPZygPXF6GqyBmr+4dMZqimwuleuloWTbnINENIfli5cCn4yYiMmiPyFaIrj 3pBw== Received: by 10.216.45.146 with SMTP id p18mr5576024web.47.1332098410530; Sun, 18 Mar 2012 12:20:10 -0700 (PDT) Received: from [82.54.101.148] (host148-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.148]) by mx.google.com with ESMTPS id gg2sm30794421wib.7.2012.03.18.12.20.06 (version=SSLv3 cipher=OTHER); Sun, 18 Mar 2012 12:20:09 -0700 (PDT) Message-ID: <4F663559.60306@gmail.com> Date: Sun, 18 Mar 2012 20:19:53 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <22fd0da7cd2505d3075eda89f87da153571e61ab.1331632293.git.stefano.lattarini@gmail.com> <4F5F3A15.5050009@gmail.com> <4F5F3DDF.50301@gmail.com> <2058925.ui3ChEzXpG@linuix> <4F63B903.7020506@gmail.com> <4F64C6DF.7020100@gmail.com> <4F6588A6.40400@gmail.com> In-Reply-To: <4F6588A6.40400@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 11030 + patch close 11030 thanks On 03/18/2012 08:03 AM, Stefano Lattarini wrote: > >> On 03/16/2012 11:04 PM, Stefano Lattarini wrote: >>> >>> You have convinced me that this behaviour is more a bug than a feature. >>> >> And here is a patch (for maint) that should settle the issue. I will push by >> tomorrow if there is no objection. >> Patch pushed now. I'm thus closing this bug report. Regards, Stefano From unknown Tue Aug 19 10:05:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11030: [FYI] {maint} install-mans: avoid spurious failure with NetBSD make (was: Re: bug#11030: should an empty "pkgdata_DATA" cause creation of $(pkgdatadir) by "make install"?) Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Sun, 18 Mar 2012 22:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11030 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Bruno Haible Cc: 11030@debbugs.gnu.org, "automake-patches@gnu.org" Received: via spool by 11030-submit@debbugs.gnu.org id=B11030.13321082945321 (code B ref 11030); Sun, 18 Mar 2012 22:05:01 +0000 Received: (at 11030) by debbugs.gnu.org; 18 Mar 2012 22:04:54 +0000 Received: from localhost ([127.0.0.1]:56080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9ODd-0001Nl-Jr for submit@debbugs.gnu.org; Sun, 18 Mar 2012 18:04:54 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:60539) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S9ODR-0001NS-Ei for 11030@debbugs.gnu.org; Sun, 18 Mar 2012 18:04:52 -0400 Received: by werb10 with SMTP id b10so6519571wer.3 for <11030@debbugs.gnu.org>; Sun, 18 Mar 2012 14:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; bh=Tx/4q0qKjAjp2BF4U+tFa5Mlr1EfM1sboI5CQhYggS8=; b=Paj4VW53vtqFH4gYxNlkl3lViOTzAktxb0P8QRfmroizVgHWQDpZQdp8PGsp0RebOd s0dsuM6/z9PZAPIY4PPs8c589k3tBjaK2SQ1hLjMmnp/adjq6zGd8jWjEKo0bvzfq1iF aYOEpfF6rBIlLUAqVra44NuVy3PgK493kQRTCY9UJDPeT/YmmxDDJUofc+wm47AQmiNe +ZmcnF5+0PD9IGWrWh1kdNWGoDrJGffkqxBoeRAGPxHxGJpidjTh8wEPwPcUUN2v4sqR EW/uBQpWhRwCJvu6vpIt91ZxNdvC6cz5KaaqBWolzi/5gWW6bqG3lF8a2HflBSHKNWpX /PDg== Received: by 10.180.83.198 with SMTP id s6mr14608946wiy.8.1332106453974; Sun, 18 Mar 2012 14:34:13 -0700 (PDT) Received: from [82.54.101.148] (host148-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.148]) by mx.google.com with ESMTPS id k7sm32258614wia.5.2012.03.18.14.34.11 (version=SSLv3 cipher=OTHER); Sun, 18 Mar 2012 14:34:12 -0700 (PDT) Message-ID: <4F6654CB.6060804@gmail.com> Date: Sun, 18 Mar 2012 22:34:03 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <22fd0da7cd2505d3075eda89f87da153571e61ab.1331632293.git.stefano.lattarini@gmail.com> <4F5F3A15.5050009@gmail.com> <4F5F3DDF.50301@gmail.com> <2058925.ui3ChEzXpG@linuix> <4F63B903.7020506@gmail.com> <4F64C6DF.7020100@gmail.com> <4F6588A6.40400@gmail.com> <4F663559.60306@gmail.com> In-Reply-To: <4F663559.60306@gmail.com> Content-Type: multipart/mixed; boundary="------------060304040504080309020204" X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------060304040504080309020204 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/18/2012 08:19 PM, Stefano Lattarini wrote: > tags 11030 + patch > close 11030 > thanks > > On 03/18/2012 08:03 AM, Stefano Lattarini wrote: >> >>> On 03/16/2012 11:04 PM, Stefano Lattarini wrote: >>>> >>>> You have convinced me that this behaviour is more a bug than a feature. >>>> >>> And here is a patch (for maint) that should settle the issue. I will push by >>> tomorrow if there is no objection. >>> > Patch pushed now. I'm thus closing this bug report. > The change introduced some new issues with NetBSD make when installing manpages. The attached follow-up (already applied to maint and merged into branch-1.11) fixes that. Sorry for the noise, Stefano --------------060304040504080309020204 Content-Type: text/x-diff; name="0001-install-mans-avoid-spurious-failure-with-NetBSD-make.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-install-mans-avoid-spurious-failure-with-NetBSD-make.pa"; filename*1="tch" >From 45ffbe9f8746224daf11a3980d69b10fc0520384 Mon Sep 17 00:00:00 2001 Message-Id: <45ffbe9f8746224daf11a3980d69b10fc0520384.1332105799.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Sun, 18 Mar 2012 22:19:45 +0100 Subject: [PATCH] install-mans: avoid spurious failure with NetBSD make * lib/am/mans.am: After the changes introduced by previous commit v1.11-759-g368f1c4, some manpage installation recipes started to fail spuriously on NetBSD 5.1 make. Apparently, the system make there eats backslashes used to escape whitespace characters in the relevant recipes. Revert to slightly slower but safer idioms that avoid the need of such escaping. Signed-off-by: Stefano Lattarini --- lib/am/mans.am | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/am/mans.am b/lib/am/mans.am index b0d5335..b92576d 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -36,7 +36,7 @@ if %?NOTRANS_MANS% ?!HAVE_NOTRANS? list2=''; \ ?HAVE_NOTRANS? list2='%NOTRANS_LIST%'; \ test -n "$(man%SECTION%dir)" \ - && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \ + && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \ @@ -77,7 +77,7 @@ if %?TRANS_MANS% ?!HAVE_TRANS? list2=''; \ ?HAVE_TRANS? list2='%TRANS_LIST%'; \ test -n "$(man%SECTION%dir)" \ - && case "$$list1$$list2" in *[^\ ]*) :;; *) false;; esac \ + && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \ -- 1.7.9 --------------060304040504080309020204--