This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 32272: Error out if building separately but srcdir has build remnants.


If the user built in-tree at some point in time, and things failed to
clean up right, then the test inside GCC_TOPLEV_SUBDIRS looking for
  $srcdir/../host-${host_noncanonical}

gets confused.  (The test is so that GCC_TOPLEV_SUBDIRS can be written
with same text for all kinds of users throughout the tree.)  We can be
more helpful by erroring out in the toplevel in that case.  This
addresses <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32272#c11>.

Note that srcdir is reliably set to '.' by Autoconf 2.64 if the source
tree and the build tree are identical (regardless of how configure is
invoked).

Tested by bootstrapping out-of-tree and bootstrapping in-tree
successfully, and then bootstrapping half-way in-tree then failing to
bootstrap out-of-tree.

OK for trunk?

Thanks,
Ralf

Error out if building separately but srcdir has build remnants.

ChangeLog:
2009-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	PR bootstrap/32272
	* configure.ac: Error out if $srcdir isn't '.' but contains
	host-${host_noncanonical}.
	* configure: Regenerate.

diff --git a/configure.ac b/configure.ac
index 79be133..9ef6884 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,11 @@ fi
 
 # Find the build and target subdir names.
 GCC_TOPLEV_SUBDIRS
+# Be sure to cover against remnants of an in-tree build.
+if test $srcdir != .  && test -d $srcdir/host-${host_noncanonical}; then
+  AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
+Use a pristine source tree when building in a separate tree])
+fi
 
 # Skipdirs are removed silently.
 skipdirs=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]