summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-08-18 12:22:43 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-08-18 12:22:43 -0500
commita004ca1eacaa18157c9c4fd3d550128e180faec9 (patch)
tree19ab359d5c797a706205ff79f125241173def161 /configure.in
parent6e566bc451f3db8a0507fe42946706fcb5616918 (diff)
check that ccache's cache size is reasoably large enough
if < 1 GB do not auto-enable ccache if < 5 GB warn about debug/symbol build
Diffstat (limited to 'configure.in')
-rwxr-xr-xconfigure.in30
1 files changed, 28 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 66aef4a71873..782d4ccd0821 100755
--- a/configure.in
+++ b/configure.in
@@ -1701,8 +1701,8 @@ if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecrea
CCACHE=""
else
CCACHE="ccache"
- dnl need to check for ccache version: otherwise prevents
- dnl caching of the results (like "-x objective-c++" for Mac)
+ # 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])
@@ -1729,6 +1729,32 @@ else
CCACHE=""
fi
+if test "$CCACHE" != "" ; then
+ ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
+ ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
+ if test "$ccache_size" = "" ; then
+ ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
+ if test "$ccache_size" = "" ; then
+ ccache_size=0
+ fi
+ # we could not determine the size or it was less than 1GB -> disable auto-ccache
+ if test $ccache_size -lt 1024 ; then
+ CCACHE=""
+ AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
+ echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
+ else
+ # warn that ccache may be too small for debug build
+ AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
+ echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
+ fi
+ else
+ if test $ccache_size -lt 5 ; then
+ #warn that ccache may be too small for debug build
+ AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
+ echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
+ fi
+ fi
+fi
dnl ===================================================================
dnl Checks for C compiler,