From unknown Fri Aug 15 15:35:00 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#13524 <13524@debbugs.gnu.org> To: bug#13524 <13524@debbugs.gnu.org> Subject: Status: Improving user experience for non-recursive builds Reply-To: bug#13524 <13524@debbugs.gnu.org> Date: Fri, 15 Aug 2025 22:35:00 +0000 retitle 13524 Improving user experience for non-recursive builds reassign 13524 automake submitter 13524 Miles Bader severity 13524 wishlist tag 13524 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 22 04:19:51 2013 Received: (at submit) by debbugs.gnu.org; 22 Jan 2013 09:19:52 +0000 Received: from localhost ([127.0.0.1]:44082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txa1H-0008Mo-EE for submit@debbugs.gnu.org; Tue, 22 Jan 2013 04:19:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40924) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txa1F-0008Mg-Sj for submit@debbugs.gnu.org; Tue, 22 Jan 2013 04:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txa08-0003pm-8R for submit@debbugs.gnu.org; Tue, 22 Jan 2013 04:18:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:50482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txa08-0003pi-5s for submit@debbugs.gnu.org; Tue, 22 Jan 2013 04:18:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txa07-0002tU-2S for bug-automake@gnu.org; Tue, 22 Jan 2013 04:18:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txa05-0003oQ-IB for bug-automake@gnu.org; Tue, 22 Jan 2013 04:18:39 -0500 Received: from mail-la0-f45.google.com ([209.85.215.45]:33907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txa03-0003jR-CG; Tue, 22 Jan 2013 04:18:35 -0500 Received: by mail-la0-f45.google.com with SMTP id er20so1662813lab.18 for ; Tue, 22 Jan 2013 01:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=pNnAviKKq8Ru6PeaPH0h2qT57HRF0yU36Su8+SceT6I=; b=IycNxiyLaTltRttTNSxfUlT2M58XCwfQlfqlVdD+Ej37X0qQ4IjKoweu2LuhRxjI4E 2DXV7aGCy6+xPaGuyCHiogNqTvP8Hp9xTVvaxwS0Ar5YmiLOB8c8W/Nqne8Ec6JCkdBD /+6WRsybgJtPsW3o/B4RRslqQGYBJc43CBuIDMzuyAjOHfKsfplrgfYwJh+I6BWCc8Ps 2EZZKz09upz0EQ6pJ+XqdZsTJHKHLvisJreK4ODzDHX2KuLnmzKaRHtCzh9/P0KWJiVo RyTG6pJe3NDmhX8WODhmxTbMxv7v8G9Ghp+7nT6x9vYHIiMLuaQ6nUPrFNK3YB/sLNgY C6NA== X-Received: by 10.152.144.130 with SMTP id sm2mr20438411lab.49.1358846313855; Tue, 22 Jan 2013 01:18:33 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id ew10sm6595572lbb.10.2013.01.22.01.18.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 01:18:32 -0800 (PST) Message-ID: <50FE5965.7050807@gmail.com> Date: Tue, 22 Jan 2013 10:18:29 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Miles Bader Subject: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> In-Reply-To: <87zk021060.fsf@catnip.gol.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit Cc: Bob Friesenhahn , bug-automake@gnu.org, Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) [+cc bug-automake, so that we won't forget about the issue] [future replies should drop the automake list] On 01/22/2013 02:22 AM, Miles Bader wrote: > Stefano Lattarini writes: >> The best solution is on the user-side IMHO: fix the build system to >> use less (ideally none) make recursion. Both the parallel and serial >> testsuite harness should support that setup OOTB. > > It would be nice if automake had some more features for that... > Indeed (albeit the present situation is already mostly good enough for most medium-sized packages). > E.g., if I have a directory "foo" that has sources etc, and builds > some specific targets, then I can isolate the automake stuff for foo > by using an include file "foo/Makefile.am.inc" or something, and then > putting an appropriate include in the top-level Makefile.am. > > But it's a bit annoying, in that AFAICT, all filenames, etc, in foo's > Makefile fragment must explicitly include the directory name. > Yes, and this issue has come up several times already. Nobody has been bothered enough to attempt a patch, though, at least so far. > E.g., if it builds a library, "foo/Makefile.am.inc" might look like: > > libfoo_a_SOURCES = foo/oink.c foo/barf.c foo/barf.h ... > > For longish directory names, this can really bloat things up... > Someone (probably Eric Blake, but I'm not 100% sure) once noted that this issue could be mitigated with simple indirections with usual make macros: d1 = wow/a/very/very/insanely/long/directory/name wow_a_very_very_insanely_long_directory_name_prog_SOURCES = \ $(d1)/a.c $(d1)/b.c ... $(d1)/z.c > It would be really cool if there was some way of telling automake > "hey, for every filename mentioned in this file, try to use a prefix > of ..." > This is probably too automatic; but Bob Friesenhahn suggested Automake could recognize special substitutions, like %CURDIR% and %XCURDIR%, so that you could simply use in %XCURDIR%_prog_SOURCES = %CURDIR%/a.c %CURDIR%/b.c ... %CURDIR%/z.c in 'wow/a/very/very/insanely/long/directory/name/local,.mk', include this '.mk' fragment from the top-level Makefile.am, and have DTRT. I think that could be implemented in a simple pre-processing step, before Automake even parses the Makefile contents (this too was Bob's suggestion, IIRC); in which case, the change would probably be unobtrusive and mostly safe. Patches (even WIP) are welcome. > I dunno whether that would be associated with the include > directive, with the makefile fragment, or what, but... anyway. > > Does automake have some feature like this that I've missed? > Unfortunately no. > Or has anybody thought about it? > They did (see above :-) Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 22 04:30:19 2013 Received: (at control) by debbugs.gnu.org; 22 Jan 2013 09:30:19 +0000 Received: from localhost ([127.0.0.1]:44087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxaBO-0000Bm-ML for submit@debbugs.gnu.org; Tue, 22 Jan 2013 04:30:18 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:45269) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxaBM-0000Bc-6K for control@debbugs.gnu.org; Tue, 22 Jan 2013 04:30:17 -0500 Received: by mail-lb0-f174.google.com with SMTP id l12so567240lbo.5 for ; Tue, 22 Jan 2013 01:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; bh=TMpkH4YbpHAFKsNOg7gLImFIEhHqd6ZTqRG8k7O+hUs=; b=vBL8wG6/fX1wmALxJ/LeVJIFa/QMIGlEKunVUbqMwcvXh3E8RST4WGmOOLzkEGe93u DEbMNsvKE+GPRnNDlilL+GRpFekwPFHACqVH6oCQV+8xkwhhBjrtbzVh5cOURXxLiPy5 Vm+VqjaWVJHH1OJfqzPuKoWvuiM9wH0p6kjyEtRyJipxATqJQYU4Kj4lgtFnFSICV2m7 tBtl5rbF9L5eAqiwDsxYKhcxK80Ry84bY0irsGbqS7BbYUEIquj0PVIKs7QAoDrCkdw5 r02cuUyQzDcGexh2emjOVdKNnzpJPFo5v5LICw1rRWvyXR/j07LMOgj02XEOnJrqBZGh +naQ== X-Received: by 10.112.9.37 with SMTP id w5mr3346309lba.62.1358846946638; Tue, 22 Jan 2013 01:29:06 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id hn3sm6581973lab.10.2013.01.22.01.29.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 01:29:04 -0800 (PST) Message-ID: <50FE5BDE.5080404@gmail.com> Date: Tue, 22 Jan 2013 10:29:02 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) submitter 13524 Miles Bader severity 13524 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 22 05:23:36 2013 Received: (at submit) by debbugs.gnu.org; 22 Jan 2013 10:23:36 +0000 Received: from localhost ([127.0.0.1]:44159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txb0x-0002O7-Ri for submit@debbugs.gnu.org; Tue, 22 Jan 2013 05:23:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57670) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txb0v-0002Nz-9u for submit@debbugs.gnu.org; Tue, 22 Jan 2013 05:23:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txazl-00049F-Vs for submit@debbugs.gnu.org; Tue, 22 Jan 2013 05:22:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:54352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txazl-00049B-TA for submit@debbugs.gnu.org; Tue, 22 Jan 2013 05:22:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txazi-00085P-PC for bug-automake@gnu.org; Tue, 22 Jan 2013 05:22:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txazg-00048K-LP for bug-automake@gnu.org; Tue, 22 Jan 2013 05:22:18 -0500 Received: from mail.lysator.liu.se ([2001:6b0:17:f0a0::3]:37346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txazg-00047w-6L; Tue, 22 Jan 2013 05:22:16 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id CF12A4000F; Tue, 22 Jan 2013 11:22:11 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 44C9C40003; Tue, 22 Jan 2013 11:22:10 +0100 (CET) Message-ID: <50FE6851.608@lysator.liu.se> Date: Tue, 22 Jan 2013 11:22:09 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> In-Reply-To: <50FE5965.7050807@gmail.com> Content-Type: multipart/mixed; boundary="------------040607060903030300010509" X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit Cc: Karl Berry , bug-automake@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) This is a multi-part message in MIME format. --------------040607060903030300010509 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2013-01-22 10:18, Stefano Lattarini wrote: > [+cc bug-automake, so that we won't forget about the issue] > [future replies should drop the automake list] > > On 01/22/2013 02:22 AM, Miles Bader wrote: >> Stefano Lattarini writes: >>> The best solution is on the user-side IMHO: fix the build system to >>> use less (ideally none) make recursion. Both the parallel and serial >>> testsuite harness should support that setup OOTB. >> >> It would be nice if automake had some more features for that... >> > Indeed (albeit the present situation is already mostly good enough > for most medium-sized packages). > >> E.g., if I have a directory "foo" that has sources etc, and builds >> some specific targets, then I can isolate the automake stuff for foo >> by using an include file "foo/Makefile.am.inc" or something, and then >> putting an appropriate include in the top-level Makefile.am. >> >> But it's a bit annoying, in that AFAICT, all filenames, etc, in foo's >> Makefile fragment must explicitly include the directory name. >> > Yes, and this issue has come up several times already. Nobody has > been bothered enough to attempt a patch, though, at least so far. > >> E.g., if it builds a library, "foo/Makefile.am.inc" might look like: >> >> libfoo_a_SOURCES = foo/oink.c foo/barf.c foo/barf.h ... >> >> For longish directory names, this can really bloat things up... >> > Someone (probably Eric Blake, but I'm not 100% sure) once noted that this > issue could be mitigated with simple indirections with usual make macros: > > d1 = wow/a/very/very/insanely/long/directory/name > > wow_a_very_very_insanely_long_directory_name_prog_SOURCES = \ > $(d1)/a.c $(d1)/b.c ... $(d1)/z.c > >> It would be really cool if there was some way of telling automake >> "hey, for every filename mentioned in this file, try to use a prefix >> of ..." >> > This is probably too automatic; but Bob Friesenhahn suggested Automake > could recognize special substitutions, like %CURDIR% and %XCURDIR%, so > that you could simply use in > > %XCURDIR%_prog_SOURCES = %CURDIR%/a.c %CURDIR%/b.c ... %CURDIR%/z.c > > in 'wow/a/very/very/insanely/long/directory/name/local,.mk', include this > '.mk' fragment from the top-level Makefile.am, and have DTRT. I think > that could be implemented in a simple pre-processing step, before > Automake even parses the Makefile contents (this too was Bob's suggestion, > IIRC); in which case, the change would probably be unobtrusive and mostly > safe. Patches (even WIP) are welcome. This is proof of concept, and I'm not a perl hacker etc, but it seems to work ok. Feel free to improve or toss or add documentation or whatever :-) Patch is based on the maint branch, but being a new feature it perhaps belongs on master instead. But as I said, do what you want with it... Cheers, Peter --------------040607060903030300010509 Content-Type: text/x-patch; name="0001-reldir-Add-support-for-relative-names-in-included-fr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-reldir-Add-support-for-relative-names-in-included-fr.pa"; filename*1="tch" >From 5cc9c775dbe46343b651a7e6ac378f71e6a3b6c1 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 22 Jan 2013 11:17:11 +0100 Subject: [PATCH] reldir: Add support for relative names in included fragments automake.in (read_am_file): Add third argument specifying the relative directory of this makefile fragment compared to the main level makefile. Replace @am_reldir@ in the fragment with this relative directory. (read_main_am_file): Adjust. t/reldir.sh: New test. t/list-of-tests.mk: Augment. --- automake.in | 28 +++++++++++++++++---- t/list-of-tests.mk | 1 + t/reldir.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 5 deletions(-) create mode 100755 t/reldir.sh diff --git a/automake.in b/automake.in index 0e3b882..4e52aca 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $RELDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. sub read_am_file ($$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $reldir) = @_; my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6423,18 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + if ($reldir ne '.') + { + my $rel_dir = &canonicalize ($reldir); + $_ =~ s/\@am_reldir\@\//${reldir}\//g; + $_ =~ s/\@am_reldir\@_/${rel_dir}_/g; + } + else + { + $_ =~ s/\@am_reldir\@\///g; + $_ =~ s/\@am_reldir\@_//g; + } + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6584,8 +6596,14 @@ sub read_am_file ($$) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_reldir = $path; + # $new_reldir =~ s/\$\($reldir\)\///; + if ($new_reldir =~ s/\/[^\/]*$// == 0) + { + $new_reldir = '.'; + } $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_reldir); $where->pop_context; } else @@ -6658,7 +6676,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 44f598e..9501ed4 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -783,6 +783,7 @@ t/parallel-tests-no-spurious-summary.sh \ t/parallel-tests-exit-statuses.sh \ t/parallel-tests-console-output.sh \ t/parallel-tests-once.sh \ +t/reldir.sh \ t/tests-environment.sh \ t/am-tests-environment.sh \ t/tests-environment-backcompat.sh \ diff --git a/t/reldir.sh b/t/reldir.sh new file mode 100755 index 0000000..97fd0c2 --- /dev/null +++ b/t/reldir.sh @@ -0,0 +1,68 @@ +#! /bin/sh +# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Test @am_reldir@ + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include foo/Makefile.am +include foo/foobar/Makefile.am +END + +cat > foo/Makefile.am << 'END' +@am_reldir@_echo: + @echo "I am @am_reldir@/Makefile.am" + +bin_PROGRAMS += @am_reldir@/mumble +@am_reldir@_mumble_SOURCES = @am_reldir@/one.c +END + +cat > foo/one.c << 'END' +int main(void) { return 0; } +END + +cp foo/Makefile.am foo/bar +cp foo/Makefile.am foo/foobar +echo "include @am_reldir@/bar/Makefile.am" >> foo/Makefile.am + +cp foo/one.c foo/bar +cp foo/one.c foo/foobar + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE foo_echo +$MAKE foo_bar_echo +$MAKE foo_foobar_echo +$MAKE +foo/mumble +foo/bar/mumble +foo/foobar/mumble -- 1.7.9 --------------040607060903030300010509-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 01:55:31 2013 Received: (at submit) by debbugs.gnu.org; 23 Jan 2013 06:55:31 +0000 Received: from localhost ([127.0.0.1]:45501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxuF8-0006Mc-S0 for submit@debbugs.gnu.org; Wed, 23 Jan 2013 01:55:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58053) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxuF5-0006MQ-Rv for submit@debbugs.gnu.org; Wed, 23 Jan 2013 01:55:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxuDt-0002f1-GH for submit@debbugs.gnu.org; Wed, 23 Jan 2013 01:54:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:45410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxuDt-0002ev-Cz for submit@debbugs.gnu.org; Wed, 23 Jan 2013 01:54:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxuDr-0002nJ-He for bug-automake@gnu.org; Wed, 23 Jan 2013 01:54:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxuDq-0002eF-6B for bug-automake@gnu.org; Wed, 23 Jan 2013 01:54:11 -0500 Received: from smtp12.dentaku.gol.com ([203.216.5.74]:43631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxuDp-0002dz-T9; Wed, 23 Jan 2013 01:54:10 -0500 Received: from 61.245.23.117.eo.eaccess.ne.jp ([61.245.23.117] helo=catnip.gol.com) by smtp12.dentaku.gol.com with esmtpa (Dentaku) (envelope-from ) id 1TxuDm-0006Qj-7y; Wed, 23 Jan 2013 15:54:06 +0900 Received: by catnip.gol.com (Postfix, from userid 1000) id 7402FDFBB; Wed, 23 Jan 2013 15:54:04 +0900 (JST) From: Miles Bader To: Stefano Lattarini Subject: Re: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> System-Type: x86_64-unknown-linux-gnu Date: Wed, 23 Jan 2013 15:54:04 +0900 In-Reply-To: <50FE5965.7050807@gmail.com> (Stefano Lattarini's message of "Tue, 22 Jan 2013 10:18:29 +0100") Message-ID: <87d2ww1jar.fsf@catnip.gol.com> Lines: 74 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: submit Cc: bug-automake@gnu.org, Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Stefano Lattarini writes: >> E.g., if I have a directory "foo" that has sources etc, and builds >> some specific targets, then I can isolate the automake stuff for foo >> by using an include file "foo/Makefile.am.inc" or something, and then >> putting an appropriate include in the top-level Makefile.am. >>=20 >> But it's a bit annoying, in that AFAICT, all filenames, etc, in foo's >> Makefile fragment must explicitly include the directory name. >> > Yes, and this issue has come up several times already. Nobody has > been bothered enough to attempt a patch, though, at least so far. > >> E.g., if it builds a library, "foo/Makefile.am.inc" might look like: >>=20 >> libfoo_a_SOURCES =3D foo/oink.c foo/barf.c foo/barf.h ... >>=20 >> For longish directory names, this can really bloat things up... >> > Someone (probably Eric Blake, but I'm not 100% sure) once noted that this > issue could be mitigated with simple indirections with usual make macros: > > d1 =3D wow/a/very/very/insanely/long/directory/name > > wow_a_very_very_insanely_long_directory_name_prog_SOURCES =3D \ > $(d1)/a.c $(d1)/b.c ... $(d1)/z.c Yes, that's the method I currently use, but it's pretty ugly, and kind of fiddly -- you need to use a unique macro name for every subdir, and practicality means probably using some variant of the directory name for that... meaning you probably have longish variable names in practice. Ugliness is better than "broken" but frankly I don't want it; one of automake's big attractions for me is that it allows one to write highly readable makefiles that are more easily maintainable because of their relative simplicity and lack of boilerplate (which hinders readability by obscuring significant content). Stuff like this feels very similar to typical Makefile boilerplate, and I think makes for more fragile, less maintainable Makefiles. > This is probably too automatic; but Bob Friesenhahn suggested Automake > could recognize special substitutions, like %CURDIR% and %XCURDIR%, so > that you could simply use in > > %XCURDIR%_prog_SOURCES =3D %CURDIR%/a.c %CURDIR%/b.c ... %CURDIR%/z.c This is less fragile, but still pretty grotty, that's going to result in makefile[-fragment]s that feel like they're full of boilerplate. Really, I'm thinking about something _more_ magic. I want to write filenames as I think about them: ..something...: a.c b.c ... z.c If something that does automagic munging of all filenames in a makefile fragment is too magic, at least maybe this could be done with some sort of simple rewrite mechanism to at least automake the common factor. E.g.: libfoo_SOURCES[libfoo/]: a.b b.c ... z.c This sort of thing would have the advantage of being relatively "stupid" (a simple explicit string rewrite), while still being able to eliminate much of the redundancy... Thanks, -miles --=20 =E3=80=8C=E5=AF=92=E3=81=84=E3=81=AD=E3=80=8D=E3=81=A8=E8=A9=B1=E3=81=97=E3= =81=8B=E3=81=91=E3=82=8C=E3=81=B0=E3=80=8C=E5=AF=92=E3=81=84=E3=81=AD=E3=80= =8D=E3=81=A8=E7=AD=94=E3=81=88=E3=82=8B=E4=BA=BA=E3=81=AE=E3=81=84=E3=82=8B= =E3=81=82=E3=81=A3=E3=81=9F=E3=81=8B=E3=81=95 [=E4=BF=B5=E4=B8=87=E6=99=BA] From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 07:29:17 2013 Received: (at submit) by debbugs.gnu.org; 23 Jan 2013 12:29:17 +0000 Received: from localhost ([127.0.0.1]:45814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxzS9-0004c0-B0 for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:29:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47864) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxzS5-0004bk-Qz for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:29:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxzQr-0001TE-Mt for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:27:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxzQr-0001TA-JN for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:27:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxzQq-00037B-9m for bug-automake@gnu.org; Wed, 23 Jan 2013 07:27:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxzQo-0001So-00 for bug-automake@gnu.org; Wed, 23 Jan 2013 07:27:56 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:35227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxzQi-0001Rg-8m; Wed, 23 Jan 2013 07:27:48 -0500 Received: by mail-lb0-f181.google.com with SMTP id gm6so2124214lbb.40 for ; Wed, 23 Jan 2013 04:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=hpWMU3S7CwtjLz9PvQgRYMzp200aEz5rR/ex6HGCDNI=; b=Z68a3/yY1PHXIdFERUEQ3OGuYFtYeypd5y1bdZOwz4a3IUgX+hxMjRt/43sfoqfoEi iZcobFbOTtucLcjhOZEnguBIrObJNwUcZceWmy37+DvhXqIUafSgydX4Xy8Z2e/AmD+4 vNudBPCfGhYZ0o+DjxVWaXzqhQILuqpT3rlvVoNtisWumesdlFWEG2Kz5W0t1WKdbTmy JeT7NiLmnajqX2qSxpInjwWbhC1S+BdiavEK28BI9rQL4CEdmqBd+x50ju3YdgVWrr1t iSFBlsNeMCETArmhHvB+B7sUxl9kzRJVciGCzcv2RNC99xVDN3LSiOXGmRLYY6rAvuTA fvaw== X-Received: by 10.112.49.97 with SMTP id t1mr655116lbn.58.1358944067002; Wed, 23 Jan 2013 04:27:47 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id er8sm8252796lbb.9.2013.01.23.04.27.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 04:27:46 -0800 (PST) Message-ID: <50FFD73F.6000703@gmail.com> Date: Wed, 23 Jan 2013 13:27:43 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Miles Bader Subject: Re: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <87d2ww1jar.fsf@catnip.gol.com> In-Reply-To: <87d2ww1jar.fsf@catnip.gol.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit Cc: bug-automake@gnu.org, Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hello Miles, thanks for the feedback. On 01/23/2013 07:54 AM, Miles Bader wrote: > Stefano Lattarini writes: >>> E.g., if I have a directory "foo" that has sources etc, and builds >>> some specific targets, then I can isolate the automake stuff for foo >>> by using an include file "foo/Makefile.am.inc" or something, and then >>> putting an appropriate include in the top-level Makefile.am. >>> >>> But it's a bit annoying, in that AFAICT, all filenames, etc, in foo's >>> Makefile fragment must explicitly include the directory name. >>> >> Yes, and this issue has come up several times already. Nobody has >> been bothered enough to attempt a patch, though, at least so far. >> >>> E.g., if it builds a library, "foo/Makefile.am.inc" might look like: >>> >>> libfoo_a_SOURCES = foo/oink.c foo/barf.c foo/barf.h ... >>> >>> For longish directory names, this can really bloat things up... >>> >> Someone (probably Eric Blake, but I'm not 100% sure) once noted that this >> issue could be mitigated with simple indirections with usual make macros: >> >> d1 = wow/a/very/very/insanely/long/directory/name >> >> wow_a_very_very_insanely_long_directory_name_prog_SOURCES = \ >> $(d1)/a.c $(d1)/b.c ... $(d1)/z.c > > Yes, that's the method I currently use, but it's pretty ugly, and kind > of fiddly -- you need to use a unique macro name for every subdir, > Yes, that is annoying and somewhat fragile. > and practicality means probably using some variant of the directory > name for that... meaning you probably have longish variable names in > practice. > > Ugliness is better than "broken" but frankly I don't want it; one of > automake's big attractions for me is that it allows one to write > highly readable makefiles that are more easily maintainable because of > their relative simplicity and lack of boilerplate (which hinders > readability by obscuring significant content). Stuff like this feels > very similar to typical Makefile boilerplate, and I think makes for > more fragile, less maintainable Makefiles. > >> This is probably too automatic; but Bob Friesenhahn suggested Automake >> could recognize special substitutions, like %CURDIR% and %XCURDIR%, so >> that you could simply use in >> >> %XCURDIR%_prog_SOURCES = %CURDIR%/a.c %CURDIR%/b.c ... %CURDIR%/z.c > > This is less fragile, > Which is a step forward at least; and since it appears it might be very easy to implement and fit in the existing automake processing scheme, I'm willing to give it a try. Further improvements and refinement might go on the top of that. > but still pretty grotty, that's going to result > in makefile[-fragment]s that feel like they're full of boilerplate. > > Really, I'm thinking about something _more_ magic. > It might be nice to do so as a second step, but I'd rather not have the best be the enemy of the good; we can make the Makefiles less fragile *today*, and make them less "boilerplatish" tomorrow. > I want to write filenames as I think about them: > > ..something...: a.c b.c ... z.c > > If something that does automagic munging of all filenames in a > makefile fragment is too magic, at least maybe this could be done with > some sort of simple rewrite mechanism to at least automake the common > factor. > > E.g.: > > libfoo_SOURCES[libfoo/]: a.b b.c ... z.c > This could be "syntactic sugar" that we might add after the improvement suggested above; in fact, the two things could eventually compound to allow usages like: libfoo_SOURCES[%CURDIR%] = a.c b.c ... z.c > This sort of thing would have the advantage of being relatively > "stupid" (a simple explicit string rewrite), while still being able to > eliminate much of the redundancy... > I'm not opposed to the idea, but I see it as a second step, after the improvement we are discussing. A second step for which patches are, as usual, welcome :-) > Thanks, > > -miles > Thanks, and best regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 07:46:39 2013 Received: (at submit) by debbugs.gnu.org; 23 Jan 2013 12:46:40 +0000 Received: from localhost ([127.0.0.1]:45822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txziw-0006cU-SG for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:46:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50891) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txzir-0006c4-G0 for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:46:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txzhd-0007dL-7y for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:45:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:58231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txzhd-0007dH-4I for submit@debbugs.gnu.org; Wed, 23 Jan 2013 07:45:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txzhb-0000HO-Nw for bug-automake@gnu.org; Wed, 23 Jan 2013 07:45:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxzhZ-0007be-S7 for bug-automake@gnu.org; Wed, 23 Jan 2013 07:45:15 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:54708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxzhX-0007Z7-2q; Wed, 23 Jan 2013 07:45:11 -0500 Received: by mail-lb0-f177.google.com with SMTP id go11so2124726lbb.8 for ; Wed, 23 Jan 2013 04:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=KOgPzd63L1iugLLwl68FkYyq7ilYoRfnyhkdyAiTJBw=; b=wW60ONTIHH7C6vQ0FkZxr3mar5zgSkDikv3JEPUXjpml0irVaZJz8+Ih6pe8LZdFuR qvXQRNvZJmM3Jo944j53LJ3NwscT7hTrOd8jzakHPky7MSfbZFue2ttQ66VmKbekD89G mBKZI/YkRZcGwWEc+NxFumYqsBU2wev8pOHKxmoT074KNfjYOQ9bUzw0pj+toruMSZcG TdJq1bfdp5UCfYMYyc7g87U7Y8rObJM4cSe/RASHQJR12EahhZRf61NXFmQNA7xWX3rd clq0DlBzmz/Xe70qifL9KOZC9XDTYjqiaoX3nuTLNl2hMbM/bClLd3FZeF40yoL8pjB/ Yxdg== X-Received: by 10.152.132.137 with SMTP id ou9mr1287323lab.7.1358945109531; Wed, 23 Jan 2013 04:45:09 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id ft8sm8268120lab.9.2013.01.23.04.45.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 04:45:08 -0800 (PST) Message-ID: <50FFDB51.7070607@gmail.com> Date: Wed, 23 Jan 2013 13:45:05 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> In-Reply-To: <50FE6851.608@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit Cc: Karl Berry , bug-automake@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi Peter, thanks for the patch. Not sure if you are in the mood (or have the time) to engage in a discussion about it, but here my review anyway. Even if you are not going to work on this patch anymore, a review will still be useful as a reference to me or other developers in the future. On 01/22/2013 11:22 AM, Peter Rosin wrote: > From 5cc9c775dbe46343b651a7e6ac378f71e6a3b6c1 Mon Sep 17 00:00:00 2001 > From: Peter Rosin > Date: Tue, 22 Jan 2013 11:17:11 +0100 > Subject: [PATCH] reldir: Add support for relative names in included fragments > A nice explanation of the ratioanle for this change is a must I think. Also, we should add reference to this discussion (and related bug number), as well give credit where's its due (this idea was Bob's brainchild). > automake.in (read_am_file): Add third argument specifying the > relative directory of this makefile fragment compared to the > main level makefile. Replace @am_reldir@ in the fragment with > this relative directory. > Using @acsubst@ style substitutions for something that is not substituted by config.status has proven a bad idea in the patch. We should use a new syntax, like '%subst%', ot even '&{subst}&'; personally, I like this latter best, since it help distinguish between Automake internal %TRASFORMS% from this new kind of special user-reserved substitution. > (read_main_am_file): Adjust. > t/reldir.sh: New test. > t/list-of-tests.mk: Augment. > --- > automake.in | 28 +++++++++++++++++---- > t/list-of-tests.mk | 1 + > t/reldir.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 92 insertions(+), 5 deletions(-) > create mode 100755 t/reldir.sh > > diff --git a/automake.in b/automake.in > index 0e3b882..4e52aca 100644 > --- a/automake.in > +++ b/automake.in > @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) > } > > > -# &read_am_file ($AMFILE, $WHERE) > -# ------------------------------- > +# &read_am_file ($AMFILE, $WHERE, $RELDIR) > +# ---------------------------------------- > # Read Makefile.am and set up %contents. Simultaneously copy lines > # from Makefile.am into $output_trailer, or define variables as > # appropriate. NOTE we put rules in the trailer section. We want > # user rules to come after our generated stuff. > sub read_am_file ($$) > { > - my ($amfile, $where) = @_; > + my ($amfile, $where, $reldir) = @_; > > my $am_file = new Automake::XFile ("< $amfile"); > verb "reading $amfile"; > @@ -6423,6 +6423,18 @@ sub read_am_file ($$) > > my $new_saw_bk = check_trailing_slash ($where, $_); > > + if ($reldir ne '.') > + { > + my $rel_dir = &canonicalize ($reldir); > + $_ =~ s/\@am_reldir\@\//${reldir}\//g; > + $_ =~ s/\@am_reldir\@_/${rel_dir}_/g; > + } > + else > + { > + $_ =~ s/\@am_reldir\@\///g; > + $_ =~ s/\@am_reldir\@_//g; > + } > + Too much automagic here IMO. We'd better have two distinct subst, one for the "real" directory name, and one for the directory name "canonicalized" for use in Automake primaries. I.e., from: # In sub/sub2/local.mk bin_PROGRAMS = sub/sub2/my-prog sub_sub2_my_prog_SOURCES = sub/sub2/main.c sub/sub2/compat.c to: # In sub/sub2/local.mk bin_PROGRAMS = &{CURDIR}&/my-prog &{CANON_CURDIR}&_my_prog_SOURCES = &{CURDIR}&/main.c &{CURDIR}&/compat.c Aa for what should be the actual names of this substitutions (I realize the names above kinda suck), suggestions are welcome. > if (/$IGNORE_PATTERN/o) > { > # Merely delete comments beginning with two hashes. > @@ -6584,8 +6596,14 @@ sub read_am_file ($$) > push_dist_common ("\$\(srcdir\)/$path"); > $path = $relative_dir . "/" . $path if $relative_dir ne '.'; > } > + my $new_reldir = $path; > + # $new_reldir =~ s/\$\($reldir\)\///; > + if ($new_reldir =~ s/\/[^\/]*$// == 0) > This is probably better written as: if ($new_reldir !~ s,/[^/]*$,,) > + { > + $new_reldir = '.'; > + } > $where->push_context ("'$path' included from here"); > - &read_am_file ($path, $where); > + &read_am_file ($path, $where, $new_reldir); > $where->pop_context; > } > else > @@ -6658,7 +6676,7 @@ sub read_main_am_file ($$) > &define_standard_variables; > > # Read user file, which might override some of our values. > - &read_am_file ($amfile, new Automake::Location); > + &read_am_file ($amfile, new Automake::Location, '.'); > } > > [SNIP good testsuite addition] > I really like how simple and unobtrusive this patch is! Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 09:36:31 2013 Received: (at 13524) by debbugs.gnu.org; 23 Jan 2013 14:36:31 +0000 Received: from localhost ([127.0.0.1]:45953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1RF-0005Zd-Dl for submit@debbugs.gnu.org; Wed, 23 Jan 2013 09:36:30 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:39847) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1R2-0005ZI-Qy for 13524@debbugs.gnu.org; Wed, 23 Jan 2013 09:36:23 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 33D5640006; Wed, 23 Jan 2013 15:35:00 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 5823540005; Wed, 23 Jan 2013 15:34:59 +0100 (CET) Message-ID: <50FFF512.6050102@lysator.liu.se> Date: Wed, 23 Jan 2013 15:34:58 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> In-Reply-To: <50FFDB51.7070607@gmail.com> Content-Type: multipart/mixed; boundary="------------070703090301070106060604" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 Cc: karl@freefriends.org, 13524@debbugs.gnu.org, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) This is a multi-part message in MIME format. --------------070703090301070106060604 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2013-01-23 13:45, Stefano Lattarini wrote: > Hi Peter, thanks for the patch. > > Not sure if you are in the mood (or have the time) to engage in a > discussion about it, but here my review anyway. Even if you are not > going to work on this patch anymore, a review will still be useful > as a reference to me or other developers in the future. Well, apparently I was in the mood and found some more time :-) > On 01/22/2013 11:22 AM, Peter Rosin wrote: >> From 5cc9c775dbe46343b651a7e6ac378f71e6a3b6c1 Mon Sep 17 00:00:00 2001 >> From: Peter Rosin >> Date: Tue, 22 Jan 2013 11:17:11 +0100 >> Subject: [PATCH] reldir: Add support for relative names in included fragments >> > A nice explanation of the ratioanle for this change is a must I think. > > Also, we should add reference to this discussion (and related bug number), > as well give credit where's its due (this idea was Bob's brainchild). And a NEWS entry, and docs. That part is less fun. >> automake.in (read_am_file): Add third argument specifying the >> relative directory of this makefile fragment compared to the >> main level makefile. Replace @am_reldir@ in the fragment with >> this relative directory. >> > Using @acsubst@ style substitutions for something that is not substituted > by config.status has proven a bad idea in the patch. We should use a new > syntax, like '%subst%', ot even '&{subst}&'; personally, I like this latter > best, since it help distinguish between Automake internal %TRASFORMS% from > this new kind of special user-reserved substitution. > >> (read_main_am_file): Adjust. >> t/reldir.sh: New test. >> t/list-of-tests.mk: Augment. >> --- >> automake.in | 28 +++++++++++++++++---- >> t/list-of-tests.mk | 1 + >> t/reldir.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 92 insertions(+), 5 deletions(-) >> create mode 100755 t/reldir.sh >> >> diff --git a/automake.in b/automake.in >> index 0e3b882..4e52aca 100644 >> --- a/automake.in >> +++ b/automake.in >> @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) >> } >> >> >> -# &read_am_file ($AMFILE, $WHERE) >> -# ------------------------------- >> +# &read_am_file ($AMFILE, $WHERE, $RELDIR) >> +# ---------------------------------------- >> # Read Makefile.am and set up %contents. Simultaneously copy lines >> # from Makefile.am into $output_trailer, or define variables as >> # appropriate. NOTE we put rules in the trailer section. We want >> # user rules to come after our generated stuff. >> sub read_am_file ($$) >> { >> - my ($amfile, $where) = @_; >> + my ($amfile, $where, $reldir) = @_; >> >> my $am_file = new Automake::XFile ("< $amfile"); >> verb "reading $amfile"; >> @@ -6423,6 +6423,18 @@ sub read_am_file ($$) >> >> my $new_saw_bk = check_trailing_slash ($where, $_); >> >> + if ($reldir ne '.') >> + { >> + my $rel_dir = &canonicalize ($reldir); >> + $_ =~ s/\@am_reldir\@\//${reldir}\//g; >> + $_ =~ s/\@am_reldir\@_/${rel_dir}_/g; >> + } >> + else >> + { >> + $_ =~ s/\@am_reldir\@\///g; >> + $_ =~ s/\@am_reldir\@_//g; >> + } >> + > Too much automagic here IMO. We'd better have two distinct subst, one for > the "real" directory name, and one for the directory name "canonicalized" > for use in Automake primaries. I.e., from: The gain was that the '.' case needs to peak at, and perhaps eat, the trailing separator anyway (or it will look bad, I mean, who wants __foo after writing &{CANON_CURDIR}&_foo and curdir happens to be '.'?) > # In sub/sub2/local.mk > bin_PROGRAMS = sub/sub2/my-prog > sub_sub2_my_prog_SOURCES = sub/sub2/main.c sub/sub2/compat.c > > to: > > # In sub/sub2/local.mk > bin_PROGRAMS = &{CURDIR}&/my-prog > &{CANON_CURDIR}&_my_prog_SOURCES = &{CURDIR}&/main.c &{CURDIR}&/compat.c > > Aa for what should be the actual names of this substitutions (I realize > the names above kinda suck), suggestions are welcome. After a short brainstorm, I went with &{CUR/DIR}& and &{CUR_DIR}&, but I'm not totally satisfied with the / version as it doesn't look "natural". But it is self explanatory, kind of. I'm not attached to the naming in any way, but &{CANON_CURDIR}& is too long IMHO. >> if (/$IGNORE_PATTERN/o) >> { >> # Merely delete comments beginning with two hashes. >> @@ -6584,8 +6596,14 @@ sub read_am_file ($$) >> push_dist_common ("\$\(srcdir\)/$path"); >> $path = $relative_dir . "/" . $path if $relative_dir ne '.'; >> } >> + my $new_reldir = $path; >> + # $new_reldir =~ s/\$\($reldir\)\///; >> + if ($new_reldir =~ s/\/[^\/]*$// == 0) >> > This is probably better written as: > > if ($new_reldir !~ s,/[^/]*$,,) Yes, looks better. I haven't bothered to look up the perl doc that spells out exactly why it is equivalent, but I'll trust you on that. >> + { >> + $new_reldir = '.'; >> + } >> $where->push_context ("'$path' included from here"); >> - &read_am_file ($path, $where); >> + &read_am_file ($path, $where, $new_reldir); >> $where->pop_context; >> } >> else >> @@ -6658,7 +6676,7 @@ sub read_main_am_file ($$) >> &define_standard_variables; >> >> # Read user file, which might override some of our values. >> - &read_am_file ($amfile, new Automake::Location); >> + &read_am_file ($amfile, new Automake::Location, '.'); >> } >> >> [SNIP good testsuite addition] >> > > I really like how simple and unobtrusive this patch is! Yes, it was simpler than I anticipated. After posting I noticed that some project (was it coreutils?) used "include $(srcdir)/foo/local.mk" and figured my changes wouldn't support that. But that works too, I don't know why though. (not that I'm complaining) Updated patch attached, I renamed it to curdir instead of reldir (and sorry for not dropping the automake list last time around). Cheers, Peter --------------070703090301070106060604 Content-Type: text/x-patch; name="0001-curdir-add-support-for-relative-names-in-included-fr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-curdir-add-support-for-relative-names-in-included-fr.pa"; filename*1="tch" >From d7c8a35e2bd9bcab2718427636d41b3734c351b2 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Wed, 23 Jan 2013 15:34:03 +0100 Subject: [PATCH] curdir: add support for relative names in included fragments Suggested by Bob Friesenhahn, and later discussed in bug #13524. automake.in (read_am_file): Add third argument specifying the relative directory of this makefile fragment compared to the main makefile. Replace &{CUR/DIR}& and &{CUR_DIR}& in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. t/curdir.sh: New test. t/list-of-tests.mk: Augment. --- automake.in | 30 ++++++++++++++++++--- t/curdir.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/list-of-tests.mk | 1 + 3 files changed, 99 insertions(+), 5 deletions(-) create mode 100755 t/curdir.sh diff --git a/automake.in b/automake.in index 0e3b882..9c9f41d 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $CURDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. sub read_am_file ($$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $curdir) = @_; my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6423,21 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + if ($curdir ne '.') + { + my $cur_dir = &canonicalize ($curdir); + $_ =~ s/&\{CUR\/DIR\}&/${curdir}/g; + $_ =~ s/&\{CUR_DIR\}&/${cur_dir}/g; + } + else + { + # If present, eat the following '_' or '/', converting + # "&{CUR/DIR}&/foo" and "&{CUR_DIR}&_foo" into plain "foo" + # when $curdir is '.'. + $_ =~ s/&\{CUR([_\/])DIR\}&\1//g; + $_ =~ s/&\{CUR[_\/]DIR\}&/${curdir}/g; + } + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6584,8 +6599,13 @@ sub read_am_file ($$) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_curdir = $path; + if ($new_curdir !~ s,/[^/]*$,,) + { + $new_curdir = '.'; + } $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_curdir); $where->pop_context; } else @@ -6658,7 +6678,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/t/curdir.sh b/t/curdir.sh new file mode 100755 index 0000000..e2251dc --- /dev/null +++ b/t/curdir.sh @@ -0,0 +1,73 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test &{CUR/DIR}& and &{CUR_DIR}&. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > local.mk << 'END' +&{CUR_DIR}&_whoami: + @echo "I am &{CUR/DIR}&/local.mk" + +bin_PROGRAMS += &{CUR/DIR}&/mumble +&{CUR_DIR}&_mumble_SOURCES = &{CUR/DIR}&/one.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +echo "include &{CUR/DIR}&/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami +$MAKE foo_whoami +$MAKE foo_bar_whoami +$MAKE foo_foobar_whoami +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 44f598e..1121735 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -340,6 +340,7 @@ t/cscope.tap \ t/cscope2.sh \ t/cscope3.sh \ t/c-demo.sh \ +t/curdir.sh \ t/cxx.sh \ t/cxx2.sh \ t/cxxcpp.sh \ -- 1.7.9 --------------070703090301070106060604-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 10:10:06 2013 Received: (at 13524) by debbugs.gnu.org; 23 Jan 2013 15:10:06 +0000 Received: from localhost ([127.0.0.1]:46582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1xl-0006QD-6b for submit@debbugs.gnu.org; Wed, 23 Jan 2013 10:10:05 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33462) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1xg-0006Pi-MP for 13524@debbugs.gnu.org; Wed, 23 Jan 2013 10:10:03 -0500 Received: by mail-lb0-f172.google.com with SMTP id n8so4471701lbj.3 for <13524@debbugs.gnu.org>; Wed, 23 Jan 2013 07:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6ivHh0ncvcYCAguEuitMMbHKdFXmaFWZeFgTW4AtDQg=; b=qZHRDyp43vlWZ8x3i2HVPNWNvk8A3cR6NJQKn8WPYhVAvVIYi/fm6+QxSRt5zxrDwI kMvkx+Q8/+jXcfsO/rCpU4Yhp8QfgTFZpLUq8NtbxtRW9Bfis+qgEto4+S0dECm06bo1 nN+H3/aHvnPmvqSprVHH03lsEJrDL5wbtndrtYW9znzDzJzXzK5LKWkAq6rlkrMNgwul 85K+oQ9h35bPRWZXcGMCEdUDyKNA6eK1Z7V8eyouVSO2x3VHJSPO75c6gzhiWEydSysH 5zxtKBo2kLhroE7m57iWBrJvLQALpD8nSkyzOCYgZj/47mW4PID4+/AlktoGw5AexkkZ EP/A== X-Received: by 10.152.144.38 with SMTP id sj6mr1606853lab.48.1358953724138; Wed, 23 Jan 2013 07:08:44 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id to7sm8474992lab.13.2013.01.23.07.08.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 07:08:43 -0800 (PST) Message-ID: <50FFFCF2.2040808@gmail.com> Date: Wed, 23 Jan 2013 16:08:34 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> In-Reply-To: <50FFF512.6050102@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: karl@freefriends.org, 13524@debbugs.gnu.org, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 01/23/2013 03:34 PM, Peter Rosin wrote: > On 2013-01-23 13:45, Stefano Lattarini wrote: >> Hi Peter, thanks for the patch. >> >> Not sure if you are in the mood (or have the time) to engage in a >> discussion about it, but here my review anyway. Even if you are not >> going to work on this patch anymore, a review will still be useful >> as a reference to me or other developers in the future. > > Well, apparently I was in the mood and found some more time :-) > >> On 01/22/2013 11:22 AM, Peter Rosin wrote: >>> From 5cc9c775dbe46343b651a7e6ac378f71e6a3b6c1 Mon Sep 17 00:00:00 2001 >>> From: Peter Rosin >>> Date: Tue, 22 Jan 2013 11:17:11 +0100 >>> Subject: [PATCH] reldir: Add support for relative names in included fragments >>> >> A nice explanation of the ratioanle for this change is a must I think. >> >> Also, we should add reference to this discussion (and related bug number), >> as well give credit where's its due (this idea was Bob's brainchild). > > And a NEWS entry, and docs. > Yes, but I've found out those can often be written in follow-up patches without too much churn or "history confusion"; OTOH, writing a clear and complete commit message is essential, especially for a new feature. > That part is less fun. > As for myself, I've actually reached a point where I find writing commit messages quite interesting. And I'm mostly neutral on NEWS entries. But of course, writing documentation sucks ;-) >>> automake.in (read_am_file): Add third argument specifying the >>> relative directory of this makefile fragment compared to the >>> main level makefile. Replace @am_reldir@ in the fragment with >>> this relative directory. >>> >> Using @acsubst@ style substitutions for something that is not substituted >> by config.status has proven a bad idea in the patch. We should use a new >> syntax, like '%subst%', ot even '&{subst}&'; personally, I like this latter >> best, since it help distinguish between Automake internal %TRASFORMS% from >> this new kind of special user-reserved substitution. >> >>> (read_main_am_file): Adjust. >>> t/reldir.sh: New test. >>> t/list-of-tests.mk: Augment. >>> --- >>> automake.in | 28 +++++++++++++++++---- >>> t/list-of-tests.mk | 1 + >>> t/reldir.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ >>> 3 files changed, 92 insertions(+), 5 deletions(-) >>> create mode 100755 t/reldir.sh >>> >>> diff --git a/automake.in b/automake.in >>> index 0e3b882..4e52aca 100644 >>> --- a/automake.in >>> +++ b/automake.in >>> @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) >>> } >>> >>> >>> -# &read_am_file ($AMFILE, $WHERE) >>> -# ------------------------------- >>> +# &read_am_file ($AMFILE, $WHERE, $RELDIR) >>> +# ---------------------------------------- >>> # Read Makefile.am and set up %contents. Simultaneously copy lines >>> # from Makefile.am into $output_trailer, or define variables as >>> # appropriate. NOTE we put rules in the trailer section. We want >>> # user rules to come after our generated stuff. >>> sub read_am_file ($$) >>> { >>> - my ($amfile, $where) = @_; >>> + my ($amfile, $where, $reldir) = @_; >>> >>> my $am_file = new Automake::XFile ("< $amfile"); >>> verb "reading $amfile"; >>> @@ -6423,6 +6423,18 @@ sub read_am_file ($$) >>> >>> my $new_saw_bk = check_trailing_slash ($where, $_); >>> >>> + if ($reldir ne '.') >>> + { >>> + my $rel_dir = &canonicalize ($reldir); >>> + $_ =~ s/\@am_reldir\@\//${reldir}\//g; >>> + $_ =~ s/\@am_reldir\@_/${rel_dir}_/g; >>> + } >>> + else >>> + { >>> + $_ =~ s/\@am_reldir\@\///g; >>> + $_ =~ s/\@am_reldir\@_//g; >>> + } >>> + >> Too much automagic here IMO. We'd better have two distinct subst, one for >> the "real" directory name, and one for the directory name "canonicalized" >> for use in Automake primaries. I.e., from: > > The gain was that the '.' case needs to peak at, and perhaps eat, the > trailing separator anyway (or it will look bad, I mean, who wants __foo > after writing &{CANON_CURDIR}&_foo and curdir happens to be '.'?) > Good point. We should allow the user to write something like "&{CANON_CURDIR}&foo_SOURCES" instead, so that it can work for the current directory too; not much important for human-written makefiles, but might be for autogenerated ones (I'm thinking ahead about a Gnulib integration here; the current support for non-recursive projects there is quite hacky, and could benefit from this new feature). >> # In sub/sub2/local.mk >> bin_PROGRAMS = sub/sub2/my-prog >> sub_sub2_my_prog_SOURCES = sub/sub2/main.c sub/sub2/compat.c >> >> to: >> >> # In sub/sub2/local.mk >> bin_PROGRAMS = &{CURDIR}&/my-prog >> &{CANON_CURDIR}&_my_prog_SOURCES = &{CURDIR}&/main.c &{CURDIR}&/compat.c >> >> Aa for what should be the actual names of this substitutions (I realize >> the names above kinda suck), suggestions are welcome. > > After a short brainstorm, I went with &{CUR/DIR}& and &{CUR_DIR}&, but > I'm not totally satisfied with the / version as it doesn't look "natural". > But it is self explanatory, kind of. I'm not attached to the naming in > any way, but &{CANON_CURDIR}& is too long IMHO. > I agree we shouldn't overthink this; the naming is something that could be changed easily in a follow-up patch, before this feature branch is integrated back in master. I'm also thinking we could introduce shorthands for often-used &{subst}&; e.g., &{C}& for &{CANON_CURDIR}& and &{D}& for &{CURDIR}&. Again, this is material for a follow-up. >>> if (/$IGNORE_PATTERN/o) >>> { >>> # Merely delete comments beginning with two hashes. >>> @@ -6584,8 +6596,14 @@ sub read_am_file ($$) >>> push_dist_common ("\$\(srcdir\)/$path"); >>> $path = $relative_dir . "/" . $path if $relative_dir ne '.'; >>> } >>> + my $new_reldir = $path; >>> + # $new_reldir =~ s/\$\($reldir\)\///; >>> + if ($new_reldir =~ s/\/[^\/]*$// == 0) >>> >> This is probably better written as: >> >> if ($new_reldir !~ s,/[^/]*$,,) > > Yes, looks better. I haven't bothered to look up the perl doc that > spells out exactly why it is equivalent, but I'll trust you on > that. > >>> + { >>> + $new_reldir = '.'; >>> + } >>> $where->push_context ("'$path' included from here"); >>> - &read_am_file ($path, $where); >>> + &read_am_file ($path, $where, $new_reldir); >>> $where->pop_context; >>> } >>> else >>> @@ -6658,7 +6676,7 @@ sub read_main_am_file ($$) >>> &define_standard_variables; >>> >>> # Read user file, which might override some of our values. >>> - &read_am_file ($amfile, new Automake::Location); >>> + &read_am_file ($amfile, new Automake::Location, '.'); >>> } >>> >>> [SNIP good testsuite addition] >>> >> >> I really like how simple and unobtrusive this patch is! > > Yes, it was simpler than I anticipated. After posting I noticed that > some project (was it coreutils?) used "include $(srcdir)/foo/local.mk" > That usage is advised by our own manual, so we should definitely support it ... As well as "include $(top_srcdir)/foo/local.mk" (this latter might be trickier though). > and figured my changes wouldn't support that. But that works too, I > don't know why though. (not that I'm complaining) > We should definitely add a test for that too; yes, I'm volunteering to do so -- you know I like writing tests :-) > Updated patch attached, I renamed it to curdir instead of reldir (and > sorry for not dropping the automake list last time around). > Thanks, I'll take a look at it tomorrow. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 24 07:22:55 2013 Received: (at 13524) by debbugs.gnu.org; 24 Jan 2013 12:22:55 +0000 Received: from localhost ([127.0.0.1]:47470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyLpW-00010W-Ri for submit@debbugs.gnu.org; Thu, 24 Jan 2013 07:22:55 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:49854) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyLpT-00010N-Fa for 13524@debbugs.gnu.org; Thu, 24 Jan 2013 07:22:53 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7C1B54000B; Thu, 24 Jan 2013 13:22:47 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id D5F9540006; Thu, 24 Jan 2013 13:22:46 +0100 (CET) Message-ID: <51012795.4050508@lysator.liu.se> Date: Thu, 24 Jan 2013 13:22:45 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini , Miles Bader , 13524@debbugs.gnu.org, Karl Berry Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> In-Reply-To: <50FFFCF2.2040808@gmail.com> Content-Type: multipart/mixed; boundary="------------010409030309050603060400" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) This is a multi-part message in MIME format. --------------010409030309050603060400 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2013-01-23 16:08, Stefano Lattarini wrote: > On 01/23/2013 03:34 PM, Peter Rosin wrote: >> On 2013-01-23 13:45, Stefano Lattarini wrote: *snip* >>> Too much automagic here IMO. We'd better have two distinct subst, one for >>> the "real" directory name, and one for the directory name "canonicalized" >>> for use in Automake primaries. I.e., from: >> >> The gain was that the '.' case needs to peak at, and perhaps eat, the >> trailing separator anyway (or it will look bad, I mean, who wants __foo >> after writing &{CANON_CURDIR}&_foo and curdir happens to be '.'?) >> > Good point. We should allow the user to write something like > "&{CANON_CURDIR}&foo_SOURCES" instead, so that it can work for the > current directory too; not much important for human-written makefiles, > but might be for autogenerated ones (I'm thinking ahead about a Gnulib > integration here; the current support for non-recursive projects > there is quite hacky, and could benefit from this new feature). Are you saying that &{CURDIR}& should be replaced with the empty string when the current relative directory is "." and the current relative directory followed by a slash otherwise? (And similar, but with a trailing underscore for &{CANON_CURDIR}&) I don't fancy that, as I think &{CURDIR}&gazonk.c is that much harder to read than &{CURDIR}&/gazonk.c. So, I'd rather have the magic extend beyond the }& even if that is ugly indeed. Maybe I'm just deluded to want that... Or, do you mean that &{CURDIR}& should peak ahead and only add a trailing "/" if it is not followed by a slash (or whitespace?) already, making "&{CURDIR}&foo.c" and "&{CURDIR}&/foo.c" equivalent except when &{CURDIR}& is "." (which would come out as "foo.c" and "./foo.c" respectively)? *snip* > Thanks, I'll take a look at it tomorrow. Another day, another version. I hope you didn't wast too much time on v2... I changed to &{CANON_CURDIR}& and &{CURDIR}&, added support for $(top_srcdir) and improved the test. There's more code due to the $(top_srcdir) support, and maybe there are some preexisting functionality that strips common leading directory components that could have been reused, but I'm ignorant. Besides, what's wrong with NIH? :-) Cheers, Peter --------------010409030309050603060400 Content-Type: text/x-patch; name="0001-curdir-add-support-for-relative-names-in-included-fr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-curdir-add-support-for-relative-names-in-included-fr.pa"; filename*1="tch" >From 2b7e4915ce65a56d03a75579cb3e3c40914acd92 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Thu, 24 Jan 2013 12:22:45 +0100 Subject: [PATCH] curdir: add support for relative names in included fragments The rationale for this change is that it is annoying to have to repeat the directory name when including a Makefile fragment. For deep directory structures these repeats can generate a lot of bloat. It also hinders reuse and easy directory restructuring if all Makefile fragments have to know exactly where they live. Suggested by Bob Friesenhahn, and later discussed in bug #13524. automake.in (read_am_file): Add third argument specifying the relative directory of this Makefile fragment compared to the main Makefile. Replace &{CURDIR}& and &{CANON_CURDIR}& in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. t/curdir.sh: New test. t/list-of-tests.mk: Augment. --- automake.in | 55 ++++++++++++++++++++++-- t/curdir.sh | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/list-of-tests.mk | 1 + 3 files changed, 166 insertions(+), 5 deletions(-) create mode 100755 t/curdir.sh diff --git a/automake.in b/automake.in index 0e3b882..f52a439 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $CURDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. sub read_am_file ($$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $curdir) = @_; my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6423,18 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + my $cur_dir = &canonicalize ($curdir); + if ($curdir eq '.') + { + # If present, eat the following '_' or '/', converting + # "&{CURDIR}&/foo" and "&{CANON_CURDIR}&_foo" into plain "foo" + # when $curdir is '.'. + $_ =~ s,&\{CURDIR\}&/,,g; + $_ =~ s,&\{CANON_CURDIR\}&_,,g; + } + $_ =~ s/&\{CURDIR\}&/${curdir}/g; + $_ =~ s/&\{CANON_CURDIR\}&/${cur_dir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6559,6 +6571,7 @@ sub read_am_file ($$) elsif (/$INCLUDE_PATTERN/o) { my $path = $1; + my $new_curdir; if ($path =~ s/^\$\(top_srcdir\)\///) { @@ -6571,6 +6584,36 @@ sub read_am_file ($$) # the dependency. # (subdircond2.test and subdircond3.test will fail.) push_dist_common ("\$\(top_srcdir\)/$path"); + $new_curdir = $path; + $new_curdir = '.' if $new_curdir !~ s,/[^/]*$,,; + if ($relative_dir ne '.') + { + # Ok, the base Makefile.am is not in the $top_srcdir, + # trim as much as possible and hope that the fragment + # is below the base Makefile.am. + my $dir; + my $rel = $relative_dir; + foreach $dir (split ('/', $rel)) + { + if ($dir ne $new_curdir + && $dir . "/" ne substr ($new_curdir, 0, length ($dir) + 1)) + { + last; + } + # Phew, this directory component matched, trim it. + substr ($new_curdir, 0, length ($dir) + 1, ""); + substr ($rel, 0, length ($dir) + 1, ""); + } + if ($rel ne '') + { + # Sad, the fragment wasn't below the base Makefile.am. + # Oh well, do the best we can... + $rel =~ s#([^\/]{2,}|[^\.\/])#\.\.#g; + $new_curdir = $rel . "/" . $new_curdir; + } + $new_curdir =~ s,/\.?$,,; + $new_curdir = '.' if $new_curdir eq ''; + } } else { @@ -6583,9 +6626,11 @@ sub read_am_file ($$) # (subdircond2.test and subdircond3.test will fail.) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; + $new_curdir = $path; + $new_curdir = '.' if $new_curdir !~ s,/[^/]*$,,; } $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_curdir); $where->pop_context; } else @@ -6658,7 +6703,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/t/curdir.sh b/t/curdir.sh new file mode 100755 index 0000000..69b82b0 --- /dev/null +++ b/t/curdir.sh @@ -0,0 +1,115 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test &{CURDIR}& and &{CANON_CURDIR}&. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk +include $(top_srcdir)/top.mk +END + +cat > local.mk << 'END' +&{CANON_CURDIR}&_whoami: + @echo "I am &{CURDIR}&/local.mk" + +bin_PROGRAMS += &{CURDIR}&/mumble +&{CANON_CURDIR}&_mumble_SOURCES = &{CURDIR}&/one.c +END + +cat > top.mk << 'END' +&{CANON_CURDIR}&_top_whoami: + @echo "I am &{CURDIR}&/top.mk" + +bin_PROGRAMS += &{CURDIR}&/scream +&{CANON_CURDIR}&_scream_SOURCES = &{CURDIR}&/two.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include &{CURDIR}&/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot +cp one.c two.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output +$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/local.mk" output +$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/bar/local.mk" output +$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/foobar/local.mk" output + +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble + +cd zot + +$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../top.mk" output +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output + +$MAKE +./mumble +../scream diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 44f598e..1121735 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -340,6 +340,7 @@ t/cscope.tap \ t/cscope2.sh \ t/cscope3.sh \ t/c-demo.sh \ +t/curdir.sh \ t/cxx.sh \ t/cxx2.sh \ t/cxxcpp.sh \ -- 1.7.9 --------------010409030309050603060400-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 25 11:04:15 2013 Received: (at 13524) by debbugs.gnu.org; 25 Jan 2013 16:04:15 +0000 Received: from localhost ([127.0.0.1]:49419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyllF-0003JU-Ui for submit@debbugs.gnu.org; Fri, 25 Jan 2013 11:04:14 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:43688) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyllB-0003JJ-Dr for 13524@debbugs.gnu.org; Fri, 25 Jan 2013 11:04:11 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0BC804001D; Fri, 25 Jan 2013 17:03:59 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 2C9CA40008; Fri, 25 Jan 2013 17:03:58 +0100 (CET) Message-ID: <5102ACED.7040306@lysator.liu.se> Date: Fri, 25 Jan 2013 17:03:57 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini , Miles Bader , 13524@debbugs.gnu.org, Karl Berry Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> In-Reply-To: <51012795.4050508@lysator.liu.se> Content-Type: multipart/mixed; boundary="------------080406060409030801060800" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) This is a multi-part message in MIME format. --------------080406060409030801060800 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2013-01-24 13:22, Peter Rosin wrote: > On 2013-01-23 16:08, Stefano Lattarini wrote: >> On 01/23/2013 03:34 PM, Peter Rosin wrote: >>> On 2013-01-23 13:45, Stefano Lattarini wrote: > *snip* >>>> Too much automagic here IMO. We'd better have two distinct subst, one for >>>> the "real" directory name, and one for the directory name "canonicalized" >>>> for use in Automake primaries. I.e., from: >>> >>> The gain was that the '.' case needs to peak at, and perhaps eat, the >>> trailing separator anyway (or it will look bad, I mean, who wants __foo >>> after writing &{CANON_CURDIR}&_foo and curdir happens to be '.'?) >>> >> Good point. We should allow the user to write something like >> "&{CANON_CURDIR}&foo_SOURCES" instead, so that it can work for the >> current directory too; not much important for human-written makefiles, >> but might be for autogenerated ones (I'm thinking ahead about a Gnulib >> integration here; the current support for non-recursive projects >> there is quite hacky, and could benefit from this new feature). > > Are you saying that &{CURDIR}& should be replaced with the empty > string when the current relative directory is "." and the current > relative directory followed by a slash otherwise? (And similar, but > with a trailing underscore for &{CANON_CURDIR}&) I don't fancy > that, as I think &{CURDIR}&gazonk.c is that much harder to read than > &{CURDIR}&/gazonk.c. > > So, I'd rather have the magic extend beyond the }& even if that is > ugly indeed. Maybe I'm just deluded to want that... > > Or, do you mean that &{CURDIR}& should peak ahead and only add a > trailing "/" if it is not followed by a slash (or whitespace?) > already, making "&{CURDIR}&foo.c" and "&{CURDIR}&/foo.c" equivalent > except when &{CURDIR}& is "." (which would come out as "foo.c" and > "./foo.c" respectively)? > > *snip* >> Thanks, I'll take a look at it tomorrow. > > Another day, another version. I hope you didn't wast too much time > on v2... > > I changed to &{CANON_CURDIR}& and &{CURDIR}&, added support for > $(top_srcdir) and improved the test. There's more code due to the > $(top_srcdir) support, and maybe there are some preexisting > functionality that strips common leading directory components that > could have been reused, but I'm ignorant. Besides, what's wrong > with NIH? :-) Zapping the NIH part reduced the code size significantly (the patch is now short, sweet and unintrusive again) so I'm posting a new version. After all, it's a new day, right? I hope it's ok to use File::Spec->abs2rel () in Automake? BTW, let me know if I should trim the CC list. Cheers, Peter --------------080406060409030801060800 Content-Type: text/x-patch; name="0001-curdir-add-support-for-relative-names-in-included-fr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-curdir-add-support-for-relative-names-in-included-fr.pa"; filename*1="tch" >From d8662c978354043708dd82bd73ff477d602071d6 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Fri, 25 Jan 2013 16:56:16 +0100 Subject: [PATCH] curdir: add support for relative names in included fragments The rationale for this change is that it is annoying to have to repeat the directory name when including a Makefile fragment. For deep directory structures these repeats can generate a lot of bloat. It also hinders reuse and easy directory restructuring if all Makefile fragments have to know exactly where they live. Suggested by Bob Friesenhahn, and later discussed in bug #13524. automake.in (read_am_file): Add third argument specifying the relative directory of this Makefile fragment compared to the main Makefile. Replace &{CURDIR}& and &{CANON_CURDIR}& in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. t/curdir.sh: New test. t/list-of-tests.mk: Augment. --- automake.in | 26 +++++++++-- t/curdir.sh | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/list-of-tests.mk | 1 + 3 files changed, 137 insertions(+), 5 deletions(-) create mode 100755 t/curdir.sh diff --git a/automake.in b/automake.in index 0e3b882..6018489 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,15 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $CURDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. sub read_am_file ($$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $curdir) = @_; my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6423,18 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + my $cur_dir = &canonicalize ($curdir); + if ($curdir eq '.') + { + # If present, eat the following '_' or '/', converting + # "&{CURDIR}&/foo" and "&{CANON_CURDIR}&_foo" into plain "foo" + # when $curdir is '.'. + $_ =~ s,&\{CURDIR\}&/,,g; + $_ =~ s,&\{CANON_CURDIR\}&_,,g; + } + $_ =~ s/&\{CURDIR\}&/${curdir}/g; + $_ =~ s/&\{CANON_CURDIR\}&/${cur_dir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6559,6 +6571,7 @@ sub read_am_file ($$) elsif (/$INCLUDE_PATTERN/o) { my $path = $1; + my $new_curdir; if ($path =~ s/^\$\(top_srcdir\)\///) { @@ -6571,6 +6584,7 @@ sub read_am_file ($$) # the dependency. # (subdircond2.test and subdircond3.test will fail.) push_dist_common ("\$\(top_srcdir\)/$path"); + $new_curdir = File::Spec->abs2rel ($path, $relative_dir); } else { @@ -6583,9 +6597,11 @@ sub read_am_file ($$) # (subdircond2.test and subdircond3.test will fail.) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; + $new_curdir = $path; } + $new_curdir = '.' if $new_curdir !~ s,/[^/]*$,,; $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_curdir); $where->pop_context; } else @@ -6658,7 +6674,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/t/curdir.sh b/t/curdir.sh new file mode 100755 index 0000000..69b82b0 --- /dev/null +++ b/t/curdir.sh @@ -0,0 +1,115 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test &{CURDIR}& and &{CANON_CURDIR}&. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk +include $(top_srcdir)/top.mk +END + +cat > local.mk << 'END' +&{CANON_CURDIR}&_whoami: + @echo "I am &{CURDIR}&/local.mk" + +bin_PROGRAMS += &{CURDIR}&/mumble +&{CANON_CURDIR}&_mumble_SOURCES = &{CURDIR}&/one.c +END + +cat > top.mk << 'END' +&{CANON_CURDIR}&_top_whoami: + @echo "I am &{CURDIR}&/top.mk" + +bin_PROGRAMS += &{CURDIR}&/scream +&{CANON_CURDIR}&_scream_SOURCES = &{CURDIR}&/two.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include &{CURDIR}&/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot +cp one.c two.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output +$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/local.mk" output +$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/bar/local.mk" output +$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/foobar/local.mk" output + +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble + +cd zot + +$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../top.mk" output +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output + +$MAKE +./mumble +../scream diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 44f598e..1121735 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -340,6 +340,7 @@ t/cscope.tap \ t/cscope2.sh \ t/cscope3.sh \ t/c-demo.sh \ +t/curdir.sh \ t/cxx.sh \ t/cxx2.sh \ t/cxxcpp.sh \ -- 1.7.9 --------------080406060409030801060800-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 26 19:54:59 2013 Received: (at 13524) by debbugs.gnu.org; 27 Jan 2013 00:55:00 +0000 Received: from localhost ([127.0.0.1]:50888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzGWQ-0000gL-Oq for submit@debbugs.gnu.org; Sat, 26 Jan 2013 19:54:59 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:42635) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzGWM-0000gA-B3 for 13524@debbugs.gnu.org; Sat, 26 Jan 2013 19:54:57 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 1978F40020; Sun, 27 Jan 2013 01:54:36 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 4BA6340009; Sun, 27 Jan 2013 01:54:35 +0100 (CET) Message-ID: <51047ACA.3050808@lysator.liu.se> Date: Sun, 27 Jan 2013 01:54:34 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini , Miles Bader , 13524@debbugs.gnu.org, Karl Berry Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> In-Reply-To: <5102ACED.7040306@lysator.liu.se> Content-Type: multipart/mixed; boundary="------------010902040106060504020702" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) This is a multi-part message in MIME format. --------------010902040106060504020702 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2013-01-25 17:03, Peter Rosin wrote: > On 2013-01-24 13:22, Peter Rosin wrote: >> On 2013-01-23 16:08, Stefano Lattarini wrote: >>> On 01/23/2013 03:34 PM, Peter Rosin wrote: >>>> On 2013-01-23 13:45, Stefano Lattarini wrote: >> *snip* >>>>> Too much automagic here IMO. We'd better have two distinct subst, one for >>>>> the "real" directory name, and one for the directory name "canonicalized" >>>>> for use in Automake primaries. I.e., from: >>>> >>>> The gain was that the '.' case needs to peak at, and perhaps eat, the >>>> trailing separator anyway (or it will look bad, I mean, who wants __foo >>>> after writing &{CANON_CURDIR}&_foo and curdir happens to be '.'?) >>>> >>> Good point. We should allow the user to write something like >>> "&{CANON_CURDIR}&foo_SOURCES" instead, so that it can work for the >>> current directory too; not much important for human-written makefiles, >>> but might be for autogenerated ones (I'm thinking ahead about a Gnulib >>> integration here; the current support for non-recursive projects >>> there is quite hacky, and could benefit from this new feature). >> >> Are you saying that &{CURDIR}& should be replaced with the empty >> string when the current relative directory is "." and the current >> relative directory followed by a slash otherwise? (And similar, but >> with a trailing underscore for &{CANON_CURDIR}&) I don't fancy >> that, as I think &{CURDIR}&gazonk.c is that much harder to read than >> &{CURDIR}&/gazonk.c. >> >> So, I'd rather have the magic extend beyond the }& even if that is >> ugly indeed. Maybe I'm just deluded to want that... >> >> Or, do you mean that &{CURDIR}& should peak ahead and only add a >> trailing "/" if it is not followed by a slash (or whitespace?) >> already, making "&{CURDIR}&foo.c" and "&{CURDIR}&/foo.c" equivalent >> except when &{CURDIR}& is "." (which would come out as "foo.c" and >> "./foo.c" respectively)? >> >> *snip* >>> Thanks, I'll take a look at it tomorrow. >> >> Another day, another version. I hope you didn't wast too much time >> on v2... >> >> I changed to &{CANON_CURDIR}& and &{CURDIR}&, added support for >> $(top_srcdir) and improved the test. There's more code due to the >> $(top_srcdir) support, and maybe there are some preexisting >> functionality that strips common leading directory components that >> could have been reused, but I'm ignorant. Besides, what's wrong >> with NIH? :-) > > Zapping the NIH part reduced the code size significantly (the patch > is now short, sweet and unintrusive again) so I'm posting a new version. > After all, it's a new day, right? > > I hope it's ok to use File::Spec->abs2rel () in Automake? This time with documentation and a NEWS entry. I also fixed the case of including something above the current base Makefile.am with a relative path, e.g.: include ../top.mk That change shaved a couple of more lines. Neat. I also rebased it, so now it is against master. Cheers, Peter --------------010902040106060504020702 Content-Type: text/x-patch; name="0001-curdir-add-support-for-relative-names-in-included-fr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-curdir-add-support-for-relative-names-in-included-fr.pa"; filename*1="tch" >From b32d5197ac8f6c97750a22990995c98240c4cadb Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Sun, 27 Jan 2013 00:48:28 +0100 Subject: [PATCH] curdir: add support for relative names in included fragments The rationale for this change is that it is annoying to have to repeat the directory name when including a Makefile fragment. For deep directory structures these repeats can generate a lot of bloat. It also hinders reuse and easy directory restructuring if all Makefile fragments have to know exactly where they live. Suggested by Bob Friesenhahn, and later discussed in bug#13524. automake.in (read_am_file): Add third argument specifying the relative directory of this Makefile fragment compared to the main Makefile. Replace &{CURDIR}& and &{CANON_CURDIR}& in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. t/curdir.sh: New test. t/list-of-tests.mk: Augment. doc/automake.texi (Include): Document the new feature. NEWS: Add new feature. Signed-off-by: Peter Rosin --- NEWS | 10 ++++ automake.in | 24 ++++++++-- doc/automake.texi | 20 ++++++++ t/curdir.sh | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/list-of-tests.mk | 1 + 5 files changed, 179 insertions(+), 5 deletions(-) create mode 100755 t/curdir.sh diff --git a/NEWS b/NEWS index 7a25b80..3a2d8e7 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,16 @@ New in 1.14: over the same-named automake-provided macro, as defined in file '/usr/local/share/aclocal-1.14/vala.m4'. +* Current directory in makefile fragments: + + - Use the special makefile fragment substitutions &{CURDIR}& and + &{CANON_CURDIR}& (a.k.a. &{D}& and &{C}& respectively) to insert the + relative directory of the fragment (or its canonicalized version) in + the makefile: + + bin_PROGRAMS += &{CURDIR}&/foo + &{CANON_CURDIR}&_foo_SOURCES = &{CURDIR}&/bar.c + * Obsolescent features flagged: - Use of the special makefile variable 'ACLOCAL_AMFLAGS' is deprecated. diff --git a/automake.in b/automake.in index 4776581..f31a4ba 100644 --- a/automake.in +++ b/automake.in @@ -6302,15 +6302,15 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $CURDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. sub read_am_file ($$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $curdir) = @_; my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6395,6 +6395,18 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + my $cur_dir = &canonicalize ($curdir); + if ($curdir eq '.') + { + # If present, eat the following '_' or '/', converting + # "&{CURDIR}&/foo" and "&{CANON_CURDIR}&_foo" into plain "foo" + # when $curdir is '.'. + $_ =~ s,&\{(D|CURDIR)\}&/,,g; + $_ =~ s,&\{(C|CANON_CURDIR)\}&_,,g; + } + $_ =~ s/&\{(D|CURDIR)\}&/${curdir}/g; + $_ =~ s/&\{(C|CANON_CURDIR)\}&/${cur_dir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6556,8 +6568,10 @@ sub read_am_file ($$) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_curdir = File::Spec->abs2rel ($path, $relative_dir); + $new_curdir = '.' if $new_curdir !~ s,/[^/]*$,,; $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_curdir); $where->pop_context; } else @@ -6630,7 +6644,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/doc/automake.texi b/doc/automake.texi index 263e0cc..43b3542 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -10500,6 +10500,26 @@ condition applies to the entire contents of that fragment. Makefile fragments included this way are always distributed because they are needed to rebuild @file{Makefile.in}. +Inside a fragment, the construct @code{&@{CURDIR@}&} is replaced with the +directory of the fragment relative to the base @file{Makefile.am}. +Similarly, @code{&@{CANON_CURDIR@}&} is replaced with the canonicalized +(@pxref{Canonicalization}) form of @code{&@{CURDIR@}&}. As a convenience, +@code{&@{D@}&} is a synonym for @code{&@{CURDIR@}&}, and @code{&@{C@}&} +is a synonym for @code{&@{CANON_CURDIR@}&}. + +A special feature is that if the fragment is in the same directory as +the base @file{Makefile.am} (i.e., @code{&@{CURDIR@}&} is @code{.}), then +@code{&@{CURDIR@}&} and @code{&@{CANON_CURDIR@}&} will expand to the empty +string as well as eat, if present, a following slash or underscore +respectively. + +Thus, a makefile fragment might look like this: + +@example +bin_PROGRAMS += &@{CURDIR@}&/mumble +&@{CANON_CURDIR@}&_mumble_SOURCES = &@{CURDIR@}&/one.c +@end example + @node Conditionals @chapter Conditionals diff --git a/t/curdir.sh b/t/curdir.sh new file mode 100755 index 0000000..d222a52 --- /dev/null +++ b/t/curdir.sh @@ -0,0 +1,129 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test &{CURDIR}& and &{CANON_CURDIR}&. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk +include $(top_srcdir)/top.mk +include ../reltop.mk +END + +cat > local.mk << 'END' +&{CANON_CURDIR}&_whoami: + @echo "I am &{CURDIR}&/local.mk" + +bin_PROGRAMS += &{CURDIR}&/mumble +&{CANON_CURDIR}&_mumble_SOURCES = &{CURDIR}&/one.c +END + +cat > top.mk << 'END' +&{CANON_CURDIR}&_top_whoami: + @echo "I am &{CURDIR}&/top.mk" + +bin_PROGRAMS += &{D}&/scream +&{C}&_scream_SOURCES = &{D}&/two.c +END + +cat > reltop.mk << 'END' +&{C}&_reltop_whoami: + @echo "I am &{D}&/reltop.mk" + +bin_PROGRAMS += &{CURDIR}&/sigh +&{CANON_CURDIR}&_sigh_SOURCES = &{CURDIR}&/three.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include &{CURDIR}&/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot +cp one.c two.c +cp one.c three.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output +$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/local.mk" output +$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/bar/local.mk" output +$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/foobar/local.mk" output + +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble + +cd zot + +$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../top.mk" output +$MAKE ___reltop_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../reltop.mk" output +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output + +$MAKE +./mumble +../scream +../sigh diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index af78211..cc8d808 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -340,6 +340,7 @@ t/cscope.tap \ t/cscope2.sh \ t/cscope3.sh \ t/c-demo.sh \ +t/curdir.sh \ t/cxx.sh \ t/cxx2.sh \ t/cxxcpp.sh \ -- 1.7.9 --------------010902040106060504020702-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 14:22:14 2013 Received: (at 13524) by debbugs.gnu.org; 27 Jan 2013 19:22:14 +0000 Received: from localhost ([127.0.0.1]:51659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzXny-0004Dj-II for submit@debbugs.gnu.org; Sun, 27 Jan 2013 14:22:14 -0500 Received: from mail-bk0-f51.google.com ([209.85.214.51]:44715) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzXnw-0004DZ-Id for 13524@debbugs.gnu.org; Sun, 27 Jan 2013 14:22:13 -0500 Received: by mail-bk0-f51.google.com with SMTP id ik5so995002bkc.10 for <13524@debbugs.gnu.org>; Sun, 27 Jan 2013 11:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ijTajz7C+B4KNZYBjq6hQmvQz1u7ok81SLnW50dLGYg=; b=0QrHqUQOdwCaNQGGVebgybATDN8eX7IfjRoFEam1+DGTc44SVs3UABMKVgCF/uHsHm 32bwWUWOPKPWGEbZaJSdvqrXijtUpXwfNI6xp59kI4yu4pfVkDJ5gPkSOFmDLblujR56 qJQCQ/AtWnp/3Ff0J3ua91QfWNPXe9q7Dof7PBIVzA9LMpr7R9ulupQRxuxi+QVxNMBO 9xn/lGq9ee53uHPfWTmNG9KX/aQnjn/inWrEaEwqwy4U/ZlUw5J6FNxa4UCbTnoHqB0+ igyGpMSabIG23WOlozvINZfTq5Q6HEttDYdhk6gJm6uf/UtBh+FcTtLlQpsGG+AoO8tU d+kg== X-Received: by 10.204.147.7 with SMTP id j7mr3416519bkv.125.1359314510370; Sun, 27 Jan 2013 11:21:50 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id n1sm4634308bkv.14.2013.01.27.11.21.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Jan 2013 11:21:49 -0800 (PST) Message-ID: <51057E46.4070601@gmail.com> Date: Sun, 27 Jan 2013 20:21:42 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> In-Reply-To: <51047ACA.3050808@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hi Peter. On 01/27/2013 01:54 AM, Peter Rosin wrote: > > [SNIP] > >> Zapping the NIH part reduced the code size significantly (the patch >> is now short, sweet and unintrusive again) so I'm posting a new version. >> After all, it's a new day, right? >> >> I hope it's ok to use File::Spec->abs2rel () in Automake? > Yes, File::Spec is a core perl module. > > This time with documentation and a NEWS entry. I also fixed the case > of including something above the current base Makefile.am with a > relative path, e.g.: > > include ../top.mk > > That change shaved a couple of more lines. Neat. > > I also rebased it, so now it is against master. > Thanks, it seems nice and good. I'm doing some testsuite enhancements, and then I have some proposals for further tweaks, but all of those should be for follow-up patches. Will you allow me some days to prepare a follow-up patch series for further discussion? Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 18:39:06 2013 Received: (at 13524) by debbugs.gnu.org; 27 Jan 2013 23:39:06 +0000 Received: from localhost ([127.0.0.1]:51752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzboX-0002kD-RW for submit@debbugs.gnu.org; Sun, 27 Jan 2013 18:39:06 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:57835) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzboT-0002jm-0L for 13524@debbugs.gnu.org; Sun, 27 Jan 2013 18:39:02 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id D9D1440012; Mon, 28 Jan 2013 00:38:37 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 2FA754000F; Mon, 28 Jan 2013 00:38:37 +0100 (CET) Message-ID: <5105BA7C.7090000@lysator.liu.se> Date: Mon, 28 Jan 2013 00:38:36 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> In-Reply-To: <51057E46.4070601@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.4 (/) Hi Stefano, On 2013-01-27 20:21, Stefano Lattarini wrote: >> This time with documentation and a NEWS entry. I also fixed the case >> of including something above the current base Makefile.am with a >> relative path, e.g.: >> >> include ../top.mk >> >> That change shaved a couple of more lines. Neat. >> >> I also rebased it, so now it is against master. >> > Thanks, it seems nice and good. I'm doing some testsuite enhancements, > and then I have some proposals for further tweaks, but all of those > should be for follow-up patches. Will you allow me some days to prepare > a follow-up patch series for further discussion? Sure, take your time, I feel like I'm done. For about the fifth time :-) or something like that. Besides, the patch will not be of all that much use to me until it lands in a released version anyway. Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 11:20:39 2013 Received: (at 13524) by debbugs.gnu.org; 1 Feb 2013 16:20:39 +0000 Received: from localhost ([127.0.0.1]:59466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1JLx-0006Ht-Si for submit@debbugs.gnu.org; Fri, 01 Feb 2013 11:20:39 -0500 Received: from mail-ea0-f180.google.com ([209.85.215.180]:64931) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1JLv-0006Hm-La for 13524@debbugs.gnu.org; Fri, 01 Feb 2013 11:20:36 -0500 Received: by mail-ea0-f180.google.com with SMTP id c1so1820753eaa.39 for <13524@debbugs.gnu.org>; Fri, 01 Feb 2013 08:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/XzPh2XNJhtC8V0f2/2cjtfpLWvOSI8E+WvyY5ManUw=; b=PDcuOw4tv0ml97PzTO7fj3Gg0tRwCys821kJE3PMmJToR8a0iiboRLHH4ipts7w0xp /wiycDS2x0npCbOVWcpkg/moDQtcjSgwncFE6Rn7J8wZBbfVisN3WB/UcReirvMTAdtC QpQpcxEi8ob4jOyPErFDsa8FKqlyXDaZ3+iS3TjmUnnAdVZovu62VABLFL8NT9P0EG+b EwiZyxw2Kphmkw3GWfXKoMubKOkEg66siu+8klYgMWPgESTJJ2VRZy6+brFp3qM9xL0N zI8qRkcK5fuSIM9fI8DSM8U8/Uy6RKPIcE9A0o9sxmg2Z4RjqWYFpvFA6ar6ChxSjqr4 Y5Hg== X-Received: by 10.14.1.195 with SMTP id 43mr40626119eed.31.1359735585921; Fri, 01 Feb 2013 08:19:45 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id q5sm13217719eeo.17.2013.02.01.08.19.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 08:19:44 -0800 (PST) Message-ID: <510BEB17.8070505@gmail.com> Date: Fri, 01 Feb 2013 17:19:35 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bert Wesarg Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Karl Berry , 13524@debbugs.gnu.org, =?UTF-8?B?Q2hy?= =?UTF-8?B?aXN0aWFuIFLDtnNzZWw=?= , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/01/2013 04:18 PM, Bert Wesarg wrote: > Hi all, > > On Mon, Jan 28, 2013 at 12:38 AM, Peter Rosin wrote: >> Hi Stefano, >> >> On 2013-01-27 20:21, Stefano Lattarini wrote: >>>> This time with documentation and a NEWS entry. I also fixed the case >>>> of including something above the current base Makefile.am with a >>>> relative path, e.g.: >>>> >>>> include ../top.mk >>>> >>>> That change shaved a couple of more lines. Neat. >>>> >>>> I also rebased it, so now it is against master. >>>> >>> Thanks, it seems nice and good. I'm doing some testsuite enhancements, >>> and then I have some proposals for further tweaks, but all of those >>> should be for follow-up patches. Will you allow me some days to prepare >>> a follow-up patch series for further discussion? >> >> Sure, take your time, I feel like I'm done. For about the fifth >> time :-) or something like that. Besides, the patch will not be of >> all that much use to me until it lands in a released version anyway. > > while I didn't try the current patch out. I would like to describe in > short the situation where one of our projects build system is in: > Sure, we use a non-recursive build. But we use the same sources in one > package by two sub-configures to build different targets. > > Our makefiles which we include in the top-level Makefile.am look like > this (we name them 'Makefile.inc.am): > > src/Makefile.inc.am: > > bin_PROGRAM = foo > foo_SOURCES = ../src/foo.c > > and in the top-level Makefile.am: > > build-1/Makefile.am: > > include ../src/Makefile.inc.am > > So, using this patch, we would change the src/Makefile.inc.am to: > > bin_PROGRAM = foo > foo_SOURCES = &{D}&/foo.c > > Right? > Yes, that should work. Best regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 11:56:02 2013 Received: (at 13524) by debbugs.gnu.org; 1 Feb 2013 16:56:02 +0000 Received: from localhost ([127.0.0.1]:59483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1JuD-00075W-Br for submit@debbugs.gnu.org; Fri, 01 Feb 2013 11:56:02 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:56395) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1IOC-0004qm-20 for 13524@debbugs.gnu.org; Fri, 01 Feb 2013 10:18:53 -0500 Received: by mail-lb0-f177.google.com with SMTP id go11so4671480lbb.36 for <13524@debbugs.gnu.org>; Fri, 01 Feb 2013 07:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=5NFaZAXv66A7KjBDMLWSFtFFqSxVa6dEA6/HiqdpLrc=; b=XJine/vtLT46zgMLDGE5KbSFEyywYWv62vN3gxW+QkSiYrM2Xenu3FhObaV/B0tf2V n7yeIW3QYyJ0at1/httzXBDDzK+9bYKp4FSSXGOgZItUeBbP3FtRYfPhsLHuP0fYAzHf g6Or1NmVz7xf9zlTV/M19gYKcn+u5qzvImcNC9fv63Q1xpzWo9tajqXLhsoTJ9qWRyRF tBv3tKxIGDU6mD2E7ZHQMm2ytjyq+umYPEN1qtYSA0ynCHctl1x5owBsJjhs+p8yIy4C iw326/N6aK3VGFtBDhsqT25SAe8BlcAC29OnqQbDR6++xnHRMdKchBMjRmjaRQdMbCsv Legw== MIME-Version: 1.0 X-Received: by 10.112.50.169 with SMTP id d9mr4868631lbo.57.1359731882581; Fri, 01 Feb 2013 07:18:02 -0800 (PST) Received: by 10.112.79.137 with HTTP; Fri, 1 Feb 2013 07:18:02 -0800 (PST) In-Reply-To: <5105BA7C.7090000@lysator.liu.se> References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> Date: Fri, 1 Feb 2013 16:18:02 +0100 Message-ID: Subject: Re: bug#13524: Improving user experience for non-recursive builds From: Bert Wesarg To: Peter Rosin Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 X-Mailman-Approved-At: Fri, 01 Feb 2013 11:55:59 -0500 Cc: 13524@debbugs.gnu.org, Karl Berry , Stefano Lattarini , =?UTF-8?Q?Christian_R=C3=B6ssel?= , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi all, On Mon, Jan 28, 2013 at 12:38 AM, Peter Rosin wrote: > Hi Stefano, > > On 2013-01-27 20:21, Stefano Lattarini wrote: >>> This time with documentation and a NEWS entry. I also fixed the case >>> of including something above the current base Makefile.am with a >>> relative path, e.g.: >>> >>> include ../top.mk >>> >>> That change shaved a couple of more lines. Neat. >>> >>> I also rebased it, so now it is against master. >>> >> Thanks, it seems nice and good. I'm doing some testsuite enhancements, >> and then I have some proposals for further tweaks, but all of those >> should be for follow-up patches. Will you allow me some days to prepare >> a follow-up patch series for further discussion? > > Sure, take your time, I feel like I'm done. For about the fifth > time :-) or something like that. Besides, the patch will not be of > all that much use to me until it lands in a released version anyway. while I didn't try the current patch out. I would like to describe in short the situation where one of our projects build system is in: Sure, we use a non-recursive build. But we use the same sources in one package by two sub-configures to build different targets. Our makefiles which we include in the top-level Makefile.am look like this (we name them 'Makefile.inc.am): src/Makefile.inc.am: bin_PROGRAM = foo foo_SOURCES = ../src/foo.c and in the top-level Makefile.am: build-1/Makefile.am: include ../src/Makefile.inc.am So, using this patch, we would change the src/Makefile.inc.am to: bin_PROGRAM = foo foo_SOURCES = &{D}&/foo.c Right? Thanks. Bert > > Cheers, > Peter > From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 03 15:43:15 2013 Received: (at 13524) by debbugs.gnu.org; 3 Feb 2013 20:43:15 +0000 Received: from localhost ([127.0.0.1]:34608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U26PD-0002Oh-15 for submit@debbugs.gnu.org; Sun, 03 Feb 2013 15:43:15 -0500 Received: from mail-ee0-f50.google.com ([74.125.83.50]:34211) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U26P9-0002OW-PI; Sun, 03 Feb 2013 15:43:13 -0500 Received: by mail-ee0-f50.google.com with SMTP id e51so2985855eek.9 for ; Sun, 03 Feb 2013 12:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=XCdtgpDIhhDvOfzQNE94x6VmAPVUV5hERzc7YnJbC9Y=; b=pObIqEOiYdFt8XfY7IPyBajA56kW2dv8p7kTIYja+mN++xFUd+h2AmrZPFXPOMxlSh lkMM/zGTXaUU+bHU+f5bNzvlX7qruVD8Lqmo2Svc4d70Xfq9wBhG/WIf3OSAJW3JVChk xiQ7rzqQ5VjHAZ0uv183AqFjNhrJ8zt4S3ioFa3Db7ZZfMuQC923+1HsKVeK1A0QzzZD nCtGMp5zVAQaj9j4NFpg0Alu3milCvipYjUDXTfETRxBoDvjX5hiVFkQJ0rrKowJRsAD dL67fxxEt/pTpdNhx3tkb9+2p7DKq4OyA2EMdmKE9jYWDI+D2UQjZASEwGHzEIFrcRUN HJGA== X-Received: by 10.14.219.5 with SMTP id l5mr64524721eep.7.1359924130190; Sun, 03 Feb 2013 12:42:10 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id t4sm23902706eel.0.2013.02.03.12.42.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Feb 2013 12:42:09 -0800 (PST) Message-ID: <510ECB9E.8040404@gmail.com> Date: Sun, 03 Feb 2013 21:42:06 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> In-Reply-To: <5105BA7C.7090000@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 13524 + patch thanks [+cc automake-patches] Reference: On 01/28/2013 12:38 AM, Peter Rosin wrote: > Hi Stefano, > > On 2013-01-27 20:21, Stefano Lattarini wrote: >>> This time with documentation and a NEWS entry. I also fixed the case >>> of including something above the current base Makefile.am with a >>> relative path, e.g.: >>> >>> include ../top.mk >>> >>> That change shaved a couple of more lines. Neat. >>> >>> I also rebased it, so now it is against master. >>> >> Thanks, it seems nice and good. I'm doing some testsuite enhancements, >> and then I have some proposals for further tweaks, but all of those >> should be for follow-up patches. Will you allow me some days to prepare >> a follow-up patch series for further discussion? > > Sure, take your time, I feel like I'm done. For about the fifth > time :-) or something like that. Besides, the patch will not be of > all that much use to me until it lands in a released version anyway. > I've pushed the promised patches to the rewindable branch 'experimental/preproc' (based off of maint). I'll also soon send them to the list to simplify review (I will drop the bug tracker from CC:, to avoid cluttering up the report). As usual, reviews are welcome. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 03 18:11:10 2013 Received: (at 13524) by debbugs.gnu.org; 3 Feb 2013 23:11:10 +0000 Received: from localhost ([127.0.0.1]:34668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U28iL-0006hV-Ra for submit@debbugs.gnu.org; Sun, 03 Feb 2013 18:11:10 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:42413) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U28iI-0006hM-Sy for 13524@debbugs.gnu.org; Sun, 03 Feb 2013 18:11:08 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 446DA40005; Mon, 4 Feb 2013 00:10:04 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 60C2440002; Mon, 4 Feb 2013 00:10:03 +0100 (CET) Message-ID: <510EEE4A.80608@lysator.liu.se> Date: Mon, 04 Feb 2013 00:10:02 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> In-Reply-To: <510ECB9E.8040404@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 2013-02-03 21:42, Stefano Lattarini wrote: > I've pushed the promised patches to the rewindable branch > 'experimental/preproc' (based off of maint). I'll also soon > send them to the list to simplify review (I will drop the > bug tracker from CC:, to avoid cluttering up the report). > > As usual, reviews are welcome. I like the end result of this series, I especially like that I don't have to type &{this}& anymore. But I have some doubts whether the longish way to get there is really all that interesting? The argument that you should keep the history to show how you get from A to B is just not worth it when it's just about bike-shedding the naming... Why not merge 1 with the nobrainer renames of 3-6? The only "real changes" in the later patches are the $$ -> $$$ thing and the NEWS entry as far as I can tell, and if something should be in its own patch, that $$$ change is it. Oh right, there's the re-computing change as well. But I don't think it's worth it, just collapse it. The only sane way to look at this series is to diff from 6/6 to the branch-point, which should tell you something. But I don't feel strongly about it, it's just what I would have done. If 2/6 is a separate patch is not important to me either, so I would be ok with you collapsing the whole series into a single co-authored patch. But then again, I don't really care, and if you get tired from just thinking about rewriting the commit message I can fully understand that position. Another thing is that your new NEWS item is a bit awkward, and its single sentence is simply too long and winding IMHO. The * heading also needs an update. >From your 5/6: * Current directory in makefile fragments: - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' (and their abbreviated versions, '{D}' and '{C}' respectively) can now be used in an included Makefile fragment to indicate respectively the relative directory of that fragment and its canonicalized version, relative to the including Makefile: My suggestion: * Relative directory in Makefile fragments: - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' (and their abbreviated versions, '{D}' and '{C}' respectively) can now be used in an included Makefile fragment. They are substituted with the relative directory of the included fragment, or its canonicalized version, compared to the top level including Makefile: Cheers, Peter PS. You introduced the curdir naming, I had reldir in my original patch. :-) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 04:36:57 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 09:36:57 +0000 Received: from localhost ([127.0.0.1]:35199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2ITw-0006Yn-F4 for submit@debbugs.gnu.org; Mon, 04 Feb 2013 04:36:56 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:36792) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2ITu-0006Yg-9y for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 04:36:55 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7C16740005; Mon, 4 Feb 2013 10:35:49 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 08EC640002; Mon, 4 Feb 2013 10:35:49 +0100 (CET) Message-ID: <510F80F4.7020208@lysator.liu.se> Date: Mon, 04 Feb 2013 10:35:48 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> In-Reply-To: <510EEE4A.80608@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 2013-02-04 00:10, Peter Rosin wrote: > On 2013-02-03 21:42, Stefano Lattarini wrote: >> I've pushed the promised patches to the rewindable branch >> 'experimental/preproc' (based off of maint). I'll also soon >> send them to the list to simplify review (I will drop the >> bug tracker from CC:, to avoid cluttering up the report). >> >> As usual, reviews are welcome. > > I like the end result of this series, I especially like that I don't have > to type &{this}& anymore. *snip* Oops, a couple more things. The new naming will clobber anyone using a Makefile variable named RELDIR with brace syntax. E.g., this previously working code is broken by the series. RELDIR = src foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=${RELDIR} It will be preprocessed into RELDIR = src foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=$src and quasi-expanded into (assuming $s is empty) foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=rc Not sure what to do about it, or if it matters... Further, the use of /dev/full in the demo test is not portable. If I create /dev on Windows (i.e. C:\dev, or have it previously, I didn't, but not unlikely), and am allowed to write there (likely, on Windows), and /dev/full isn't supported (where is it supported, except Linux?), then the test falls apart. The MinGW program happily writes "dummy" to /dev/full (i.e. C:\dev\full from its view of the file system) but the MSYS script does not think /dev/full is a character device and it is not be allowed to write to /dev/full either, because typically /dev doesn't exist as a real directory. Typically /dev is virtual in MSYS (if it existed, it would be C:\MinGW\msys\1.0\dev from the MSYS view of the file system) so it assumes the MinGW program skipped, but it didn't. Why use special features like /dev/full in the testsuite of Automake? Surely there are better things one can do to check if a Makefile works. Mixing in stuff like that is just a recipe for strange bug reports and hardship for those on weird platforms. The gain for Automake is zero. Also, creating the file /dev/full with content "dummy" is bad manors, even if someone runs the testsuite as root (on a system not supporting /dev/full) and arguably deserves it. Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 06:25:09 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 11:25:09 +0000 Received: from localhost ([127.0.0.1]:35271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KAe-0000o6-L1 for submit@debbugs.gnu.org; Mon, 04 Feb 2013 06:25:08 -0500 Received: from mail-ee0-f53.google.com ([74.125.83.53]:53807) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KAa-0000nD-Vl for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 06:25:06 -0500 Received: by mail-ee0-f53.google.com with SMTP id e53so3095130eek.12 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 03:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=MAtGBWKu3aDcPFE5bTLaXzYC7Ti8sbqN2KL232jskSQ=; b=MuPEHQ1DECLkf6Cyxya1D6qABZ86z7x566/LRckzccDboCY7JuvYgdu5FCwBwqF6i3 KrAVxUt0vdUqRx6KpI55HHKcXLIubDPrDhiUZFwqjRMUc+5Jovioe29cKBOp1MirB/Ek WaW6tsOxhp1XQp4NYpuhfFZH6AMoRPmoHgFWJbemKbaXKUUW0565eWQHL2jjupCQtajO m3s/aPcsRK5QjsJjuY8+CCc+1ZdT3RNHvw21MT3dEjGGEvO9hc1CNainOZ2cuEtNxzsP Pp2zDfUKhNHsUDMckKElSHYO6JUexH2rxdWreiC205OyzTY7MxUfoeElAoatSr53A6CA c9MQ== X-Received: by 10.14.200.137 with SMTP id z9mr55063633een.20.1359977040068; Mon, 04 Feb 2013 03:24:00 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id h5sm26775502eem.1.2013.02.04.03.23.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:23:59 -0800 (PST) Message-ID: <510F9A4C.6000703@gmail.com> Date: Mon, 04 Feb 2013 12:23:56 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> In-Reply-To: <510EEE4A.80608@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 12:10 AM, Peter Rosin wrote: > On 2013-02-03 21:42, Stefano Lattarini wrote: >> I've pushed the promised patches to the rewindable branch >> 'experimental/preproc' (based off of maint). I'll also soon >> send them to the list to simplify review (I will drop the >> bug tracker from CC:, to avoid cluttering up the report). >> >> As usual, reviews are welcome. > > I like the end result of this series, I especially like that I don't have > to type &{this}& anymore. But I have some doubts whether the longish > way to get there is really all that interesting? > No, not really; the different approaches and names we tried can just be reported in the commit message, rather than littering up the Git history. So I'll squash all the patches, excluding only the second one, which I still wish to keep separate. > [SNIP] rest of rationle > Another thing is that your new NEWS item is a bit awkward, and its > single sentence is simply too long and winding IMHO. The * heading > also needs an update. > > From your 5/6: > > * Current directory in makefile fragments: > Oops, I had indeed forgotten to update this! > - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' > (and their abbreviated versions, '{D}' and '{C}' respectively) can now > be used in an included Makefile fragment to indicate respectively the > relative directory of that fragment and its canonicalized version, > relative to the including Makefile: > > My suggestion: > > * Relative directory in Makefile fragments: > > - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' > (and their abbreviated versions, '{D}' and '{C}' respectively) can now > be used in an included Makefile fragment. They are substituted with > the relative directory of the included fragment, or its canonicalized > version, compared to the top level including Makefile: > Yes, better. But I find the following even better (marginally): The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' (and their abbreviated versions, '{D}' and '{C}' respectively) can now be used in an included Makefile fragment. They are substituted, respectively, with the relative directory of the included fragment and its canonicalized version, compared to the top level including Makefile: OK? > PS. You introduced the curdir naming, I had reldir in my original patch. :-) > Yikes, sorry. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 06:34:43 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 11:34:44 +0000 Received: from localhost ([127.0.0.1]:35282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KJv-00012f-AC for submit@debbugs.gnu.org; Mon, 04 Feb 2013 06:34:43 -0500 Received: from mail-ee0-f50.google.com ([74.125.83.50]:65329) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KJs-00012X-U8 for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 06:34:41 -0500 Received: by mail-ee0-f50.google.com with SMTP id e51so3239958eek.23 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 03:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aGkDBEj8h4nqq3qWX9znf/qciU0ggUiQvORdt5XaROU=; b=RA64Zn774q4pKJ+VEji/Cbh64aB7B83PvGHcGvHmQYNVDKyNKc3yWe9ebcgMSf1Sba gPUcEEqCAuTDhgB7k7oQRWV7dOabu1Q2E/t0P0dfpwFMM8iCypWSUePOxVdpqZKXXPOn nUpjiYFvnnA1eVY+qraercDEgjS4JHBcD0kTbAsHFKN7ovdtECUn/b29NO+NN+Z5gUQm 4iVOpmtsL1sVnkRZELJzhAE55eDUUySMLjlJB7TKMFSncIUn2bJ1edBpZD4NJ0iNLaLk D+frW0AzkyDuCERhIVN2U8kqoxtmjDEK3Ntzh/EnmlGsYxd0EHOWK5Hzk7U6B3DARYMH OEmw== X-Received: by 10.14.176.133 with SMTP id b5mr56323021eem.37.1359977615796; Mon, 04 Feb 2013 03:33:35 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id q42sm17550048eem.14.2013.02.04.03.33.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:33:34 -0800 (PST) Message-ID: <510F9C8D.7000207@gmail.com> Date: Mon, 04 Feb 2013 12:33:33 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> In-Reply-To: <510F80F4.7020208@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 10:35 AM, Peter Rosin wrote: > On 2013-02-04 00:10, Peter Rosin wrote: >> On 2013-02-03 21:42, Stefano Lattarini wrote: >>> I've pushed the promised patches to the rewindable branch >>> 'experimental/preproc' (based off of maint). I'll also soon >>> send them to the list to simplify review (I will drop the >>> bug tracker from CC:, to avoid cluttering up the report). >>> >>> As usual, reviews are welcome. >> >> I like the end result of this series, I especially like that I don't have >> to type &{this}& anymore. > > *snip* > > Oops, a couple more things. The new naming will clobber > anyone using a Makefile variable named RELDIR with brace > syntax. Yikes, I didn't think of that. *blush* > E.g., this previously working code is broken by > the series. > > RELDIR = src > foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=${RELDIR} > > It will be preprocessed into > > RELDIR = src > foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=$src > Ouch. > and quasi-expanded into (assuming $s is empty) > > foobar_CPPFLAGS = $(AM_CPPFLAGS) -DRELDIR=rc > > Not sure what to do about it, or if it matters... > It does IMHO, since the failure you pointed out, albeit easy to work around, wouldn't be very obvious to diagnose, from the point of view of a non-particularly-expert user. What about doubling the curly braces? As in '{{RELDIR}}'. Would that be tolerable? Other possibilities (none particularly pleasant either, IMHO): {+RELDIR+} {:RELDIR:} {.RELDIR.} {-RELDIR-} Other proposals? > > Further, the use of /dev/full in the demo test is not > portable. If I create /dev on Windows (i.e. C:\dev, or have > it previously, I didn't, but not unlikely), and am allowed > to write there (likely, on Windows), and /dev/full isn't > supported (where is it supported, except Linux?), then the > test falls apart. The MinGW program happily writes "dummy" > to /dev/full (i.e. C:\dev\full from its view of the file > system) but the MSYS script does not think /dev/full is a > character device and it is not be allowed to write to > /dev/full either, because typically /dev doesn't exist as > a real directory. Typically /dev is virtual in MSYS (if it > existed, it would be C:\MinGW\msys\1.0\dev from the MSYS > view of the file system) so it assumes the MinGW program > skipped, but it didn't. > > Why use special features like /dev/full in the testsuite of > Automake? Surely there are better things one can do to check if > a Makefile works. Mixing in stuff like that is just a recipe > for strange bug reports and hardship for those on weird > platforms. The gain for Automake is zero. > > Also, creating the file /dev/full with content "dummy" is > bad manors, even if someone runs the testsuite as root (on a > system not supporting /dev/full) and arguably deserves it. > Mostly agreed; I tried to create the test as a reasonable demo mimicking real-world packages, but I've probably gotten carried too far, for no real advantage (but with potential lurking issues down the road). I will simplify the test. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 06:49:42 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 11:49:42 +0000 Received: from localhost ([127.0.0.1]:35291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KYP-0001Pk-Vc for submit@debbugs.gnu.org; Mon, 04 Feb 2013 06:49:42 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:39371) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2KYL-0001PZ-HR for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 06:49:38 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 9678140005; Mon, 4 Feb 2013 12:48:31 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id DE4F940002; Mon, 4 Feb 2013 12:48:30 +0100 (CET) Message-ID: <510FA00E.8050801@lysator.liu.se> Date: Mon, 04 Feb 2013 12:48:30 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F9A4C.6000703@gmail.com> In-Reply-To: <510F9A4C.6000703@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 2013-02-04 12:23, Stefano Lattarini wrote: > On 02/04/2013 12:10 AM, Peter Rosin wrote: >> On 2013-02-03 21:42, Stefano Lattarini wrote: >>> I've pushed the promised patches to the rewindable branch >>> 'experimental/preproc' (based off of maint). I'll also soon >>> send them to the list to simplify review (I will drop the >>> bug tracker from CC:, to avoid cluttering up the report). >>> >>> As usual, reviews are welcome. >> >> I like the end result of this series, I especially like that I don't have >> to type &{this}& anymore. But I have some doubts whether the longish >> way to get there is really all that interesting? >> > No, not really; the different approaches and names we tried can just be > reported in the commit message, rather than littering up the Git history. > > So I'll squash all the patches, excluding only the second one, which I > still wish to keep separate. Good. >> [SNIP] rest of rationle > >> Another thing is that your new NEWS item is a bit awkward, and its >> single sentence is simply too long and winding IMHO. The * heading >> also needs an update. >> >> From your 5/6: >> >> * Current directory in makefile fragments: >> > Oops, I had indeed forgotten to update this! > >> - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' >> (and their abbreviated versions, '{D}' and '{C}' respectively) can now >> be used in an included Makefile fragment to indicate respectively the >> relative directory of that fragment and its canonicalized version, >> relative to the including Makefile: >> >> My suggestion: >> >> * Relative directory in Makefile fragments: >> >> - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' >> (and their abbreviated versions, '{D}' and '{C}' respectively) can now >> be used in an included Makefile fragment. They are substituted with >> the relative directory of the included fragment, or its canonicalized >> version, compared to the top level including Makefile: >> > Yes, better. But I find the following even better (marginally): > > The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' > (and their abbreviated versions, '{D}' and '{C}' respectively) can now > be used in an included Makefile fragment. They are substituted, > respectively, with the relative directory of the included fragment and > its canonicalized version, compared to the top level including Makefile: > > OK? I still like my version better, I think that the slight ambiguity you aim to kill with the extra "respectively" is not going to fool anyone, and I find that the twist it adds just makes it harder to read the dang thing. But I'm not a native speaker, so what do I know? New (and final, from me) attempt: * Relative directory in Makefile fragments: - The special Automake-time substitutions '{RELDIR}' and '{CANON_RELDIR}' (and their abbreviated versions, '{D}' and '{C}' respectively) can now be used in an included Makefile fragment. The former is substituted with the relative directory of the included fragment (compared to the top level including Makefile), and the latter with the canonicalized version of the same relative directory: Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 07:05:51 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 12:05:51 +0000 Received: from localhost ([127.0.0.1]:35317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Ko3-0001nM-98 for submit@debbugs.gnu.org; Mon, 04 Feb 2013 07:05:51 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:41271) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Ko1-0001nC-EA for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 07:05:50 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 6F5CF40006; Mon, 4 Feb 2013 13:04:44 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id EA40940002; Mon, 4 Feb 2013 13:04:43 +0100 (CET) Message-ID: <510FA3DB.9040608@lysator.liu.se> Date: Mon, 04 Feb 2013 13:04:43 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> In-Reply-To: <510F9C8D.7000207@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) On 2013-02-04 12:33, Stefano Lattarini wrote: > On 02/04/2013 10:35 AM, Peter Rosin wrote: >> Not sure what to do about it, or if it matters... >> > It does IMHO, since the failure you pointed out, albeit easy to > work around, wouldn't be very obvious to diagnose, from the point > of view of a non-particularly-expert user. > > What about doubling the curly braces? As in '{{RELDIR}}'. > Would that be tolerable? Other possibilities (none particularly > pleasant either, IMHO): > > {+RELDIR+} > {:RELDIR:} > {.RELDIR.} > {-RELDIR-} > > Other proposals? ':' is a shifted symbol on my keyboard, as is &, and {} are on a separate modifier (AltGr) making the old style (which I refuse to replicate here) a bitch to type (which is why I refuse). So, on the grounds of that, I'd vote against {:RELDIR:}. I {{think}} this one will be the easiest on us of all. Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 07:45:32 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 12:45:33 +0000 Received: from localhost ([127.0.0.1]:35357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2LQR-0003e5-Eg for submit@debbugs.gnu.org; Mon, 04 Feb 2013 07:45:32 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34593) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2LQQ-0003dy-5v for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 07:45:30 -0500 Received: by mail-pa0-f43.google.com with SMTP id bh2so1070748pad.30 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 04:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=wtb4d3nkcjTSSbFuOSg51Z6KrM85+XdyA18KekG3t0A=; b=bfYNfdBev2z9z61pDALbK6Nk7gusMTvm1xU03fDAGWR2IneXqGU2WdZs/vqdxqXgM0 rhRwEDfbUttLN0z68Fmix7byUEmiEt9NkKQZ1iQlvitJLYDopgW2bpd3ccqDAH4I6FA/ lHDtrwS4AnwmPM0H457vkVmsT70nIBh6MlIGevxQRxnprakJgMGFvpJpVGZWO+DtuWbg byHyjbTKLpplMheolRIHL/qiBsimXZDMXMH4J1ourZn0sG4Y9cgGupXHu0OQa7GAiq/8 bynaY92M+ScvPZl1vsBPlFEIhTArLgvaaYVLIQKm2P4d8XdHKZ8DFQYfg4vEFAKoauwh gvfA== X-Received: by 10.66.52.116 with SMTP id s20mr4120478pao.70.1359981864335; Mon, 04 Feb 2013 04:44:24 -0800 (PST) Received: from limpar.local (124-148-41-104.dyn.iinet.net.au. [124.148.41.104]) by mx.google.com with ESMTPS id x6sm21134751paw.0.2013.02.04.04.44.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:44:22 -0800 (PST) Message-ID: <510FAD12.30500@gmail.com> Date: Mon, 04 Feb 2013 22:44:02 +1000 From: Peter Johansson User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> In-Reply-To: <510F9C8D.7000207@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2/4/13 9:33 PM, Stefano Lattarini wrote: > What about doubling the curly braces? As in '{{RELDIR}}'. > Would that be tolerable? Other possibilities (none particularly > pleasant either, IMHO): > > {+RELDIR+} > {:RELDIR:} > {.RELDIR.} > {-RELDIR-} > > Other proposals? Using Automake's namespace, 'AM_', comes to mind: {AM_RELDIR}. cheers, -- Peter Johansson From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 08:42:51 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 13:42:51 +0000 Received: from localhost ([127.0.0.1]:35443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2MJt-0005xI-NH for submit@debbugs.gnu.org; Mon, 04 Feb 2013 08:42:51 -0500 Received: from mail-ea0-f173.google.com ([209.85.215.173]:59299) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2MJq-0005x9-0I for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 08:42:46 -0500 Received: by mail-ea0-f173.google.com with SMTP id i1so2782050eaa.4 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 05:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IuDHwxiBPzO9cqWIeAdv5fkIVtmsvxB3uAhzKLhS45w=; b=kw3Y4IcMslz6B7Vos4q71JUPGcJsMRlNJu4PHGwZSuZKHnHMHti5ZDf3Hdo1Fjfrzs mShA/O1Xt0N//Q9g61iVQlqfGln7iWdsCdlKO84MLxigCLQMMvc+dh2ruZgnRYenKMyo xFWWpAd+MaqbmEpRi64dipm4IPPHztkxTXeW453xV4+/s7CLlq77RoUoeoC63gazTMZD Xgha2iHzgQfcbFMcdhBnC/wIAt5YME9M9AeYvivlxRRL9YXbhYzB7eBC8Mng4kXQ2XoK CykCdNa610XEtCLd6y3InIsFrQquWSc4rhAbLGNycPDJtylc5VLF6sZ/R+9UP5xFBY4Z SHEA== X-Received: by 10.14.173.196 with SMTP id v44mr71336354eel.29.1359985300094; Mon, 04 Feb 2013 05:41:40 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id j46sm23966165eeo.3.2013.02.04.05.41.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 05:41:39 -0800 (PST) Message-ID: <510FBA90.2030100@gmail.com> Date: Mon, 04 Feb 2013 14:41:36 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Johansson Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FAD12.30500@gmail.com> In-Reply-To: <510FAD12.30500@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 01:44 PM, Peter Johansson wrote: > On 2/4/13 9:33 PM, Stefano Lattarini wrote: >> What about doubling the curly braces? As in '{{RELDIR}}'. >> Would that be tolerable? Other possibilities (none particularly >> pleasant either, IMHO): >> >> {+RELDIR+} >> {:RELDIR:} >> {.RELDIR.} >> {-RELDIR-} >> >> Other proposals? > Using Automake's namespace, 'AM_', comes to mind: {AM_RELDIR}. > I'm not sure about this; being namespace-clean even here sounds nice in theory, but {AM_RELDIR} actually seems quite ugly to me, and less clear than the simpler (albeit namespace-polluting) {{RELDIR}}. But I'd like to read other opinions before making up my mind. Anyone has further feedback? Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 08:44:47 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 13:44:47 +0000 Received: from localhost ([127.0.0.1]:35448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2MLm-00060O-OG for submit@debbugs.gnu.org; Mon, 04 Feb 2013 08:44:47 -0500 Received: from mail-ee0-f49.google.com ([74.125.83.49]:61772) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2MLk-00060F-FW for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 08:44:45 -0500 Received: by mail-ee0-f49.google.com with SMTP id d4so3097833eek.22 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 05:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VbLqzNlOiEtGvSlezBjImlumYstfJb7WibECGiTy048=; b=T5PbkxDdrZ6z5rX/4KKpFzPheYxwka2yjc/4+3QEJpRjBiHTwc6Kiy7DkjSHCtd/R1 Q6t/pzuAOMr6dT2uFUJaYtfF011ohMeS+txLmL2ctXP6gL3MyrJbC9/NDTLWyOnSP3N2 Wu24f7XCUbh5WZvnJRwGEe9m0xAmwkUni2bCUjFfrnato71ONdT2nd+gj+NSgzTG+2Xe jCJ9H/QMbbQVXTGEKh4U+PBmEjmOnvHwlBok8ahP0beaJUa9GcSuxWJgvsKHZ/rUFyoc EbTsCyrAguRN7G15NqTACUn516qHCWBHLm/P6LJVcK23gqSiGaXGdpHspILphJV720oU Te7g== X-Received: by 10.14.176.66 with SMTP id a42mr71541333eem.34.1359985418745; Mon, 04 Feb 2013 05:43:38 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id j46sm23973960eeo.3.2013.02.04.05.43.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 05:43:37 -0800 (PST) Message-ID: <510FBB08.5080003@gmail.com> Date: Mon, 04 Feb 2013 14:43:36 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> In-Reply-To: <510FA3DB.9040608@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 01:04 PM, Peter Rosin wrote: > On 2013-02-04 12:33, Stefano Lattarini wrote: >> On 02/04/2013 10:35 AM, Peter Rosin wrote: >>> Not sure what to do about it, or if it matters... >>> >> It does IMHO, since the failure you pointed out, albeit easy to >> work around, wouldn't be very obvious to diagnose, from the point >> of view of a non-particularly-expert user. >> >> What about doubling the curly braces? As in '{{RELDIR}}'. >> Would that be tolerable? Other possibilities (none particularly >> pleasant either, IMHO): >> >> {+RELDIR+} >> {:RELDIR:} >> {.RELDIR.} >> {-RELDIR-} >> >> Other proposals? > > ':' is a shifted symbol on my keyboard, as is &, and {} are > on a separate modifier (AltGr) > Same on my keyboard, actually. So ... > making the old style (which I > refuse to replicate here) a bitch to type (which is why I > refuse). So, on the grounds of that, I'd vote against > {:RELDIR:}. > ... I agree with you (and should probably lart myself with my own keyboard for not having thought of your rationale myself). > I {{think}} this one will be the easiest on us of all. > I tend to agree (but see Peter Johansson's proposal to use {AM_RELDIR} instead; what do you think about it?) Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 09:07:23 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 14:07:23 +0000 Received: from localhost ([127.0.0.1]:35456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Mhf-0006Wz-7L for submit@debbugs.gnu.org; Mon, 04 Feb 2013 09:07:23 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:55607) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Mhb-0006Wq-MH for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 09:07:21 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 81F1F40006; Mon, 4 Feb 2013 15:06:13 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 4064C40002; Mon, 4 Feb 2013 15:06:12 +0100 (CET) Message-ID: <510FC053.8080009@lysator.liu.se> Date: Mon, 04 Feb 2013 15:06:11 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> In-Reply-To: <510FBB08.5080003@gmail.com> Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: ClamAV using ClamSMTP Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 2013-02-04 14:43, Stefano Lattarini wrote: > On 02/04/2013 01:04 PM, Peter Rosin wrote: >> I {{think}} this one will be the easiest on us of all. BTW, that was a mix of "on us all" and "on all of us", if anyone didn't notice... >> > I tend to agree (but see Peter Johansson's proposal to use > {AM_RELDIR} instead; what do you think about it?) Well, I had @am_reldir@ in my original patch, so obviously I'm not totally against the am_ prefix, but I did think it was too long. You didn't really say in what way using @ was bad? This might be the time to revisit that, so that we can come full circle on this issue? :-) But seriously, why would it be bad to use @ for something that is not going to be seen by config.status anyway? Because grepping the source becomes 'difficult'? Trouble documenting? Users expecting to be able to AC_SUBST? What? You also suggested %percent% way back when but didn't like it. How bad was that? What about =C2=A7reldir=C2=A7 (not ascii, so I guess not) or [reldir]? Are square brackets legit in a Makefile for anything? If we do go with the prefix, do we really want to advertice so obviously? I mean, {AM_D}, come on... :-) I don't really care, just pick something that works. And stick to it. Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 12:21:11 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 17:21:11 +0000 Received: from localhost ([127.0.0.1]:36244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2PjC-0002jU-PD for submit@debbugs.gnu.org; Mon, 04 Feb 2013 12:21:11 -0500 Received: from mail-ea0-f181.google.com ([209.85.215.181]:52205) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Pj8-0002jJ-BY for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 12:21:09 -0500 Received: by mail-ea0-f181.google.com with SMTP id i13so2876426eaa.40 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 09:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ppvxDvU1u51EDtAhSE62/gclVBKkM6t6CegWoXs7A88=; b=uOlgsmcTLJ7EMr+PW+uk/JJesVOPZfxCywGRsRn1r0+nsxA6uTMocT3ZPBGic5c2fj atgxNgaK9lHN2q78Br7PCgJksuGqvfbu2M96sKuDI6zR3WsPzII1hQZdc6DlNYztiska xEDVsRcb2t4anNMMipnKQZTStCDsqb4NwAfOjsnRenLz6CdkfyGQ4Nyezc1plKbbgHMQ zdA4ZwcZ016BSNMo0MNL0HGHgrIxRdTWHQxSMQ3rGD25U6hQzwg1QgD5vsHTLguIx1dE nWlZBeg1A4xQwpMppSsUiit6lc6VqcWrsM8VRvHHR4zmcVKzbbEmPUVkppRTJ7f/gf5+ 1lyQ== X-Received: by 10.14.225.133 with SMTP id z5mr74495333eep.15.1359998399820; Mon, 04 Feb 2013 09:19:59 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id a1sm2969639eep.2.2013.02.04.09.19.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 09:19:58 -0800 (PST) Message-ID: <510FEDB1.5080809@gmail.com> Date: Mon, 04 Feb 2013 18:19:45 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> In-Reply-To: <510FC053.8080009@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 03:06 PM, Peter Rosin wrote: > On 2013-02-04 14:43, Stefano Lattarini wrote: >> On 02/04/2013 01:04 PM, Peter Rosin wrote: >>> I {{think}} this one will be the easiest on us all. >>> >> I tend to agree (but see Peter Johansson's proposal to use >> {AM_RELDIR} instead; what do you think about it?) > > Well, I had @am_reldir@ in my original patch, so obviously I'm > not totally against the am_ prefix, but I did think it was too > long. You didn't really say in what way using @ was bad? > Yes, and I stand by that. The proposal here was to use {AM_RELDIR}, not @AM_RELDIR@. > This might be the time to revisit that, so that we can come full > circle on this issue? :-) > Not really. > But seriously, why would it be bad > to use @ for something that is not going to be seen by > config.status anyway? > Because it would mix up very different concepts: a '@...@' substitution is meant for something that depends on configure-time check (or at least from code in configure), and is substituted the same in *every* Makefile and makefile fragment; while the proposed '{...}' would depend merely on the relative position of the included fragment, and have nothing to do with configure code or configure-time checks. > Because grepping the source becomes > 'difficult'? Trouble documenting? Users expecting to be able > to AC_SUBST? What? > To summarize: conceptual confusion. > You also suggested %percent% way back when but didn't like it. > Again, it would cause confusion between automake-time substitutions in the private makefile fragments 'lib/am/*.am' (invisible and transparent to the user) and substitutions meant to be visible and actively employed by the user; albeit in this case only automake developers would be exposed to this source of confusion, so the situation wouldn't be nearly as bad. > How bad was that? > Honestly, something like: %RELDIR_CANON%_foo_SOURCES = ... seems quite ugly to me; albeit %RELDIR-CANON%_foo_SOURCES = ... seems a little better. But I still prefer the "substitution starts", "substitution ends" hinted at by the symmetric '{' and '}' characters > What about §reldir§ (not ascii, so I guess > not) or [reldir]? Are square brackets legit in a Makefile for > anything? > Anyone using '[FOO]' in a make variable name probably deserve to suffer, and uses of the'[C]' or '[D]' literal strings in recipes or variables' expansions should be rare enough not to cause real problems (and such problem could be easily worked around anyway). I still marginally prefer '{{...}}', but happily I'll go with '[...]' instead if its proponents rewrite the patch series for me (hint hint, nudge nudge). Anyone actually painting the shed gets to choose its color :-) > If we do go with the prefix, do we really want to advertice > so obviously? I mean, {AM_D}, come on... :-) > Ah, LOL. And the use of namespace in the shorthands would destroy their beauty and handiness ... > I don't really care, just pick something that works. And stick > to it. > > Cheers, > Peter > Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 12:44:21 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 17:44:21 +0000 Received: from localhost ([127.0.0.1]:36273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Q5d-0003Ib-87 for submit@debbugs.gnu.org; Mon, 04 Feb 2013 12:44:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28227) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2Q5Z-0003IM-D0 for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 12:44:19 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r14Hh90o012496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Feb 2013 12:43:10 -0500 Received: from [10.3.113.71] (ovpn-113-71.phx2.redhat.com [10.3.113.71]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r14HXEnT013138; Mon, 4 Feb 2013 12:33:14 -0500 Message-ID: <510FF0DA.3070809@redhat.com> Date: Mon, 04 Feb 2013 10:33:14 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> In-Reply-To: <510FEDB1.5080809@gmail.com> X-Enigmail-Version: 1.5.0 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2WXEQVTVMQLMVJELJJENG" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WXEQVTVMQLMVJELJJENG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/04/2013 10:19 AM, Stefano Lattarini wrote: > Because it would mix up very different concepts: a '@...@' substitution= > is meant for something that depends on configure-time check (or at > least from code in configure), and is substituted the same in *every* > Makefile and makefile fragment; Not so - in the section on preset output variables, autoconf documents that several @...@ substitutions are dependent on where in the hierarchy they are replaced (generally, the variables with all lower-case names). https://www.gnu.org/software/autoconf/manual/autoconf.html#Preset-Output-= Variables > while the proposed '{...}' would depend > merely on the relative position of the included fragment, and have > nothing to do with configure code or configure-time checks. So they aren't quite affected by configure, but they are dependent on relative location, just like existing substitutions like @top_srcdir@ are dependent on relative location. That said, the idea of using some syntax other than @...@ for automake substitutions, to make it clear that they are different than config.status substitutions, works for me. I just don't know that I have any better ideas for what syntax to prefer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2WXEQVTVMQLMVJELJJENG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRD/DaAAoJEKeha0olJ0Nqmx4IAJE0t8pgaH6EVFz+ulLMgtAC XkdhLrJeHqIwG8VJuWnHoyR0PbPoBmNVZHg1tbCW+ozjOwZ9Mi4oVj0dpCsqjSkL I9bPHofowjImtHjYGMSxFIhdoMBvheZ9Ad/vY8E5lNEoOt1iFVgJI2Fo071evhxf H73KB3GK/ffVAujEOjwV21teuzq7KvKPn+3akCopN9VK9RU1xYu3GtBE9QbSlKzb gbYZp19TJxApAgEVHcr+IsErtuv5MwB/sIotQSYnYyFnG80cIGE9COTFNTf+Br9E Ii3F+Lv4eZgOuIFqYZWeUScW22pQhaTLj09Bs357dvnysL8nbosRI0Tg0pcLYss= =5w0h -----END PGP SIGNATURE----- ------enig2WXEQVTVMQLMVJELJJENG-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 13:13:09 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 18:13:09 +0000 Received: from localhost ([127.0.0.1]:36310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2QXU-0003xJ-Pb for submit@debbugs.gnu.org; Mon, 04 Feb 2013 13:13:09 -0500 Received: from mail-ea0-f175.google.com ([209.85.215.175]:57078) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2QXS-0003xB-6U for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 13:13:07 -0500 Received: by mail-ea0-f175.google.com with SMTP id d1so2940475eab.34 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 10:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=cXklV84Rq7JbKKbpgB8/nvaFEj/UGnSfPSau4PxXS48=; b=ff9SZ4hC+iQeJbLOp+3JUQNO6at2mN9ABveaMcz7CSW12BBRCQWCkfL48qk7+ZCXHc fCStjn7tV7o1RIoElE5RezH87oAVPkkYwVO2zx71a6cLMe6aZ+FE7Cja2mDY77SjT+4G 7PGLjB8CHX2KZFuzBK3vmKcECJOZlvn7cH5Mem7QeCjDwh1+jHJyfNoaNRDw5uE8S/NJ qZQR34EjulQ8SGy8iz7ftV+khUM7Q5VaT2xwpFyFDHkyTlpVVQ4L4vr1sQUsXlwsxJLc 278+oXATkG2EQao5cnZpwG10pVyScQd+njbkZW9fplLoPeExZDhwM9lOnDi5OPSSncEu ztpw== X-Received: by 10.14.211.137 with SMTP id w9mr73379159eeo.39.1360001519309; Mon, 04 Feb 2013 10:11:59 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id b2sm28451854eep.9.2013.02.04.10.11.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 10:11:58 -0800 (PST) Message-ID: <510FF9E6.7030205@gmail.com> Date: Mon, 04 Feb 2013 19:11:50 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> In-Reply-To: <510FF0DA.3070809@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Karl Berry , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/04/2013 06:33 PM, Eric Blake wrote: > On 02/04/2013 10:19 AM, Stefano Lattarini wrote: >> Because it would mix up very different concepts: a '@...@' substitution >> is meant for something that depends on configure-time check (or at >> least from code in configure), and is substituted the same in *every* >> Makefile and makefile fragment; > > Not so - in the section on preset output variables, autoconf documents > that several @...@ substitutions are dependent on where in the hierarchy > they are replaced (generally, the variables with all lower-case names). > > https://www.gnu.org/software/autoconf/manual/autoconf.html#Preset-Output-Variables > OK, I stand corrected. And while stuff like '@top_srcdir@' still depends on the details of how configure is run, other stuff like '@top_builddir@' actually depends *only* on the relative position of the file it is being instantiated. However, see below. >> while the proposed '{...}' would depend >> merely on the relative position of the included fragment, and have >> nothing to do with configure code or configure-time checks. > > So they aren't quite affected by configure, but they are dependent on > relative location, just like existing substitutions like @top_srcdir@ > are dependent on relative location. > Yes, but they are dependent on the relative position of an 'include'd file w.r.t. the currently-processed Makefile.am, not the "top-level" directory of the project. Not a big deal, but still, another minor possible source of confusion, as in "all the same @subst@ in a Makefile.in are substituted with the same text, even if they come from an automake-time included fragment ... except for the @am_reldir@ etc. substs"; not a big deal, but not a great example of cleanliness and consistency either IMVHO). > That said, the idea of using some syntax other than @...@ for automake > substitutions, to make it clear that they are different than > config.status substitutions, works for me. > I still marginally prefer to keep this distinction, so, since you seem to have no fundamental objection, I'll stick to it. > I just don't know that I > have any better ideas for what syntax to prefer. > Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 18:04:38 2013 Received: (at 13524) by debbugs.gnu.org; 4 Feb 2013 23:04:38 +0000 Received: from localhost ([127.0.0.1]:36511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2V5Z-00042V-SF for submit@debbugs.gnu.org; Mon, 04 Feb 2013 18:04:38 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:54727) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2V5W-00042L-7u for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 18:04:35 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id D012640006; Tue, 5 Feb 2013 00:03:25 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id B9E4A40002; Tue, 5 Feb 2013 00:03:24 +0100 (CET) Message-ID: <51103E3B.6080401@lysator.liu.se> Date: Tue, 05 Feb 2013 00:03:23 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> In-Reply-To: <510FF9E6.7030205@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 2013-02-04 19:11, Stefano Lattarini wrote: > On 02/04/2013 06:33 PM, Eric Blake wrote: >> So they aren't quite affected by configure, but they are dependent on >> relative location, just like existing substitutions like @top_srcdir@ >> are dependent on relative location. >> > Yes, but they are dependent on the relative position of an 'include'd > file w.r.t. the currently-processed Makefile.am, not the "top-level" > directory of the project. Not a big deal, but still, another minor > possible source of confusion, as in "all the same @subst@ in a Makefile.in > are substituted with the same text, even if they come from an automake-time > included fragment ... except for the @am_reldir@ etc. substs"; not a big To me, you are splitting hairs. However, I do see one strongish argument against @am_reldir@. The short forms (@D@ and @C@) will potentially break any project already doing AC_SUBST([C]) (or D). And @am_D@, @AM_D@ or whatever isn't all that pretty. So, we can't really use @am_reldir@, because then we'll have to find some other notation for the short form. And that would be confusing. Or drop the short form, but we all want the short form, right? > deal, but not a great example of cleanliness and consistency either IMVHO). Having umpteen different replacement operators isn't all that minimal and neat either IMVHO. Anyway, summing up. 0. &{reldir}& is a pest to type. 1. {reldir} doesn't work, it conflicts with ${reldir}. 2. @am_reldir@ doesn't work, short form @D@ conflicts with AC_SUBST([D]). 3. {am_reldir} doesn't work, short form {D} conflicts with ${D}. It is clear that we have to invent a new notation, much as I hate it. Whatever notation we try to overload is likely have a conflict when we mix in the short form. So, %reldir% is best so far IMHO, but if Automake developers are too easily confused or if we don't control that namespace, I'd go with {{reldir}}. Oh, while I'm at it I have a wish, {reldir}/@am_reldir@/whatever is so much easier on the eyes compared to {RELDIR}/@AM_RELDIR@/WHATEVER. Can we please skip the capital letters in the naming that is finally decided? (using capital letter for the short form is fine though) Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 20:03:12 2013 Received: (at 13524) by debbugs.gnu.org; 5 Feb 2013 01:03:12 +0000 Received: from localhost ([127.0.0.1]:36585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2WwJ-0006oW-8Q for submit@debbugs.gnu.org; Mon, 04 Feb 2013 20:03:11 -0500 Received: from mail-qe0-f51.google.com ([209.85.128.51]:65233) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2WwE-0006oF-9d for 13524@debbugs.gnu.org; Mon, 04 Feb 2013 20:03:07 -0500 Received: by mail-qe0-f51.google.com with SMTP id 6so3141604qea.38 for <13524@debbugs.gnu.org>; Mon, 04 Feb 2013 17:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=EsToDVvXrbjBSRArnPtyVwgf1TkaufPU9P3ugCNCBSo=; b=tlxjkMkRJi5X5rcC9BHC8s23U9zZ8wC4LKbbFMwOAz/XoebLRWqPe/wd+54WYRXIPU PDpTwy0HJJwBZ3VMqBPiwS12RvsnmHXEIt1lCLrRizTsuaxwfYendUsUiAZ0nvqYy76j +1FM/W1Dw6vl5GjbOHo5A/iXl4xRZC2y9BCcxQp3MEaq28eiITyuz6XR7wMvSNg7tQN2 GXePhSDQXgo19xabDF/+Ua6eD0Vmry/Y/HTRVY1IlNIdD9WBL0LJ43STHrgvA63T7EbX a13SI2+xG2HQ2zGB/mGKmxqO3K54L1Ij97XvMU081+7mEopUtdSmvIj6HNgxnSGL8Y2y 4zVw== X-Received: by 10.224.146.136 with SMTP id h8mr18844355qav.97.1360026118120; Mon, 04 Feb 2013 17:01:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.94.83 with HTTP; Mon, 4 Feb 2013 17:01:17 -0800 (PST) In-Reply-To: <51103E3B.6080401@lysator.liu.se> References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> From: Miles Bader Date: Tue, 5 Feb 2013 10:01:17 +0900 X-Google-Sender-Auth: nm_5WwbTRTg5F_DegsCZPePo2VY Message-ID: Subject: Re: bug#13524: Improving user experience for non-recursive builds To: Peter Rosin Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: Eric Blake , Stefano Lattarini , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) %...% seems nice to me. I don't think "typability" should be a prime factor in deciding, especially such trivial issues such as shifted-characters (like 75% of punctuation in Makefiles is shifted on most keyboards); readability is _much_ more important (and readability in many cases means not too long, especially for something which is likely to appear multiple times in file lists etc...). I don't like the AM_ variants: automake input files are obviously in the automake language, so it seems silly and redundant to include "AM_". Incidentally, given the name, I assume the name "reldir" always refers to a relative path? What is it relative to again? If I want to refer to a source file, do I write "$(srcdir)/%reldir%/filename" (as opposed to e.g. "$(top_srcdir)/%reldir%/filename")? ... and "canon_reldir" means the same thing, except canonicalized? [In other words, still always relative, e.g. by converting to an absolute canonical name using some sort of truename function, and then removing the source-directory prefix.] Thanks, -miles -- Cat is power. Cat is peace. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 04:27:09 2013 Received: (at 13524) by debbugs.gnu.org; 7 Feb 2013 09:27:09 +0000 Received: from localhost ([127.0.0.1]:40727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Nl6-0007ld-LX for submit@debbugs.gnu.org; Thu, 07 Feb 2013 04:27:09 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:61426) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Nl3-0007lU-Mg for 13524@debbugs.gnu.org; Thu, 07 Feb 2013 04:27:07 -0500 Received: by mail-wi0-f172.google.com with SMTP id ez12so6591388wid.11 for <13524@debbugs.gnu.org>; Thu, 07 Feb 2013 01:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=BPMcdbnGuwJaRq7voGqG94N9aPZlYVrwExkuk0YHYA0=; b=icIZfT7cmHQU53dT7XlXCFRHbPUMe584fyUoAngP2HtACzyu/XjOhCFR3ZSdxdK6+3 swAT44ZxnOVMQQW2z/95NY8nIjmX6TJodvfLvruyCAXKPh/ecO2D+3nLX2TnUgmOuj9U ftd1QEhWxQBsHjSzgv34c+yWCakXsw+3/Qb1DPKahr2PxETSZ/svO09Gih7m/Rf1ehGc z1WZzOrQ3M2hRnTrn/ExHJ3kkRfrhgP65NpUMIw2wwhXjXRNZ3kiipH4EWWCDbPSLx4f zceELklDHPtm+NFIXOTJfPlE4OXWZMQhZzBUTSSekLbLb/18Rvx/Jkdrj/FSX0ttiRFr 08Pw== X-Received: by 10.180.73.80 with SMTP id j16mr1206424wiv.5.1360229143979; Thu, 07 Feb 2013 01:25:43 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id cu7sm7431519wib.8.2013.02.07.01.25.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 01:25:42 -0800 (PST) Message-ID: <5113730E.9010004@gmail.com> Date: Thu, 07 Feb 2013 10:25:34 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> In-Reply-To: <51103E3B.6080401@lysator.liu.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , "automake-patches@gnu.org" , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/05/2013 12:03 AM, Peter Rosin wrote: > On 2013-02-04 19:11, Stefano Lattarini wrote: >> On 02/04/2013 06:33 PM, Eric Blake wrote: >>> So they aren't quite affected by configure, but they are dependent on >>> relative location, just like existing substitutions like @top_srcdir@ >>> are dependent on relative location. >>> >> Yes, but they are dependent on the relative position of an 'include'd >> file w.r.t. the currently-processed Makefile.am, not the "top-level" >> directory of the project. Not a big deal, but still, another minor >> possible source of confusion, as in "all the same @subst@ in a Makefile.in >> are substituted with the same text, even if they come from an automake-time >> included fragment ... except for the @am_reldir@ etc. substs"; not a big > > To me, you are splitting hairs. However, I do see one strongish argument > against @am_reldir@. The short forms (@D@ and @C@) will potentially > break any project already doing AC_SUBST([C]) (or D). And @am_D@, @AM_D@ > or whatever isn't all that pretty. So, we can't really use @am_reldir@, > because then we'll have to find some other notation for the short form. > And that would be confusing. Or drop the short form, but we all want > the short form, right? > >> deal, but not a great example of cleanliness and consistency either IMVHO). > > Having umpteen different replacement operators isn't all that minimal > and neat either IMVHO. > Fine (see below for more). > Anyway, summing up. > > 0. &{reldir}& is a pest to type. > 1. {reldir} doesn't work, it conflicts with ${reldir}. > 2. @am_reldir@ doesn't work, short form @D@ conflicts with AC_SUBST([D]). > Plus is conceptually confusing/misleading, IMVHO. > 3. {am_reldir} doesn't work, short form {D} conflicts with ${D}. > > It is clear that we have to invent a new notation, much as I hate it. > Whatever notation we try to overload is likely have a conflict when > we mix in the short form. > > So, %reldir% is best so far IMHO, but if Automake developers are > too easily confused > (in hindsight, I probably overemphasized the risk of confusion here) > or if we don't control that namespace, I'd go > with {{reldir}}. > I don't have a strong opinion about '{{...}}' vs '%...%' [1]; I marginally prefer the former, but if people prefer the latter (as your and Miles' messages suggest), I'm *perfectly* fine to use it as well. So, shall we go for '%...%' in the end? [1] OTOH, I'd have strongly preferred '{...}' over '%...%'; but alas, as we've seen, this shorter and sweeter syntax remains unusable if we want to avoid collisions and confusions with the ${FOO} form for make and shell variable expansions. > Oh, while I'm at it I have a wish, {reldir}/@am_reldir@/whatever is so > much easier on the eyes compared to {RELDIR}/@AM_RELDIR@/WHATEVER. Can we > please skip the capital letters in the naming that is finally decided? > (using capital letter for the short form is fine though) > Fine as well. And of curse, if you want to speed thing up and have more control on the final result, feel free to shepherd the pending patches to the agreed form ;-) -- which if I'm not mistaken is: - make the series consist of only two patches, one introducing the feature (complete with documentation and NEWS additions, plus your original test case), and one follow-up patch implementing my testsuite enhancement; - use the '%...%' form, and prefer lower-case for long names (so, '%reldir%' a.k.a. '%D%' and '%canon-reldir%' a.k.a. '%C%'). Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 04:35:16 2013 Received: (at 13524) by debbugs.gnu.org; 7 Feb 2013 09:35:16 +0000 Received: from localhost ([127.0.0.1]:40731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Nsu-0007x6-PN for submit@debbugs.gnu.org; Thu, 07 Feb 2013 04:35:15 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:45254) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Nsq-0007wx-UP for 13524@debbugs.gnu.org; Thu, 07 Feb 2013 04:35:10 -0500 Received: by mail-wg0-f54.google.com with SMTP id fm10so1790588wgb.33 for <13524@debbugs.gnu.org>; Thu, 07 Feb 2013 01:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0SWkMknLTHzbMNFl8flhJqSmMCcZmXII2BqSk+yOegY=; b=ogDnxUodsg5zSPA01moR89ekaHRsQM/BQS8033yAyWvoofH5fiWsa3awJqQDh6vVn/ ZvElEApnDJSMai8suOcIHFHboV8NCAnTw4F2iWIfFMj+5as61ry2Yj8+c6ti+vm0fp3Z +djvbuvLVHTiUrvmrYbmOuPwcYESu4h3gjz7sWuMlkX5fjLsA/RJl2ZXjryM0l1yGQuZ WgajHqphdmF21ndi0LTqvuJOVgbZJTZI5+weRhnH5AVLsYPDFN/VF4Aw6phd7kmFjDrq EF4EaM3/TeOB8Sz8ORqiZTCBc1dphNOz/X4CKqYit2FnSjMx8W0GlcBSpNyPXOytQY80 QVmw== X-Received: by 10.180.73.212 with SMTP id n20mr1239117wiv.11.1360229627449; Thu, 07 Feb 2013 01:33:47 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id e6sm8138297wiz.1.2013.02.07.01.33.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 01:33:46 -0800 (PST) Message-ID: <511374F8.4020605@gmail.com> Date: Thu, 07 Feb 2013 10:33:44 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Miles Bader Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Eric Blake , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/05/2013 02:01 AM, Miles Bader wrote: > %...% seems nice to me. > I'm fine to settle for that (see my reply to last mail from Peter for more details). > Incidentally, given the name, I assume the name "reldir" always refers > to a relative path? What is it relative to again? > The path of the Makefile.am currently being processed. > If I want to refer > to a source file, do I write "$(srcdir)/%reldir%/filename" (as opposed > to e.g. "$(top_srcdir)/%reldir%/filename")? > Yes; and I think we should add a test for this, since it might be a very important use case (thanks for bringing it up, BTW). > ... and "canon_reldir" means the same thing, except canonicalized? > Yes, "canonicalized" in a sense quite specific to Automake: So, for example, if %reldir% expands to 'foo/bar-baz.d', '%canon-reldir%' will expand to 'foo_bar_baz_d'. > [In other words, still always relative, e.g. by converting to an > absolute canonical name using some sort of truename function, and > then removing the source-directory prefix.] > Not at all; see above. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 04:54:55 2013 Received: (at 13524) by debbugs.gnu.org; 7 Feb 2013 09:54:55 +0000 Received: from localhost ([127.0.0.1]:40760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3OBz-0008Pi-5Q for submit@debbugs.gnu.org; Thu, 07 Feb 2013 04:54:55 -0500 Received: from mail-qe0-f45.google.com ([209.85.128.45]:49240) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3OBw-0008PZ-W9 for 13524@debbugs.gnu.org; Thu, 07 Feb 2013 04:54:53 -0500 Received: by mail-qe0-f45.google.com with SMTP id b4so1090792qen.32 for <13524@debbugs.gnu.org>; Thu, 07 Feb 2013 01:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/bETO11K14VMFszCNtOLH+iIEcA54WH8irjIQSwALDc=; b=tRuFmoKWlZ8f+g1twXhkoEMa13oFBCQ6xcCwyblM+y4obglzrVU03yMuqp5BzF+tJ1 BtS3WfHA9izm6SRY/MqJsYHtxCsvN51nu0/DSJyWhMHmSNB3VATpC4p25f0bN/CbUIwZ KUZF4TJ3iA96630Vs4lqTIQa5IQWcYe+xcpJXsJ8Nls9Ps6v9EajsAtco0B2rmiRLJSO jSD6uLurgpedwRSjwAiW4/+wS1cHqDIeogFN/YMlbUDYLlvQbj1prMRzDml+4njauSL8 ie5kBxa9utXPgZx8H4tUfXl/5CJhkquIsyk6vAONjeYxPxZvuooK83dGmc9fQrNrP8sB mFlA== X-Received: by 10.224.177.81 with SMTP id bh17mr470610qab.26.1360230811315; Thu, 07 Feb 2013 01:53:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.94.83 with HTTP; Thu, 7 Feb 2013 01:52:51 -0800 (PST) In-Reply-To: <511374F8.4020605@gmail.com> References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> <511374F8.4020605@gmail.com> From: Miles Bader Date: Thu, 7 Feb 2013 18:52:51 +0900 X-Google-Sender-Auth: uukgTu2W-1zNKH-qxviHvIKhULg Message-ID: Subject: Re: bug#13524: Improving user experience for non-recursive builds To: Stefano Lattarini Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Eric Blake , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) >> ... and "canon_reldir" means the same thing, except canonicalized? >> > Yes, "canonicalized" in a sense quite specific to Automake: > > > > So, for example, if %reldir% expands to 'foo/bar-baz.d', '%canon-reldir%' > will expand to 'foo_bar_baz_d'. Hmm, if that's the case, then I think "canon" is the wrong term to use, as it typically implies that the result is still in the same domain as the input. This operation seems to be more what one might call "sanitizing"... [Even if automake uses this term internally, I still think it would be confusing to expose such unusual usage to the user.] -miles -- Cat is power. Cat is peace. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 07:55:22 2013 Received: (at 13524) by debbugs.gnu.org; 7 Feb 2013 12:55:22 +0000 Received: from localhost ([127.0.0.1]:40931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3R0a-0004y4-Vg for submit@debbugs.gnu.org; Thu, 07 Feb 2013 07:55:21 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:53608) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3R0X-0004xv-Td for 13524@debbugs.gnu.org; Thu, 07 Feb 2013 07:55:19 -0500 Received: by mail-we0-f179.google.com with SMTP id x43so2021752wey.38 for <13524@debbugs.gnu.org>; Thu, 07 Feb 2013 04:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=N7VzIVy/nQjj1vVlSAFrt53d9ZWCm10Fe6hxxsJKrCA=; b=aiDWzBJ2VkZgQYnD/EGS4i4jGgDpq8ETIS0SAaxz16ljKdPB0yH83+pM/ANqAUAe+q 0btSC1Rl677LvvMeC7RwQtp7s3q9oD1eeJPs2pbNz5ebue2tRvk/t987uzF9RzfMPPGQ PfSCINisQM2v3/eNtuZ8gFbpFqYPgaogGDN56Dh8opnCqcYnvzZkLBOIppvNbuR9jAHR v59QPxBnIJoaOxuzkomLVVtSsEp93Dv5uw6ctjGtb4tzwPXs9d/j+h00tSRGNGLk2t1S zVGOG/xQZEh3vNkMw/arsXPUenDiTGXqyLmB6mKMLtcUrNFUEgVckaE0PcBecUUM1A6A BwqA== X-Received: by 10.194.92.65 with SMTP id ck1mr2456686wjb.54.1360241635234; Thu, 07 Feb 2013 04:53:55 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id ge2sm8498913wib.4.2013.02.07.04.53.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 04:53:54 -0800 (PST) Message-ID: <5113A3D7.20109@gmail.com> Date: Thu, 07 Feb 2013 13:53:43 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Miles Bader Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> <511374F8.4020605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Eric Blake , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/07/2013 10:52 AM, Miles Bader wrote: >>> ... and "canon_reldir" means the same thing, except canonicalized? >>> >> Yes, "canonicalized" in a sense quite specific to Automake: >> >> >> >> So, for example, if %reldir% expands to 'foo/bar-baz.d', '%canon-reldir%' >> will expand to 'foo_bar_baz_d'. > > Hmm, if that's the case, then I think "canon" is the wrong term to > use, as it typically implies that the result is still in the same > domain as the input. > Suggestions for a better name then? > This operation seems to be more what one might > call "sanitizing"... > > [Even if automake uses this term internally, I still think it would be > confusing to expose such unusual usage to the user.] > Actually, automake uses the term in the manual as well, repeatedly. Regards, Stefano > -miles > From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 23:14:13 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 04:14:13 +0000 Received: from localhost ([127.0.0.1]:42727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3fLo-0005q6-JI for submit@debbugs.gnu.org; Thu, 07 Feb 2013 23:14:13 -0500 Received: from mail-qc0-f182.google.com ([209.85.216.182]:65487) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3fLl-0005py-G5 for 13524@debbugs.gnu.org; Thu, 07 Feb 2013 23:14:10 -0500 Received: by mail-qc0-f182.google.com with SMTP id k19so1284015qcs.13 for <13524@debbugs.gnu.org>; Thu, 07 Feb 2013 20:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=gTo+GazE1Glqz74UrFXI+yKze4fX5ucoWTY9FUVVVqg=; b=0kYu+0msXstzy2gYYTLcL1LIm0CblIu8fXbJoZlrKbQue3g89gAaOBeGl/55vkY+or aAM6f6rMbDvw0TSKObNqgEsJo0TsAxdWgBCWXpS1qogZpyFoWEHfJrSsIZe3Qej12SWW jAsH+aNB4elWaizFJxY2trAL27uxq52V87FGuYPnwTy+xVCTX2T0+1050KgOr5BzH021 A58suxsn/W2bmC8kRVYOo7bZk7s/5Ain8hUZlqgy5GGdWw7SIx63yiLYy15hfJvDNe0h qCKBfHhO5/TWuKJK70a1q3/j006gnnm+1tm+4aqu//40uKuecYZlGjaDnOrIIyToH/Yu F10Q== X-Received: by 10.49.121.38 with SMTP id lh6mr1642981qeb.7.1360296848025; Thu, 07 Feb 2013 20:14:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.94.83 with HTTP; Thu, 7 Feb 2013 20:13:27 -0800 (PST) In-Reply-To: <5113A3D7.20109@gmail.com> References: <201301202220.r0KMKsNG029531@freefriends.org> <50FD4B4E.6020106@gmail.com> <87zk021060.fsf@catnip.gol.com> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> <511374F8.4020605@gmail.com> <5113A3D7.20109@gmail.com> From: Miles Bader Date: Fri, 8 Feb 2013 13:13:27 +0900 X-Google-Sender-Auth: yQBct9HZ0qMT5joluwBmUqtx4XI Message-ID: Subject: Re: bug#13524: Improving user experience for non-recursive builds To: Stefano Lattarini Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Eric Blake , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) >> Hmm, if that's the case, then I think "canon" is the wrong term to >> use, as it typically implies that the result is still in the same >> domain as the input. >> > Suggestions for a better name then? Dunno... something like "RELDIR_SYM" would make sense ... it's a symbol corresponding to RELDIR... -miles -- Cat is power. Cat is peace. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 03:45:44 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 08:45:44 +0000 Received: from localhost ([127.0.0.1]:42858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jaa-0005Z7-Ee for submit@debbugs.gnu.org; Fri, 08 Feb 2013 03:45:44 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:52593) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jaY-0005Z0-KL for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 03:45:43 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 46A724001A for <13524@debbugs.gnu.org>; Fri, 8 Feb 2013 09:45:39 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3C09A4000F; Fri, 8 Feb 2013 09:45:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.1 X-Spam-Score: -0.9 Received: from peda-pc (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 8E5C940009; Fri, 8 Feb 2013 09:45:36 +0100 (CET) Received: by peda-pc (sSMTP sendmail emulation); Fri, 08 Feb 2013 09:45:36 +0200 From: Peter Rosin To: Stefano Lattarini Subject: bug#13524: Improving user experience for non-recursive builds Date: Fri, 8 Feb 2013 09:45:24 +0100 Message-Id: <1360313126-26068-1-git-send-email-peda@lysator.liu.se> X-Mailer: git-send-email 1.7.9 In-Reply-To: <5113730E.9010004@gmail.com> References: <5113730E.9010004@gmail.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , automake-patches@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) Stefano Lattarini wrote: > Fine as well. And of curse, if you want to speed thing up and have more > control on the final result, feel free to shepherd the pending patches to > the agreed form ;-) -- which if I'm not mistaken is: > > - make the series consist of only two patches, one introducing the > feature (complete with documentation and NEWS additions, plus your > original test case), and one follow-up patch implementing my > testsuite enhancement; > > - use the '%...%' form, and prefer lower-case for long names (so, > '%reldir%' a.k.a. '%D%' and '%canon-reldir%' a.k.a. '%C%'). Done. I didn't address the canonicalization concern raised by Miles. That seems like a bigger issue than this patch series. However, If that naming is changing, it must be done before this series lands in a released version, or we'll end up with bad comptibility hacks... Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 03:45:54 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 08:45:55 +0000 Received: from localhost ([127.0.0.1]:42861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jaj-0005ZS-Lc for submit@debbugs.gnu.org; Fri, 08 Feb 2013 03:45:54 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:35176) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jag-0005ZJ-Hc for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 03:45:52 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 2676F4000F for <13524@debbugs.gnu.org>; Fri, 8 Feb 2013 09:45:48 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 1B81C4000E; Fri, 8 Feb 2013 09:45:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.1 X-Spam-Score: -0.9 Received: from peda-pc (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id D835840009; Fri, 8 Feb 2013 09:45:45 +0100 (CET) Received: by peda-pc (sSMTP sendmail emulation); Fri, 08 Feb 2013 09:45:45 +0200 From: Peter Rosin To: Stefano Lattarini Subject: [PATCH 1/2] preproc: add support for relative names in included fragments Date: Fri, 8 Feb 2013 09:45:25 +0100 Message-Id: <1360313126-26068-2-git-send-email-peda@lysator.liu.se> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1360313126-26068-1-git-send-email-peda@lysator.liu.se> References: <5113730E.9010004@gmail.com> <1360313126-26068-1-git-send-email-peda@lysator.liu.se> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Karl Berry , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) The rationale for this change is that it is annoying to have to repeat the directory name when including a Makefile fragment. For deep directory structures these repeats can generate a lot of bloat. It also hinders reuse and easy directory restructuring if all Makefile fragments have to know exactly where they live. Suggested by Bob Friesenhahn, and later discussed in bug#13524. In the course of discussion, the following notations were rejected: &{reldir}& - to hard to type, {reldir} - interferes with ${reldir}, {am_reldir} - short form {D} interferes with ${D}, @am_reldir@ - short form @D@ interferes with AC_SUBST([D]) as well as invading the config.status turf. Other notations were also suggested... * automake.in (read_am_file): Add third argument specifying the relative directory of this Makefile fragment compared to the main Makefile. Replace %reldir% and %canon_reldir% in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. * t/preproc-reldir.sh: New test. * t/list-of-tests.mk: Augment. * doc/automake.texi (Include): Document the new feature. NEWS: Add new feature. Co-authored-by: Stefano Lattarini Signed-off-by: Peter Rosin --- NEWS | 12 +++++ automake.in | 26 ++++++++-- doc/automake.texi | 20 ++++++++ t/list-of-tests.mk | 1 + t/preproc-reldir.sh | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 182 insertions(+), 6 deletions(-) create mode 100755 t/preproc-reldir.sh diff --git a/NEWS b/NEWS index 6dcce72..e27e0cf 100644 --- a/NEWS +++ b/NEWS @@ -100,6 +100,18 @@ New in 1.13.2: be longer necessary, so we deprecate it with runtime warnings. It will likely be removed altogether in Automake 1.14. +* Relative directory in Makefile fragments: + + - The special Automake-time substitutions '%reldir%' and '%canon_reldir%' + (and their short versions, '%D%' and '%C%' respectively) can now be used + in an included Makefile fragment. The former is substituted with the + relative directory of the included fragment (compared to the top level + including Makefile), and the latter with the canonicalized version of + the same relative directory: + + bin_PROGRAMS += %reldir%/foo + %canon_reldir%_foo_SOURCES = {reldir}/bar.c + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.13.2: diff --git a/automake.in b/automake.in index d6ed599..80e54ff 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,16 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $RELDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. -sub read_am_file ($$) +sub read_am_file ($$$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $reldir) = @_; + my $canon_reldir = &canonicalize ($reldir); my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6424,17 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + if ($reldir eq '.') + { + # If present, eat the following '_' or '/', converting + # "%reldir%/foo" and "%canon_reldir%_foo" into plain "foo" + # when $reldir is '.'. + $_ =~ s,%(D|reldir)%/,,g; + $_ =~ s,%(C|canon_reldir)%_,,g; + } + $_ =~ s/%(D|reldir)%/${reldir}/g; + $_ =~ s/%(C|canon_reldir)%/${canon_reldir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6584,8 +6596,10 @@ sub read_am_file ($$) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_reldir = File::Spec->abs2rel ($path, $relative_dir); + $new_reldir = '.' if $new_reldir !~ s,/[^/]*$,,; $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_reldir); $where->pop_context; } else @@ -6658,7 +6672,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/doc/automake.texi b/doc/automake.texi index feae3ac..d420d28 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -10519,6 +10519,26 @@ condition applies to the entire contents of that fragment. Makefile fragments included this way are always distributed because they are needed to rebuild @file{Makefile.in}. +Inside a fragment, the construct @code{%reldir%} is replaced with the +directory of the fragment relative to the base @file{Makefile.am}. +Similarly, @code{%canon_reldir%} is replaced with the canonicalized +(@pxref{Canonicalization}) form of @code{%reldir%}. As a convenience, +@code{%D%} is a synonym for @code{%reldir%}, and @code{%C%} +is a synonym for @code{%canon_reldir%}. + +A special feature is that if the fragment is in the same directory as +the base @file{Makefile.am} (i.e., @code{%reldir%} is @code{.}), then +@code{%reldir%} and @code{%canon_reldir%} will expand to the empty +string as well as eat, if present, a following slash or underscore +respectively. + +Thus, a makefile fragment might look like this: + +@example +bin_PROGRAMS += %reldir%/mumble +%canon_reldir%_mumble_SOURCES = %reldir%/one.c +@end example + @node Conditionals @chapter Conditionals diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 0acbdcf..72c99ee 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -865,6 +865,7 @@ t/pr401.sh \ t/pr401b.sh \ t/pr401c.sh \ t/prefix.sh \ +t/preproc-reldir.sh \ t/primary.sh \ t/primary2.sh \ t/primary3.sh \ diff --git a/t/preproc-reldir.sh b/t/preproc-reldir.sh new file mode 100755 index 0000000..ab443df --- /dev/null +++ b/t/preproc-reldir.sh @@ -0,0 +1,129 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test %reldir% and %canon_reldir%. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk +include $(top_srcdir)/top.mk +include ../reltop.mk +END + +cat > local.mk << 'END' +%canon_reldir%_whoami: + @echo "I am %reldir%/local.mk" + +bin_PROGRAMS += %reldir%/mumble +%canon_reldir%_mumble_SOURCES = %reldir%/one.c +END + +cat > top.mk << 'END' +%canon_reldir%_top_whoami: + @echo "I am %reldir%/top.mk" + +bin_PROGRAMS += %D%/scream +%C%_scream_SOURCES = %D%/two.c +END + +cat > reltop.mk << 'END' +%C%_reltop_whoami: + @echo "I am %D%/reltop.mk" + +bin_PROGRAMS += %reldir%/sigh +%canon_reldir%_sigh_SOURCES = %reldir%/three.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include %reldir%/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot +cp one.c two.c +cp one.c three.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output +$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/local.mk" output +$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/bar/local.mk" output +$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/foobar/local.mk" output + +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble + +cd zot + +$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../top.mk" output +$MAKE ___reltop_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../reltop.mk" output +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output + +$MAKE +./mumble +../scream +../sigh -- 1.7.9 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 03:46:05 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 08:46:05 +0000 Received: from localhost ([127.0.0.1]:42864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jar-0005Zw-UB for submit@debbugs.gnu.org; Fri, 08 Feb 2013 03:46:05 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:56050) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jam-0005Za-Ch for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 03:46:00 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id F173F40019 for <13524@debbugs.gnu.org>; Fri, 8 Feb 2013 09:45:53 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E1BF040009; Fri, 8 Feb 2013 09:45:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.1 X-Spam-Score: -0.9 Received: from peda-pc (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 6B7E04000E; Fri, 8 Feb 2013 09:45:50 +0100 (CET) Received: by peda-pc (sSMTP sendmail emulation); Fri, 08 Feb 2013 09:45:50 +0200 From: Peter Rosin To: Stefano Lattarini Subject: [PATCH 2/2] preproc: enhance and extend tests Date: Fri, 8 Feb 2013 09:45:26 +0100 Message-Id: <1360313126-26068-3-git-send-email-peda@lysator.liu.se> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1360313126-26068-1-git-send-email-peda@lysator.liu.se> References: <5113730E.9010004@gmail.com> <1360313126-26068-1-git-send-email-peda@lysator.liu.se> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , automake-patches@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) From: Stefano Lattarini * t/preproc-demo.sh: New test, a "demo" of how the new pre-processing feature could be used in a real-world package. * t/preproc-errmsg.sh: New test, check that error messages remain useful when the new pre-processing features are involved. * t/preproc-reldir.sh: Split up ... * t/preproc-basics.sh, t/preproc-c-compile.sh: ... into these two tests, with some refactorings, clean-up and enhancements. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini --- t/list-of-tests.mk | 5 +- t/preproc-basics.sh | 106 +++++++++++++++++++++++ t/preproc-c-compile.sh | 118 +++++++++++++++++++++++++ t/preproc-demo.sh | 222 ++++++++++++++++++++++++++++++++++++++++++++++++ t/preproc-errmsg.sh | 75 ++++++++++++++++ t/preproc-reldir.sh | 129 ---------------------------- 6 files changed, 525 insertions(+), 130 deletions(-) create mode 100755 t/preproc-basics.sh create mode 100755 t/preproc-c-compile.sh create mode 100755 t/preproc-demo.sh create mode 100755 t/preproc-errmsg.sh delete mode 100755 t/preproc-reldir.sh diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 72c99ee..679fe5d 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -865,7 +865,10 @@ t/pr401.sh \ t/pr401b.sh \ t/pr401c.sh \ t/prefix.sh \ -t/preproc-reldir.sh \ +t/preproc-basics.sh \ +t/preproc-c-compile.sh \ +t/preproc-demo.sh \ +t/preproc-errmsg.sh \ t/primary.sh \ t/primary2.sh \ t/primary3.sh \ diff --git a/t/preproc-basics.sh b/t/preproc-basics.sh new file mode 100755 index 0000000..6000d88 --- /dev/null +++ b/t/preproc-basics.sh @@ -0,0 +1,106 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Basic tests for '%...%' preprocessing in included Makefile fragments: +# %reldir% a.k.a. %D% +# %canon_reldir% a.k.a. %C% + +. test-init.sh + +cat >> configure.ac << 'END' +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo foo/bar foo/foobar zot + +cat > Makefile.am << 'END' +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +include $(top_srcdir)/zot/local.mk + +## Check that '%canon_reldir%' doesn't remain overridden +## by the previous include. +%canon_reldir%_zot_whoami: + echo "I am %reldir%/Makefile.am" >$@ + +include $(top_srcdir)/top.mk +include ../reltop.mk +END + +cat > local.mk << 'END' +%canon_reldir%_whoami: + echo "I am %reldir%/local.mk" >$@ +END + +cat > top.mk << 'END' +%canon_reldir%_top_whoami: + echo "I am %reldir%/top.mk" >$@ +END + +cat > reltop.mk << 'END' +%C%_reltop_whoami: + echo "I am %D%/reltop.mk" >$@ +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot + +cat >> foo/local.mk << 'END' +include %reldir%/bar/local.mk +## Check that '%canon_reldir%' doesn't remain overridden by the +## previous include. The duplicated checks are done to ensure that +## Automake substitutes all pre-processing occurrences on a line, +## not just the first one. +test-%reldir%: + test '%reldir%' = foo && test '%reldir%' = foo + test '%D%' = foo && test '%D%' = foo + test '%canon_reldir%' = foo && test '%C%' = foo +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +check () +{ + test $# -eq 2 || fatal_ "made_into(): bad usage" + target=$1 contents=$2 + rm -f "$target" \ + && $MAKE "$target" \ + && test x"$(cat "$target")" = x"$contents" +} + +check whoami "I am local.mk" +check foo_whoami "I am foo/local.mk" +check foo_bar_whoami "I am foo/bar/local.mk" +check foo_foobar_whoami "I am foo/foobar/local.mk" +$MAKE test-foo + +cd zot +check whoami "I am local.mk" +check ___top_whoami "I am ../top.mk" +check ___reltop_whoami "I am ../reltop.mk" +check zot_whoami "I am Makefile.am" + +: diff --git a/t/preproc-c-compile.sh b/t/preproc-c-compile.sh new file mode 100755 index 0000000..79e9325 --- /dev/null +++ b/t/preproc-c-compile.sh @@ -0,0 +1,118 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test pre-processing substitutions '%reldir%' and '%canon_reldir%' +# with C compilation and subdir objects. + +require=cc +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +SUBDIRS = zot +bin_PROGRAMS = + +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk + +check-local: + is $(bin_PROGRAMS) == \ + foo/mumble2$(EXEEXT) \ + foo/bar/mumble$(EXEEXT) \ + foo/foobar/mumble$(EXEEXT) \ + mumble$(EXEEXT) + test '$(mumble_SOURCES)' = one.c + test '$(foo_mumble2_SOURCES)' = foo/one.c + test '$(foo_bar_mumble_SOURCES)' = foo/bar/one.c + test '$(foo_foobar_mumble_SOURCES)' = foo/foobar/one.c + test -f mumble$(EXEEXT) + test -f foo/mumble2$(EXEEXT) + test -f foo/bar/mumble$(EXEEXT) + test -f foo/foobar/mumble$(EXEEXT) + test -f zot/mumble$(EXEEXT) + : Test some of the object files too. + test -f one.$(OBJEXT) + test -f foo/foobar/one.$(OBJEXT) + test -f zot/one.$(OBJEXT) +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk + +test: + test '$(bin_PROGRAMS)' == mumble$(EXEEXT) + test '$(mumble_SOURCES)' = one.c +check-local: test +END + +cat > local.mk << 'END' +bin_PROGRAMS += %reldir%/mumble +%canon_reldir%_mumble_SOURCES = %reldir%/one.c +END + +echo 'int main (void) { return 0; }' > one.c + +sed 's/mumble/mumble2/' local.mk > foo/local.mk +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include %reldir%/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +$MAKE +$MAKE check-local +if ! cross_compiling; then + ./mumble + ./foo/mumble2 + ./foo/bar/mumble + ./foo/foobar/mumble + ./zot/mumble +fi + +(cd zot && $MAKE test) + +# GNU install refuses to override a just-installed file; since we +# have plenty of 'mumble' dummy programs to install in the same +# location, such "overridden installations" are not a problem for +# us, so just force the use the 'install-sh' script +ac_cv_path_install=$(pwd)/install-sh; export ac_cv_path_install +$MAKE distcheck + +: diff --git a/t/preproc-demo.sh b/t/preproc-demo.sh new file mode 100755 index 0000000..f8d1e25 --- /dev/null +++ b/t/preproc-demo.sh @@ -0,0 +1,222 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Demo of a package using pre-processing substitutions '%reldir%' and +# '%canon_reldir%', and their respective shorthands '%D%' and '%C%'. + +am_create_testdir=empty +required=cc +. test-init.sh + +if cross_compiling; then + WE_ARE_CROSS_COMPILING=yes +else + WE_ARE_CROSS_COMPILING=no +fi +export WE_ARE_CROSS_COMPILING + +cat > configure.ac << 'END' +AC_INIT([GNU Demo], [0.7], [bug-automake@gnu.org]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([1.12.6 foreign subdir-objects -Wall]) +AM_CONDITIONAL([NATIVE_BUILD], [test $WE_ARE_CROSS_COMPILING != yes]) +AC_CONFIG_FILES([Makefile]) +AC_PROG_CC +AM_PROG_CC_C_O +AM_PROG_AR +AC_PROG_RANLIB +AC_OUTPUT +END + +mkdir build-aux lib lib/tests src tests + +## Top level. + +cat > Makefile.am << 'END' +bin_PROGRAMS = +check_PROGRAMS = +noinst_LIBRARIES = +AM_CPPFLAGS = +AM_TESTS_ENVIRONMENT = +CLEANFILES = +EXTRA_DIST = +LDADD = +TESTS = +XFAIL_TESTS = + +include $(srcdir)/src/progs.am +include $(srcdir)/lib/gnulib.am +include $(srcdir)/tests/check.am +END + +## Src subdir. + +cat > src/progs.am <<'END' +bin_PROGRAMS += %reldir%/hello + +bin_PROGRAMS += %D%/goodbye +%canon_reldir%_goodbye_SOURCES = %D%/hello.c +%C%_goodbye_CPPFLAGS = $(AM_CPPFLAGS) -DGREETINGS='"Goodbye"' + +# The testsuite should have access to our built programs. +AM_TESTS_ENVIRONMENT += \ + PATH='$(abs_builddir)/%reldir%':$$PATH; \ + export PATH; +END + +cat > src/hello.c <<'END' +#include "safe-print.h" +#include +#include + +#ifndef GREETINGS +# define GREETINGS "Hello" +#endif + +int +main (void) +{ + safe_print (stdout, GREETINGS ", World!\n"); + exit (EXIT_SUCCESS); +} +END + +## Lib subdir. + +cat > lib/gnulib.am << 'END' +noinst_LIBRARIES += %D%/libgnu.a + +AM_CPPFLAGS += -I%D% -I$(top_srcdir)/%D% +LDADD += $(noinst_LIBRARIES) + +%C%_libgnu_a_SOURCES = \ + %D%/safe-print.c \ + %D%/safe-print.h + +if NATIVE_BUILD +include %D%/tests/gnulib-check.am +endif +END + +cat > lib/safe-print.c <<'END' +#include "safe-print.h" +#include +#include + +void +safe_print (FILE *fp, const char * str) +{ + if (fprintf (fp, "%s", str) != strlen (str) + || fflush (fp) != 0 || ferror (fp)) + { + fprintf (stderr, "I/O error\n"); + exit (EXIT_FAILURE); + } +} + +END + +cat > lib/safe-print.h <<'END' +#include +void safe_print (FILE *, const char *); +END + +## Lib/Tests (sub)subdir. + +cat > lib/tests/gnulib-check.am <<'END' +check_PROGRAMS += %D%/safe-print-test +TESTS += $(check_PROGRAMS) +XFAIL_TESTS += %D%/safe-print-test +END + +cat > lib/tests/safe-print-test.c <<'END' +#include "safe-print.h" +int +main (void) +{ + FILE *fp; + if ((fp = fopen ("/dev/full", "w")) == NULL) + return 77; + safe_print (fp, "dummy\n"); + return 0; +} +END + +## Tests subdir. + +cat > tests/check.am <<'END' +TEST_EXTENSIONS = .sh +SH_LOG_COMPILER = $(SHELL) + +TESTS += %D%/hello.sh +EXTRA_DIST += %D%/hello.sh + +TESTS += %D%/goodbye.sh +CLEANFILES += %D%/goodbye.sh +%D%/goodbye.sh: %D%/hello.sh + $(MKDIR_P) %D% + rm -f $@ $@-t + sed -e 's/hello/goodbye/' \ + -e 's/Hello/Goodbye/' \ + < $(srcdir)/%D%/hello.sh >$@-t + chmod a-w,a+x $@-t && mv -f $@-t $@ +END + +cat > tests/hello.sh <<'END' +#!/bin/sh +set -x -e +if test "$WE_ARE_CROSS_COMPILING" = yes; then + echo Skipping: cannot run in cross-compilation mode + exit 77 +else + hello || exit 1 + test "`hello`" = 'Hello, World!' || exit 1 +fi +END + +## Go. + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing --copy +test ! -e compile +test -f build-aux/compile + +./configure + +$MAKE + +$MAKE check >stdout || { cat stdout; exit 1; } +cat stdout +cat tests/hello.log +cat tests/goodbye.log +if cross_compiling; then + test ! -e lib/tests/safe-print-test.log + count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0 +else + if test -c /dev/full && test -w /dev/full; then + s=0 x=1 + grep "I/O error" lib/tests/safe-print-test.log + else + cat lib/tests/safe-print-test.log + s=1 x=0 + fi + count_test_results total=3 pass=2 fail=0 xpass=0 xfail=$x skip=$s error=0 +fi + +$MAKE distcheck + +: diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh new file mode 100755 index 0000000..d7cf488 --- /dev/null +++ b/t/preproc-errmsg.sh @@ -0,0 +1,75 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Tests error messages when '%reldir%' and '%canon_reldir%' substitutions +# (and their shorthands '%D%' and '%C%') are involved. + +. test-init.sh + +cat >> configure.ac <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AM_PROG_AR +END + +: > ar-lib + +mkdir sub sub/sub2 + +cat > Makefile.am <<'END' +%canon_reldir%_x1_SOURCES = bar.c +include sub/local.mk +END + +cat > sub/local.mk <<'END' +AUTOMAKE_OPTIONS = -Wno-extra-portability +include %D%/sub2/more.mk +noinst_LIBRARIES = %reldir%-one.a %D%-two.a +%C%_x2_SOURCES = foo.c +END + +cat > sub/sub2/more.mk <<'END' +%C%_UNDEFINED += +END + +$ACLOCAL +AUTOMAKE_fails + +cat > expected << 'END' +sub/sub2/more.mk:1: sub_sub2_UNDEFINED must be set with '=' before using '+=' +Makefile.am:2: 'sub/local.mk' included from here +sub/local.mk:2: 'sub/sub2/more.mk' included from here +sub/local.mk:3: 'sub-one.a' is not a standard library name +sub/local.mk:3: did you mean 'libsub-one.a'? +Makefile.am:2: 'sub/local.mk' included from here +sub/local.mk:3: 'sub-two.a' is not a standard library name +sub/local.mk:3: did you mean 'libsub-two.a'? +Makefile.am:2: 'sub/local.mk' included from here +Makefile.am:1: variable 'x1_SOURCES' is defined but no program or +Makefile.am:1: library has 'x1' as canonical name (possible typo) +sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or +sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo) +Makefile.am:2: 'sub/local.mk' included from here +END + +sed -e '/warnings are treated as errors/d' \ + -e 's/: warning:/:/' -e 's/: error:/:/' \ + -e 's/ */ /g' \ + obtained + +diff expected obtained + +: diff --git a/t/preproc-reldir.sh b/t/preproc-reldir.sh deleted file mode 100755 index ab443df..0000000 --- a/t/preproc-reldir.sh +++ /dev/null @@ -1,129 +0,0 @@ -#! /bin/sh -# Copyright (C) 2013 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 . - -# Test %reldir% and %canon_reldir%. - -. test-init.sh - -cat >> configure.ac << 'END' -AC_PROG_CC -AM_PROG_CC_C_O -AC_CONFIG_FILES([zot/Makefile]) -AC_OUTPUT -END - -mkdir foo -mkdir foo/bar -mkdir foo/foobar -mkdir zot - -cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects -bin_PROGRAMS = -include $(top_srcdir)/foo/local.mk -include $(srcdir)/foo/foobar/local.mk -include local.mk -END - -cat > zot/Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects -bin_PROGRAMS = -include $(top_srcdir)/zot/local.mk -include $(top_srcdir)/top.mk -include ../reltop.mk -END - -cat > local.mk << 'END' -%canon_reldir%_whoami: - @echo "I am %reldir%/local.mk" - -bin_PROGRAMS += %reldir%/mumble -%canon_reldir%_mumble_SOURCES = %reldir%/one.c -END - -cat > top.mk << 'END' -%canon_reldir%_top_whoami: - @echo "I am %reldir%/top.mk" - -bin_PROGRAMS += %D%/scream -%C%_scream_SOURCES = %D%/two.c -END - -cat > reltop.mk << 'END' -%C%_reltop_whoami: - @echo "I am %D%/reltop.mk" - -bin_PROGRAMS += %reldir%/sigh -%canon_reldir%_sigh_SOURCES = %reldir%/three.c -END - -cat > one.c << 'END' -int main(void) { return 0; } -END - -cp local.mk foo -cp local.mk foo/bar -cp local.mk foo/foobar -cp local.mk zot -echo "include %reldir%/bar/local.mk" >> foo/local.mk - -cp one.c foo -cp one.c foo/bar -cp one.c foo/foobar -cp one.c zot -cp one.c two.c -cp one.c three.c - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a -./configure - -$MAKE whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am local.mk" output -$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/local.mk" output -$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/bar/local.mk" output -$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/foobar/local.mk" output - -$MAKE -./mumble -foo/mumble -foo/bar/mumble -foo/foobar/mumble - -cd zot - -$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am ../top.mk" output -$MAKE ___reltop_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am ../reltop.mk" output -$MAKE whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am local.mk" output - -$MAKE -./mumble -../scream -../sigh -- 1.7.9 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 04:11:31 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 09:11:31 +0000 Received: from localhost ([127.0.0.1]:42931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jzX-00075L-KA for submit@debbugs.gnu.org; Fri, 08 Feb 2013 04:11:31 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:38185) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3jzU-00075D-Lk for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 04:11:29 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 1F7254000E; Fri, 8 Feb 2013 10:11:26 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 6B77240007; Fri, 8 Feb 2013 10:11:25 +0100 (CET) Message-ID: <5114C13C.1020107@lysator.liu.se> Date: Fri, 08 Feb 2013 10:11:24 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <5113730E.9010004@gmail.com> <1360313126-26068-1-git-send-email-peda@lysator.liu.se> In-Reply-To: <1360313126-26068-1-git-send-email-peda@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , automake-patches@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) On 2013-02-08 09:45, Peter Rosin wrote: > Stefano Lattarini wrote: >> Fine as well. And of curse, if you want to speed thing up and have more >> control on the final result, feel free to shepherd the pending patches to >> the agreed form ;-) -- which if I'm not mistaken is: >> >> - make the series consist of only two patches, one introducing the >> feature (complete with documentation and NEWS additions, plus your >> original test case), and one follow-up patch implementing my >> testsuite enhancement; >> >> - use the '%...%' form, and prefer lower-case for long names (so, >> '%reldir%' a.k.a. '%D%' and '%canon-reldir%' a.k.a. '%C%'). > > Done. I didn't address the canonicalization concern raised by Miles. That > seems like a bigger issue than this patch series. However, If that naming > is changing, it must be done before this series lands in a released > version, or we'll end up with bad comptibility hacks... Errm, compatibility... Forgot to ask, but should I push out this non-fast-forward to the experimental/preproc branch? That would be 'git checkout experimental/preproc' followed by 'git push -f origin', right? I did rewrite that branch locally assuming the old branch was destined for the bin, but I have never actually done such a rewind of upstream before... Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 06:34:11 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 11:34:11 +0000 Received: from localhost ([127.0.0.1]:43009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3mDb-0002rI-4G for submit@debbugs.gnu.org; Fri, 08 Feb 2013 06:34:11 -0500 Received: from mail-ee0-f43.google.com ([74.125.83.43]:42517) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3mDY-0002rA-9L for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 06:34:09 -0500 Received: by mail-ee0-f43.google.com with SMTP id c50so1974074eek.16 for <13524@debbugs.gnu.org>; Fri, 08 Feb 2013 03:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=M5FZ6O6donJDszaldVikiUEgDbFonYIYmO43EsG8BH8=; b=WwZ6QiQ3zdOYyFuTYXDNiutBzF/+1SnRDbYWZLS9cXOI2zrWtGxoky9YzS7jbp+4mr HRX2YrsrvHX7uF1O6VL0/QyJXem0Gj2nNqv5bBAwBD0YUG06W6fx957xNdcX4hnB8l4s VOsWqYoZVi359e9cKnllJL3WK9ytbk8Nk+2xJ9t5+2bom4V4RtWPYTrynS7Bl6Q2ZWz4 JMvkA+NeSngDzYflWZbdehYIbQWHKjJwo04nkRNja6G9p5UGvP4KdzZOcpylkewRKGk5 et2/us8D67BJ/qouGVkSDhVDl/hmgnaUl92nKNSC0g19uRTgQ5TJaJRZNPuUtC/+EChF oWnA== X-Received: by 10.14.225.72 with SMTP id y48mr14853190eep.46.1360323244825; Fri, 08 Feb 2013 03:34:04 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id a1sm21545912eep.2.2013.02.08.03.34.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Feb 2013 03:34:03 -0800 (PST) Message-ID: <5114E2A4.5050206@gmail.com> Date: Fri, 08 Feb 2013 12:33:56 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Miles Bader Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <201301202220.r0KMKsNG029531@freefriends.org> <50FE5965.7050807@gmail.com> <50FE6851.608@lysator.liu.se> <50FFDB51.7070607@gmail.com> <50FFF512.6050102@lysator.liu.se> <50FFFCF2.2040808@gmail.com> <51012795.4050508@lysator.liu.se> <5102ACED.7040306@lysator.liu.se> <51047ACA.3050808@lysator.liu.se> <51057E46.4070601@gmail.com> <5105BA7C.7090000@lysator.liu.se> <510ECB9E.8040404@gmail.com> <510EEE4A.80608@lysator.liu.se> <510F80F4.7020208@lysator.liu.se> <510F9C8D.7000207@gmail.com> <510FA3DB.9040608@lysator.liu.se> <510FBB08.5080003@gmail.com> <510FC053.8080009@lysator.liu.se> <510FEDB1.5080809@gmail.com> <510FF0DA.3070809@redhat.com> <510FF9E6.7030205@gmail.com> <51103E3B.6080401@lysator.liu.se> <511374F8.4020605@gmail.com> <5113A3D7.20109@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: Peter Rosin , Eric Blake , 13524@debbugs.gnu.org, "automake-patches@gnu.org" , Karl Berry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/08/2013 05:13 AM, Miles Bader wrote: >>> Hmm, if that's the case, then I think "canon" is the wrong term to >>> use, as it typically implies that the result is still in the same >>> domain as the input. >>> >> Suggestions for a better name then? > > Dunno... something like "RELDIR_SYM" would make sense ... it's a > symbol corresponding to RELDIR... > But if we go this way, we should also fix the manual (and some function names in the automake script itself) to use the new terminology instead of the one based on "canonicalization"; otherwise we risk more confusion and inconsistencies. And this "SYM" doesn't sounds clear nor expressive enough IMHO. So, unless someone comes up with a new term that can be easily used in the documentation as well, I think staying with "canonicalize" is the lesser evil. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 07:31:15 2013 Received: (at 13524) by debbugs.gnu.org; 8 Feb 2013 12:31:15 +0000 Received: from localhost ([127.0.0.1]:43036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3n6o-00054Y-J6 for submit@debbugs.gnu.org; Fri, 08 Feb 2013 07:31:14 -0500 Received: from mail-ee0-f54.google.com ([74.125.83.54]:60190) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3n6m-00054P-3A for 13524@debbugs.gnu.org; Fri, 08 Feb 2013 07:31:13 -0500 Received: by mail-ee0-f54.google.com with SMTP id c41so2107174eek.41 for <13524@debbugs.gnu.org>; Fri, 08 Feb 2013 04:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/+mUJuZP7ekAn1xnGUtp3ZfiZXZun3JZG5SosMUko0A=; b=OeD8jmfB6oO45Vx+FLFiznkuT175DXZJLxqSPWeuaMeqph4cq6kKTiYHvkJVTMkbtu pwGpaOaEu0Z2W9fNZqOzM/b3Hb3Lekb5VpVf/nIzTxOcz+ab5yJePtQBNDnUkCrkO288 MQQt3BmnRmLmz+cw0NcuTmFyzehwC2hdsMcFuqt6Yek2zQn7zVf0wnQyfCTdW4/njTXL iKebkDQEXYBTguOc3lpdbxkYfH/F07/vVvya/qgQgi4GpoVxUuY8bkt73RwwFzfWNPmE N6UnNlI4zAqV9hLmCY8+QhGdzgObP7Q1JFGeeh8jLmqX3rTvdZ1gsT4htu3Dn6Q5iS43 otPw== X-Received: by 10.14.221.9 with SMTP id q9mr15889679eep.3.1360326668362; Fri, 08 Feb 2013 04:31:08 -0800 (PST) Received: from [192.168.178.21] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id a1sm21814494eep.2.2013.02.08.04.31.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Feb 2013 04:31:07 -0800 (PST) Message-ID: <5114F008.3010300@gmail.com> Date: Fri, 08 Feb 2013 13:31:04 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#13524: Improving user experience for non-recursive builds References: <5113730E.9010004@gmail.com> <1360313126-26068-1-git-send-email-peda@lysator.liu.se> <5114C13C.1020107@lysator.liu.se> In-Reply-To: <5114C13C.1020107@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Karl Berry , Eric Blake , automake-patches@gnu.org, Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/08/2013 10:11 AM, Peter Rosin wrote: > On 2013-02-08 09:45, Peter Rosin wrote: >> Stefano Lattarini wrote: >>> Fine as well. And of curse, if you want to speed thing up and have more >>> control on the final result, feel free to shepherd the pending patches to >>> the agreed form ;-) -- which if I'm not mistaken is: >>> >>> - make the series consist of only two patches, one introducing the >>> feature (complete with documentation and NEWS additions, plus your >>> original test case), and one follow-up patch implementing my >>> testsuite enhancement; >>> >>> - use the '%...%' form, and prefer lower-case for long names (so, >>> '%reldir%' a.k.a. '%D%' and '%canon-reldir%' a.k.a. '%C%'). >> >> Done. I didn't address the canonicalization concern raised by Miles. That >> seems like a bigger issue than this patch series. However, If that naming >> is changing, it must be done before this series lands in a released >> version, or we'll end up with bad comptibility hacks... > > Errm, compatibility... > > Forgot to ask, but should I push out this non-fast-forward to the > experimental/preproc branch? > Yes please. I will rewind it again once I have, as you suggest, fixed my "demo test" not to needlessly fiddle with '/dev/full'. > That would be 'git checkout experimental/preproc' followed by > 'git push -f origin', right? I did rewrite that branch locally > assuming the old branch was destined for the bin, but I have > never actually done such a rewind of upstream before... > I fear that Savannah forbid such simple for of non-fast-forward pushes. Here is what you can do to still force the rewind: $ git branch -m experimental/preproc x $ git push origin :experimental/preproc $ git branch -m x experimental/preproc $ git push origin experimental/preproc Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 05:27:35 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 10:27:35 +0000 Received: from localhost ([127.0.0.1]:55201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2Q-00057W-O7 for submit@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:35 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:49153) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2O-00057J-1R for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:33 -0500 Received: by mail-wg0-f42.google.com with SMTP id 12so5000351wgh.3 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 02:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Q7pmSvYH2TPHMqPdh/PBso4UNx0q39RJ4ibXpHLYqKQ=; b=sQfF5ewLDeMoolFN33q8Q6XjdUC0OE6jYev3uRtU+L/WGaYAu4GmLnkjPzsp57mK1l BBEIbFASHJcokqmKfgqR5YDcD81x6sMlkoOhDp833Ns3iG5nXs3JQOA8ZzmWU9vBEz5Y 9J7QeZR5sZUtdouIloCa/HzYb60kqcX/Ng1S25ZfIwMjTJqgQx1WRPyB/URkVaxaaH49 0osFYiPSj2iW45wiY3/LX9XEq56eBj3tv1nG2kbruPykFBi6X6XbY5wuDeKOibEmDmC7 sMCytKEsnALgqIyFE5BEuzjw10HzYyvvuz26ea1QAfQzxQYcCIbMFooTCxu9/kPGoqrc lPBg== X-Received: by 10.180.109.82 with SMTP id hq18mr15989657wib.0.1360837614512; Thu, 14 Feb 2013 02:26:54 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id hb9sm47369684wib.3.2013.02.14.02.26.52 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 02:26:53 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org, 13524@debbugs.gnu.org Subject: [PATCH 0/2] Improving user experience for non-recursive builds Date: Thu, 14 Feb 2013 11:26:39 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.662.gaa39828 In-Reply-To: <5114F008.3010300@gmail.com> References: <5114F008.3010300@gmail.com> X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us, eblake@redhat.com, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/08/2013 01:31 PM, Stefano Lattarini wrote: > On 02/08/2013 10:11 AM, Peter Rosin wrote: >> On 2013-02-08 09:45, Peter Rosin wrote: >>> Stefano Lattarini wrote: >>>> Fine as well. And of curse, if you want to speed thing up and have more >>>> control on the final result, feel free to shepherd the pending patches to >>>> the agreed form ;-) -- which if I'm not mistaken is: >>>> >>>> - make the series consist of only two patches, one introducing the >>>> feature (complete with documentation and NEWS additions, plus your >>>> original test case), and one follow-up patch implementing my >>>> testsuite enhancement; >>>> >>>> - use the '%...%' form, and prefer lower-case for long names (so, >>>> '%reldir%' a.k.a. '%D%' and '%canon-reldir%' a.k.a. '%C%'). >>> >>> Done. I didn't address the canonicalization concern raised by Miles. That >>> seems like a bigger issue than this patch series. However, If that naming >>> is changing, it must be done before this series lands in a released >>> version, or we'll end up with bad comptibility hacks... >> >> Errm, compatibility... >> >> Forgot to ask, but should I push out this non-fast-forward to the >> experimental/preproc branch? >> > Yes please. I will rewind it again once I have, as you suggest, fixed > my "demo test" not to needlessly fiddle with '/dev/full'. > OK, done. If there are no further objections, I will soon proceed to re-write the experimental/preproc branch once again with the latest version of these patches; then we can think when and how to merge it into 'master' or 'next' (the merge will be delayed until the discussion about the new branching/versioning scheme for automake has been sorted out; see ). Thanks, Stefano -*-*-*- Peter Rosin (1): preproc: add support for relative names in included fragments Stefano Lattarini (1): preproc: enhance and extend tests NEWS | 12 +++ automake.in | 26 ++++-- doc/automake.texi | 20 +++++ t/list-of-tests.mk | 4 + t/preproc-basics.sh | 106 +++++++++++++++++++++++ t/preproc-c-compile.sh | 118 +++++++++++++++++++++++++ t/preproc-demo.sh | 230 +++++++++++++++++++++++++++++++++++++++++++++++++ t/preproc-errmsg.sh | 75 ++++++++++++++++ 8 files changed, 585 insertions(+), 6 deletions(-) create mode 100755 t/preproc-basics.sh create mode 100755 t/preproc-c-compile.sh create mode 100755 t/preproc-demo.sh create mode 100755 t/preproc-errmsg.sh -- 1.8.1.1.662.gaa39828 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 05:27:41 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 10:27:41 +0000 Received: from localhost ([127.0.0.1]:55205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2W-00057x-7x for submit@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:41 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:55142) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2Q-00057U-Rq for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:37 -0500 Received: by mail-wi0-f173.google.com with SMTP id hq4so6820044wib.0 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 02:26:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=axkrRVPaaPOoROAXqqIGjJcAuZEL0MnfC7toG1KvcZc=; b=UuSnRgaRH+td1UqX1zS6KKznHooZw3rbQ7kACDs27jzBknTf9Hboh0qLQfFZoT04p1 twzLP43LubDNHk4OOIvHTb3+3V/IcTklRLLN2cy5axQrGyx6lFomVGM2qMw02DUEiBXM l7ctEQ0tOgOC0q5xUSEqZcMAedqTLFqkLOv+UDKlcw9k1g0lQYtNuLAnrR1Q70UuwJUS xLrE2SOTFzKGdoQWTWge8Ler6I55UlV+IeYLhpyr4g9K+Bb1pGqmDCoZCe6AjEat3dCS ADoWqXIEwsiMIw6gofmBQ2saScaQc7FRdK1fSCVKRWXvE80a3UAb8H1zpWIPZZmpBWQY guDg== X-Received: by 10.195.13.200 with SMTP id fa8mr44334008wjd.15.1360837616795; Thu, 14 Feb 2013 02:26:56 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id hb9sm47369684wib.3.2013.02.14.02.26.54 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 02:26:55 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org, 13524@debbugs.gnu.org Subject: [PATCH 1/2] preproc: add support for relative names in included fragments Date: Thu, 14 Feb 2013 11:26:40 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.662.gaa39828 In-Reply-To: References: <5114F008.3010300@gmail.com> In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us, eblake@redhat.com, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) From: Peter Rosin The rationale for this change is that it is annoying to have to repeat the directory name when including a Makefile fragment. For deep directory structures these repeats can generate a lot of bloat. It also hinders reuse and easy directory restructuring if all Makefile fragments have to know exactly where they live. Suggested by Bob Friesenhahn, and later discussed in bug#13524. In the course of discussion, the following notations were rejected: &{reldir}& - to hard to type, {reldir} - interferes with ${reldir}, {am_reldir} - short form {D} interferes with ${D}, @am_reldir@ - short form @D@ interferes with AC_SUBST([D]) as well as invading the config.status turf. Other notations were also suggested... * automake.in (read_am_file): Add third argument specifying the relative directory of this Makefile fragment compared to the main Makefile. Replace %reldir% and %canon_reldir% in the fragment with this relative directory (with slashes etc, or canonicalized). (read_main_am_file): Adjust. * t/preproc-reldir.sh: New test. * t/list-of-tests.mk: Augment. * doc/automake.texi (Include): Document the new feature. NEWS: Add new feature. Co-authored-by: Stefano Lattarini Signed-off-by: Peter Rosin --- NEWS | 12 +++++ automake.in | 26 ++++++++--- doc/automake.texi | 20 ++++++++ t/list-of-tests.mk | 1 + t/preproc-reldir.sh | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 182 insertions(+), 6 deletions(-) create mode 100755 t/preproc-reldir.sh diff --git a/NEWS b/NEWS index 6dcce72..e27e0cf 100644 --- a/NEWS +++ b/NEWS @@ -100,6 +100,18 @@ New in 1.13.2: be longer necessary, so we deprecate it with runtime warnings. It will likely be removed altogether in Automake 1.14. +* Relative directory in Makefile fragments: + + - The special Automake-time substitutions '%reldir%' and '%canon_reldir%' + (and their short versions, '%D%' and '%C%' respectively) can now be used + in an included Makefile fragment. The former is substituted with the + relative directory of the included fragment (compared to the top level + including Makefile), and the latter with the canonicalized version of + the same relative directory: + + bin_PROGRAMS += %reldir%/foo + %canon_reldir%_foo_SOURCES = {reldir}/bar.c + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.13.2: diff --git a/automake.in b/automake.in index d6ed599..80e54ff 100644 --- a/automake.in +++ b/automake.in @@ -6330,15 +6330,16 @@ sub check_trailing_slash ($\$) } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# &read_am_file ($AMFILE, $WHERE, $RELDIR) +# ---------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. -sub read_am_file ($$) +sub read_am_file ($$$) { - my ($amfile, $where) = @_; + my ($amfile, $where, $reldir) = @_; + my $canon_reldir = &canonicalize ($reldir); my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@ -6423,6 +6424,17 @@ sub read_am_file ($$) my $new_saw_bk = check_trailing_slash ($where, $_); + if ($reldir eq '.') + { + # If present, eat the following '_' or '/', converting + # "%reldir%/foo" and "%canon_reldir%_foo" into plain "foo" + # when $reldir is '.'. + $_ =~ s,%(D|reldir)%/,,g; + $_ =~ s,%(C|canon_reldir)%_,,g; + } + $_ =~ s/%(D|reldir)%/${reldir}/g; + $_ =~ s/%(C|canon_reldir)%/${canon_reldir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@ -6584,8 +6596,10 @@ sub read_am_file ($$) push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_reldir = File::Spec->abs2rel ($path, $relative_dir); + $new_reldir = '.' if $new_reldir !~ s,/[^/]*$,,; $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + &read_am_file ($path, $where, $new_reldir); $where->pop_context; } else @@ -6658,7 +6672,7 @@ sub read_main_am_file ($$) &define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + &read_am_file ($amfile, new Automake::Location, '.'); } diff --git a/doc/automake.texi b/doc/automake.texi index feae3ac..d420d28 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -10519,6 +10519,26 @@ condition applies to the entire contents of that fragment. Makefile fragments included this way are always distributed because they are needed to rebuild @file{Makefile.in}. +Inside a fragment, the construct @code{%reldir%} is replaced with the +directory of the fragment relative to the base @file{Makefile.am}. +Similarly, @code{%canon_reldir%} is replaced with the canonicalized +(@pxref{Canonicalization}) form of @code{%reldir%}. As a convenience, +@code{%D%} is a synonym for @code{%reldir%}, and @code{%C%} +is a synonym for @code{%canon_reldir%}. + +A special feature is that if the fragment is in the same directory as +the base @file{Makefile.am} (i.e., @code{%reldir%} is @code{.}), then +@code{%reldir%} and @code{%canon_reldir%} will expand to the empty +string as well as eat, if present, a following slash or underscore +respectively. + +Thus, a makefile fragment might look like this: + +@example +bin_PROGRAMS += %reldir%/mumble +%canon_reldir%_mumble_SOURCES = %reldir%/one.c +@end example + @node Conditionals @chapter Conditionals diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 0acbdcf..72c99ee 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -865,6 +865,7 @@ t/pr401.sh \ t/pr401b.sh \ t/pr401c.sh \ t/prefix.sh \ +t/preproc-reldir.sh \ t/primary.sh \ t/primary2.sh \ t/primary3.sh \ diff --git a/t/preproc-reldir.sh b/t/preproc-reldir.sh new file mode 100755 index 0000000..ab443df --- /dev/null +++ b/t/preproc-reldir.sh @@ -0,0 +1,129 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test %reldir% and %canon_reldir%. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo +mkdir foo/bar +mkdir foo/foobar +mkdir zot + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = +include $(top_srcdir)/zot/local.mk +include $(top_srcdir)/top.mk +include ../reltop.mk +END + +cat > local.mk << 'END' +%canon_reldir%_whoami: + @echo "I am %reldir%/local.mk" + +bin_PROGRAMS += %reldir%/mumble +%canon_reldir%_mumble_SOURCES = %reldir%/one.c +END + +cat > top.mk << 'END' +%canon_reldir%_top_whoami: + @echo "I am %reldir%/top.mk" + +bin_PROGRAMS += %D%/scream +%C%_scream_SOURCES = %D%/two.c +END + +cat > reltop.mk << 'END' +%C%_reltop_whoami: + @echo "I am %D%/reltop.mk" + +bin_PROGRAMS += %reldir%/sigh +%canon_reldir%_sigh_SOURCES = %reldir%/three.c +END + +cat > one.c << 'END' +int main(void) { return 0; } +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot +echo "include %reldir%/bar/local.mk" >> foo/local.mk + +cp one.c foo +cp one.c foo/bar +cp one.c foo/foobar +cp one.c zot +cp one.c two.c +cp one.c three.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure + +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output +$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/local.mk" output +$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/bar/local.mk" output +$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am foo/foobar/local.mk" output + +$MAKE +./mumble +foo/mumble +foo/bar/mumble +foo/foobar/mumble + +cd zot + +$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../top.mk" output +$MAKE ___reltop_whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am ../reltop.mk" output +$MAKE whoami >output 2>&1 || { cat output; exit 1; } +cat output +grep "I am local.mk" output + +$MAKE +./mumble +../scream +../sigh -- 1.8.1.1.662.gaa39828 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 05:27:43 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 10:27:43 +0000 Received: from localhost ([127.0.0.1]:55207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2X-000580-AL for submit@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:43 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:43058) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5w2S-00057e-4A for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 05:27:39 -0500 Received: by mail-we0-f169.google.com with SMTP id t11so1851788wey.0 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 02:26:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=MspFaNCz+6sJ7N41USd+QO8BkGpVW89dk8ztojTTPqA=; b=hvI9jt3mXO2SdfDTWTqzi/1dDAmY82Apr+dZgNG9ySbazwBj2NjwoTrFe1XhZtx0r7 aXz8Vi8W5uNurJxVE6vvC3Jn6EUcn+hKAfDrmlNlJ/Dvf0CyU0Ctsb0dZu2AFTH0ixvH D9pHMvj5Z+SLeA5tMULZS7AwD/IJ3HP0SSqyLEBLWyUEmE6gpRoyVL0e81sBOZsqmEYv SXDZ6vZa4abpyIn1smkw0cTRCl3VAA0oI6njgTzW6aPY2J5FloXn+kvAfSEErSTB4po8 /94q3lGwMaMLSPU8wUGs1aB+lDiANqV9Y7N7Y76hQluI09GHBW+TjBXk7qy+mw9la2n2 fWXA== X-Received: by 10.180.97.197 with SMTP id ec5mr15757669wib.1.1360837618957; Thu, 14 Feb 2013 02:26:58 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id hb9sm47369684wib.3.2013.02.14.02.26.56 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 02:26:58 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org, 13524@debbugs.gnu.org Subject: [PATCH 2/2] preproc: enhance and extend tests Date: Thu, 14 Feb 2013 11:26:41 +0100 Message-Id: <75b6d08fbc0a8fde063a919401b325bc91c9cfd3.1360837100.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.1.1.662.gaa39828 In-Reply-To: References: <5114F008.3010300@gmail.com> In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us, eblake@redhat.com, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * t/preproc-demo.sh: New test, a "demo" of how the new pre-processing feature could be used in a real-world package. * t/preproc-errmsg.sh: New test, check that error messages remain useful when the new pre-processing features are involved. * t/preproc-reldir.sh: Split up ... * t/preproc-basics.sh, t/preproc-c-compile.sh: ... into these two tests, with some refactorings, clean-up and enhancements. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini --- t/list-of-tests.mk | 5 +- t/preproc-basics.sh | 106 ++++++++++++ t/{preproc-reldir.sh => preproc-c-compile.sh} | 115 ++++++------- t/preproc-demo.sh | 230 ++++++++++++++++++++++++++ t/preproc-errmsg.sh | 75 +++++++++ 5 files changed, 467 insertions(+), 64 deletions(-) create mode 100755 t/preproc-basics.sh rename t/{preproc-reldir.sh => preproc-c-compile.sh} (50%) create mode 100755 t/preproc-demo.sh create mode 100755 t/preproc-errmsg.sh diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 72c99ee..679fe5d 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -865,7 +865,10 @@ t/pr401.sh \ t/pr401b.sh \ t/pr401c.sh \ t/prefix.sh \ -t/preproc-reldir.sh \ +t/preproc-basics.sh \ +t/preproc-c-compile.sh \ +t/preproc-demo.sh \ +t/preproc-errmsg.sh \ t/primary.sh \ t/primary2.sh \ t/primary3.sh \ diff --git a/t/preproc-basics.sh b/t/preproc-basics.sh new file mode 100755 index 0000000..6000d88 --- /dev/null +++ b/t/preproc-basics.sh @@ -0,0 +1,106 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Basic tests for '%...%' preprocessing in included Makefile fragments: +# %reldir% a.k.a. %D% +# %canon_reldir% a.k.a. %C% + +. test-init.sh + +cat >> configure.ac << 'END' +AC_CONFIG_FILES([zot/Makefile]) +AC_OUTPUT +END + +mkdir foo foo/bar foo/foobar zot + +cat > Makefile.am << 'END' +include $(top_srcdir)/foo/local.mk +include $(srcdir)/foo/foobar/local.mk +include local.mk +END + +cat > zot/Makefile.am << 'END' +include $(top_srcdir)/zot/local.mk + +## Check that '%canon_reldir%' doesn't remain overridden +## by the previous include. +%canon_reldir%_zot_whoami: + echo "I am %reldir%/Makefile.am" >$@ + +include $(top_srcdir)/top.mk +include ../reltop.mk +END + +cat > local.mk << 'END' +%canon_reldir%_whoami: + echo "I am %reldir%/local.mk" >$@ +END + +cat > top.mk << 'END' +%canon_reldir%_top_whoami: + echo "I am %reldir%/top.mk" >$@ +END + +cat > reltop.mk << 'END' +%C%_reltop_whoami: + echo "I am %D%/reltop.mk" >$@ +END + +cp local.mk foo +cp local.mk foo/bar +cp local.mk foo/foobar +cp local.mk zot + +cat >> foo/local.mk << 'END' +include %reldir%/bar/local.mk +## Check that '%canon_reldir%' doesn't remain overridden by the +## previous include. The duplicated checks are done to ensure that +## Automake substitutes all pre-processing occurrences on a line, +## not just the first one. +test-%reldir%: + test '%reldir%' = foo && test '%reldir%' = foo + test '%D%' = foo && test '%D%' = foo + test '%canon_reldir%' = foo && test '%C%' = foo +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +check () +{ + test $# -eq 2 || fatal_ "made_into(): bad usage" + target=$1 contents=$2 + rm -f "$target" \ + && $MAKE "$target" \ + && test x"$(cat "$target")" = x"$contents" +} + +check whoami "I am local.mk" +check foo_whoami "I am foo/local.mk" +check foo_bar_whoami "I am foo/bar/local.mk" +check foo_foobar_whoami "I am foo/foobar/local.mk" +$MAKE test-foo + +cd zot +check whoami "I am local.mk" +check ___top_whoami "I am ../top.mk" +check ___reltop_whoami "I am ../reltop.mk" +check zot_whoami "I am Makefile.am" + +: diff --git a/t/preproc-reldir.sh b/t/preproc-c-compile.sh similarity index 50% rename from t/preproc-reldir.sh rename to t/preproc-c-compile.sh index ab443df..79e9325 100755 --- a/t/preproc-reldir.sh +++ b/t/preproc-c-compile.sh @@ -14,8 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test %reldir% and %canon_reldir%. +# Test pre-processing substitutions '%reldir%' and '%canon_reldir%' +# with C compilation and subdir objects. +require=cc . test-init.sh cat >> configure.ac << 'END' @@ -32,49 +34,53 @@ mkdir zot cat > Makefile.am << 'END' AUTOMAKE_OPTIONS = subdir-objects +SUBDIRS = zot bin_PROGRAMS = + include $(top_srcdir)/foo/local.mk include $(srcdir)/foo/foobar/local.mk include local.mk + +check-local: + is $(bin_PROGRAMS) == \ + foo/mumble2$(EXEEXT) \ + foo/bar/mumble$(EXEEXT) \ + foo/foobar/mumble$(EXEEXT) \ + mumble$(EXEEXT) + test '$(mumble_SOURCES)' = one.c + test '$(foo_mumble2_SOURCES)' = foo/one.c + test '$(foo_bar_mumble_SOURCES)' = foo/bar/one.c + test '$(foo_foobar_mumble_SOURCES)' = foo/foobar/one.c + test -f mumble$(EXEEXT) + test -f foo/mumble2$(EXEEXT) + test -f foo/bar/mumble$(EXEEXT) + test -f foo/foobar/mumble$(EXEEXT) + test -f zot/mumble$(EXEEXT) + : Test some of the object files too. + test -f one.$(OBJEXT) + test -f foo/foobar/one.$(OBJEXT) + test -f zot/one.$(OBJEXT) END cat > zot/Makefile.am << 'END' AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = include $(top_srcdir)/zot/local.mk -include $(top_srcdir)/top.mk -include ../reltop.mk + +test: + test '$(bin_PROGRAMS)' == mumble$(EXEEXT) + test '$(mumble_SOURCES)' = one.c +check-local: test END cat > local.mk << 'END' -%canon_reldir%_whoami: - @echo "I am %reldir%/local.mk" - bin_PROGRAMS += %reldir%/mumble %canon_reldir%_mumble_SOURCES = %reldir%/one.c END -cat > top.mk << 'END' -%canon_reldir%_top_whoami: - @echo "I am %reldir%/top.mk" - -bin_PROGRAMS += %D%/scream -%C%_scream_SOURCES = %D%/two.c -END - -cat > reltop.mk << 'END' -%C%_reltop_whoami: - @echo "I am %D%/reltop.mk" +echo 'int main (void) { return 0; }' > one.c -bin_PROGRAMS += %reldir%/sigh -%canon_reldir%_sigh_SOURCES = %reldir%/three.c -END - -cat > one.c << 'END' -int main(void) { return 0; } -END - -cp local.mk foo +sed 's/mumble/mumble2/' local.mk > foo/local.mk cp local.mk foo/bar cp local.mk foo/foobar cp local.mk zot @@ -84,46 +90,29 @@ cp one.c foo cp one.c foo/bar cp one.c foo/foobar cp one.c zot -cp one.c two.c -cp one.c three.c $ACLOCAL $AUTOCONF -$AUTOMAKE -a +$AUTOMAKE ./configure -$MAKE whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am local.mk" output -$MAKE foo_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/local.mk" output -$MAKE foo_bar_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/bar/local.mk" output -$MAKE foo_foobar_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am foo/foobar/local.mk" output - -$MAKE -./mumble -foo/mumble -foo/bar/mumble -foo/foobar/mumble - -cd zot - -$MAKE ___top_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am ../top.mk" output -$MAKE ___reltop_whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am ../reltop.mk" output -$MAKE whoami >output 2>&1 || { cat output; exit 1; } -cat output -grep "I am local.mk" output - $MAKE -./mumble -../scream -../sigh +$MAKE check-local +if ! cross_compiling; then + ./mumble + ./foo/mumble2 + ./foo/bar/mumble + ./foo/foobar/mumble + ./zot/mumble +fi + +(cd zot && $MAKE test) + +# GNU install refuses to override a just-installed file; since we +# have plenty of 'mumble' dummy programs to install in the same +# location, such "overridden installations" are not a problem for +# us, so just force the use the 'install-sh' script +ac_cv_path_install=$(pwd)/install-sh; export ac_cv_path_install +$MAKE distcheck + +: diff --git a/t/preproc-demo.sh b/t/preproc-demo.sh new file mode 100755 index 0000000..4c1b2d9 --- /dev/null +++ b/t/preproc-demo.sh @@ -0,0 +1,230 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Demo of a package using pre-processing substitutions '%reldir%' and +# '%canon_reldir%', and their respective shorthands '%D%' and '%C%'. + +am_create_testdir=empty +required=cc +. test-init.sh + +if cross_compiling; then + WE_ARE_CROSS_COMPILING=yes +else + WE_ARE_CROSS_COMPILING=no +fi +export WE_ARE_CROSS_COMPILING + +SAFE_PRINT_FAIL=; unset SAFE_PRINT_FAIL + +cat > configure.ac << 'END' +AC_INIT([GNU Demo], [0.7], [bug-automake@gnu.org]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([1.12.6 foreign subdir-objects -Wall]) +AM_CONDITIONAL([NATIVE_BUILD], [test $WE_ARE_CROSS_COMPILING != yes]) +AC_CONFIG_FILES([Makefile]) +AC_PROG_CC +AM_PROG_CC_C_O +AM_PROG_AR +AC_PROG_RANLIB +AC_OUTPUT +END + +mkdir build-aux lib lib/tests src tests + +## Top level. + +cat > Makefile.am << 'END' +bin_PROGRAMS = +check_PROGRAMS = +noinst_LIBRARIES = +AM_CPPFLAGS = +AM_TESTS_ENVIRONMENT = +CLEANFILES = +EXTRA_DIST = +LDADD = +TESTS = + +include $(srcdir)/src/progs.am +include $(srcdir)/lib/gnulib.am +include $(srcdir)/tests/check.am +END + +## Src subdir. + +cat > src/progs.am <<'END' +bin_PROGRAMS += %reldir%/hello + +bin_PROGRAMS += %D%/goodbye +%canon_reldir%_goodbye_SOURCES = %D%/hello.c +%C%_goodbye_CPPFLAGS = $(AM_CPPFLAGS) -DGREETINGS='"Goodbye"' + +# The testsuite should have access to our built programs. +AM_TESTS_ENVIRONMENT += \ + PROGDIR='$(top_builddir)/%reldir%'; \ + export PROGDIR; \ + PATH='$(abs_builddir)/%reldir%'$(PATH_SEPARATOR)$$PATH; \ + export PATH; +END + +cat > src/hello.c <<'END' +#include "safe-print.h" +#include +#include + +#ifndef GREETINGS +# define GREETINGS "Hello" +#endif + +int +main (void) +{ + safe_print (stdout, GREETINGS ", World!\n"); + exit (EXIT_SUCCESS); +} +END + +## Lib subdir. + +cat > lib/gnulib.am << 'END' +noinst_LIBRARIES += %D%/libgnu.a + +AM_CPPFLAGS += -I%D% -I$(top_srcdir)/%D% +LDADD += $(noinst_LIBRARIES) + +%C%_libgnu_a_SOURCES = \ + %D%/safe-print.c \ + %D%/safe-print.h + +if NATIVE_BUILD +include %D%/tests/gnulib-check.am +endif +END + +cat > lib/safe-print.c <<'END' +#include "safe-print.h" +#include +#include + +void +safe_print (FILE *fp, const char * str) +{ + if (fprintf (fp, "%s", str) != strlen (str) + || fflush (fp) != 0 || ferror (fp)) + { + fprintf (stderr, "I/O error\n"); + exit (EXIT_FAILURE); + } +} + +END + +cat > lib/safe-print.h <<'END' +#include +void safe_print (FILE *, const char *); +END + +## Lib/Tests (sub)subdir. + +cat > lib/tests/gnulib-check.am <<'END' +check_PROGRAMS += %D%/safe-print-test +TESTS += $(check_PROGRAMS) +AM_TESTS_ENVIRONMENT += EXEEXT='$(EXEEXT)'; export EXEEXT; +END + +cat > lib/tests/safe-print-test.c <<'END' +#include "safe-print.h" +int +main (void) +{ + safe_print (stdout, "dummy\n"); + return 0; +} +END + +## Tests subdir. + +cat > tests/check.am <<'END' +TEST_EXTENSIONS = .sh +SH_LOG_COMPILER = $(SHELL) + +handwritten_TESTS = \ + %D%/hello.sh \ + %D%/built.sh +TESTS += $(handwritten_TESTS) +EXTRA_DIST += $(handwritten_TESTS) + +TESTS += %D%/goodbye.sh +CLEANFILES += %D%/goodbye.sh +%D%/goodbye.sh: %D%/hello.sh + $(MKDIR_P) %D% + rm -f $@ $@-t + sed -e 's/hello/goodbye/' \ + -e 's/Hello/Goodbye/' \ + < $(srcdir)/%D%/hello.sh >$@-t + chmod a-w,a+x $@-t && mv -f $@-t $@ +END + +cat > tests/hello.sh <<'END' +#!/bin/sh +set -x -e +if test "$WE_ARE_CROSS_COMPILING" = yes; then + echo Skipping: cannot run in cross-compilation mode + exit 77 +else + hello || exit 1 + test "`hello`" = 'Hello, World!' || exit 1 +fi +END + +cat > tests/built.sh <<'END' +#!/bin/sh +set -x +test -n "$PROGDIR" || exit 99 +test -f "$PROGDIR/hello$EXEEXT" || exit 1 +test -x "$PROGDIR/hello$EXEEXT" || exit 1 +test -f "$PROGDIR/goodbye$EXEEXT" || exit 1 +test -x "$PROGDIR/goodbye$EXEEXT" || exit 1 +END + + +## Go. + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing --copy +test ! -e compile +test -f build-aux/compile + +./configure + +$MAKE + +VERBOSE=x $MAKE check >stdout || { cat stdout; exit 1; } +cat stdout +cat tests/built.log +cat tests/hello.log +cat tests/goodbye.log +if cross_compiling; then + test ! -e lib/tests/safe-print-test.log + count_test_results total=3 pass=1 fail=0 xpass=0 xfail=0 skip=2 error=0 +else + count_test_results total=4 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=0 +fi + +$MAKE distcheck + +: diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh new file mode 100755 index 0000000..d7cf488 --- /dev/null +++ b/t/preproc-errmsg.sh @@ -0,0 +1,75 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Tests error messages when '%reldir%' and '%canon_reldir%' substitutions +# (and their shorthands '%D%' and '%C%') are involved. + +. test-init.sh + +cat >> configure.ac <<'END' +AC_PROG_CC +AC_PROG_RANLIB +AM_PROG_AR +END + +: > ar-lib + +mkdir sub sub/sub2 + +cat > Makefile.am <<'END' +%canon_reldir%_x1_SOURCES = bar.c +include sub/local.mk +END + +cat > sub/local.mk <<'END' +AUTOMAKE_OPTIONS = -Wno-extra-portability +include %D%/sub2/more.mk +noinst_LIBRARIES = %reldir%-one.a %D%-two.a +%C%_x2_SOURCES = foo.c +END + +cat > sub/sub2/more.mk <<'END' +%C%_UNDEFINED += +END + +$ACLOCAL +AUTOMAKE_fails + +cat > expected << 'END' +sub/sub2/more.mk:1: sub_sub2_UNDEFINED must be set with '=' before using '+=' +Makefile.am:2: 'sub/local.mk' included from here +sub/local.mk:2: 'sub/sub2/more.mk' included from here +sub/local.mk:3: 'sub-one.a' is not a standard library name +sub/local.mk:3: did you mean 'libsub-one.a'? +Makefile.am:2: 'sub/local.mk' included from here +sub/local.mk:3: 'sub-two.a' is not a standard library name +sub/local.mk:3: did you mean 'libsub-two.a'? +Makefile.am:2: 'sub/local.mk' included from here +Makefile.am:1: variable 'x1_SOURCES' is defined but no program or +Makefile.am:1: library has 'x1' as canonical name (possible typo) +sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or +sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo) +Makefile.am:2: 'sub/local.mk' included from here +END + +sed -e '/warnings are treated as errors/d' \ + -e 's/: warning:/:/' -e 's/: error:/:/' \ + -e 's/ */ /g' \ + obtained + +diff expected obtained + +: -- 1.8.1.1.662.gaa39828 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 07:21:21 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 12:21:21 +0000 Received: from localhost ([127.0.0.1]:55274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5xoW-0000XL-Qe for submit@debbugs.gnu.org; Thu, 14 Feb 2013 07:21:21 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:61882) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5xoS-0000X7-6x for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 07:21:19 -0500 Received: by mail-lb0-f176.google.com with SMTP id s4so1706266lbc.7 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 04:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=X6dqi7uuLBAyCpo1vbF+XFDOR07E69sZr+WffLC1Nzw=; b=XN6qtj++QuZFoZThzSry4KyOWnmtcck6sNKD1Dpk9eTthuGWJT0QfkQCpUmYS047Fl +MHYHy5Lee+FpDTEzpg8q9yVLRFAHIE4GKBsdmJuZUonKEMWhNqEY6WFaZAnw3EIyDZr 76qoxbHUrsyrIscxhLLOIlqWwI2plDl8N3lzopvFx3uh+/tRRgk1cSRah90Kgo8VOFaz Fi3/hGGDYDub24rzzfp7tFVbo7ojFz66EESXA0LHamghggT7Gq0Ep5hmz4Nsiwqk+U7N +OEKnwwBIFCpGcmqITqvsUGkD0iD/y7X6OHQED3gdPA21hIsGZHPo9CmeJUvacoQWpX/ S7hA== MIME-Version: 1.0 X-Received: by 10.152.45.140 with SMTP id n12mr23700039lam.36.1360844438132; Thu, 14 Feb 2013 04:20:38 -0800 (PST) Received: by 10.112.79.137 with HTTP; Thu, 14 Feb 2013 04:20:37 -0800 (PST) In-Reply-To: References: <5114F008.3010300@gmail.com> Date: Thu, 14 Feb 2013 13:20:37 +0100 Message-ID: Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments From: Bert Wesarg To: Stefano Lattarini Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi, On Thu, Feb 14, 2013 at 11:26 AM, Stefano Lattarini wrote: > From: Peter Rosin > > The rationale for this change is that it is annoying to have > to repeat the directory name when including a Makefile fragment. > For deep directory structures these repeats can generate a lot > of bloat. It also hinders reuse and easy directory restructuring > if all Makefile fragments have to know exactly where they live. > > Suggested by Bob Friesenhahn, and later discussed in bug#13524. > > In the course of discussion, the following notations were rejected: > &{reldir}& - to hard to type, {reldir} - interferes with ${reldir}, > {am_reldir} - short form {D} interferes with ${D}, @am_reldir@ - short > form @D@ interferes with AC_SUBST([D]) as well as invading the > config.status turf. Other notations were also suggested... > > * automake.in (read_am_file): Add third argument specifying the > relative directory of this Makefile fragment compared to the > main Makefile. Replace %reldir% and %canon_reldir% in the > fragment with this relative directory (with slashes etc, or > canonicalized). > (read_main_am_file): Adjust. > * t/preproc-reldir.sh: New test. > * t/list-of-tests.mk: Augment. > * doc/automake.texi (Include): Document the new feature. > NEWS: Add new feature. > > Co-authored-by: Stefano Lattarini > Signed-off-by: Peter Rosin > --- > NEWS | 12 +++++ > automake.in | 26 ++++++++--- > doc/automake.texi | 20 ++++++++ > t/list-of-tests.mk | 1 + > t/preproc-reldir.sh | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 5 files changed, 182 insertions(+), 6 deletions(-) > create mode 100755 t/preproc-reldir.sh > > diff --git a/NEWS b/NEWS > index 6dcce72..e27e0cf 100644 > --- a/NEWS > +++ b/NEWS > @@ -100,6 +100,18 @@ New in 1.13.2: > be longer necessary, so we deprecate it with runtime warnings. It will > likely be removed altogether in Automake 1.14. > > +* Relative directory in Makefile fragments: > + > + - The special Automake-time substitutions '%reldir%' and '%canon_reldir%' > + (and their short versions, '%D%' and '%C%' respectively) can now be used > + in an included Makefile fragment. The former is substituted with the > + relative directory of the included fragment (compared to the top level > + including Makefile), and the latter with the canonicalized version of > + the same relative directory: > + > + bin_PROGRAMS += %reldir%/foo > + %canon_reldir%_foo_SOURCES = {reldir}/bar.c the rejected '{reldir}' is still used in this example. Does this substition happens in the whole file, or only in specific syntactic constructs? What definitily will not work ist something like this, right? here = %reldir% target = %canon_reldir%/foo bin_PROGRAMS += ${here}/foo ${target}_SOURCES = ${here}/bar.c Speaking of 'here' wouldn't that also an candidate instead of 'reldir'? and %.% as the shortform of %reldir% does sound: bin_PROGRAMS += %.%/foo %canon_here%_foo_SOURCES = %.%/bar.c Regards, Bert From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 07:40:30 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 12:40:30 +0000 Received: from localhost ([127.0.0.1]:55282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5y74-000244-8K for submit@debbugs.gnu.org; Thu, 14 Feb 2013 07:40:30 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:34603) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5y72-00023w-AU for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 07:40:29 -0500 Received: by mail-wi0-f169.google.com with SMTP id l13so7218258wie.2 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 04:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=DtRCGLNQIUSdLJbvH2m3C0gV86dv9JXjyFCKVTvF5OA=; b=TT+SV8EnR5Jvg6jgq/ut6BSjBE3Z34E9u8/9PHx9t9vqvhwgVGjFVgY/dHQDl7ZADS WisPOwRtf7k8M7vPrpndMAWLb4niDK+QdlQCCZGm6z53gwyhMJJDnWct4vJMg4tsaIl7 om7mXzcMVsHlxfXcJo5WXCfw+kkpy9ADJhZ17XD7msvP4oggcaiVeqxycWmRw1U/bGVA NYg42cTiWtV000wb2YNJborOIVPv9BTBaZ05xpKwhQvGXcSNhLRRHcaWpIl47DUnjs7+ FliESTq15eqlM1/DQ28pB6KmWbrJWFgAL2otz9QU2xtsn2SFrPTOWuYmbuaFRmu3LvDs ying== X-Received: by 10.194.238.5 with SMTP id vg5mr45020226wjc.40.1360845590745; Thu, 14 Feb 2013 04:39:50 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id bg5sm10509461wib.8.2013.02.14.04.39.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 04:39:49 -0800 (PST) Message-ID: <511CDB0D.2020103@gmail.com> Date: Thu, 14 Feb 2013 13:39:41 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bert Wesarg Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments References: <5114F008.3010300@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/14/2013 01:20 PM, Bert Wesarg wrote: > Hi, > > On Thu, Feb 14, 2013 at 11:26 AM, Stefano Lattarini wrote: > >> diff --git a/NEWS b/NEWS >> index 6dcce72..e27e0cf 100644 >> --- a/NEWS >> +++ b/NEWS >> @@ -100,6 +100,18 @@ New in 1.13.2: >> be longer necessary, so we deprecate it with runtime warnings. It will >> likely be removed altogether in Automake 1.14. >> >> +* Relative directory in Makefile fragments: >> + >> + - The special Automake-time substitutions '%reldir%' and '%canon_reldir%' >> + (and their short versions, '%D%' and '%C%' respectively) can now be used >> + in an included Makefile fragment. The former is substituted with the >> + relative directory of the included fragment (compared to the top level >> + including Makefile), and the latter with the canonicalized version of >> + the same relative directory: >> + >> + bin_PROGRAMS += %reldir%/foo >> + %canon_reldir%_foo_SOURCES = {reldir}/bar.c > > the rejected '{reldir}' is still used in this example. > Yikes! Good catch, fixed now. Thanks. > Does this substition happens in the whole file, or only in specific > syntactic constructs? > On the whole file, before the automake limited makefile parser is called. This is by design. > What definitily will not work ist something like this, right? > > here = %reldir% > target = %canon_reldir%/foo > > bin_PROGRAMS += ${here}/foo > ${target}_SOURCES = ${here}/bar.c > The ${target}_SOURCES wouldn't work even when no %...% substitution is used. As for ${here}, it can work only if that variable is not redefined in other included fragments. But the reason behind the %reldir% introduction is exactly saving the developers from the need of using this kind of brittle indirections ... > > Speaking of 'here' wouldn't that also an candidate instead of > 'reldir'? > Actually I find the latter clearer and more expressive. After all, what we are expanding is exactly the relative directory of the current makefile fragment w.r.t. the "master" makefile, so the name 'reldir' sounds really appropriate. > and %.% as the shortform of %reldir% does sound: > > bin_PROGRAMS += %.%/foo > %canon_here%_foo_SOURCES = %.%/bar.c > I find the above rather unreadable; the existing '%D%' shorthand is good enough IMHO. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 09:54:29 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 14:54:29 +0000 Received: from localhost ([127.0.0.1]:55326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U60Ci-0006uV-JF for submit@debbugs.gnu.org; Thu, 14 Feb 2013 09:54:29 -0500 Received: from blade.simplesystems.org ([65.66.246.74]:63775) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U60Cg-0006uH-3h for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 09:54:27 -0500 Received: from freddy.simplesystems.org (freddy.simplesystems.org [65.66.246.65]) by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id r1EErkpr001031; Thu, 14 Feb 2013 08:53:46 -0600 (CST) Date: Thu, 14 Feb 2013 08:53:46 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org To: Stefano Lattarini Subject: Re: [PATCH 1/2] preproc: add support for relative names in included fragments In-Reply-To: Message-ID: References: <5114F008.3010300@gmail.com> User-Agent: Alpine 2.01 (GSO 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (blade.simplesystems.org [65.66.246.90]); Thu, 14 Feb 2013 08:53:47 -0600 (CST) X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, 13524@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) On Thu, 14 Feb 2013, Stefano Lattarini wrote: > From: Peter Rosin > > The rationale for this change is that it is annoying to have > to repeat the directory name when including a Makefile fragment. > For deep directory structures these repeats can generate a lot > of bloat. It also hinders reuse and easy directory restructuring > if all Makefile fragments have to know exactly where they live. I was not aware that it is my birthday today but it sure feels like it now after reading this email. Much thanks to Peter and Stefano for implementing this. A substantial blocker for converting large packages to non-recursive builds will be eliminated. Considerable time and electricity will be saved. Bob -- Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 13:52:53 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 18:52:53 +0000 Received: from localhost ([127.0.0.1]:56552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U63vR-0000Qo-Aw for submit@debbugs.gnu.org; Thu, 14 Feb 2013 13:52:53 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:64007) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U63vO-0000Qe-E3 for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 13:52:51 -0500 Received: by mail-ea0-f178.google.com with SMTP id a14so1064201eaa.23 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 10:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=SUYsWZlcxc7KOxQxdBBckalBpWPpALjDLSGJ5S1Hqm0=; b=RMIOaK+8lNeh6TOuVMTuWeLnCj9SY2rHr4hIcFEmXMajxLTMArWryPfqhEQY9JHoXI rcxFLCxALDhxcDj3AocjLHqexnZTVUKajoLtDZoFp0zt2w0iIcQgbalstdOpF+31yrHj 80uKIupen3HR7NclRHY2mi/nESqG/07/Myffq9JyB384wcsnAY1SGoNgjlSj8ClMMbzP hG9iW9C/R0tCbeNMpcv14aniiQOrnreL7yLF3wenIDcaoknu3Pg+hqR1pVwPELghbDQL gwjOOPRS0s6QY8Y7ygjfNaY5Rt81kLb0Zt1NsA3qUlnwdnQYBJClLOoTq00EEyqBLKnv uQDw== X-Received: by 10.14.210.8 with SMTP id t8mr23134133eeo.35.1360867931334; Thu, 14 Feb 2013 10:52:11 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id t4sm79990599eel.0.2013.02.14.10.52.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 10:52:10 -0800 (PST) Message-ID: <511D324E.9080807@gmail.com> Date: Thu, 14 Feb 2013 19:51:58 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bob Friesenhahn Subject: Re: [PATCH 1/2] preproc: add support for relative names in included fragments References: <5114F008.3010300@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, 13524@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/14/2013 03:53 PM, Bob Friesenhahn wrote: > On Thu, 14 Feb 2013, Stefano Lattarini wrote: > >> From: Peter Rosin >> >> The rationale for this change is that it is annoying to have >> to repeat the directory name when including a Makefile fragment. >> For deep directory structures these repeats can generate a lot >> of bloat. It also hinders reuse and easy directory restructuring >> if all Makefile fragments have to know exactly where they live. > > I was not aware that it is my birthday today but it sure feels like > it now after reading this email. Much thanks to Peter and Stefano > for implementing this. > Note that it's Peter the one who should have most of the credit, since he was the one who set things in motion, wrote all of the code and documentation (I basically just added tests and did very minor tweaks), and put up with my nitpicks and bikeshedding. So thanks Peter! And of course, thanks to anyone else who has contributed feedback and suggestions. > A substantial blocker for converting large packages to non-recursive > builds will be eliminated. Considerable time and electricity will > be saved. By chance, do you plan to start using the feature in some package of yours, even before it lands in a released Automake version? I'm asking because it could be some months before the next minor (non-bug-fixing) Automake release. Best regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 14:11:26 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 19:11:26 +0000 Received: from localhost ([127.0.0.1]:56573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U64DN-00015C-4J for submit@debbugs.gnu.org; Thu, 14 Feb 2013 14:11:25 -0500 Received: from blade.simplesystems.org ([65.66.246.74]:64383) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U64DK-000150-7j for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 14:11:23 -0500 Received: from freddy.simplesystems.org (freddy.simplesystems.org [65.66.246.65]) by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id r1EJAgS7002121; Thu, 14 Feb 2013 13:10:42 -0600 (CST) Date: Thu, 14 Feb 2013 13:10:42 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org To: Stefano Lattarini Subject: Re: [PATCH 1/2] preproc: add support for relative names in included fragments In-Reply-To: <511D324E.9080807@gmail.com> Message-ID: References: <5114F008.3010300@gmail.com> <511D324E.9080807@gmail.com> User-Agent: Alpine 2.01 (GSO 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (blade.simplesystems.org [65.66.246.90]); Thu, 14 Feb 2013 13:10:42 -0600 (CST) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, 13524@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Thu, 14 Feb 2013, Stefano Lattarini wrote: > >> A substantial blocker for converting large packages to non-recursive >> builds will be eliminated. Considerable time and electricity will >> be saved. > > By chance, do you plan to start using the feature in some package of > yours, even before it lands in a released Automake version? I'm asking > because it could be some months before the next minor (non-bug-fixing) > Automake release. I might be convinced to test it with GraphicsMagick (presumably a collection of sed substitutions would be sufficient to edit the Makefiles) but would not want to release any software based on an unreleased Automake. Bob -- Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 14 14:23:49 2013 Received: (at 13524) by debbugs.gnu.org; 14 Feb 2013 19:23:49 +0000 Received: from localhost ([127.0.0.1]:56577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U64PM-0001Vf-Sd for submit@debbugs.gnu.org; Thu, 14 Feb 2013 14:23:49 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:50067) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U64PJ-0001VR-IW for 13524@debbugs.gnu.org; Thu, 14 Feb 2013 14:23:47 -0500 Received: by mail-ee0-f45.google.com with SMTP id b57so1402392eek.4 for <13524@debbugs.gnu.org>; Thu, 14 Feb 2013 11:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=blBrWTf7SAOEuoqGSjP/6c9I+gcdoSBze+ChEatlxxc=; b=hOH8gmY+G0uLo536Bxch0yC32+7sGER6cktVwM8z4Hluc0slHgfBVyZ8jnmAkKwHJH hVobYqYPAezaa9VlAF7DE9QhsIvLkeeKxxLFcOhcKRmObUdO5b8TrYNXKjfg6BRSc5wW ZIOcxDcm8m/4pwo/qBLS3KYzSIrvtOlnxzUA3jFS9J7fcNWV0AR5B2sMq+HTs+ZHj0HE iWoPv0IFLmaDOIjep2Cp5IDJ9BOxLZMBb6215A1fHenOGwQR81YJhQRX/sg+kv3S2nOS 22btCoypcGKlPBnxJ21SOICnSzRPlmG3AKPAbtZJ4vZJEOP/FESqNXjHsVadUSPkv1Em 3THQ== X-Received: by 10.14.219.129 with SMTP id m1mr20539981eep.16.1360869785862; Thu, 14 Feb 2013 11:23:05 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id a1sm54819448eep.2.2013.02.14.11.23.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 11:23:05 -0800 (PST) Message-ID: <511D3996.5060401@gmail.com> Date: Thu, 14 Feb 2013 20:23:02 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bob Friesenhahn Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments References: <5114F008.3010300@gmail.com> <511D324E.9080807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, 13524@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/14/2013 08:10 PM, Bob Friesenhahn wrote: > On Thu, 14 Feb 2013, Stefano Lattarini wrote: >> >>> A substantial blocker for converting large packages to non-recursive >>> builds will be eliminated. Considerable time and electricity will >>> be saved. >> >> By chance, do you plan to start using the feature in some package of >> yours, even before it lands in a released Automake version? I'm asking >> because it could be some months before the next minor (non-bug-fixing) >> Automake release. > > I might be convinced to test it with GraphicsMagick (presumably a > collection of sed substitutions would be sufficient to edit the Makefiles) > but would not want to release any software based on an unreleased Automake. > Of course. I was thinking more about an experimental branch where the new feature could be used (so that an unreleased Automake version would be required only to bootstrap that branch); and such a branch wouldn't be merged back into the "trunk" until the require feature has appeared in a released Automake. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 23 12:48:51 2013 Received: (at 13524) by debbugs.gnu.org; 23 Feb 2013 17:48:51 +0000 Received: from localhost ([127.0.0.1]:45947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9JDO-0005wu-Lh for submit@debbugs.gnu.org; Sat, 23 Feb 2013 12:48:51 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:63275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9JDL-0005wl-JY for 13524@debbugs.gnu.org; Sat, 23 Feb 2013 12:48:49 -0500 Received: by mail-wi0-f177.google.com with SMTP id hm14so1853086wib.4 for <13524@debbugs.gnu.org>; Sat, 23 Feb 2013 09:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6BiAlT2Y+kEKHqgyn0htBBCybmZQAFi+5H+t6XYwdF8=; b=d+2RjxBqWOaNdBE26QMvsuEQB08QvLL254gDa9iTAKrpIdn8PamCoxnxeYfbPOwHkL 51vajGy6xV64G5ZML93LMxwtZjbqmsEKWjKPw2WtjTg5gGVhbLzhKkwdpEDxzuO17j38 ZN7LZXU20jt87uv9FgOQmc/HXIdoLv1Pwnn3PyfYlBIiI3/zlZ3rEjQYoGLu+E9Cvag/ 2JnhoMEQC9G9Qa7Uc9yl5YY3ExYRyCjIGFZPt6JKWswWRGMJB99WmxJm4nFQoJ01mRGB cducezW6y8NvdvWxLUBlUu3Y7V47jVwZNpxW+DS+8Bp/nAiorXTfOzfy9KcYUcCzjE3J +Z2w== X-Received: by 10.180.77.9 with SMTP id o9mr3551570wiw.16.1361641637773; Sat, 23 Feb 2013 09:47:17 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id n2sm4715081wiy.6.2013.02.23.09.47.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Feb 2013 09:47:16 -0800 (PST) Message-ID: <512900A2.5030107@gmail.com> Date: Sat, 23 Feb 2013 18:47:14 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: automake-patches@gnu.org, 13524@debbugs.gnu.org Subject: Re: bug#13524: [PATCH 0/2] Improving user experience for non-recursive builds References: <5114F008.3010300@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us, eblake@redhat.com, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02/14/2013 11:26 AM, Stefano Lattarini wrote: > > OK, done. If there are no further objections, I will soon proceed to > re-write the experimental/preproc branch once again with the latest > version of these patches; > This has been done already. > then we can think when and how to merge it > into 'master' or 'next' (the merge will be delayed until the discussion > about the new branching/versioning scheme for automake has been sorted > out; see ). > That discussion has been sorted out; I propose to merge this patches, which are mostly safe an unobtrusive, in the 'master' branch, so that they will appear in the next minor Automake version (1.14). OK? I will proceed to do so in a couple of days if there are no objections. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 05 11:33:28 2013 Received: (at 13524-done) by debbugs.gnu.org; 5 Mar 2013 16:33:28 +0000 Received: from localhost ([127.0.0.1]:60854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCunu-0004c2-9M for submit@debbugs.gnu.org; Tue, 05 Mar 2013 11:33:27 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:43711) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCunp-0004bn-Ta for 13524-done@debbugs.gnu.org; Tue, 05 Mar 2013 11:33:23 -0500 Received: by mail-wg0-f42.google.com with SMTP id 12so3311734wgh.3 for <13524-done@debbugs.gnu.org>; Tue, 05 Mar 2013 08:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7RZeIbTpqTHLccpnKPcdBJ048RDQm63fcfixf8cb2r0=; b=y5xlJ/fRAkaAz5arROg8RtjDeYlRb6QZ6as2UEu+vJ8PD3g4Ar55wH0TaIjbs5de87 97JgEs4TgNvZMDu43i24snqWh7WRUx+xC6IjKdhfi1Qd2JT8dsr4iqC/hNcEdssb+qsU GwmlLBq1LrA3166RITi6GXNl8ojB5vz73J13Z2L00zzd1mkQcXfYCg0ubQ6rvgyB1BfZ A63DH1xtPvul2rH59IOCPSprbbwJmGOL+4ywtByozmmxAWQ4O4bBm07eInZkeHTkLVEA mduwR9YTfPOY2yh7by8N9UwAJKMZLEYANFaj7RlhMSmIwIa+AGsjmdsMsEV77HQ14bEj 9wdA== X-Received: by 10.204.146.22 with SMTP id f22mr9631388bkv.120.1362501174923; Tue, 05 Mar 2013 08:32:54 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id v2sm7335466bkw.5.2013.03.05.08.32.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 08:32:53 -0800 (PST) Message-ID: <51361E31.4090608@gmail.com> Date: Tue, 05 Mar 2013 17:32:49 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: automake-patches@gnu.org, 13524-done@debbugs.gnu.org Subject: Re: bug#13524: [PATCH 0/2] Improving user experience for non-recursive builds References: <5114F008.3010300@gmail.com> <512900A2.5030107@gmail.com> In-Reply-To: <512900A2.5030107@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524-done Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us, eblake@redhat.com, miles@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) On 02/23/2013 06:47 PM, Stefano Lattarini wrote: > On 02/14/2013 11:26 AM, Stefano Lattarini wrote: >> >> OK, done. If there are no further objections, I will soon proceed to >> re-write the experimental/preproc branch once again with the latest >> version of these patches; >> > This has been done already. > >> then we can think when and how to merge it >> into 'master' or 'next' (the merge will be delayed until the discussion >> about the new branching/versioning scheme for automake has been sorted >> out; see ). >> > That discussion has been sorted out; > Well, not really, we are stuck with the old branch naming scheme (I messed up causing non-fast-forward pushes, but that is fixed now; refer to the report linked above for more details). So ... > I propose to merge this patches, > which are mostly safe an unobtrusive, in the 'master' branch, so that > they will appear in the next minor Automake version (1.14). > ... these patches should now be merged in the *maint* branch, since that is the one from where the Automake 1.14 release will be cut. I've done that already. I'm thus closing this report. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 05:32:28 2013 Received: (at 13524) by debbugs.gnu.org; 11 Mar 2013 09:32:29 +0000 Received: from localhost ([127.0.0.1]:45355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEz5n-0007xK-HH for submit@debbugs.gnu.org; Mon, 11 Mar 2013 05:32:28 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:62681) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEz5l-0007x8-5y for 13524@debbugs.gnu.org; Mon, 11 Mar 2013 05:32:26 -0400 Received: by mail-la0-f50.google.com with SMTP id ec20so3561076lab.23 for <13524@debbugs.gnu.org>; Mon, 11 Mar 2013 02:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=9uHrhvYRj/yagqrhVh8VGy29bk8/33hzK9qRCHXAJVQ=; b=YtokxfTlj2IbXUkqeJqIVaSKu9a+HHTm6xVCw8nlr5tsRqIMIpz64UE/cqudLuSijf N2Qv1kN5K2WEX+BpjI0uO5iACws+IEZPNm1O4hyOJj2uyVpG9IWA+DM07PehSLxuvBGu H5/oWExh/N9xYY6Vp++Wt/rfVciNVm2jUxdimIIjLoPErlx0W3IRiWhLrexXaQiOrJN9 5h9/M6U//xMznv0RBjKOQY8wr+bujuVHQfAfH5TPGjJZXh+K0IiGjslMGri9vzO7HTde UirXJzuOFxyQUWunn6EPhNJvyLRBhoV+Y09/zhT7a5gb8ENYXqQi5AVT6fb3+H2sQdKX 3pqw== MIME-Version: 1.0 X-Received: by 10.152.147.130 with SMTP id tk2mr9654429lab.24.1362994285861; Mon, 11 Mar 2013 02:31:25 -0700 (PDT) Received: by 10.112.163.97 with HTTP; Mon, 11 Mar 2013 02:31:25 -0700 (PDT) In-Reply-To: <511CDB0D.2020103@gmail.com> References: <5114F008.3010300@gmail.com> <511CDB0D.2020103@gmail.com> Date: Mon, 11 Mar 2013 10:31:25 +0100 Message-ID: Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments From: Bert Wesarg To: Stefano Lattarini Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi, I have one more question here: On Thu, Feb 14, 2013 at 1:39 PM, Stefano Lattarini wrote: > On 02/14/2013 01:20 PM, Bert Wesarg wrote: >> Hi, >> >> On Thu, Feb 14, 2013 at 11:26 AM, Stefano Lattarini wrote: >> What definitily will not work ist something like this, right? >> >> here = %reldir% >> target = %canon_reldir%/foo >> >> bin_PROGRAMS += ${here}/foo >> ${target}_SOURCES = ${here}/bar.c >> I have the impression that variable references in filenames aren't supported anyway, right? Thanks, Bert From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 05:48:10 2013 Received: (at 13524) by debbugs.gnu.org; 11 Mar 2013 09:48:10 +0000 Received: from localhost ([127.0.0.1]:45380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEzL0-0008J9-2M for submit@debbugs.gnu.org; Mon, 11 Mar 2013 05:48:10 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:62781) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEzKu-0008Ia-Nt for 13524@debbugs.gnu.org; Mon, 11 Mar 2013 05:48:09 -0400 Received: by mail-bk0-f54.google.com with SMTP id w5so1597906bku.27 for <13524@debbugs.gnu.org>; Mon, 11 Mar 2013 02:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VnhmwR9qRjPswO14c46wolIFXW4hMFn96zaZENXAFXA=; b=wIU7Y9xcj3Cmd9hPZZNdQG6J8JjMoVae73D3zgQ18dkNT8wxas9UBiRyUO+K80733y Du2uiI7OgbnvLJwYmWCBgUet016NcIukKeAWuWPbG4WsztXbICtcCFyr7mODnen6XyjU czp2z0G4YWAWyQEhnDpCXgvPM9V5LDr6Toml0DuhwERd5MTEiDIGgCuPZCPQuD68T6bq IGAlAqIpi1RYpYCroFcCcu+xmGpjm3hCh7YG4JB/5uwmWb1smlT8jTzfJawE045jTOCl I6DDBvoJP1KAsRrfDmeX64Elqo/a4WMZJB82BvY8wOrwQRnDUtTHNRmZEQi9pbreQMAS +IVQ== X-Received: by 10.204.195.133 with SMTP id ec5mr4225579bkb.32.1362995225348; Mon, 11 Mar 2013 02:47:05 -0700 (PDT) Received: from [192.168.178.20] (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPS id fy17sm3762319bkc.6.2013.03.11.02.47.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Mar 2013 02:47:04 -0700 (PDT) Message-ID: <513DA80F.4070802@gmail.com> Date: Mon, 11 Mar 2013 10:46:55 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bert Wesarg Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments References: <5114F008.3010300@gmail.com> <511CDB0D.2020103@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 03/11/2013 10:31 AM, Bert Wesarg wrote: > Hi, > > I have one more question here: > > On Thu, Feb 14, 2013 at 1:39 PM, Stefano Lattarini > wrote: >> On 02/14/2013 01:20 PM, Bert Wesarg wrote: >>> Hi, >>> >>> On Thu, Feb 14, 2013 at 11:26 AM, Stefano Lattarini wrote: >>> What definitily will not work ist something like this, right? >>> >>> here = %reldir% >>> target = %canon_reldir%/foo >>> >>> bin_PROGRAMS += ${here}/foo >>> ${target}_SOURCES = ${here}/bar.c >>> > > I have the impression that variable references in filenames aren't > supported anyway, right? > Wrong, actually. What isn't supported are variable references in variable/primary names: $ cat > Makefile.am <<-END foo = bin $(foo)_PROGRAMS = bar END $ automake -a Makefile.am:2: bad characters in variable name `$(foo)_PROGRAMS' Makefile.am:2: `$(foo)_PROGRAMS' is used but `$(foo)dir' is undefined Best regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 08:06:45 2013 Received: (at 13524) by debbugs.gnu.org; 11 Mar 2013 12:06:45 +0000 Received: from localhost ([127.0.0.1]:45545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF1V6-000278-KO for submit@debbugs.gnu.org; Mon, 11 Mar 2013 08:06:44 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:33834) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF1V4-000267-35 for 13524@debbugs.gnu.org; Mon, 11 Mar 2013 08:06:43 -0400 Received: by mail-lb0-f181.google.com with SMTP id gm6so2990929lbb.26 for <13524@debbugs.gnu.org>; Mon, 11 Mar 2013 05:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=zSkOvue7weufu5GSD0/miMJzPwDKly4DUJ+gOhv5vds=; b=swiFCTqb0zHQkRJEcqPWG12CvKrYa+e390J4z9NoBKIl9wI05iNBvHl5UXxOWcuZRT h1k5pLRAhn2Dw/NhfAp2tsS3Lq8xBFxCFF0kfLKvYiwaKpv05u3qbGltDJ7guT7I4sYv wAqVQAzXihJ8WqQM24lyI5JXluyOQrP5TA1n1cai033UewXQepNpiMjL8qSJzhzioAqh J0pBK7ICg8lcv/Svke6wlgSFOY0Ix1OmRWRPvKFai+vIGBFQArxf902RMuPD6CIX6mTn r8+7KcVRL2Xysgx0rFoGJDucOYk/m4DM3F6151jC5NpCre6UOXnOdgBBCCUdxNJO4BM9 Hmfg== MIME-Version: 1.0 X-Received: by 10.152.45.140 with SMTP id n12mr10013319lam.36.1363003542035; Mon, 11 Mar 2013 05:05:42 -0700 (PDT) Received: by 10.112.163.97 with HTTP; Mon, 11 Mar 2013 05:05:41 -0700 (PDT) In-Reply-To: <513DA80F.4070802@gmail.com> References: <5114F008.3010300@gmail.com> <511CDB0D.2020103@gmail.com> <513DA80F.4070802@gmail.com> Date: Mon, 11 Mar 2013 13:05:41 +0100 Message-ID: Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments From: Bert Wesarg To: Stefano Lattarini Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Mon, Mar 11, 2013 at 10:46 AM, Stefano Lattarini wrote: > On 03/11/2013 10:31 AM, Bert Wesarg wrote: >> I have the impression that variable references in filenames aren't >> supported anyway, right? >> > Wrong, actually. But when I prefixing a source file with '$(src)/' and use subdir-objects then I get something like this in the Makefile.in $(src)/test-test.o: $(src)/test.c And after a configure I get an '$(src)' directory in my build dir. - 8< - Makefile.am - >8 - src = . bin_PROGRAMS = test test_SOURCES = \ $(src)/test.c test_CPPFLAGS = \ $(AM_CPPFLAGS) -W - >8 - Makefile.am - 8< - Bert > > Best regards, > Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 14:59:24 2013 Received: (at 13524) by debbugs.gnu.org; 11 Mar 2013 18:59:24 +0000 Received: from localhost ([127.0.0.1]:46754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF7wR-0006dz-5D for submit@debbugs.gnu.org; Mon, 11 Mar 2013 14:59:24 -0400 Received: from mail-ee0-f52.google.com ([74.125.83.52]:64666) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF7wO-0006do-Ty for 13524@debbugs.gnu.org; Mon, 11 Mar 2013 14:59:22 -0400 Received: by mail-ee0-f52.google.com with SMTP id b15so2325856eek.39 for <13524@debbugs.gnu.org>; Mon, 11 Mar 2013 11:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IjJgeaIZdQG5xPu9y7JC62vAbQFy8n3t94+heuVpuWA=; b=RCANpiRyHL4GXDuJ559OnMAgnCDaFA6FomvepkTelhhIJyc7MSJTdVusbpZTCHCHNW 2lu68Me2ql7cvo7XSeYmU696l3NffgFwMXJbzmhKvKxBTrAsp7HaRs1giz6wkD6Vk4Sx 1jHJchuBtGXOSnoMjOP4hbAWbLz0nr+OStXtff8vPAvZFYQKaFLellTH2qWEBhGaLHM2 Z/wLL5uLgjQFfG4Vvmfa8V9a0AgzFGW00Ow9eN2tlKCir7nwY1YdQfgd5nU2kplxI9YQ WfN3dMrTAJDozIXP+kYlO+ZaA40NTvaFn98UAWLKrm7b45CpsO3J0r6A7NmWH0h/u84I Wlaw== X-Received: by 10.15.23.193 with SMTP id h41mr39435145eeu.17.1363028299631; Mon, 11 Mar 2013 11:58:19 -0700 (PDT) Received: from [192.168.178.20] (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPS id d47sm25222121eem.9.2013.03.11.11.58.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Mar 2013 11:58:18 -0700 (PDT) Message-ID: <513E2941.7080900@gmail.com> Date: Mon, 11 Mar 2013 19:58:09 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Bert Wesarg Subject: Re: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments References: <5114F008.3010300@gmail.com> <511CDB0D.2020103@gmail.com> <513DA80F.4070802@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13524 Cc: 13524@debbugs.gnu.org, Peter Rosin , automake-patches@gnu.org, Bob Friesenhahn , Eric Blake , Miles Bader X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 03/11/2013 01:05 PM, Bert Wesarg wrote: > On Mon, Mar 11, 2013 at 10:46 AM, Stefano Lattarini > wrote: >> On 03/11/2013 10:31 AM, Bert Wesarg wrote: >>> I have the impression that variable references in filenames aren't >>> supported anyway, right? >>> >> Wrong, actually. > > But when I prefixing a source file with '$(src)/' and use > subdir-objects then I get something like this in the Makefile.in > > $(src)/test-test.o: $(src)/test.c > > And after a configure I get an '$(src)' directory in my build dir. > Yes -- and this is intended behavior of subdir-objects. Why do you think Automake is acting wrong? (Honest question, I might be missing something here ...) > - 8< - Makefile.am - >8 - > > src = . > bin_PROGRAMS = test > test_SOURCES = \ > $(src)/test.c > test_CPPFLAGS = \ > $(AM_CPPFLAGS) -W > > - >8 - Makefile.am - 8< - > > Bert > Regards, Stefano From unknown Fri Aug 15 15:35:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 09 Apr 2013 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