Bug 867750 - Add a --with-compiler-wrapper configure option r=glandium
authorJames Willcox <snorp@snorp.net>
Thu, 02 May 2013 09:26:13 -0400
changeset 137404 d8db39f5734946a35325c2999589f9377445a0d6
parent 137403 088bb497b532a5e962dcf95e2dc8d364c4f221c7
child 137405 5ac1564bff87ff999bb461ffebceb0a6308c95a2
push id3752
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 17:21:10 +0000
treeherdermozilla-aurora@1580544aef0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs867750
milestone23.0a1
Bug 867750 - Add a --with-compiler-wrapper configure option r=glandium
aclocal.m4
build/autoconf/wrapper.m4
configure.in
js/src/aclocal.m4
js/src/build/autoconf/wrapper.m4
js/src/configure.in
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -3,16 +3,17 @@ dnl Local autoconf macros used with mozi
 dnl The contents of this file are under the Public Domain.
 dnl
 
 builtin(include, build/autoconf/acwinpaths.m4)dnl
 builtin(include, build/autoconf/hooks.m4)dnl
 builtin(include, build/autoconf/config.status.m4)dnl
 builtin(include, build/autoconf/toolchain.m4)dnl
 builtin(include, build/autoconf/ccache.m4)dnl
+builtin(include, build/autoconf/wrapper.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/nss.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/codeset.m4)dnl
 builtin(include, build/autoconf/altoptions.m4)dnl
 builtin(include, build/autoconf/mozprog.m4)dnl
 builtin(include, build/autoconf/mozheader.m4)dnl
 builtin(include, build/autoconf/mozcommonheader.m4)dnl
new file mode 100644
--- /dev/null
+++ b/build/autoconf/wrapper.m4
@@ -0,0 +1,22 @@
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl =======================================================================
+dnl = Enable compiling with various compiler wrappers (distcc, ccache, etc)
+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
+fi
+
+AC_SUBST(MOZ_USING_COMPILER_WRAPPER)
+])
--- a/configure.in
+++ b/configure.in
@@ -7389,16 +7389,17 @@ MOZ_ARG_ENABLE_BOOL(js-diagnostics,
                           Enable JS diagnostic assertions and breakpad data],
     JS_CRASH_DIAGNOSTICS=1,
     JS_CRASH_DIAGNOSTICS= )
 if test -n "$JS_CRASH_DIAGNOSTICS"; then
     AC_DEFINE(JS_CRASH_DIAGNOSTICS)
 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/aclocal.m4
+++ b/js/src/aclocal.m4
@@ -3,16 +3,17 @@ dnl Local autoconf macros used with mozi
 dnl The contents of this file are under the Public Domain.
 dnl
 
 builtin(include, build/autoconf/acwinpaths.m4)dnl
 builtin(include, build/autoconf/hooks.m4)dnl
 builtin(include, build/autoconf/config.status.m4)dnl
 builtin(include, build/autoconf/toolchain.m4)dnl
 builtin(include, build/autoconf/ccache.m4)dnl
+builtin(include, build/autoconf/wrapper.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/altoptions.m4)dnl
 builtin(include, build/autoconf/moznbytetype.m4)dnl
 builtin(include, build/autoconf/mozprog.m4)dnl
 builtin(include, build/autoconf/mozheader.m4)dnl
 builtin(include, build/autoconf/mozcommonheader.m4)dnl
 builtin(include, build/autoconf/lto.m4)dnl
new file mode 100644
--- /dev/null
+++ b/js/src/build/autoconf/wrapper.m4
@@ -0,0 +1,22 @@
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl =======================================================================
+dnl = Enable compiling with various compiler wrappers (distcc, ccache, etc)
+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
+fi
+
+AC_SUBST(MOZ_USING_COMPILER_WRAPPER)
+])
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3762,16 +3762,17 @@ 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],