Bug 1400533: Pickup $TOOLTOOL_DIR to figure out where compilers are.
MozReview-Commit-ID: 9wG6Y0c3E9O
--- a/build/macosx/local-mozconfig.common
+++ b/build/macosx/local-mozconfig.common
@@ -4,36 +4,37 @@
if [ "x$IS_NIGHTLY" = "xyes" ]; then
# Some nightlies (eg: Mulet) don't want these set.
MOZ_AUTOMATION_UPLOAD_SYMBOLS=${MOZ_AUTOMATION_UPLOAD_SYMBOLS-1}
MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
fi
. "$topsrcdir/build/mozconfig.common"
-if [ -d "$topsrcdir/clang" ]; then
+if [ -d $TOOLTOOL_DIR/clang ]; then
+ true
+elif [ -d "$topsrcdir/clang" ]; then
# mozilla-central based build
- export CC=$topsrcdir/clang/bin/clang
- export CXX=$topsrcdir/clang/bin/clang++
- export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
- export DSYMUTIL=$topsrcdir/clang/bin/llvm-dsymutil
+ TOOLTOOL_DIR=$topsrcdir
+elif [ -d "$topsrcdir/../clang" ]; then
+ TOOLTOOL_DIR=$topsrcdir/..
+else
+ echo "Don't know where we are; can't find clang. topsrcdir: $topsrcdir"
+fi
+
+if [ -d $TOOLTOOL_DIR ]; then
+ export CC="$TOOLTOOL_DIR/clang/bin/clang"
+ export CXX="$TOOLTOOL_DIR/clang/bin/clang++"
+ export CPP="$TOOLTOOL_DIR/clang/bin/clang -E"
+ export LLVMCONFIG=$TOOLTOOL_DIR/clang/bin/llvm-config
+ export DSYMUTIL=$TOOLTOOL_DIR/clang/bin/llvm-dsymutil
# Use an updated linker.
- ldflags="-B$topsrcdir/cctools/bin"
- export AR=$topsrcdir/cctools/bin/ar
- export RANLIB=$topsrcdir/cctools/bin/ranlib
-elif [ -d "$topsrcdir/../clang" ]; then
- # comm-central based build
- export CC=$topsrcdir/../clang/bin/clang
- export CXX=$topsrcdir/../clang/bin/clang++
- export LLVMCONFIG=$topsrcdir/../clang/bin/llvm-config
- export DSYMUTIL=$topsrcdir/../clang/bin/llvm-dsymutil
- # Use an updated linker.
- ldflags="-B$topsrcdir/../cctools/bin"
- export AR=$topsrcdir/../cctools/bin/ar
- export RANLIB=$topsrcdir/../cctools/bin/ranlib
+ ldflags="-B$TOOLTOOL_DIR/cctools/bin "
+ export AR=$TOOLTOOL_DIR/cctools/bin/ar
+ export RANLIB=$TOOLTOOL_DIR/cctools/bin/ranlib
fi
# Ensure the updated linker doesn't generate things our older build tools
# don't understand.
ldflags="$ldflags -Wl,-no_data_in_code_info"
export LDFLAGS="$ldflags"
# If not set use the system default clang