Bug 1400533: Pickup $TOOLTOOL_DIR to figure out where compilers are; r=me
authorTom Prince <mozilla@hocat.ca>
Thu, 21 Sep 2017 18:26:47 -0600
changeset 29085 67bd36f127c9d65e7139b18f1827295f3c9a34df
parent 29084 2f034b0789b557105e53c7919506458d501eca93
child 29086 210e3bfaccd6002508ed81d457d058c37c0aa8c0
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1400533
Bug 1400533: Pickup $TOOLTOOL_DIR to figure out where compilers are; r=me MozReview-Commit-ID: 9wG6Y0c3E9O
build/macosx/local-mozconfig.common
--- 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