common/autoconf/build-performance.m4

changeset 2203
28b247535e18
parent 972
f3697e0783e2
child 2204
0e87966d7ff1
     1.1 --- a/common/autoconf/build-performance.m4	Wed Feb 07 10:39:09 2018 -0800
     1.2 +++ b/common/autoconf/build-performance.m4	Sun Mar 18 15:15:36 2018 -0700
     1.3 @@ -160,20 +160,28 @@
     1.4  AC_DEFUN([BPERF_SETUP_CCACHE],
     1.5  [
     1.6    AC_ARG_ENABLE([ccache],
     1.7 -      [AS_HELP_STRING([--disable-ccache],
     1.8 -      [disable using ccache to speed up recompilations @<:@enabled@:>@])],
     1.9 -      [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
    1.10 -  if test "x$ENABLE_CCACHE" = xyes; then
    1.11 +      [AS_HELP_STRING([--enable-ccache],
    1.12 +      [enable using ccache to speed up recompilations @<:@disabled@:>@])])
    1.13 +
    1.14 +  CCACHE=
    1.15 +  AC_MSG_CHECKING([is ccache enabled])
    1.16 +  ENABLE_CCACHE=$enable_ccache
    1.17 +  if test "x$enable_ccache" = xyes; then
    1.18 +    AC_MSG_RESULT([yes])
    1.19      OLD_PATH="$PATH"
    1.20      if test "x$TOOLS_DIR" != x; then
    1.21        PATH=$TOOLS_DIR:$PATH
    1.22      fi
    1.23 -    AC_PATH_PROG(CCACHE, ccache)
    1.24 +    BASIC_REQUIRE_PROG(CCACHE, ccache)
    1.25 +    CCACHE_STATUS="enabled"
    1.26      PATH="$OLD_PATH"
    1.27 +  elif test "x$enable_ccache" = xno; then
    1.28 +    AC_MSG_RESULT([no, explicitly disabled])
    1.29 +  elif test "x$enable_ccache" = x; then
    1.30 +    AC_MSG_RESULT([no])
    1.31    else
    1.32 -    AC_MSG_CHECKING([for ccache])
    1.33 -    AC_MSG_RESULT([explicitly disabled])
    1.34 -    CCACHE=
    1.35 +    AC_MSG_RESULT([unknown])
    1.36 +    AC_MSG_ERROR([--enable-ccache does not accept any parameters])
    1.37    fi
    1.38    AC_SUBST(CCACHE)
    1.39  
    1.40 @@ -185,8 +193,11 @@
    1.41      # When using a non home ccache directory, assume the use is to share ccache files
    1.42      # with other users. Thus change the umask.
    1.43      SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
    1.44 +    if test "x$CCACHE" = x; then
    1.45 +      AC_MSG_WARN([--with-ccache-dir has no meaning when ccache is not enabled])
    1.46 +    fi
    1.47    fi
    1.48 -  CCACHE_FOUND=""
    1.49 +
    1.50    if test "x$CCACHE" != x; then
    1.51      BPERF_SETUP_CCACHE_USAGE
    1.52    fi
    1.53 @@ -195,7 +206,6 @@
    1.54  AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
    1.55  [
    1.56    if test "x$CCACHE" != x; then
    1.57 -    CCACHE_FOUND="true"
    1.58      # Only use ccache if it is 3.1.4 or later, which supports
    1.59      # precompiled headers.
    1.60      AC_MSG_CHECKING([if ccache supports precompiled headers])
    1.61 @@ -203,6 +213,7 @@
    1.62      if test "x$HAS_GOOD_CCACHE" = x; then
    1.63        AC_MSG_RESULT([no, disabling ccache])
    1.64        CCACHE=
    1.65 +      CCACHE_STATUS="disabled"
    1.66      else
    1.67        AC_MSG_RESULT([yes])
    1.68        AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
    1.69 @@ -215,6 +226,7 @@
    1.70        else
    1.71          AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
    1.72          CCACHE=
    1.73 +        CCACHE_STATUS="disabled"
    1.74        fi
    1.75      fi
    1.76    fi

mercurial