aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPhil Edwards <pme@gcc.gnu.org>2002-06-18 20:02:21 +0000
committerPhil Edwards <pme@gcc.gnu.org>2002-06-18 20:02:21 +0000
commitbb20b7dafd604a1ceba1da24d9992ed38838479f (patch)
tree7817d5f71723db16dab21b115baae3ba65b847ed /configure
parentc985dc5e74907ffe09a8d132981ef434304fdacf (diff)
downloadgcc-bb20b7dafd604a1ceba1da24d9992ed38838479f.zip
gcc-bb20b7dafd604a1ceba1da24d9992ed38838479f.tar.gz
gcc-bb20b7dafd604a1ceba1da24d9992ed38838479f.tar.bz2
configure: For in-source builds, make a subdir and re-exec there.
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: r54759
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure33
1 files changed, 32 insertions, 1 deletions
diff --git a/configure b/configure
index d64ea33..3e891d9 100755
--- a/configure
+++ b/configure
@@ -89,7 +89,7 @@ subdirs=
target_alias=NOTARGET
target_makefile_frag=
undefs=NOUNDEFS
-version="$Revision: 1.42 $"
+version="$Revision: 1.43 $"
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