From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27607 invoked by alias); 31 Aug 2009 20:29:49 -0000 Received: (qmail 27597 invoked by uid 22791); 31 Aug 2009 20:29:48 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 31 Aug 2009 20:29:43 +0000 Received: (qmail invoked by alias); 31 Aug 2009 20:29:40 -0000 Received: from xdsl-87-78-67-253.netcologne.de (EHLO localhost.localdomain) [87.78.67.253] by mail.gmx.net (mp004) with SMTP; 31 Aug 2009 22:29:40 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1MiDVT-0005ck-C4; Mon, 31 Aug 2009 22:29:39 +0200 Date: Mon, 31 Aug 2009 20:42:00 -0000 From: Ralf Wildenhues To: Jan Kratochvil Cc: gdb-patches@sourceware.org, bonzini@gnu.org Subject: obtaining configure args from config.status (was: Update rebuild rules in non-automake directories.) Message-ID: <20090831202938.GC21485@gmx.de> References: <20090628183334.GA5401@gmx.de> <20090728181748.GA3134@gmx.de> <20090826151719.GA22276@host0.dyn.jankratochvil.net> <20090826164636.GA15791@ins.uni-bonn.de> <20090826165410.GA28796@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090826165410.GA28796@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-08-09) 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 X-SW-Source: 2009-08/txt/msg00593.txt.bz2 * Jan Kratochvil wrote on Wed, Aug 26, 2009 at 06:54:10PM CEST: > On Wed, 26 Aug 2009 18:46:36 +0200, Ralf Wildenhues wrote: > > when running 'make check//unix' in $build which lives outside of src; > > that seems to do the desired thing. Do you build in-tree? > > You are right it works from a build directory outside of the source directory. > > I am using (and it worked for GDB before): > cd src; ./configure; make; make -C gdb check//unix Thanks. The difference in Autoconf that caused this is that a srcdir of `pwd` is now simplified to '.' which wasn't done before, and thus the check//% rule in gdb fails when trying to run /path/to/src/gdb/testsuite/config.status --recheck in the /path/to/src/gdb/testsuite.$$vardots/ directory. Hmm, that's ugly. This is caused/exposed by this change in Autoconf quite a while ago: 597bc15a76f08893e1e0c372cbd96732ba7b7ed6 | +2005-08-16 Stepan Kasal | + | + When building in place, set srcdir="."; suggested by Tim Van Holder. | + | + * lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Do this; to recognize | + build in place, we need ac_pwd, and thus have to AC_REQUIRE ... | + (_AC_INIT_DIRCHECK): ... this macro and AC_DEFUN both of them. | + * lib/autoconf/status.m4 (_AC_SRCDIRS): Fix a comment: srcdir="." | + does not mean "no --srcdir option". Also, I'm not sure I really like relying on a rather obscure feature of running 'config.status --recheck' from a different directory. Paolo, we could "fix" this by overriding _AC_INIT_SRCDIR in override.m4, but I'm not really sure the old behavior is all that desirable either. Instead, I'll try to revive my `config.status --config' patch upstream; for the moment, let's parse --version output to get the configuration, and add a FIXME note to fix things up later. The one bit I think is a little awkward in the makefile rule is that the eval could do harm to unusual settings of $(SHELL), and it's not clear how to quote that. For the rest, I think I got the quoting safe. The previous behavior explicitly invoked each config.status, where the --recheck avoids recursion. I think just invoking the topmost gdb/testsuite/configure should be sufficient, as it should recurse to the other sub configures and do the right thing for them. OK to apply? Cheers, Ralf Fix parallel check//% rule in gdb. 2009-08-29 Ralf Wildenhues * gdb/Makefile.in (check//%): Parse 'config.status --version' output to recreate the configuration from the testsuite directory, rather than running 'config.status --recheck' from a different build directory. Let configure do the recursion rather than doing it manually. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 90c285f..7bc02cd 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -888,6 +888,7 @@ check: force # a shell that expands alternations within braces. If GNU make is not # used, this rule will harmlessly fail to match. Used FORCE_PARALLEL to # prevent serialized checking due to the passed RUNTESTFLAGS. +# FIXME: use config.status --config not --version, when available. check//%: force @if [ -f testsuite/config.status ]; then \ rootme=`pwd`; export rootme; \ @@ -896,14 +897,14 @@ check//%: force variant=`echo "$@" | sed 's,^[^/]*//,,'`; \ vardots=`echo "$$variant" | sed 's,/,.,g'`; \ testdir=testsuite.$$vardots; \ - if [ ! -f $$testdir/Makefile ]; then \ - (cd testsuite && find . -name config.status) | \ - sed s,/config.status$$,, | sort | while read subdir; do \ - $(SHELL) $(srcdir)/../mkinstalldirs $$testdir/$$subdir && \ - (cd $$testdir/$$subdir && \ - $(SHELL) $$rootme/testsuite/$$subdir/config.status \ - --recheck && \ - $(SHELL) ./config.status); done; \ + if [ ! -f $$testdir/Makefile ] && [ -f testsuite/config.status ]; then \ + configargs=`cd testsuite && ./config.status --version | \ + sed -n -e 's,"$$,,' -e 's,^ *with options ",,p'`; \ + $(SHELL) $(srcdir)/../mkinstalldirs $$testdir && \ + (cd $$testdir && \ + eval $(SHELL) "\"\$$rootsrc/testsuite/configure\" $$configargs" \ + "\"--srcdir=\$$rootsrc/testsuite\"" \ + ); \ else :; fi && cd $$testdir && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) \ RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \