For B&I-style builds, tweak build_llvm script to prefer LLVM-G++ if

available.  Override by setting CC and CXX in the environment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83024 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stuart Hastings 2009-09-28 22:17:53 +00:00
parent ec9eef4a15
commit dc3d8cc6a6

View File

@ -56,9 +56,6 @@ DIR=`pwd`
DARWIN_VERS=`uname -r | sed 's/\..*//'`
echo DARWIN_VERS = $DARWIN_VERS
# If the user has CC set in their environment unset it now
unset CC
if [ "x$RC_ProjectName" = "xllvmCore_Embedded" ]; then
DT_HOME=$DEST_DIR/Developer/Platforms/iPhoneOS.platform/Developer/usr
DEST_ROOT="/Developer/Platforms/iPhoneOS.platform/Developer$DEST_ROOT"
@ -90,6 +87,15 @@ ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
mkdir -p $DIR/obj-llvm || exit 1
cd $DIR/obj-llvm || exit 1
# 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.
XTMPCC=$(which llvm-gcc)
if [ x$CC = x -a x$XTMPCC != x ] ; then export CC=$XTMPCC ; fi
XTMPCC=$(which llvm-g++)
if [ x$CXX = x -a x$XTMPCC != x ] ; then export CXX=$XTMPCC ; fi
unset XTMPCC
if [ \! -f Makefile.config ]; then
$SRC_DIR/configure --prefix=$DT_HOME/local \
--enable-targets=arm,x86,powerpc,cbe \
@ -152,7 +158,7 @@ make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \
VERBOSE=1
if ! test $? == 0 ; then
if [ $? != 0 ] ; then
echo "error: LLVM 'make' failed!"
exit 1
fi