Bug 776428 - Port |
Bug 755145 - Define CCACHE_CP2 when using ccache and Clang| to SeaMonkey. r=Callek
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,13 +1,14 @@
dnl
dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.
dnl
+builtin(include, mozilla/build/autoconf/ccache.m4)dnl
builtin(include, mozilla/build/autoconf/config.status.m4)dnl
builtin(include, mozilla/build/autoconf/nspr.m4)dnl
builtin(include, mozilla/build/autoconf/nss.m4)dnl
builtin(include, mozilla/build/autoconf/pkg.m4)dnl
builtin(include, mozilla/build/autoconf/codeset.m4)dnl
builtin(include, mozilla/build/autoconf/altoptions.m4)dnl
builtin(include, mozilla/build/autoconf/mozprog.m4)dnl
builtin(include, mozilla/build/autoconf/acwinpaths.m4)dnl
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -71,16 +71,18 @@ MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
MOZ_MEMORY = @MOZ_MEMORY@
MOZ_PROFILING = @MOZ_PROFILING@
MOZ_ENABLE_PROFILER_SPS = @MOZ_ENABLE_PROFILER_SPS@
MOZ_JPROF = @MOZ_JPROF@
MOZ_SHARK = @MOZ_SHARK@
DEHYDRA_PATH = @DEHYDRA_PATH@
+MOZ_USING_CCACHE = @MOZ_USING_CCACHE@
+CLANG_CXX = @CLANG_CXX@
NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
MOZ_CALENDAR = @MOZ_CALENDAR@
MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
MOZ_COMPOSER = @MOZ_COMPOSER@
ENABLE_TESTS = @ENABLE_TESTS@
--- a/config/config.mk
+++ b/config/config.mk
@@ -493,16 +493,23 @@ endif # NEXT_ROOT
PBBUILD_SETTINGS = GCC_VERSION="$(GCC_VERSION)" SYMROOT=build ARCHS="$(OS_TEST)"
ifdef MACOS_SDK_DIR
PBBUILD_SETTINGS += SDKROOT="$(MACOS_SDK_DIR)"
endif # MACOS_SDK_DIR
ifdef MACOSX_DEPLOYMENT_TARGET
export MACOSX_DEPLOYMENT_TARGET
PBBUILD_SETTINGS += MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DEPLOYMENT_TARGET)"
endif # MACOSX_DEPLOYMENT_TARGET
+
+ifdef MOZ_USING_CCACHE
+ifdef CLANG_CXX
+export CCACHE_CPP2=1
+endif
+endif
+
ifdef MOZ_OPTIMIZE
ifeq (2,$(MOZ_OPTIMIZE))
# Only override project defaults if the config specified explicit settings
PBBUILD_SETTINGS += GCC_MODEL_TUNING= OPTIMIZATION_CFLAGS="$(MOZ_OPTIMIZE_FLAGS)"
endif # MOZ_OPTIMIZE=2
endif # MOZ_OPTIMIZE
endif # OS_ARCH=Darwin
--- a/configure.in
+++ b/configure.in
@@ -345,69 +345,17 @@ else
if test -z "$HOST_AR"; then
HOST_AR='$AR'
fi
if test -z "$HOST_AR_FLAGS"; then
HOST_AR_FLAGS='$AR_FLAGS'
fi
fi
-GNU_AS=
-GNU_LD=
-GNU_CC=
-GNU_CXX=
-CC_VERSION='N/A'
-CXX_VERSION='N/A'
-if test "$GCC" = "yes"; then
- GNU_CC=1
- CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
-fi
-if test "$GXX" = "yes"; then
- GNU_CXX=1
- CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
-fi
-if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
- GNU_AS=1
-fi
-if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
- GNU_LD=1
-fi
-if test "$GNU_CC"; then
- if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
- GCC_USE_GNU_LD=1
- fi
-fi
-
-INTEL_CC=
-INTEL_CXX=
-if test "$GCC" = yes; then
- if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
- INTEL_CC=1
- fi
-fi
-
-if test "$GXX" = yes; then
- if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
- INTEL_CXX=1
- fi
-fi
-
-CLANG_CC=
-CLANG_CXX=
-if test "$GCC" = yes; then
- if test "`$CC -v 2>&1 | grep -c 'clang version'`" != "0"; then
- CLANG_CC=1
- fi
-fi
-
-if test "$GXX" = yes; then
- if test "`$CXX -v 2>&1 | grep -c 'clang version'`" != "0"; then
- CLANG_CXX=1
- fi
-fi
+MOZ_TOOL_VARIABLES
dnl Special win32 checks
dnl ========================================================
case "$target" in
*-wince|*-winmo)
WINVER=500
;;
*)
@@ -5894,42 +5842,17 @@ MOZ_ARG_ENABLE_BOOL(shark,
[ --enable-shark Enable shark remote profiling (needs CHUD framework). Implies --enable-profiling.],
MOZ_SHARK=1,
MOZ_SHARK= )
if test -n "$MOZ_SHARK"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_SHARK)
fi
-dnl ======================================================
-dnl = Enable compiling with ccache
-dnl ======================================================
-MOZ_ARG_WITH_STRING(ccache,
-[ --with-ccache[=path/to/ccache]
- Enable compiling with ccache],
- CCACHE=$withval, CCACHE="no")
-
-if test "$CCACHE" != "no"; then
- if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
- CCACHE=
- else
- if test ! -e "$CCACHE"; then
- AC_MSG_ERROR([$CCACHE not found])
- fi
- fi
- MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
- if test -z "$CCACHE" -o "$CCACHE" = ":"; then
- AC_MSG_ERROR([ccache not found])
- elif test -x "$CCACHE"; then
- CC="$CCACHE $CC"
- CXX="$CCACHE $CXX"
- else
- AC_MSG_ERROR([$CCACHE is not executable])
- fi
-fi
+MOZ_CHECK_CCACHE
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],