From: Phil Edwards Date: Tue, 18 Jun 2002 20:02:49 +0000 (+0000) Subject: configure: For in-source builds, make a subdir and re-exec there. X-Git-Tag: releases/gcc-3.1.1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f974d378163fe98a0c4ca0b653488c688661777;p=thirdparty%2Fgcc.git configure: For in-source builds, make a subdir and re-exec there. 2002-06-18 Phil Edwards * 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 --- diff --git a/.cvsignore b/.cvsignore index e2952dc9ac35..9cd799e739ae 100644 --- a/.cvsignore +++ b/.cvsignore @@ -26,7 +26,6 @@ configure.tps configure.vr configure.vrs dir.info -Makefile lost+found update.out LAST_UPDATED diff --git a/ChangeLog b/ChangeLog index a845620448a9..dcf3cfeb1bd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-06-18 Phil Edwards + + * 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 * ltmain.sh: Detect and handle object name conflicts while diff --git a/configure b/configure index 8c6870a222d4..dfe0f38ecc8a 100755 --- 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