From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org, bonzini@gnu.org
Subject: obtaining configure args from config.status (was: Update rebuild rules in non-automake directories.)
Date: Mon, 31 Aug 2009 20:42:00 -0000 [thread overview]
Message-ID: <20090831202938.GC21485@gmx.de> (raw)
In-Reply-To: <20090826165410.GA28796@host0.dyn.jankratochvil.net>
* 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 <kasal@ucw.cz>
| +
| + 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 <Ralf.Wildenhues@gmx.de>
* 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)" \
next prev parent reply other threads:[~2009-08-31 20:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090628183334.GA5401@gmx.de>
2009-07-28 18:54 ` Update rebuild rules in non-automake directories Ralf Wildenhues
2009-07-28 19:51 ` Paolo Bonzini
2009-07-28 21:35 ` Tom Tromey
2009-07-29 3:09 ` Samuel Bronson
2009-07-29 5:31 ` Tom Tromey
2009-07-29 16:15 ` Ralf Wildenhues
2009-07-29 18:35 ` Samuel Bronson
2009-07-29 18:37 ` Tom Tromey
2009-07-30 21:27 ` Ralf Wildenhues
[not found] ` <20090730210952.GD24465__15749.4424529888$1248988226$gmane$org@gmx.de>
2009-07-30 21:30 ` Tom Tromey
2009-07-29 15:16 ` Ben Elliston
2009-08-26 16:29 ` Jan Kratochvil
2009-08-26 16:54 ` Ralf Wildenhues
2009-08-26 17:10 ` Jan Kratochvil
2009-08-26 17:51 ` Ralf Wildenhues
2009-08-26 17:57 ` Eli Zaretskii
2009-08-26 19:13 ` Jan Kratochvil
2009-08-31 20:42 ` Ralf Wildenhues [this message]
2009-09-01 1:10 ` obtaining configure args from config.status Paolo Bonzini
2009-09-06 18:15 ` obtaining configure args from config.status (was: Update rebuild rules in non-automake directories.) Ralf Wildenhues
2009-09-08 18:37 ` obtaining configure args from config.status Tom Tromey
2009-09-08 16:28 ` Jan Kratochvil
2009-09-08 18:26 ` Ralf Wildenhues
2009-09-08 18:38 ` Tom Tromey
2009-09-08 18:51 ` Ralf Wildenhues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090831202938.GC21485@gmx.de \
--to=ralf.wildenhues@gmx.de \
--cc=bonzini@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox