Pickup $TOOLTOOL_DIR to figure out where compilers are. draft
authorTom Prince <mozilla@hocat.ca>
Thu, 21 Sep 2017 18:26:47 -0600
changeset 55054 f76b5a1a28e28004b044ee2fc230dae98968add5
parent 55031 8f431a95645cdf312393eac5f0a2ad5a57839706
child 55055 1b859c4ef9d83db1f07b053b24c452844d4e38db
push id4962
push usermozilla@hocat.ca
push dateTue, 26 Sep 2017 20:13:05 +0000
treeherdertry-comm-central@7d2aa215907f [default view] [failures only]
Pickup $TOOLTOOL_DIR to figure out where compilers are. 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