summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-02-15 13:06:04 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-02-15 13:08:23 +0200
commitc1f5475bd626849fe7a98cb8986219990a526ce3 (patch)
tree15ac0ffc7db47654b7a8fd3b316e1fd11e2d857c
parent48649cdfb8671fb49a28b33c1ba1cd71c0999a07 (diff)
Do try to use ccache even if CC/CXX are set
For Android, they could have been set earlier in the configure script even. We do want to use ccache also for Android cross-compilation.
-rw-r--r--configure.in53
1 files changed, 25 insertions, 28 deletions
diff --git a/configure.in b/configure.in
index b96b081fcfb6..752f761225b5 100644
--- a/configure.in
+++ b/configure.in
@@ -2032,37 +2032,34 @@ dnl ===================================================================
dnl Checks if ccache is available
dnl ===================================================================
if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \) ; then
- if test -z "$CC" ; then
- if test -z "$CXX" ; then
- AC_PATH_PROG([CCACHE],[ccache],[not found])
- if test "$CCACHE" = "not found" ; then
- CCACHE=""
- else
- CCACHE="ccache"
- # need to check for ccache version: otherwise prevents
- # caching of the results (like "-x objective-c++" for Mac)
- if test $_os = Darwin -o $_os = iOS; then
- # check ccache version
- AC_MSG_CHECKING([whether version of ccache is suitable])
- CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
- CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
- if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.])
- CCACHE=""
- fi
+ case "%$CC%$CXX%" in
+ # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
+ # assume that's good then
+ ccache[[-_' ']]*|*/ccache[[-_' ']]*)
+ AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
+ ;;
+ *)
+ AC_PATH_PROG([CCACHE],[ccache],[not found])
+ if test "$CCACHE" = "not found" ; then
+ CCACHE=""
+ else
+ # Need to check for ccache version: otherwise prevents
+ # caching of the results (like "-x objective-c++" for Mac)
+ if test $_os = Darwin -o $_os = iOS; then
+ # Check ccache version
+ AC_MSG_CHECKING([whether version of ccache is suitable])
+ CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
+ CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
+ if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
+ AC_MSG_RESULT([yes, $CCACHE_VERSION])
+ else
+ AC_MSG_RESULT([no, $CCACHE_VERSION])
+ CCACHE=""
fi
fi
- else
- AC_MSG_NOTICE([Automatic ccache detection ignored: CXX is pre-defined])
- CCACHE=""
fi
- else
- AC_MSG_NOTICE([Automatic ccache detection ignored: CC is pre-defined])
- CCACHE=""
- fi
+ ;;
+ esac
else
CCACHE=""
fi