Bug 974205 - Use --with-compiler-wrapper when enabling sccache. r=glandium
authorMike Shal <mshal@mozilla.com>
Tue, 25 Feb 2014 15:41:57 +0900
changeset 170319 8cb85ffb2c15d3a37a059beab1aedaf8849c196c
parent 170318 eb02c9e3db0a961c57c689d1b84f0b5f1e703c27
child 170320 29cfe52e604c7d79e51f9e8076cbdfecb407643d
push id26284
push usercbook@mozilla.com
push dateTue, 25 Feb 2014 13:28:56 +0000
treeherdermozilla-central@8c1eb349d342 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs974205
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 974205 - Use --with-compiler-wrapper when enabling sccache. r=glandium
build/autoconf/wrapper.m4
build/mozconfig.cache
configure.in
js/src/configure.in
--- a/build/autoconf/wrapper.m4
+++ b/build/autoconf/wrapper.m4
@@ -8,15 +8,26 @@ dnl ====================================
 AC_DEFUN([MOZ_CHECK_COMPILER_WRAPPER],
 [
 MOZ_ARG_WITH_STRING(compiler_wrapper,
 [  --with-compiler-wrapper[=path/to/wrapper]
     Enable compiling with wrappers such as distcc and ccache],
     COMPILER_WRAPPER=$withval, COMPILER_WRAPPER="no")
 
 if test "$COMPILER_WRAPPER" != "no"; then
-    CC="$COMPILER_WRAPPER $CC"
-    CXX="$COMPILER_WRAPPER $CXX"
-    MOZ_USING_COMPILER_WRAPPER=1
+    case "$CC" in
+    $COMPILER_WRAPPER\ *)
+        :
+        ;;
+    *)
+        CC="$COMPILER_WRAPPER $CC"
+        CXX="$COMPILER_WRAPPER $CXX"
+        _SUBDIR_CC="$CC"
+        _SUBDIR_CXX="$CXX"
+        ac_cv_prog_CC="$CC"
+        ac_cv_prog_CXX="$CXX"
+        MOZ_USING_COMPILER_WRAPPER=1
+        ;;
+    esac
 fi
 
 AC_SUBST(MOZ_USING_COMPILER_WRAPPER)
 ])
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -16,11 +16,10 @@ if test -f "$topsrcdir/sccache/sccache.p
     esac
 fi
 
 if test -z "$bucket"; then
     ac_add_options --with-ccache
 else
     mk_add_options "export SCCACHE_BUCKET=$bucket"
     mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
-    export CC="python2.7 $topsrcdir/sccache/sccache.py $CC"
-    export CXX="python2.7 $topsrcdir/sccache/sccache.py $CXX"
+    ac_add_options "--with-compiler-wrapper=python2.7 $topsrcdir/sccache/sccache.py"
 fi
--- a/configure.in
+++ b/configure.in
@@ -361,16 +361,18 @@ else
 fi
 
 if test -n "$MOZ_WINCONSOLE"; then
     AC_DEFINE(MOZ_WINCONSOLE)
 fi
 
 MOZ_TOOL_VARIABLES
 
+MOZ_CHECK_COMPILER_WRAPPER
+
 if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
     if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 4 ||
        test "$GCC_MAJOR_VERSION" -lt 4; then
         AC_MSG_ERROR([Only GCC 4.4 or newer supported])
     fi
 fi
 
 dnl ========================================================
@@ -7075,17 +7077,16 @@ MOZ_ARG_ENABLE_BOOL(root-analysis,
 [  --enable-root-analysis  Enable moving GC stack root analysis],
     JSGC_ROOT_ANALYSIS=1,
     JSGC_ROOT_ANALYSIS= )
 if test -n "$JSGC_ROOT_ANALYSIS"; then
     AC_DEFINE(JSGC_ROOT_ANALYSIS)
 fi
 
 MOZ_CHECK_CCACHE
-MOZ_CHECK_COMPILER_WRAPPER
 
 dnl ========================================================
 dnl = Enable static checking using gcc-dehydra
 dnl ========================================================
 
 MOZ_ARG_WITH_STRING(static-checking,
 [  --with-static-checking=path/to/gcc_dehydra.so
                           Enable static checking of code using GCC-dehydra],
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -330,16 +330,18 @@ else
     fi
     if test -z "$HOST_AR_FLAGS"; then
         HOST_AR_FLAGS='$(AR_FLAGS)'
     fi
 fi
 
 MOZ_TOOL_VARIABLES
 
+MOZ_CHECK_COMPILER_WRAPPER
+
 if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
     if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 4 ||
        test "$GCC_MAJOR_VERSION" -lt 4; then
         AC_MSG_ERROR([Only GCC 4.4 or newer supported])
     fi
 fi
 
 dnl Special win32 checks
@@ -3461,17 +3463,16 @@ MOZ_ARG_ENABLE_BOOL(oom-backtrace,
                           Enable output of backtraces on artificial OOMs (-A)],
     JS_OOM_DO_BACKTRACES=1,
     JS_OOM_DO_BACKTRACES= )
 if test -n "$JS_OOM_DO_BACKTRACES"; then
     AC_DEFINE(JS_OOM_DO_BACKTRACES)
 fi
 
 MOZ_CHECK_CCACHE
-MOZ_CHECK_COMPILER_WRAPPER
 
 dnl ========================================================
 dnl = Enable static checking using gcc-dehydra
 dnl ========================================================
 
 MOZ_ARG_WITH_STRING(static-checking,
 [  --with-static-checking=path/to/gcc_dehydra.so
                           Enable static checking of code using GCC-dehydra],