From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23715 invoked by alias); 3 Sep 2018 11:15:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23665 invoked by uid 89); 3 Sep 2018 11:15:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=remarks, aclocal_m4_deps, H*f:sk:a3aeaa0, itll X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Sep 2018 11:14:50 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0D9A40201BE; Mon, 3 Sep 2018 11:14:48 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97D071134CCC; Mon, 3 Sep 2018 11:14:45 +0000 (UTC) Subject: Re: [PATCH] Automatically update "aclocal_m4_deps" when updating gnulib To: Sergio Durigan Junior , GDB Patches References: <20180902212100.19034-1-sergiodj@redhat.com> Cc: Tom Tromey , Simon Marchi From: Pedro Alves Message-ID: Date: Mon, 03 Sep 2018 11:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180902212100.19034-1-sergiodj@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00014.txt.bz2 On 09/02/2018 10:21 PM, Sergio Durigan Junior wrote: > When we update gnulib using our "update-gnulib.sh" tool, it doesn't > automatically update the list of M4 files present at > gnulib/Makefile.in:aclocal_m4_deps. This patch extends the tool to do > that. It also puts "aclocal_m4_deps" in its own file (a Makefile > fragment), so that it's easier to update it programatically. > > Tested by generating the file and diff'ing the results against the > current version of "aclocal_m4_deps". Thanks for doing this. Three remarks below. > diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh > index 3dcafeb3e6..6c10c8a8c4 100755 > --- a/gdb/gnulib/update-gnulib.sh > +++ b/gdb/gnulib/update-gnulib.sh > @@ -167,3 +167,9 @@ if [ $? -ne 0 ]; then > exit 1 > fi > > +# Update aclocal-m4-deps.mk > +cat > aclocal-m4-deps.mk < +aclocal_m4_deps = \\ > + configure.ac \\ > +$(find import/m4 -type f -name "*.m4" | sed 's/^/\t/; s/$/ \\/; $s/ \\//g') > +EOF #1 I'd find it a little better to make it so that the new file only includes the M4 files, and leave adding configure.ac to Makefile.in. I.e., put the m4 files list in a different variable here and them do something like: # Fill in $m4_files include $(srcdir)/m4-files.mk aclocal_m4_deps = configure.ac $m4_files in Makefile.in, or, tweak the rule to include configure.ac directly: $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ configure.ac $(m4_files) #2 I think it'll be good practice to generate the file to a temporary name, and then use move-if-change to atomically update the destination, in case someone Ctrl-Cs just while the script is halfway generated. I.e.: cat > foo.mk.tmp <