This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
obtaining configure args from config.status (was: Update rebuild rules in non-automake directories.)
* 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)" \