From unknown Sun Jun 22 11:32:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7647 <7647@debbugs.gnu.org> To: bug#7647 <7647@debbugs.gnu.org> Subject: Status: Diagnose invalid primary/directory combinations (was: Re: configmake module and automake 1.9.6) Reply-To: bug#7647 <7647@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:32:38 +0000 retitle 7647 Diagnose invalid primary/directory combinations (was: Re: conf= igmake module and automake 1.9.6) reassign 7647 automake submitter 7647 Stefano Lattarini severity 7647 normal tag 7647 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 15 06:22:54 2010 Received: (at submit) by debbugs.gnu.org; 15 Dec 2010 11:22:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSpRd-0003me-Qb for submit@debbugs.gnu.org; Wed, 15 Dec 2010 06:22:54 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSpRb-0003mS-3K for submit@debbugs.gnu.org; Wed, 15 Dec 2010 06:22:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSpXd-0007xH-Ub for submit@debbugs.gnu.org; Wed, 15 Dec 2010 06:29:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:39900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSpXd-0007xD-S9 for submit@debbugs.gnu.org; Wed, 15 Dec 2010 06:29:05 -0500 Received: from [140.186.70.92] (port=42887 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSpXc-0006II-O2 for bug-automake@gnu.org; Wed, 15 Dec 2010 06:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSpXb-0007wY-O3 for bug-automake@gnu.org; Wed, 15 Dec 2010 06:29:04 -0500 Received: from mail-ey0-f177.google.com ([209.85.215.177]:44879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSpXZ-0007wF-44; Wed, 15 Dec 2010 06:29:01 -0500 Received: by eyd9 with SMTP id 9so1302765eyd.36 for ; Wed, 15 Dec 2010 03:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=l/ipNNnYZFvVn4X8zH4F1pDRhoUiwAVDsnzqlMBduv4=; b=JJlH5iSfxrnE0XI9Zgf7gudgSTv4kpPvJZH5dEF4inFqs93PVNoud8XOZFQy/jV8oS oVjbiaOveob+6CC5o04VYRRzFKBqjJ+/acVy04v+xjo7Shu7SOa9VznhqNPMaVFg+h8Q ymhBOvo6GxNTrMQF6rHmMGpM9s0mqWjhasV3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=hvL3gtUvxYEwciaRsE8S5U4uTTwT5z0YF6VBms7dG0gBdJKhE6+zT15RWgxDWmFk/g 9Bw6hTAPlv4dJbEChWuaBPsqJp6hyESyyMexrxpmrQBDjK/iw7PMHNYhteiAjOc/cXa5 PcW/6T33lVSLjmybj+xiDb/8PW7l/jxiWrCl4= Received: by 10.213.16.81 with SMTP id n17mr364006eba.21.1292412539927; Wed, 15 Dec 2010 03:28:59 -0800 (PST) Received: from bigio.localnet (host160-94-dynamic.54-82-r.retail.telecomitalia.it [82.54.94.160]) by mx.google.com with ESMTPS id b52sm852605eei.13.2010.12.15.03.28.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Dec 2010 03:28:59 -0800 (PST) From: Stefano Lattarini To: automake@gnu.org Subject: Diagnose invalid primary/directory combinations (was: Re: configmake module and automake 1.9.6) Date: Wed, 15 Dec 2010 12:27:43 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <4D07E784.9050104@redhat.com> <4D07ECD0.50003@redhat.com> In-Reply-To: <4D07ECD0.50003@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201012151227.43932.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit Cc: bug-automake@gnu.org, Ralf Wildenhues , Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -5.9 (-----) Hi Eric. On Tuesday 14 December 2010, Eric Blake wrote: > [dropping gnulib for this reply] > > On 12/14/2010 02:54 PM, Eric Blake wrote: > >>> # Listed in the same order as the GNU makefile conventions. > >>> # The Automake-defined pkg* macros are appended, in the order > >>> # listed in the Automake 1.10a+ documentation. > >>> +# Support newer definitions even when using older automake 1.9.6 > >> > >> The Automake version is probably irrelevant here. It's the Autoconf > >> version that matters. > > > > Oh; it's a mix of both autoconf and automake macros (autoconf AC_SUBST's > > localedir, but only automake 1.11 AC_SUBST's pkglibexecdir); the comment > > in modules/configmake only mentioned automake, but both tools have a > > hand in feeding configmake.h. > > In fact, I think automake has a minor bug. automake.in lists the > following directories: > > my %standard_prefix = > map { $_ => 1 } (qw(bin data dataroot dvi exec html include info > lib libexec lisp localstate man man1 man2 man3 > man4 man5 man6 man7 man8 man9 oldinclude pdf > pkgdatadir pkgincludedir pkglibdir pkglibexecdir > ps sbin sharedstate sysconf)); > > That list is missing 'doc' and 'locale'. > If you are referring to this issue: then I don't think this automake bug (or limitation) is relevant. The list in `%standard_prefix' is used only for diagnosing invalid primary/directory combinations, such as `data_PROGRAMS' or 'lib_HEADERS'. For more info, see test `dirforbid.test', PR/294 at , and commit e87d851a863a7c321af8bc7b2b36aff5e072ff94 (05/03/2002). That said, you might have uncovered a bug in automake, because something like: doc_LIBRARIES = libfoo.a should warn IMHO, but it currently doesn't. Ralf, what do you think? If you agree with me, I'll attempt a patch (and a testsuite enhancement). Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 15 13:25:01 2010 Received: (at submit) by debbugs.gnu.org; 15 Dec 2010 18:25:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSw29-0005nL-K1 for submit@debbugs.gnu.org; Wed, 15 Dec 2010 13:25:01 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSw27-0005n9-LY for submit@debbugs.gnu.org; Wed, 15 Dec 2010 13:25:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSw8B-0001ZM-5W for submit@debbugs.gnu.org; Wed, 15 Dec 2010 13:31:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:48111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSw87-0001Lq-KC for submit@debbugs.gnu.org; Wed, 15 Dec 2010 13:31:15 -0500 Received: from [140.186.70.92] (port=41307 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSw3Y-00073G-Fy for bug-automake@gnu.org; Wed, 15 Dec 2010 13:26:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSw3K-0000bC-Uk for bug-automake@gnu.org; Wed, 15 Dec 2010 13:26:15 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]:60392 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PSw3K-0000b3-Fw for bug-automake@gnu.org; Wed, 15 Dec 2010 13:26:14 -0500 Received: (qmail invoked by alias); 15 Dec 2010 18:26:13 -0000 Received: from xdsl-89-0-151-26.netcologne.de (EHLO localhost.localdomain) [89.0.151.26] by mail.gmx.net (mp039) with SMTP; 15 Dec 2010 19:26:13 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX18qzrR7qKwqStIbT1wjvTJmm05mrb5tUrwXW51oCF GTfGfAIIGgIhux Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PSw3I-00071O-GX; Wed, 15 Dec 2010 19:26:12 +0100 Date: Wed, 15 Dec 2010 19:26:12 +0100 From: Ralf Wildenhues To: Stefano Lattarini Subject: Re: Diagnose invalid primary/directory combinations Message-ID: <20101215182612.GE26556@gmx.de> Mail-Followup-To: Stefano Lattarini , Eric Blake , bug-automake@gnu.org References: <4D07D748.8060003@redhat.com> <4D07E784.9050104@redhat.com> <4D07ECD0.50003@redhat.com> <201012151227.43932.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012151227.43932.stefano.lattarini@gmail.com> Organization: Institute for Numerical Simulation, University of Bonn User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: bug-automake@gnu.org, Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -4.3 (----) Hello, and dropping automake@, * Stefano Lattarini wrote on Wed, Dec 15, 2010 at 12:27:43PM CET: > The list in `%standard_prefix' is used only for diagnosing invalid > primary/directory combinations, such as `data_PROGRAMS' or > 'lib_HEADERS'. For more info, see test `dirforbid.test', PR/294 at > , > and commit e87d851a863a7c321af8bc7b2b36aff5e072ff94 (05/03/2002). > > That said, you might have uncovered a bug in automake, because > something like: > doc_LIBRARIES = libfoo.a > should warn IMHO, but it currently doesn't. Agreed. Extending dirforbid.test and fixing fallout would be good. Thanks, Ralf From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 17 09:53:17 2010 Received: (at 7647) by debbugs.gnu.org; 17 Dec 2010 14:53:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTbgJ-0006qT-PE for submit@debbugs.gnu.org; Fri, 17 Dec 2010 09:53:17 -0500 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTbgG-0006qD-E8 for 7647@debbugs.gnu.org; Fri, 17 Dec 2010 09:53:14 -0500 Received: by wyf23 with SMTP id 23so723406wyf.3 for <7647@debbugs.gnu.org>; Fri, 17 Dec 2010 06:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :message-id; bh=GQ/7uFUCtDtqAKnhTeR/ARQ9jf/HDJ/xtOUKubyIpzE=; b=iNzGsZZ8CPZAMkE3SN5rfMnTdqjA1JOKbcp1uSmu748oegzoFEeA6RnMin1UuPMZgG S4LC11XTuR6LcuQYM5xtvSTujmPm66hk5/TjJvBXprhQE+h0rxJcKaRF+sa6pAgDF8al KfdLzgn8PHVAp/SONnnrvfKq12StQEknJiMrA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; b=bK+Mfo3h8YXPTg78wmxluDKbyY+dV1suEoBwZltHKZxMJzQR4TgJf9qA0Ib6jpIYwa uNM8Tu3KVuzv575LCNElXMV4RPL3gGWPrYYn+Ao0WzverE5rwK0odzZ8D1m2kpKHqMxq VuRxkyPLcATyal0EXzg6lH6WBIRbhfG3UG478= Received: by 10.227.134.206 with SMTP id k14mr614934wbt.5.1292597973645; Fri, 17 Dec 2010 06:59:33 -0800 (PST) Received: from bigio.localnet (host11-8-dynamic.13-87-r.retail.telecomitalia.it [87.13.8.11]) by mx.google.com with ESMTPS id q18sm308680wbe.23.2010.12.17.06.59.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Dec 2010 06:59:32 -0800 (PST) From: Stefano Lattarini To: 7647@debbugs.gnu.org, automake-patches@gnu.org Subject: Re: bug#7647: Diagnose invalid primary/directory combinations Date: Fri, 17 Dec 2010 15:59:10 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <201012151227.43932.stefano.lattarini@gmail.com> <20101215182612.GE26556@gmx.de> In-Reply-To: <20101215182612.GE26556@gmx.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_/q3CNmw21gksI3E" Message-Id: <201012171559.11698.stefano.lattarini@gmail.com> X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: 7647 Cc: Ralf Wildenhues , Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.8 (---) --Boundary-00=_/q3CNmw21gksI3E Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wednesday 15 December 2010, Ralf Wildenhues wrote: > Hello, and dropping automake@, > > * Stefano Lattarini wrote on Wed, Dec 15, 2010 at 12:27:43PM CET: > > The list in `%standard_prefix' is used only for diagnosing invalid > > primary/directory combinations, such as `data_PROGRAMS' or > > 'lib_HEADERS'. For more info, see test `dirforbid.test', PR/294 at > > , > > and commit e87d851a863a7c321af8bc7b2b36aff5e072ff94 (05/03/2002). > > > > That said, you might have uncovered a bug in automake, because > > something like: > > doc_LIBRARIES = libfoo.a > > should warn IMHO, but it currently doesn't. > > Agreed. Extending dirforbid.test and fixing fallout would be good. > I've also throw in a couple of related fixings and improvements, and (as you might have guessed I'd do ;-) greatly extended the relevant tests. Attached is what I'd like to push; it's based off of maint, but I'd like to push it to master only, as it might cause some backwards incompatibilities (IMHO very minor, but better play safe here). OK to apply? Regards, Stefano --Boundary-00=_/q3CNmw21gksI3E Content-Type: text/x-patch; charset="us-ascii"; name="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" =46rom 5d284ed4fccb649b3e968aa2700891afab001029 Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Thu, 16 Dec 2010 19:23:06 +0100 Subject: [PATCH] Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', `pkgincludedir' and `pkglibexecdir'. (handle_programs): List `pkglibexec', not `pkglib', among the prefixes valid for the `PROGRAMS' primary. (handle_data): List also `doc' among the prefixes valid for the `DATA' primary. This is required by automake's own build system. * tests/dirforbid.test: Test removed, superseded by ... * tests/primary-prefix-invalid-couples.test: ... this new test. * tests/primary-prefix-valid-couples.test: New test. * tests/primary-prefix-documented-valid.test: Likewise. * tests/primary-prefix-force-valid.test: Likewise. * tests/java3.test: Adjusted, and extended a bit. * tests/Makefile.am (TESTS): Updated. * NEWS: Updated. =46rom a report by Eric Blake. =2D-- ChangeLog | 21 +++ NEWS | 3 + automake.in | 16 +- tests/Makefile.am | 5 +- tests/Makefile.in | 5 +- tests/dirforbid.test | 38 ----- tests/java3.test | 14 ++- tests/primary-prefix-couples-documented-valid.test | 83 ++++++++++++ tests/primary-prefix-couples-force-valid.test | 87 ++++++++++++ tests/primary-prefix-invalid-couples.test | 142 ++++++++++++++++= ++++ tests/primary-prefix-valid-couples.test | 90 ++++++++++++ 11 files changed, 453 insertions(+), 51 deletions(-) delete mode 100755 tests/dirforbid.test create mode 100755 tests/primary-prefix-couples-documented-valid.test create mode 100755 tests/primary-prefix-couples-force-valid.test create mode 100755 tests/primary-prefix-invalid-couples.test create mode 100755 tests/primary-prefix-valid-couples.test diff --git a/ChangeLog b/ChangeLog index 2482ef1..a67b1d0 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2010-12-17 Stefano Lattarini + + Warnings about primary/prefix mismatch fixed and extended. + * automake.in (%standard_prefix): Add `doc' and `locale'. + Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', + `pkgincludedir' and `pkglibexecdir'. + (handle_programs): List `pkglibexec', not `pkglib', among the + prefixes valid for the `PROGRAMS' primary. + (handle_data): List also `doc' among the prefixes valid for + the `DATA' primary. This is required by automake's own build + system. + * tests/dirforbid.test: Test removed, superseded by ... + * tests/primary-prefix-invalid-couples.test: ... this new test. + * tests/primary-prefix-valid-couples.test: New test. + * tests/primary-prefix-couples-documented-valid.test: Likewise. + * tests/primary-prefix-couples-force-valid.test: Likewise. + * tests/java3.test: Adjusted, and extended a bit. + * tests/Makefile.am (TESTS): Updated. + * NEWS: Updated. + From a report by Eric Blake. + 2010-12-14 Stefano Lattarini =20 Improve tests on generated portions of configure help screen. diff --git a/NEWS b/NEWS index 6bc0d6f..2f98f90 100644 =2D-- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Bugs fixed in 1.11.0a: =20 * Long standing bugs: =20 + - Automake now warns about more primary/directory invalid combinations, + such as "doc_LIBRARIES" or "pkglib_PROGRAMS". + - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Pytho= n' even if the `--prefix' argument pointed outside of a system directory. AM_PATH_PYTHON has been fixed to ignore the value returned from python= 's diff --git a/automake.in b/automake.in index 8f3edde..c3bcfd5 100755 =2D-- a/automake.in +++ b/automake.in @@ -249,11 +249,11 @@ my @common_sometimes =3D # Standard directories from the GNU Coding Standards, and additional # pkg* directories from Automake. Stored in a hash for fast member check. my %standard_prefix =3D =2D map { $_ =3D> 1 } (qw(bin data dataroot dvi exec html include info =2D lib libexec lisp localstate man man1 man2 man3 =2D man4 man5 man6 man7 man8 man9 oldinclude pdf =2D pkgdatadir pkgincludedir pkglibdir pkglibexecdir =2D ps sbin sharedstate sysconf)); + map { $_ =3D> 1 } (qw(bin data dataroot doc dvi exec html include info + lib libexec lisp locale localstate man man1 man2 + man3 man4 man5 man6 man7 man8 man9 oldinclude pdf + pkgdata pkginclude pkglib pkglibexec ps sbin + sharedstate sysconf)); =20 # Copyright on generated Makefile.ins. my $gen_copyright =3D "\ @@ -2616,7 +2616,7 @@ sub handle_libtool sub handle_programs { my @proglist =3D &am_install_var ('progs', 'PROGRAMS', =2D 'bin', 'sbin', 'libexec', 'pkglib', + 'bin', 'sbin', 'libexec', 'pkglibexec', 'noinst', 'check'); return if ! @proglist; =20 @@ -3726,8 +3726,8 @@ sub handle_man_pages sub handle_data { &am_install_var ('-noextra', '-candist', 'data', 'DATA', =2D 'data', 'dataroot', 'dvi', 'html', 'pdf', 'ps', =2D 'sysconf', 'sharedstate', 'localstate', + 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf', + 'ps', 'sysconf', 'sharedstate', 'localstate', 'pkgdata', 'lisp', 'noinst', 'check'); } =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index dab04e3..5940ffe 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -270,7 +270,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -598,6 +597,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index de21f43..f70aee1 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -537,7 +537,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -865,6 +864,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/dirforbid.test b/tests/dirforbid.test deleted file mode 100755 index 3ab319d..0000000 =2D-- a/tests/dirforbid.test +++ /dev/null @@ -1,38 +0,0 @@ =2D#! /bin/sh =2D# Copyright (C) 2002, 2003 Free Software Foundation, Inc. =2D# =2D# This program is free software; you can redistribute it and/or modify =2D# it under the terms of the GNU General Public License as published by =2D# the Free Software Foundation; either version 2, or (at your option) =2D# any later version. =2D# =2D# This program is distributed in the hope that it will be useful, =2D# but WITHOUT ANY WARRANTY; without even the implied warranty of =2D# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =2D# GNU General Public License for more details. =2D# =2D# You should have received a copy of the GNU General Public License =2D# along with this program. If not, see . =2D =2D# All primaries cannot be used with all directories. =2D# Automake should flag them as errors. =2D# For PR/294 =2D =2D. ./defs || Exit 1 =2D =2Dset -e =2D =2Dcat >> configure.in <<'END' =2DAC_PROG_CC =2DEND =2D =2D# Try some (not all) disallowed variables =2Dfor i in data_PROGRAMS lib_HEADERS ; do =2D cat > Makefile.am << END =2D$i =3D foo =2DEND =2D $ACLOCAL =2D AUTOMAKE_fails -a =2D grep 'Makefile.am:1:.*directory' stderr =2Ddone =2D: diff --git a/tests/java3.test b/tests/java3.test index 7895769..41dbb71 100755 =2D-- a/tests/java3.test +++ b/tests/java3.test @@ -23,7 +23,7 @@ set -e =20 cat >> configure.in << 'END' =2DAM_CONDITIONAL([WHO_CARES], false) +AM_CONDITIONAL([WHO_CARES], [false]) AC_OUTPUT END =20 @@ -32,7 +32,7 @@ if WHO_CARES JAVA_FILES =3D MyClass1.java endif =20 =2Ddist_pkgdata_JAVA =3D $(JAVA_FILES) +dist_java_JAVA =3D $(JAVA_FILES) END =20 : >MyClass1.java @@ -40,5 +40,13 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE =2D./configure + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" +$MAKE install +test ! -d _inst +test ! -r _inst +$MAKE uninstall $MAKE distcheck + +: diff --git a/tests/primary-prefix-couples-documented-valid.test b/tests/pri= mary-prefix-couples-documented-valid.test new file mode 100755 index 0000000..893704f =2D-- /dev/null +++ b/tests/primary-prefix-couples-documented-valid.test @@ -0,0 +1,83 @@ +#! /bin/sh +# Copyright (C) 2010 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 that the "uncommon" prefix/primary combinations used in +# examples in the Automake manual do not cause obvious errors. +# Please keep this test in sync with the automake manual. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_CC +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +END + +# Fake libtool availability. +: > ltmain.sh +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +cat > Makefile.am <<'END' +xmldir =3D $(datadir)/xml +xml_DATA =3D file.xml + +data_DATA =3D file1 file2 file3 +data2dir =3D $(datadir) +data2_DATA =3D file4 file5 file6 + +aclocaldir =3D $(datadir)/aclocal +aclocal_DATA =3D mymacro.m4 myothermacro.m4 + +imagesdir =3D $(pkgdatadir)/images +soundsdir =3D $(pkgdatadir)/sounds +dist_images_DATA =3D images/vortex.pgm +dist_sounds_DATA =3D sounds/whirl.ogg + +lisp_DATA =3D file1.el file2.el + +javadir =3D $(datadir)/java +dist_java_JAVA =3D a.java b.java c.java + +pkgpython_PYTHON =3D foo.py + +pyexec_LTLIBRARIES =3D quaternion.la +quaternion_la_SOURCES =3D quaternion.c support.c support.h +quaternion_la_LDFLAGS =3D -avoid-version -module + +myexecbindir =3D /exec +myexecbin_PROGRAMS =3D foo + +foodir =3D $(prefix)/foo +barexecdir =3D $(prefix)/bar/binaries +foo_SCRIPTS =3D foo.sh +barexec_SCRIPTS =3D quux.pl +END + +$ACLOCAL + +# Both these two invocations are meant. +# They exercise both code paths concerning auxiliary files. +$AUTOMAKE -a +$AUTOMAKE + +: diff --git a/tests/primary-prefix-couples-force-valid.test b/tests/primary-= prefix-couples-force-valid.test new file mode 100755 index 0000000..02728b9 =2D-- /dev/null +++ b/tests/primary-prefix-couples-force-valid.test @@ -0,0 +1,87 @@ +#! /bin/sh +# Copyright (C) 2010 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 that a user who wants to use an invalid prefix/primary +# combination can do so with a proper workaround. +# For example, this: +# lib_PROGRAMS =3D foo +# is expected to cause an automake error, but this: +# bardir =3D $(libdir) +# bar_PROGRAMS =3D foo +# should work. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_OUTPUT +END + +cat > Makefile.am <<'END' +my_libdir =3D $(libdir) +my_lib_PROGRAMS =3D foo + +foodir =3D $(bindir) +foo_LIBRARIES =3D libquux.a + +xdir =3D $(libexecdir) +x_HEADERS =3D bar.h + +installcheck-local: test +.PHONY: test +test: + (cd '$(prefix)' && find .);: for debugging + ls -l '$(libdir)/foo' + test -f '$(libdir)/foo' + test -x '$(libdir)/foo' + ls -l '$(bindir)/libquux.a' + test -f '$(bindir)/libquux.a' + ls -l '$(libexecdir)/bar.h' + test -f '$(libexecdir)/bar.h' + test ! -x '$(libexecdir)/bar.h' +END + +cat > foo.c <<'END' +int main (void) +{ + return 0; +} +END + +cat > libquux.c <<'END' +int quux(void) +{ + return 1; +} +END + +: > bar.h + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" + +$MAKE install +$MAKE installcheck +$MAKE distcheck + +: diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-pref= ix-invalid-couples.test new file mode 100755 index 0000000..1a3d4e0 =2D-- /dev/null +++ b/tests/primary-prefix-invalid-couples.test @@ -0,0 +1,142 @@ +#! /bin/sh +# Copyright (C) 2010 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 . + +# Not all primaries/directories combinations are valid. +# Automake should flag them as errors. +# Originated from PR/294, extended later (following bug #7647) to +# cover more cases. +# See also test `primary-prefix-valid-couples.test'. + +. ./defs || Exit 1 + +set -e + +oIFS=3D$IFS # saved for later + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +$ACLOCAL + +# Please keep this list in sync with the list of "Directory Variables" +# in the GNU Coding Standards and with the list additional directory +# variables provided by autoconf and/or automake (pkgdatadir, pkglibdir, +# ...). See also the hash `%standard_prefix' in the automake script. +prefixes=3D'bin data dataroot doc dvi exec html include info lib libexec + lisp locale localstate man man1 man2 man3 man4 man5 man6 man7 + man8 man9 oldinclude pdf pkgdata pkginclude pkglib pkglibexec + ps sbin sharedstate sysconf' +# Please keep this list in sync with the list of primaries documented in +# the Automake manual (see the "The Uniform Naming Scheme" section). +primaries=3D'PROGRAMS LIBRARIES LTLIBRARIES LISP PYTHON JAVA SCRIPTS DATA + HEADERS MANS TEXINFOS' + +# Use files, not variables, to hold the list of all the possible +# prefix_PRIMARY couples and the list of those couples valid for +# automake, to avoid having unreadable very verbose traces. + +set +x # don't be overly verbose + +for prefix in $prefixes; do + for primary in $primaries; do + echo ${prefix}_${primary} + done +done >all.list + +for primary in $primaries; do + prefixes_ok=3D'' + case $primary in + LIBRARIES|LTLIBRARIES) + prefixes_ok=3D'lib pkglib' + ;; + PROGRAMS) + prefixes_ok=3D'bin sbin libexec pkglibexec' + ;; + SCRIPTS) + prefixes_ok=3D'bin sbin libexec pkgdata' + ;; + DATA) + prefixes_ok=3D'data dataroot pkgdata doc html dvi pdf ps + sysconf sharedstate localstate lisp' + ;; + HEADERS) + prefixes_ok=3D'include oldinclude pkginclude' + ;; + LISP) + prefixes_ok=3D'lisp' + ;; + PYTHON) + prefixes_ok=3D'python' + ;; + JAVA) + prefixes_ok=3D'java' + ;; + MANS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'man man1 man2 man3 man4 man5 man6 man7 man8 man9' + # but Automake currently fails on that, as it allows the MANS + # primary to be coupled to any prefix. + # See also Automake bug#7656. + # We should dig out how automake had come to behave this way, and + # if such a behaviour can be safely changed. + prefixes_ok=3D$prefixes + ;; + TEXINFOS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'info' + # but Automake currently fails on that, as it allows the TEXINFOS + # primary to be coupled to any prefix. + # See also Automake bug#7657. + # We should dig out how automake had come to behave this way, and + # if such a behaviour can be safely changed. + prefixes_ok=3D$prefixes + ;; + *) + echo "$me: internal error: unrecognized primary '$primary'" >&2 + Exit 99 + ;; + esac + for prefix in $prefixes_ok; do + echo ${prefix}_${primary} + done +done >allow.list + +set -x + +cat all.list +cat allow.list + +while read x; do + grep "^$x$" allow.list >/dev/null && continue + # To get the expected error message more in detail. + IFS=3D_; set $x; IFS=3D$oIFS + test $# -eq 2 || Exit 99 # sanity check + prefix=3D$1 + primary=3D$2 + errmsg_rx=3D".*${prefix}dir.* not a legitimate directory .*$primary" + # Now do the test for this prefix/primary combination. + echo "$x =3D foo" > Makefile.am + AUTOMAKE_fails -a + grep "^Makefile\\.am:1:$errmsg_rx" stderr +done . + +# Test for valid prefix/primary combinations. +# See also test `primary-prefix-invalid-couples.test'. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +# Fake libtool availability. +: > ltmain.sh +: > config.sub +: > config.guess +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +# Other required files. +echo '@setfilename foo' > foo.texi +: > texinfo.tex +: > py-compile +: > elisp-comp + +# Setup Makefile.am. + +: > Makefile.am + +for p in bin sbin libexec pkglibexec; do + echo "${p}_PROGRAMS =3D prog-$p" >> Makefile.am=20 +done=20 + +for p in lib pkglib; do + echo "${p}_LIBRARIES =3D libs-$p.a" >> Makefile.am + echo "${p}_LTLIBRARIES =3D libd-$p.la" >> Makefile.am +done + +for p in bin sbin libexec pkgdata; do + echo "${p}_SCRIPTS =3D $p.sh" >> Makefile.am +done + +for p in data dataroot pkgdata doc html dvi pdf ps sysconf \ + sharedstate localstate lisp; do + echo "${p}_DATA =3D $p.dat" >> Makefile.am +done + +for p in include oldinclude pkginclude; do + echo "${p}_HEADERS =3D $p.h" >> Makefile.am +done + +for p in man man1 man2 man3 man4 man5 man6 man7 man8 man9; do + echo "${p}_MANS =3D bar.$p" +done + =20 +echo "info_TEXINFOS =3D foo.texi" >> Makefile.am +echo "lisp_LISP =3D foo.el" >> Makefile.am +echo "python_PYTHON =3D foo.py" >> Makefile.am +echo "java_JAVA =3D foo.java" >> Makefile.am + +awk '{print NR ":" $0}' Makefile.am # for debugging + +# Go with the tests. + +$ACLOCAL +$AUTOMAKE + +: =2D-=20 1.7.1 --Boundary-00=_/q3CNmw21gksI3E-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 21 08:42:54 2010 Received: (at control) by debbugs.gnu.org; 21 Dec 2010 13:42:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PV2UP-0001Sx-Oh for submit@debbugs.gnu.org; Tue, 21 Dec 2010 08:42:54 -0500 Received: from mail-ww0-f42.google.com ([74.125.82.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PV2UN-0001Sm-O3 for control@debbugs.gnu.org; Tue, 21 Dec 2010 08:42:52 -0500 Received: by wwi17 with SMTP id 17so4057131wwi.3 for ; Tue, 21 Dec 2010 05:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:mime-version:content-type:content-transfer-encoding :message-id; bh=Aj8rJFEVy8VqGwXYrTbJWVGfWd5FsGlar08HfMSq81M=; b=a/+CDSCBx3Hn0MhdokIUhr5ZHJEWknzDdfD8d9trV8N+w7d+IgyoydrovXvCpPPdAi LW9I9HZo8aQd3hVQSKGtYt5f9oEaAzhC/l5NgONVMwY7cUnchd/TfshvzU5n0F/70QTH eAn0w+Oajh/eiOnJOfcboSJTGDHVCxupQbd0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; b=ROB/CrosmSMFQExEU4JH++jLUpM6oScymm2atpDDCoh7ET5z7bv64Z9o1Lo8McHlZF nrXAj9OkEqNNAlascVNMHgTlmfISaaLFLXtfsbCL3PLSxC4NcmwzWt/0smiPWdr/PN45 l+lz+Tl7nhCjadRR+FJfEcgI5uY/XWysuM0UM= Received: by 10.216.158.205 with SMTP id q55mr8760404wek.76.1292939363113; Tue, 21 Dec 2010 05:49:23 -0800 (PST) Received: from bigio.localnet (host81-43-dynamic.48-82-r.retail.telecomitalia.it [82.48.43.81]) by mx.google.com with ESMTPS id t5sm2501870wes.33.2010.12.21.05.49.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Dec 2010 05:49:22 -0800 (PST) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: automake bug#7647 Date: Tue, 21 Dec 2010 14:48:35 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201012211448.36311.stefano.lattarini@gmail.com> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: control Cc: Ralf Wildenhues X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.5 (---) tags 7647 patch thanks Hi Ralf. Since I've submitted a patch that IMVHO fixes the bug#7647: ``Diagnose invalid primary/directory combinations (was: Re: configmake module and automake 1.9.6'' I'm tagging it with the "patch" keyword. I'll close the report if and when the patch is applied. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 03 09:25:29 2011 Received: (at 7647) by debbugs.gnu.org; 3 Jan 2011 14:25:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZlLk-0005JY-4J for submit@debbugs.gnu.org; Mon, 03 Jan 2011 09:25:29 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZlLf-0005JJ-GU for 7647@debbugs.gnu.org; Mon, 03 Jan 2011 09:25:26 -0500 Received: by wwj40 with SMTP id 40so14915828wwj.15 for <7647@debbugs.gnu.org>; Mon, 03 Jan 2011 06:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:message-id :content-type; bh=w5TNUdNdSnccUPnSGImmMzx5uikJjbkI6GGezuemPZc=; b=T6UK3jHqUKjCuJ+fTeO7gUdaXPzsvs7hnyrjq6f/wBDbXLiq7Gujo2SvP2sRcl0yzF 0E/oBsWEijZlvDQpYe/l9X1mTLPGS0i5rrQyJ646h+XUKjdNurVe8pK3wzvBPN0bOuDy 8dIVx7eNiXdKKvF1pUjrgKviPQfaUvxr5Li5g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:message-id:content-type; b=fN3MUaaSd06MlGkjfBd31XNYC3QXXdcLLi5LONg8HgagVCbeYG3/cbZDEnaztvixkh HFk5WIuNfusjwlBJyY3m+PJJUaMW0cPrqpYZfRThEuojXX2NfySEAo2P2MRIykicUq4E 3aQ23q0hhEQKOjxJThPCxw93F5esfqXNoDdG8= Received: by 10.216.178.132 with SMTP id f4mr23286076wem.62.1294065149516; Mon, 03 Jan 2011 06:32:29 -0800 (PST) Received: from bigio.localnet (host234-51-dynamic.48-82-r.retail.telecomitalia.it [82.48.51.234]) by mx.google.com with ESMTPS id p49sm8794346wes.42.2011.01.03.06.32.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 06:32:28 -0800 (PST) From: Stefano Lattarini To: 7647@debbugs.gnu.org Subject: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended. (was: Re: bug#7647: Diagnose invalid primary/directory combinations) Date: Mon, 3 Jan 2011 15:32:00 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <20101215182612.GE26556@gmx.de> <201012171559.11698.stefano.lattarini@gmail.com> In-Reply-To: <201012171559.11698.stefano.lattarini@gmail.com> MIME-Version: 1.0 Message-Id: <201101031532.01052.stefano.lattarini@gmail.com> Content-Type: Multipart/Mixed; boundary="Boundary-00=_g3dINv/aDGGedlM" X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7647 Cc: Ralf Wildenhues , Eric Blake , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.6 (---) --Boundary-00=_g3dINv/aDGGedlM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: -*-*- Hello automakers. I've rebased the patch on latest maint, removed trailing whitespaces, fixed the copyright years, and extended the new testcase `primary-prefix-documented-valid.test' to cover the new examples added in the manual with commit `v1.11-261-gd5a408d' -- reference: Below is what I've squashed into the rebased patch; the whole amended patch is attached. OK for maint? Regards, Stefano -*-*- diff --git a/ChangeLog b/ChangeLog index 08403ef..625d580 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2010-12-17 Stefano Lattarini +2011-01-03 Stefano Lattarini Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. diff --git a/tests/primary-prefix-couples-documented-valid.test b/tests/primary-prefix-couples-documented-valid.test index 893704f..5bc851c 100755 --- a/tests/primary-prefix-couples-documented-valid.test +++ b/tests/primary-prefix-couples-documented-valid.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -25,6 +25,7 @@ set -e cat >> configure.in <<'END' AC_PROG_CC AC_PROG_CC +AC_PROG_RANLIB AC_PROG_LIBTOOL AM_PROG_GCJ AM_PATH_PYTHON @@ -65,12 +65,17 @@ quaternion_la_SOURCES = quaternion.c support.c support.h quaternion_la_LDFLAGS = -avoid-version -module myexecbindir = /exec -myexecbin_PROGRAMS = foo +myexecbin_PROGRAMS = zardoz foodir = $(prefix)/foo barexecdir = $(prefix)/bar/binaries foo_SCRIPTS = foo.sh barexec_SCRIPTS = quux.pl + +my_execbindir = $(pkglibdir) +my_doclibdir = $(docdir) +my_execbin_PROGRAMS = foo +my_doclib_LIBRARIES = libquux.a END $ACLOCAL diff --git a/tests/primary-prefix-couples-force-valid.test b/tests/primary-prefix-couples-force-valid.test index 02728b9..159f297 100755 --- a/tests/primary-prefix-couples-force-valid.test +++ b/tests/primary-prefix-couples-force-valid.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 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 diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-prefix-invalid-couples.test index 1a3d4e0..bd7a346 100755 --- a/tests/primary-prefix-invalid-couples.test +++ b/tests/primary-prefix-invalid-couples.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 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 diff --git a/tests/primary-prefix-valid-couples.test b/tests/primary-prefix-valid-couples.test index 8acb32e..b6b53dc 100755 --- a/tests/primary-prefix-valid-couples.test +++ b/tests/primary-prefix-valid-couples.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -50,8 +50,8 @@ echo '@setfilename foo' > foo.texi : > Makefile.am for p in bin sbin libexec pkglibexec; do - echo "${p}_PROGRAMS = prog-$p" >> Makefile.am -done + echo "${p}_PROGRAMS = prog-$p" >> Makefile.am +done for p in lib pkglib; do echo "${p}_LIBRARIES = libs-$p.a" >> Makefile.am @@ -74,7 +74,7 @@ done for p in man man1 man2 man3 man4 man5 man6 man7 man8 man9; do echo "${p}_MANS = bar.$p" done - + echo "info_TEXINFOS = foo.texi" >> Makefile.am echo "lisp_LISP = foo.el" >> Makefile.am echo "python_PYTHON = foo.py" >> Makefile.am --Boundary-00=_g3dINv/aDGGedlM Content-Type: text/x-patch; charset="us-ascii"; name="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" =46rom 5ef86e55c8a500798b86d536f9daf8aeaef540b3 Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Thu, 16 Dec 2010 19:23:06 +0100 Subject: [PATCH] Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', `pkgincludedir' and `pkglibexecdir'. (handle_programs): List `pkglibexec', not `pkglib', among the prefixes valid for the `PROGRAMS' primary. (handle_data): List also `doc' among the prefixes valid for the `DATA' primary. This is required by automake's own build system. * tests/dirforbid.test: Test removed, superseded by ... * tests/primary-prefix-invalid-couples.test: ... this new test. * tests/primary-prefix-valid-couples.test: New test. * tests/primary-prefix-documented-valid.test: Likewise. * tests/primary-prefix-force-valid.test: Likewise. * tests/java3.test: Adjusted, and extended a bit. * tests/Makefile.am (TESTS): Updated. * NEWS: Updated. =46rom a report by Eric Blake. =2D-- ChangeLog | 21 +++ NEWS | 3 + automake.in | 16 +- tests/Makefile.am | 5 +- tests/Makefile.in | 5 +- tests/dirforbid.test | 38 ----- tests/java3.test | 14 ++- tests/primary-prefix-couples-documented-valid.test | 89 ++++++++++++ tests/primary-prefix-couples-force-valid.test | 87 ++++++++++++ tests/primary-prefix-invalid-couples.test | 142 ++++++++++++++++= ++++ tests/primary-prefix-valid-couples.test | 90 ++++++++++++ 11 files changed, 459 insertions(+), 51 deletions(-) delete mode 100755 tests/dirforbid.test create mode 100755 tests/primary-prefix-couples-documented-valid.test create mode 100755 tests/primary-prefix-couples-force-valid.test create mode 100755 tests/primary-prefix-invalid-couples.test create mode 100755 tests/primary-prefix-valid-couples.test diff --git a/ChangeLog b/ChangeLog index bf44677..625d580 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2011-01-03 Stefano Lattarini + + Warnings about primary/prefix mismatch fixed and extended. + * automake.in (%standard_prefix): Add `doc' and `locale'. + Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', + `pkgincludedir' and `pkglibexecdir'. + (handle_programs): List `pkglibexec', not `pkglib', among the + prefixes valid for the `PROGRAMS' primary. + (handle_data): List also `doc' among the prefixes valid for + the `DATA' primary. This is required by automake's own build + system. + * tests/dirforbid.test: Test removed, superseded by ... + * tests/primary-prefix-invalid-couples.test: ... this new test. + * tests/primary-prefix-valid-couples.test: New test. + * tests/primary-prefix-couples-documented-valid.test: Likewise. + * tests/primary-prefix-couples-force-valid.test: Likewise. + * tests/java3.test: Adjusted, and extended a bit. + * tests/Makefile.am (TESTS): Updated. + * NEWS: Updated. + From a report by Eric Blake. + 2011-01-02 Stefano Lattarini =20 * NEWS: Fix typo (forgotten word). diff --git a/NEWS b/NEWS index eb31266..b147e48 100644 =2D-- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Bugs fixed in 1.11.0a: =20 * Long standing bugs: =20 + - Automake now warns about more primary/directory invalid combinations, + such as "doc_LIBRARIES" or "pkglib_PROGRAMS". + - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Pytho= n' even if the `--prefix' argument pointed outside of a system directory. AM_PATH_PYTHON has been fixed to ignore the value returned from python= 's diff --git a/automake.in b/automake.in index fa110a5..9879b93 100755 =2D-- a/automake.in +++ b/automake.in @@ -249,11 +249,11 @@ my @common_sometimes =3D # Standard directories from the GNU Coding Standards, and additional # pkg* directories from Automake. Stored in a hash for fast member check. my %standard_prefix =3D =2D map { $_ =3D> 1 } (qw(bin data dataroot dvi exec html include info =2D lib libexec lisp localstate man man1 man2 man3 =2D man4 man5 man6 man7 man8 man9 oldinclude pdf =2D pkgdatadir pkgincludedir pkglibdir pkglibexecdir =2D ps sbin sharedstate sysconf)); + map { $_ =3D> 1 } (qw(bin data dataroot doc dvi exec html include info + lib libexec lisp locale localstate man man1 man2 + man3 man4 man5 man6 man7 man8 man9 oldinclude pdf + pkgdata pkginclude pkglib pkglibexec ps sbin + sharedstate sysconf)); =20 # Copyright on generated Makefile.ins. my $gen_copyright =3D "\ @@ -2626,7 +2626,7 @@ sub handle_libtool sub handle_programs { my @proglist =3D &am_install_var ('progs', 'PROGRAMS', =2D 'bin', 'sbin', 'libexec', 'pkglib', + 'bin', 'sbin', 'libexec', 'pkglibexec', 'noinst', 'check'); return if ! @proglist; =20 @@ -3736,8 +3736,8 @@ sub handle_man_pages sub handle_data { &am_install_var ('-noextra', '-candist', 'data', 'DATA', =2D 'data', 'dataroot', 'dvi', 'html', 'pdf', 'ps', =2D 'sysconf', 'sharedstate', 'localstate', + 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf', + 'ps', 'sysconf', 'sharedstate', 'localstate', 'pkgdata', 'lisp', 'noinst', 'check'); } =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index 8842be3..00f8c9f 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -272,7 +272,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -600,6 +599,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3bc4415..d6302b4 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -539,7 +539,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -867,6 +866,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/dirforbid.test b/tests/dirforbid.test deleted file mode 100755 index 3ab319d..0000000 =2D-- a/tests/dirforbid.test +++ /dev/null @@ -1,38 +0,0 @@ =2D#! /bin/sh =2D# Copyright (C) 2002, 2003 Free Software Foundation, Inc. =2D# =2D# This program is free software; you can redistribute it and/or modify =2D# it under the terms of the GNU General Public License as published by =2D# the Free Software Foundation; either version 2, or (at your option) =2D# any later version. =2D# =2D# This program is distributed in the hope that it will be useful, =2D# but WITHOUT ANY WARRANTY; without even the implied warranty of =2D# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =2D# GNU General Public License for more details. =2D# =2D# You should have received a copy of the GNU General Public License =2D# along with this program. If not, see . =2D =2D# All primaries cannot be used with all directories. =2D# Automake should flag them as errors. =2D# For PR/294 =2D =2D. ./defs || Exit 1 =2D =2Dset -e =2D =2Dcat >> configure.in <<'END' =2DAC_PROG_CC =2DEND =2D =2D# Try some (not all) disallowed variables =2Dfor i in data_PROGRAMS lib_HEADERS ; do =2D cat > Makefile.am << END =2D$i =3D foo =2DEND =2D $ACLOCAL =2D AUTOMAKE_fails -a =2D grep 'Makefile.am:1:.*directory' stderr =2Ddone =2D: diff --git a/tests/java3.test b/tests/java3.test index 7895769..41dbb71 100755 =2D-- a/tests/java3.test +++ b/tests/java3.test @@ -23,7 +23,7 @@ set -e =20 cat >> configure.in << 'END' =2DAM_CONDITIONAL([WHO_CARES], false) +AM_CONDITIONAL([WHO_CARES], [false]) AC_OUTPUT END =20 @@ -32,7 +32,7 @@ if WHO_CARES JAVA_FILES =3D MyClass1.java endif =20 =2Ddist_pkgdata_JAVA =3D $(JAVA_FILES) +dist_java_JAVA =3D $(JAVA_FILES) END =20 : >MyClass1.java @@ -40,5 +40,13 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE =2D./configure + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" +$MAKE install +test ! -d _inst +test ! -r _inst +$MAKE uninstall $MAKE distcheck + +: diff --git a/tests/primary-prefix-couples-documented-valid.test b/tests/pri= mary-prefix-couples-documented-valid.test new file mode 100755 index 0000000..c52e40f =2D-- /dev/null +++ b/tests/primary-prefix-couples-documented-valid.test @@ -0,0 +1,89 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 that the "uncommon" prefix/primary combinations used in +# examples in the Automake manual do not cause obvious errors. +# Please keep this test in sync with the automake manual. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +END + +# Fake libtool availability. +: > ltmain.sh +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +cat > Makefile.am <<'END' +xmldir =3D $(datadir)/xml +xml_DATA =3D file.xml + +data_DATA =3D file1 file2 file3 +data2dir =3D $(datadir) +data2_DATA =3D file4 file5 file6 + +aclocaldir =3D $(datadir)/aclocal +aclocal_DATA =3D mymacro.m4 myothermacro.m4 + +imagesdir =3D $(pkgdatadir)/images +soundsdir =3D $(pkgdatadir)/sounds +dist_images_DATA =3D images/vortex.pgm +dist_sounds_DATA =3D sounds/whirl.ogg + +lisp_DATA =3D file1.el file2.el + +javadir =3D $(datadir)/java +dist_java_JAVA =3D a.java b.java c.java + +pkgpython_PYTHON =3D foo.py + +pyexec_LTLIBRARIES =3D quaternion.la +quaternion_la_SOURCES =3D quaternion.c support.c support.h +quaternion_la_LDFLAGS =3D -avoid-version -module + +myexecbindir =3D /exec +myexecbin_PROGRAMS =3D zardoz + +foodir =3D $(prefix)/foo +barexecdir =3D $(prefix)/bar/binaries +foo_SCRIPTS =3D foo.sh +barexec_SCRIPTS =3D quux.pl + +my_execbindir =3D $(pkglibdir) +my_doclibdir =3D $(docdir) +my_execbin_PROGRAMS =3D foo +my_doclib_LIBRARIES =3D libquux.a +END + +$ACLOCAL + +# Both these two invocations are meant. +# They exercise both code paths concerning auxiliary files. +$AUTOMAKE -a +$AUTOMAKE + +: diff --git a/tests/primary-prefix-couples-force-valid.test b/tests/primary-= prefix-couples-force-valid.test new file mode 100755 index 0000000..159f297 =2D-- /dev/null +++ b/tests/primary-prefix-couples-force-valid.test @@ -0,0 +1,87 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 that a user who wants to use an invalid prefix/primary +# combination can do so with a proper workaround. +# For example, this: +# lib_PROGRAMS =3D foo +# is expected to cause an automake error, but this: +# bardir =3D $(libdir) +# bar_PROGRAMS =3D foo +# should work. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_OUTPUT +END + +cat > Makefile.am <<'END' +my_libdir =3D $(libdir) +my_lib_PROGRAMS =3D foo + +foodir =3D $(bindir) +foo_LIBRARIES =3D libquux.a + +xdir =3D $(libexecdir) +x_HEADERS =3D bar.h + +installcheck-local: test +.PHONY: test +test: + (cd '$(prefix)' && find .);: for debugging + ls -l '$(libdir)/foo' + test -f '$(libdir)/foo' + test -x '$(libdir)/foo' + ls -l '$(bindir)/libquux.a' + test -f '$(bindir)/libquux.a' + ls -l '$(libexecdir)/bar.h' + test -f '$(libexecdir)/bar.h' + test ! -x '$(libexecdir)/bar.h' +END + +cat > foo.c <<'END' +int main (void) +{ + return 0; +} +END + +cat > libquux.c <<'END' +int quux(void) +{ + return 1; +} +END + +: > bar.h + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" + +$MAKE install +$MAKE installcheck +$MAKE distcheck + +: diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-pref= ix-invalid-couples.test new file mode 100755 index 0000000..bd7a346 =2D-- /dev/null +++ b/tests/primary-prefix-invalid-couples.test @@ -0,0 +1,142 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 . + +# Not all primaries/directories combinations are valid. +# Automake should flag them as errors. +# Originated from PR/294, extended later (following bug #7647) to +# cover more cases. +# See also test `primary-prefix-valid-couples.test'. + +. ./defs || Exit 1 + +set -e + +oIFS=3D$IFS # saved for later + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +$ACLOCAL + +# Please keep this list in sync with the list of "Directory Variables" +# in the GNU Coding Standards and with the list additional directory +# variables provided by autoconf and/or automake (pkgdatadir, pkglibdir, +# ...). See also the hash `%standard_prefix' in the automake script. +prefixes=3D'bin data dataroot doc dvi exec html include info lib libexec + lisp locale localstate man man1 man2 man3 man4 man5 man6 man7 + man8 man9 oldinclude pdf pkgdata pkginclude pkglib pkglibexec + ps sbin sharedstate sysconf' +# Please keep this list in sync with the list of primaries documented in +# the Automake manual (see the "The Uniform Naming Scheme" section). +primaries=3D'PROGRAMS LIBRARIES LTLIBRARIES LISP PYTHON JAVA SCRIPTS DATA + HEADERS MANS TEXINFOS' + +# Use files, not variables, to hold the list of all the possible +# prefix_PRIMARY couples and the list of those couples valid for +# automake, to avoid having unreadable very verbose traces. + +set +x # don't be overly verbose + +for prefix in $prefixes; do + for primary in $primaries; do + echo ${prefix}_${primary} + done +done >all.list + +for primary in $primaries; do + prefixes_ok=3D'' + case $primary in + LIBRARIES|LTLIBRARIES) + prefixes_ok=3D'lib pkglib' + ;; + PROGRAMS) + prefixes_ok=3D'bin sbin libexec pkglibexec' + ;; + SCRIPTS) + prefixes_ok=3D'bin sbin libexec pkgdata' + ;; + DATA) + prefixes_ok=3D'data dataroot pkgdata doc html dvi pdf ps + sysconf sharedstate localstate lisp' + ;; + HEADERS) + prefixes_ok=3D'include oldinclude pkginclude' + ;; + LISP) + prefixes_ok=3D'lisp' + ;; + PYTHON) + prefixes_ok=3D'python' + ;; + JAVA) + prefixes_ok=3D'java' + ;; + MANS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'man man1 man2 man3 man4 man5 man6 man7 man8 man9' + # but Automake currently fails on that, as it allows the MANS + # primary to be coupled to any prefix. + # See also Automake bug#7656. + # We should dig out how automake had come to behave this way, and + # if such a behaviour can be safely changed. + prefixes_ok=3D$prefixes + ;; + TEXINFOS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'info' + # but Automake currently fails on that, as it allows the TEXINFOS + # primary to be coupled to any prefix. + # See also Automake bug#7657. + # We should dig out how automake had come to behave this way, and + # if such a behaviour can be safely changed. + prefixes_ok=3D$prefixes + ;; + *) + echo "$me: internal error: unrecognized primary '$primary'" >&2 + Exit 99 + ;; + esac + for prefix in $prefixes_ok; do + echo ${prefix}_${primary} + done +done >allow.list + +set -x + +cat all.list +cat allow.list + +while read x; do + grep "^$x$" allow.list >/dev/null && continue + # To get the expected error message more in detail. + IFS=3D_; set $x; IFS=3D$oIFS + test $# -eq 2 || Exit 99 # sanity check + prefix=3D$1 + primary=3D$2 + errmsg_rx=3D".*${prefix}dir.* not a legitimate directory .*$primary" + # Now do the test for this prefix/primary combination. + echo "$x =3D foo" > Makefile.am + AUTOMAKE_fails -a + grep "^Makefile\\.am:1:$errmsg_rx" stderr +done . + +# Test for valid prefix/primary combinations. +# See also test `primary-prefix-invalid-couples.test'. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +# Fake libtool availability. +: > ltmain.sh +: > config.sub +: > config.guess +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +# Other required files. +echo '@setfilename foo' > foo.texi +: > texinfo.tex +: > py-compile +: > elisp-comp + +# Setup Makefile.am. + +: > Makefile.am + +for p in bin sbin libexec pkglibexec; do + echo "${p}_PROGRAMS =3D prog-$p" >> Makefile.am +done + +for p in lib pkglib; do + echo "${p}_LIBRARIES =3D libs-$p.a" >> Makefile.am + echo "${p}_LTLIBRARIES =3D libd-$p.la" >> Makefile.am +done + +for p in bin sbin libexec pkgdata; do + echo "${p}_SCRIPTS =3D $p.sh" >> Makefile.am +done + +for p in data dataroot pkgdata doc html dvi pdf ps sysconf \ + sharedstate localstate lisp; do + echo "${p}_DATA =3D $p.dat" >> Makefile.am +done + +for p in include oldinclude pkginclude; do + echo "${p}_HEADERS =3D $p.h" >> Makefile.am +done + +for p in man man1 man2 man3 man4 man5 man6 man7 man8 man9; do + echo "${p}_MANS =3D bar.$p" +done + +echo "info_TEXINFOS =3D foo.texi" >> Makefile.am +echo "lisp_LISP =3D foo.el" >> Makefile.am +echo "python_PYTHON =3D foo.py" >> Makefile.am +echo "java_JAVA =3D foo.java" >> Makefile.am + +awk '{print NR ":" $0}' Makefile.am # for debugging + +# Go with the tests. + +$ACLOCAL +$AUTOMAKE + +: =2D-=20 1.7.2.3 --Boundary-00=_g3dINv/aDGGedlM-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 27 15:28:39 2011 Received: (at 7647) by debbugs.gnu.org; 27 Jan 2011 20:28:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiYSL-0006C2-U5 for submit@debbugs.gnu.org; Thu, 27 Jan 2011 15:28:38 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiYSI-0006Bo-LZ for 7647@debbugs.gnu.org; Thu, 27 Jan 2011 15:28:36 -0500 Received: by wwj40 with SMTP id 40so2652009wwj.15 for <7647@debbugs.gnu.org>; Thu, 27 Jan 2011 12:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:message-id; bh=nYYXENZnir3YKQ05INRtCFc9ffCgo+jZKhcr9XvX1Mc=; b=N50f7xDHAJpgkaTeqCx2zylQxtBtYaP4936P8hy88aPO8FnP6rVF3ZLtVabR8Vx+Zu DPABMaunCjPxpzS8xKu6Flk2PxzFWGYrpHhDk2rsZiEjsDTKz2VYYVb37s2QaAdMbij1 /1Vmi1DqNVPnbuZ6iOvHwXGZ6NwR4oYrrtrLs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; b=nG4RIdNzq12z/9XsqUJizteahC1uejhO4NSEno9JnXATnXXqdT1OscRYBt61Q2SNLI j8wDMMxBRC8uubqLgp/KNwzCx/t1psXAuTXcE0gyldy0b5Uovf3ptXHmUOgeoq0nyE+0 fzKA5O08iaFH4V3nIrsEYQxk1qPkY/0e0dNVI= Received: by 10.227.142.145 with SMTP id q17mr1666837wbu.126.1296160604741; Thu, 27 Jan 2011 12:36:44 -0800 (PST) Received: from bigio.localnet (host54-100-dynamic.1-79-r.retail.telecomitalia.it [79.1.100.54]) by mx.google.com with ESMTPS id f35sm12097943wbf.20.2011.01.27.12.36.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 Jan 2011 12:36:42 -0800 (PST) From: Stefano Lattarini To: 7647@debbugs.gnu.org Subject: Re: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended. (was: Re: bug#7647: Diagnose invalid primary/directory combinations) Date: Thu, 27 Jan 2011 21:36:29 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <201012171559.11698.stefano.lattarini@gmail.com> <201101031532.01052.stefano.lattarini@gmail.com> In-Reply-To: <201101031532.01052.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_OddQN0r69pkEcEq" Message-Id: <201101272136.30194.stefano.lattarini@gmail.com> X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 7647 Cc: Ralf Wildenhues , Eric Blake , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.9 (---) --Boundary-00=_OddQN0r69pkEcEq Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Ping on this? References: I've rebased the patch on latest maint, and improved the comments in the testcase `primary-prefix-documented-valid.test'. Below is what I've squashed in; the updated patch is attached. So... OK for maint? Regards, Stefano -*-*-*- diff --git a/ChangeLog b/ChangeLog index 625d580..5e1dcd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2011-01-03 Stefano Lattarini +2011-01-27 Stefano Lattarini Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-prefix-invalid-couples.test index bd7a346..a8f61a9 100755 --- a/tests/primary-prefix-invalid-couples.test +++ b/tests/primary-prefix-invalid-couples.test @@ -103,11 +103,12 @@ for primary in $primaries; do TEXINFOS) # FIXME: Here we'd like to have: # prefixes_ok='info' - # but Automake currently fails on that, as it allows the TEXINFOS - # primary to be coupled to any prefix. + # but Automake currently fails on that, as it allows the use of + # `foo_TEXINFOS' to declare extra Texinfo sources for the `foo' + # Texinfo manual, as in e.g.: + # info_TEXINFOS = foo.texi + # foo_TEXINFOS = gpl.texi # See also Automake bug#7657. - # We should dig out how automake had come to behave this way, and - # if such a behaviour can be safely changed. prefixes_ok=$prefixes ;; *) --Boundary-00=_OddQN0r69pkEcEq Content-Type: text/x-patch; charset="us-ascii"; name="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-Warnings-about-primary-prefix-mismatch-fixed-and-ext.patch" =46rom e73827393f4ca2bc0b126bf9c31ec55064b0b6af Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Thu, 16 Dec 2010 19:23:06 +0100 Subject: [PATCH] Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', `pkgincludedir' and `pkglibexecdir'. (handle_programs): List `pkglibexec', not `pkglib', among the prefixes valid for the `PROGRAMS' primary. (handle_data): List also `doc' among the prefixes valid for the `DATA' primary. This is required by automake's own build system. * tests/dirforbid.test: Test removed, superseded by ... * tests/primary-prefix-invalid-couples.test: ... this new test. * tests/primary-prefix-valid-couples.test: New test. * tests/primary-prefix-documented-valid.test: Likewise. * tests/primary-prefix-force-valid.test: Likewise. * tests/java3.test: Adjusted, and extended a bit. * tests/Makefile.am (TESTS): Updated. * NEWS: Updated. =46rom a report by Eric Blake. =2D-- ChangeLog | 21 +++ NEWS | 3 + automake.in | 16 +- tests/Makefile.am | 5 +- tests/Makefile.in | 5 +- tests/dirforbid.test | 38 ----- tests/java3.test | 14 ++- tests/primary-prefix-couples-documented-valid.test | 89 ++++++++++++ tests/primary-prefix-couples-force-valid.test | 87 ++++++++++++ tests/primary-prefix-invalid-couples.test | 143 ++++++++++++++++= ++++ tests/primary-prefix-valid-couples.test | 90 ++++++++++++ 11 files changed, 460 insertions(+), 51 deletions(-) delete mode 100755 tests/dirforbid.test create mode 100755 tests/primary-prefix-couples-documented-valid.test create mode 100755 tests/primary-prefix-couples-force-valid.test create mode 100755 tests/primary-prefix-invalid-couples.test create mode 100755 tests/primary-prefix-valid-couples.test diff --git a/ChangeLog b/ChangeLog index bed0418..615a72d 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2011-01-27 Stefano Lattarini + + Warnings about primary/prefix mismatch fixed and extended. + * automake.in (%standard_prefix): Add `doc' and `locale'. + Rename `pkgdatadir' to `pkgdata'. Similarly for`pkglibdir', + `pkgincludedir' and `pkglibexecdir'. + (handle_programs): List `pkglibexec', not `pkglib', among the + prefixes valid for the `PROGRAMS' primary. + (handle_data): List also `doc' among the prefixes valid for + the `DATA' primary. This is required by automake's own build + system. + * tests/dirforbid.test: Test removed, superseded by ... + * tests/primary-prefix-invalid-couples.test: ... this new test. + * tests/primary-prefix-valid-couples.test: New test. + * tests/primary-prefix-couples-documented-valid.test: Likewise. + * tests/primary-prefix-couples-force-valid.test: Likewise. + * tests/java3.test: Adjusted, and extended a bit. + * tests/Makefile.am (TESTS): Updated. + * NEWS: Updated. + From a report by Eric Blake. + 2011-01-24 Stefano Lattarini =20 docs: color-tests issues with parallel make diff --git a/NEWS b/NEWS index b5cb6e9..703aeb2 100644 =2D-- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Bugs fixed in 1.11.0a: =20 * Long standing bugs: =20 + - Automake now warns about more primary/directory invalid combinations, + such as "doc_LIBRARIES" or "pkglib_PROGRAMS". + - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Pytho= n' even if the `--prefix' argument pointed outside of a system directory. AM_PATH_PYTHON has been fixed to ignore the value returned from python= 's diff --git a/automake.in b/automake.in index d56fbf7..c9ba0f1 100755 =2D-- a/automake.in +++ b/automake.in @@ -249,11 +249,11 @@ my @common_sometimes =3D # Standard directories from the GNU Coding Standards, and additional # pkg* directories from Automake. Stored in a hash for fast member check. my %standard_prefix =3D =2D map { $_ =3D> 1 } (qw(bin data dataroot dvi exec html include info =2D lib libexec lisp localstate man man1 man2 man3 =2D man4 man5 man6 man7 man8 man9 oldinclude pdf =2D pkgdatadir pkgincludedir pkglibdir pkglibexecdir =2D ps sbin sharedstate sysconf)); + map { $_ =3D> 1 } (qw(bin data dataroot doc dvi exec html include info + lib libexec lisp locale localstate man man1 man2 + man3 man4 man5 man6 man7 man8 man9 oldinclude pdf + pkgdata pkginclude pkglib pkglibexec ps sbin + sharedstate sysconf)); =20 # Copyright on generated Makefile.ins. my $gen_copyright =3D "\ @@ -2627,7 +2627,7 @@ sub handle_libtool sub handle_programs { my @proglist =3D &am_install_var ('progs', 'PROGRAMS', =2D 'bin', 'sbin', 'libexec', 'pkglib', + 'bin', 'sbin', 'libexec', 'pkglibexec', 'noinst', 'check'); return if ! @proglist; =20 @@ -3737,8 +3737,8 @@ sub handle_man_pages sub handle_data { &am_install_var ('-noextra', '-candist', 'data', 'DATA', =2D 'data', 'dataroot', 'dvi', 'html', 'pdf', 'ps', =2D 'sysconf', 'sharedstate', 'localstate', + 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf', + 'ps', 'sysconf', 'sharedstate', 'localstate', 'pkgdata', 'lisp', 'noinst', 'check'); } =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index 78bacf2..d43ad48 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -281,7 +281,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -610,6 +609,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 18cb337..d925805 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -548,7 +548,6 @@ depend4.test \ depend5.test \ depend6.test \ destdir.test \ =2Ddirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ @@ -877,6 +876,10 @@ prefix.test \ primary.test \ primary2.test \ primary3.test \ +primary-prefix-invalid-couples.test \ +primary-prefix-valid-couples.test \ +primary-prefix-couples-force-valid.test \ +primary-prefix-couples-documented-valid.test \ proginst.test \ python.test \ python2.test \ diff --git a/tests/dirforbid.test b/tests/dirforbid.test deleted file mode 100755 index 3ab319d..0000000 =2D-- a/tests/dirforbid.test +++ /dev/null @@ -1,38 +0,0 @@ =2D#! /bin/sh =2D# Copyright (C) 2002, 2003 Free Software Foundation, Inc. =2D# =2D# This program is free software; you can redistribute it and/or modify =2D# it under the terms of the GNU General Public License as published by =2D# the Free Software Foundation; either version 2, or (at your option) =2D# any later version. =2D# =2D# This program is distributed in the hope that it will be useful, =2D# but WITHOUT ANY WARRANTY; without even the implied warranty of =2D# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =2D# GNU General Public License for more details. =2D# =2D# You should have received a copy of the GNU General Public License =2D# along with this program. If not, see . =2D =2D# All primaries cannot be used with all directories. =2D# Automake should flag them as errors. =2D# For PR/294 =2D =2D. ./defs || Exit 1 =2D =2Dset -e =2D =2Dcat >> configure.in <<'END' =2DAC_PROG_CC =2DEND =2D =2D# Try some (not all) disallowed variables =2Dfor i in data_PROGRAMS lib_HEADERS ; do =2D cat > Makefile.am << END =2D$i =3D foo =2DEND =2D $ACLOCAL =2D AUTOMAKE_fails -a =2D grep 'Makefile.am:1:.*directory' stderr =2Ddone =2D: diff --git a/tests/java3.test b/tests/java3.test index 7895769..41dbb71 100755 =2D-- a/tests/java3.test +++ b/tests/java3.test @@ -23,7 +23,7 @@ set -e =20 cat >> configure.in << 'END' =2DAM_CONDITIONAL([WHO_CARES], false) +AM_CONDITIONAL([WHO_CARES], [false]) AC_OUTPUT END =20 @@ -32,7 +32,7 @@ if WHO_CARES JAVA_FILES =3D MyClass1.java endif =20 =2Ddist_pkgdata_JAVA =3D $(JAVA_FILES) +dist_java_JAVA =3D $(JAVA_FILES) END =20 : >MyClass1.java @@ -40,5 +40,13 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE =2D./configure + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" +$MAKE install +test ! -d _inst +test ! -r _inst +$MAKE uninstall $MAKE distcheck + +: diff --git a/tests/primary-prefix-couples-documented-valid.test b/tests/pri= mary-prefix-couples-documented-valid.test new file mode 100755 index 0000000..c52e40f =2D-- /dev/null +++ b/tests/primary-prefix-couples-documented-valid.test @@ -0,0 +1,89 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 that the "uncommon" prefix/primary combinations used in +# examples in the Automake manual do not cause obvious errors. +# Please keep this test in sync with the automake manual. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +END + +# Fake libtool availability. +: > ltmain.sh +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +cat > Makefile.am <<'END' +xmldir =3D $(datadir)/xml +xml_DATA =3D file.xml + +data_DATA =3D file1 file2 file3 +data2dir =3D $(datadir) +data2_DATA =3D file4 file5 file6 + +aclocaldir =3D $(datadir)/aclocal +aclocal_DATA =3D mymacro.m4 myothermacro.m4 + +imagesdir =3D $(pkgdatadir)/images +soundsdir =3D $(pkgdatadir)/sounds +dist_images_DATA =3D images/vortex.pgm +dist_sounds_DATA =3D sounds/whirl.ogg + +lisp_DATA =3D file1.el file2.el + +javadir =3D $(datadir)/java +dist_java_JAVA =3D a.java b.java c.java + +pkgpython_PYTHON =3D foo.py + +pyexec_LTLIBRARIES =3D quaternion.la +quaternion_la_SOURCES =3D quaternion.c support.c support.h +quaternion_la_LDFLAGS =3D -avoid-version -module + +myexecbindir =3D /exec +myexecbin_PROGRAMS =3D zardoz + +foodir =3D $(prefix)/foo +barexecdir =3D $(prefix)/bar/binaries +foo_SCRIPTS =3D foo.sh +barexec_SCRIPTS =3D quux.pl + +my_execbindir =3D $(pkglibdir) +my_doclibdir =3D $(docdir) +my_execbin_PROGRAMS =3D foo +my_doclib_LIBRARIES =3D libquux.a +END + +$ACLOCAL + +# Both these two invocations are meant. +# They exercise both code paths concerning auxiliary files. +$AUTOMAKE -a +$AUTOMAKE + +: diff --git a/tests/primary-prefix-couples-force-valid.test b/tests/primary-= prefix-couples-force-valid.test new file mode 100755 index 0000000..159f297 =2D-- /dev/null +++ b/tests/primary-prefix-couples-force-valid.test @@ -0,0 +1,87 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 that a user who wants to use an invalid prefix/primary +# combination can do so with a proper workaround. +# For example, this: +# lib_PROGRAMS =3D foo +# is expected to cause an automake error, but this: +# bardir =3D $(libdir) +# bar_PROGRAMS =3D foo +# should work. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_OUTPUT +END + +cat > Makefile.am <<'END' +my_libdir =3D $(libdir) +my_lib_PROGRAMS =3D foo + +foodir =3D $(bindir) +foo_LIBRARIES =3D libquux.a + +xdir =3D $(libexecdir) +x_HEADERS =3D bar.h + +installcheck-local: test +.PHONY: test +test: + (cd '$(prefix)' && find .);: for debugging + ls -l '$(libdir)/foo' + test -f '$(libdir)/foo' + test -x '$(libdir)/foo' + ls -l '$(bindir)/libquux.a' + test -f '$(bindir)/libquux.a' + ls -l '$(libexecdir)/bar.h' + test -f '$(libexecdir)/bar.h' + test ! -x '$(libexecdir)/bar.h' +END + +cat > foo.c <<'END' +int main (void) +{ + return 0; +} +END + +cat > libquux.c <<'END' +int quux(void) +{ + return 1; +} +END + +: > bar.h + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +cwd=3D`pwd` || Exit 1 +./configure --prefix=3D"$cwd/_inst" + +$MAKE install +$MAKE installcheck +$MAKE distcheck + +: diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-pref= ix-invalid-couples.test new file mode 100755 index 0000000..a2f98e1 =2D-- /dev/null +++ b/tests/primary-prefix-invalid-couples.test @@ -0,0 +1,143 @@ +#! /bin/sh +# Copyright (C) 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 +# 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 . + +# Not all primaries/directories combinations are valid. +# Automake should flag them as errors. +# Originated from PR/294, extended later (following bug #7647) to +# cover more cases. +# See also test `primary-prefix-valid-couples.test'. + +. ./defs || Exit 1 + +set -e + +oIFS=3D$IFS # saved for later + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +$ACLOCAL + +# Please keep this list in sync with the list of "Directory Variables" +# in the GNU Coding Standards and with the list additional directory +# variables provided by autoconf and/or automake (pkgdatadir, pkglibdir, +# ...). See also the hash `%standard_prefix' in the automake script. +prefixes=3D'bin data dataroot doc dvi exec html include info lib libexec + lisp locale localstate man man1 man2 man3 man4 man5 man6 man7 + man8 man9 oldinclude pdf pkgdata pkginclude pkglib pkglibexec + ps sbin sharedstate sysconf' +# Please keep this list in sync with the list of primaries documented in +# the Automake manual (see the "The Uniform Naming Scheme" section). +primaries=3D'PROGRAMS LIBRARIES LTLIBRARIES LISP PYTHON JAVA SCRIPTS DATA + HEADERS MANS TEXINFOS' + +# Use files, not variables, to hold the list of all the possible +# prefix_PRIMARY couples and the list of those couples valid for +# automake, to avoid having unreadable very verbose traces. + +set +x # don't be overly verbose + +for prefix in $prefixes; do + for primary in $primaries; do + echo ${prefix}_${primary} + done +done >all.list + +for primary in $primaries; do + prefixes_ok=3D'' + case $primary in + LIBRARIES|LTLIBRARIES) + prefixes_ok=3D'lib pkglib' + ;; + PROGRAMS) + prefixes_ok=3D'bin sbin libexec pkglibexec' + ;; + SCRIPTS) + prefixes_ok=3D'bin sbin libexec pkgdata' + ;; + DATA) + prefixes_ok=3D'data dataroot pkgdata doc html dvi pdf ps + sysconf sharedstate localstate lisp' + ;; + HEADERS) + prefixes_ok=3D'include oldinclude pkginclude' + ;; + LISP) + prefixes_ok=3D'lisp' + ;; + PYTHON) + prefixes_ok=3D'python' + ;; + JAVA) + prefixes_ok=3D'java' + ;; + MANS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'man man1 man2 man3 man4 man5 man6 man7 man8 man9' + # but Automake currently fails on that, as it allows the MANS + # primary to be coupled to any prefix. + # See also Automake bug#7656. + # We should dig out how automake had come to behave this way, and + # if such a behaviour can be safely changed. + prefixes_ok=3D$prefixes + ;; + TEXINFOS) + # FIXME: Here we'd like to have: + # prefixes_ok=3D'info' + # but Automake currently fails on that, as it allows the use of + # `foo_TEXINFOS' to declare extra Texinfo sources for the `foo' + # Texinfo manual, as in e.g.: + # info_TEXINFOS =3D foo.texi + # foo_TEXINFOS =3D gpl.texi + # See also Automake bug#7657. + prefixes_ok=3D$prefixes + ;; + *) + echo "$me: internal error: unrecognized primary '$primary'" >&2 + Exit 99 + ;; + esac + for prefix in $prefixes_ok; do + echo ${prefix}_${primary} + done +done >allow.list + +set -x + +cat all.list +cat allow.list + +while read x; do + grep "^$x$" allow.list >/dev/null && continue + # To get the expected error message more in detail. + IFS=3D_; set $x; IFS=3D$oIFS + test $# -eq 2 || Exit 99 # sanity check + prefix=3D$1 + primary=3D$2 + errmsg_rx=3D".*${prefix}dir.* not a legitimate directory .*$primary" + # Now do the test for this prefix/primary combination. + echo "$x =3D foo" > Makefile.am + AUTOMAKE_fails -a + grep "^Makefile\\.am:1:$errmsg_rx" stderr +done . + +# Test for valid prefix/primary combinations. +# See also test `primary-prefix-invalid-couples.test'. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_LIBTOOL +AM_PROG_GCJ +AM_PATH_PYTHON +AM_PATH_LISPDIR +END + +# Fake libtool availability. +: > ltmain.sh +: > config.sub +: > config.guess +cat > acinclude.m4 <<'END' +AC_DEFUN([AC_PROG_LIBTOOL], + [AC_SUBST([LIBTOOL], [:])]) +END + +# Other required files. +echo '@setfilename foo' > foo.texi +: > texinfo.tex +: > py-compile +: > elisp-comp + +# Setup Makefile.am. + +: > Makefile.am + +for p in bin sbin libexec pkglibexec; do + echo "${p}_PROGRAMS =3D prog-$p" >> Makefile.am +done + +for p in lib pkglib; do + echo "${p}_LIBRARIES =3D libs-$p.a" >> Makefile.am + echo "${p}_LTLIBRARIES =3D libd-$p.la" >> Makefile.am +done + +for p in bin sbin libexec pkgdata; do + echo "${p}_SCRIPTS =3D $p.sh" >> Makefile.am +done + +for p in data dataroot pkgdata doc html dvi pdf ps sysconf \ + sharedstate localstate lisp; do + echo "${p}_DATA =3D $p.dat" >> Makefile.am +done + +for p in include oldinclude pkginclude; do + echo "${p}_HEADERS =3D $p.h" >> Makefile.am +done + +for p in man man1 man2 man3 man4 man5 man6 man7 man8 man9; do + echo "${p}_MANS =3D bar.$p" +done + +echo "info_TEXINFOS =3D foo.texi" >> Makefile.am +echo "lisp_LISP =3D foo.el" >> Makefile.am +echo "python_PYTHON =3D foo.py" >> Makefile.am +echo "java_JAVA =3D foo.java" >> Makefile.am + +awk '{print NR ":" $0}' Makefile.am # for debugging + +# Go with the tests. + +$ACLOCAL +$AUTOMAKE + +: =2D-=20 1.7.2.3 --Boundary-00=_OddQN0r69pkEcEq-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 30 05:08:32 2011 Received: (at 7647) by debbugs.gnu.org; 30 Mar 2011 09:08:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4rOC-0000ON-7V for submit@debbugs.gnu.org; Wed, 30 Mar 2011 05:08:32 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4rOA-0000OB-01 for 7647@debbugs.gnu.org; Wed, 30 Mar 2011 05:08:30 -0400 Received: by wwk4 with SMTP id 4so4156309wwk.3 for <7647@debbugs.gnu.org>; Wed, 30 Mar 2011 02:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=1z97WUxrpkvdj288BcanKF//2tdKq0R7bdgE6afquss=; b=gdc2Qsxqb/qv11fun7XYIa5Xhd72LECSLmzzxDnudEY5/ecCg7J79wmWDmYThnprn3 VSjmLv0R9mmXL48EOa02dEt9DFRCJAJQKl8gJAIG02s/iFnn7zpOjqslG5bncWvh/37p LSzChuw/iPTaIMd7t9PXfXIj2A9DQ3vRg7kLA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=FEgj32IkdXAunWaoGyi9dD+gyPRJ8NJVwQvcBdKsP1+Gp25BFZ68MTpB3R+q0UMGXL IqG4Li2WrcES6mriTMliKuocD3jglzJLwZdYb7IVSKZ7LKkBP0Ec/DJoK9jtawcJSdKG MFXuu49mU+ucXmk0G+pmJFH6bSLfcUMQ4+mEA= Received: by 10.227.164.2 with SMTP id c2mr917522wby.222.1301476103015; Wed, 30 Mar 2011 02:08:23 -0700 (PDT) Received: from bigio.localnet (host112-90-dynamic.14-87-r.retail.telecomitalia.it [87.14.90.112]) by mx.google.com with ESMTPS id z13sm2898143wbd.12.2011.03.30.02.08.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 02:08:22 -0700 (PDT) From: Stefano Lattarini To: 7647@debbugs.gnu.org Subject: Re: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended. Date: Wed, 30 Mar 2011 11:08:05 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <201101031532.01052.stefano.lattarini@gmail.com> <201101272136.30194.stefano.lattarini@gmail.com> In-Reply-To: <201101272136.30194.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103301108.06127.stefano.lattarini@gmail.com> X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7647 Cc: Ralf Wildenhues , Eric Blake , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.6 (---) References: Ping^2? I will push in 72 hours if there are no objections. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 17 15:23:32 2011 Received: (at 7647) by debbugs.gnu.org; 17 Apr 2011 19:23:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBXZE-0000aJ-1O for submit@debbugs.gnu.org; Sun, 17 Apr 2011 15:23:32 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBXZB-0000a6-Gr for 7647@debbugs.gnu.org; Sun, 17 Apr 2011 15:23:30 -0400 Received: by wwb28 with SMTP id 28so5162992wwb.15 for <7647@debbugs.gnu.org>; Sun, 17 Apr 2011 12:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=WyIYq9kEP3gzsHj3IXzepiBhkWuFoSe/kpbezNSyWeo=; b=f29YZo4pGeWfk6Q9Xz+hvLD2Wr7z6MdeYcXehVvzHqyOPmTkoim2my6vKTzNLqlZ7z fbjE9A6AKF8wHFoFLvPpHFttSvFTtr2uIwKjoG7OtLX+PT1LCR8SRVO1uM4Malt2ixfK JNeQU3AFScdbiF2VwHjBaF4KYN2WjL3pden+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=VnNAOJZE0Cv7/BMfAIq4Cd76iiSkuxNiNda/W2RmNBhi+2AKU+R0aWR04yA0MU/Qda y95TV1Pf1EePf2wf8S30dCUOA4NucpqIhMU8P6xkg45qvEr79OdFtTuKq2vcyxgNCCiy kAOVB6VmuO7/P6n7H5AtFrZw8EEFLGKhMB8Fk= Received: by 10.216.232.4 with SMTP id m4mr1648805weq.87.1303068202608; Sun, 17 Apr 2011 12:23:22 -0700 (PDT) Received: from bigio.localnet (host225-92-dynamic.4-87-r.retail.telecomitalia.it [87.4.92.225]) by mx.google.com with ESMTPS id a50sm2249845wer.42.2011.04.17.12.23.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Apr 2011 12:23:21 -0700 (PDT) From: Stefano Lattarini To: 7647@debbugs.gnu.org Subject: Re: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended. Date: Sun, 17 Apr 2011 21:23:10 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <201101272136.30194.stefano.lattarini@gmail.com> <201103301108.06127.stefano.lattarini@gmail.com> In-Reply-To: <201103301108.06127.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104172123.10987.stefano.lattarini@gmail.com> X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7647 Cc: Ralf Wildenhues , Eric Blake , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -3.6 (---) Reference: On Wednesday 30 March 2011, Stefano Lattarini wrote: > References: > > > > Ping^2? > > I will push in 72 hours if there are no objections. > > Regards, > Stefano > I've just realized that the "adjusted" test java3.test has been made weaker, since $(javadir) is empty by default and thus nothing gets installed there anyway. The following squash-in should solve this issue: -*-*- diff --git a/ChangeLog b/ChangeLog index 615a72d..0c54062 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2011-01-27 Stefano Lattarini +2011-04-17 Stefano Lattarini Warnings about primary/prefix mismatch fixed and extended. * automake.in (%standard_prefix): Add `doc' and `locale'. diff --git a/tests/java3.test b/tests/java3.test index 41dbb71..e1850a8 100755 --- a/tests/java3.test +++ b/tests/java3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 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 @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure that Java rules don't attempt to install *.java files when -# there are none. +# Make sure that Java rules don't attempt to compile or install +# *.java files when there are none. # Report from Johannes Nicolai (PR/441). . ./defs || Exit 1 @@ -32,10 +32,13 @@ if WHO_CARES JAVA_FILES = MyClass1.java endif -dist_java_JAVA = $(JAVA_FILES) +javadir = $(prefix)/java +java_JAVA = $(JAVA_FILES) END -: >MyClass1.java +cat > MyClass1.java << 'END' +class MyClass1 { // Deliberately missing right curly bracket. +END $ACLOCAL $AUTOCONF @@ -43,9 +46,10 @@ $AUTOMAKE cwd=`pwd` || Exit 1 ./configure --prefix="$cwd/_inst" +$MAKE $MAKE install -test ! -d _inst -test ! -r _inst +ls -l . _inst/java # For debugging. +find . -name '*.class' | grep . && Exit 1 $MAKE uninstall $MAKE distcheck -*-*- I'll push in 72 hours if there is no review by then. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 16 12:21:11 2011 Received: (at 7647-done) by debbugs.gnu.org; 16 Jun 2011 16:21:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QXFJe-0002zY-Nx for submit@debbugs.gnu.org; Thu, 16 Jun 2011 12:21:10 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QXFJc-0002zM-UY for 7647-done@debbugs.gnu.org; Thu, 16 Jun 2011 12:21:09 -0400 Received: by wyb29 with SMTP id 29so1212783wyb.3 for <7647-done@debbugs.gnu.org>; Thu, 16 Jun 2011 09:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=WC7jkQhp03uEgbEY/dNFLcrX/4Htha9vYre6qZyTlgc=; b=mF6o/fXeOiL6XKpuQPhJ4TiMFwoaCWLW4xBQQICivqKoxqt3XiuTnRwJWfBK/Kyj73 P9DTwikrVlaI+WuU4FvqH2pRuRjH8vg0v181ajPYROtIUMI5EDtDxoO+rJcyAh+RpZjm uGTCTXvzus6xTTH+EVpcdDUmzaQ2bXL2M6AuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=cdzxyeqiUtPOjfq8vkY3E/BAn9Ckg6DmZZCVABjrjSX2n/vdbz/vvKkGNRbyqvt+lj Q8EwYL96cDrb2pPx2u7E3+7PF+4lAbqcT1QU8aJxHNajOacSaaEpKwrqNsg3V6T+efQf woDW1PnFkDeYxq8ANFtah3Kd/Yz/rt7A9sllA= Received: by 10.216.140.219 with SMTP id e69mr1270184wej.45.1308241263100; Thu, 16 Jun 2011 09:21:03 -0700 (PDT) Received: from bigio.localnet (host10-98-dynamic.24-79-r.retail.telecomitalia.it [79.24.98.10]) by mx.google.com with ESMTPS id g2sm933525wes.10.2011.06.16.09.21.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2011 09:21:01 -0700 (PDT) From: Stefano Lattarini To: 7647-done@debbugs.gnu.org Subject: Re: bug#7647: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended. Date: Thu, 16 Jun 2011 18:20:49 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <4D07D748.8060003@redhat.com> <201103301108.06127.stefano.lattarini@gmail.com> <201104172123.10987.stefano.lattarini@gmail.com> In-Reply-To: <201104172123.10987.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106161820.49876.stefano.lattarini@gmail.com> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 7647-done Cc: Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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: -4.1 (----) The patch has been finally as commit v1.11-373-g9ca6326, with a non-trivial optimization (for speed reasons) to a test case applied with follow-up commit `v1.11-374-ged078da'. I'm thus marking this bug as closed. Regards, Stefano From unknown Sun Jun 22 11:32:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 15 Jul 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator