[llvm-branch-commits] [llvm-gcc-branch] r84045 - /llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc

Bill Wendling isanbard at gmail.com
Tue Oct 13 15:50:23 PDT 2009


Author: void
Date: Tue Oct 13 17:50:22 2009
New Revision: 84045

URL: http://llvm.org/viewvc/llvm-project?rev=84045&view=rev
Log:
$ svn merge -c 83029 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r83029 into '.':
U    build_gcc


Modified:
    llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc

Modified: llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc?rev=84045&r1=84044&r2=84045&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc (original)
+++ llvm-gcc-4.2/branches/Apple/Bender-SWB/build_gcc Tue Oct 13 17:50:22 2009
@@ -256,6 +256,17 @@
 fi
 # LLVM LOCAL end
 
+# If the user has set CC or CXX, respect their wishes.  If not,
+# compile with LLVM-GCC/LLVM-G++ if available; if LLVM is not
+# available, fall back to usual GCC/G++ default.
+savedPATH=$PATH ; PATH="$PATH:/Developer/usr/bin"
+XTMPCC=$(which llvm-gcc)
+if [ x$CC  = x -a x$XTMPCC != x ] ; then export CC=$XTMPCC  forcedCC=1  ; fi
+XTMPCC=$(which llvm-g++)
+if [ x$CXX = x -a x$XTMPCC != x ] ; then export CXX=$XTMPCC forcedCXX=1 ; fi
+PATH=$savedPATH
+unset XTMPCC savedPATH
+
 # Build the native GCC.  Do this even if the user didn't ask for it
 # because it'll be needed for the bootstrap.
 mkdir -p $DIR/obj-$BUILD-$BUILD $DIR/dst-$BUILD-$BUILD || exit 1
@@ -265,6 +276,7 @@
    $NON_ARM_CONFIGFLAGS \
    --host=$BUILD-apple-darwin$DARWIN_VERS --target=$BUILD-apple-darwin$DARWIN_VERS || exit 1
 fi
+
 # Unset RC_DEBUG_OPTIONS because it causes the bootstrap to fail.
 # Also keep unset for cross compilers so that the cross built libraries are
 # comparable to the native built libraries.
@@ -274,6 +286,11 @@
 make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 
+# Now that we've built a native compiler, un-kludge these so that
+# subsequent cross-hosted compilers can be found normally.
+if [ x$forcedCC  != x ] ; then unset CC  forcedCC  ; fi
+if [ x$forcedCXX != x ] ; then unset CXX forcedCXX ; fi
+
 # Add the compiler we just built to the path, giving it appropriate names.
 # LLVM LOCAL begin Support for non /usr $DEST_ROOT
 D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin





More information about the llvm-branch-commits mailing list