michael@0: dnl This Source Code Form is subject to the terms of the Mozilla Public michael@0: dnl License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: dnl ====================================================== michael@0: dnl = Enable compiling with ccache michael@0: dnl ====================================================== michael@0: AC_DEFUN([MOZ_CHECK_CCACHE], michael@0: [ michael@0: MOZ_ARG_WITH_STRING(ccache, michael@0: [ --with-ccache[=path/to/ccache] michael@0: Enable compiling with ccache], michael@0: CCACHE=$withval, CCACHE="no") michael@0: michael@0: if test "$CCACHE" != "no"; then michael@0: if test -z "$CCACHE" -o "$CCACHE" = "yes"; then michael@0: CCACHE= michael@0: else michael@0: if test ! -e "$CCACHE"; then michael@0: AC_MSG_ERROR([$CCACHE not found]) michael@0: fi michael@0: fi michael@0: MOZ_PATH_PROGS(CCACHE, $CCACHE ccache) michael@0: if test -z "$CCACHE" -o "$CCACHE" = ":"; then michael@0: AC_MSG_ERROR([ccache not found]) michael@0: elif test -x "$CCACHE"; then michael@0: CC="$CCACHE $CC" michael@0: CXX="$CCACHE $CXX" michael@0: MOZ_USING_CCACHE=1 michael@0: else michael@0: AC_MSG_ERROR([$CCACHE is not executable]) michael@0: fi michael@0: fi michael@0: michael@0: AC_SUBST(MOZ_USING_CCACHE) michael@0: ])