1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/autoconf/ccache.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +dnl This Source Code Form is subject to the terms of the Mozilla Public 1.5 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +dnl ====================================================== 1.9 +dnl = Enable compiling with ccache 1.10 +dnl ====================================================== 1.11 +AC_DEFUN([MOZ_CHECK_CCACHE], 1.12 +[ 1.13 +MOZ_ARG_WITH_STRING(ccache, 1.14 +[ --with-ccache[=path/to/ccache] 1.15 + Enable compiling with ccache], 1.16 + CCACHE=$withval, CCACHE="no") 1.17 + 1.18 +if test "$CCACHE" != "no"; then 1.19 + if test -z "$CCACHE" -o "$CCACHE" = "yes"; then 1.20 + CCACHE= 1.21 + else 1.22 + if test ! -e "$CCACHE"; then 1.23 + AC_MSG_ERROR([$CCACHE not found]) 1.24 + fi 1.25 + fi 1.26 + MOZ_PATH_PROGS(CCACHE, $CCACHE ccache) 1.27 + if test -z "$CCACHE" -o "$CCACHE" = ":"; then 1.28 + AC_MSG_ERROR([ccache not found]) 1.29 + elif test -x "$CCACHE"; then 1.30 + CC="$CCACHE $CC" 1.31 + CXX="$CCACHE $CXX" 1.32 + MOZ_USING_CCACHE=1 1.33 + else 1.34 + AC_MSG_ERROR([$CCACHE is not executable]) 1.35 + fi 1.36 +fi 1.37 + 1.38 +AC_SUBST(MOZ_USING_CCACHE) 1.39 +])