]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
configure: For in-source builds, make a subdir and re-exec there.
authorPhil Edwards <pme@gcc.gnu.org>
Tue, 18 Jun 2002 20:02:49 +0000 (20:02 +0000)
committerPhil Edwards <pme@gcc.gnu.org>
Tue, 18 Jun 2002 20:02:49 +0000 (20:02 +0000)
2002-06-18  Phil Edwards  <pme@gcc.gnu.org>

* configure:  For in-source builds, make a subdir and re-exec there.
* Makefile:  New file.  Pass targets through to build directory.
* .cvsignore:  No longer ignore "Makefile".

From-SVN: r54761

.cvsignore
ChangeLog
configure

index e2952dc9ac356489266c11ad58c6a06a68e968ab..9cd799e739ae2d271ddf1e3217840fe8715a710b 100644 (file)
@@ -26,7 +26,6 @@ configure.tps
 configure.vr
 configure.vrs
 dir.info
-Makefile
 lost+found
 update.out
 LAST_UPDATED
index a845620448a9b482afccbdb93b1e444234748735..dcf3cfeb1bd63fd212c2a7170c01d94cf170e466 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-18  Phil Edwards  <pme@gcc.gnu.org>
+
+       * configure:  For in-source builds, make a subdir and re-exec there.
+       * Makefile:  New file.  Pass targets through to build directory.
+       * .cvsignore:  No longer ignore "Makefile".
+
 2002-06-05  Loren J. Rittle <ljrittle@acm.org>
 
        * ltmain.sh: Detect and handle object name conflicts while
index 8c6870a222d4ec588f629fe5a64663ec97834c70..dfe0f38ecc8a0cc38b377085fc6b751538677a8e 100755 (executable)
--- a/configure
+++ b/configure
@@ -89,7 +89,7 @@ subdirs=
 target_alias=NOTARGET
 target_makefile_frag=
 undefs=NOUNDEFS
-version="$Revision: 1.39 $"
+version="$Revision: 1.40 $"
 x11=default
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
@@ -573,6 +573,37 @@ case "${srcdir}" in
        fi
 esac
 
+# If it's an in-source build, make a directory and configure there instead.
+# Name the build directory after the host for clarity's sake.  Remember that
+# name for the redirecting makefile's use, since the makefile shouldn't have
+# to duplicate the work of figuring out host_alias.
+#
+# Also remember if this is a native build or not.  Variations on "or not"
+# are performed later in this script so we can't test them here.  In
+# particular, build_alias will still be empty unless specified by the user,
+# so do not try in-source builds when making a host-x-host compiler.
+# For a cross compile, "make all" = "all".  Otherwise, "all" = "bootstrap".
+if test "${srcdir}" = "." ; then
+       builddir=${host_alias}
+       if test ! -d ${builddir}; then
+               mkdir ${builddir} || exit 1
+       fi
+       if test ${host_alias} != ${target_alias}; then
+               t=all
+       else
+               t=bootstrap
+       fi
+       # stamp-builddir is too long for #$&!*@ 8.3 filesystems
+       echo "builddir=${builddir}" > s-buildd
+       echo "defaulttarget=$t" >> s-buildd
+       cd ${builddir}
+echo host $host_alias
+echo target $target_alias
+echo t $t
+sleep 20
+       exec ${config_shell} ../configure $arguments
+fi
+
 ### warn about some conflicting configurations.
 
 case "${srcdir}" in