summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-01-03 02:00:58 +0900
committerKoichi Sasada <ko1@atdot.net>2020-01-03 02:07:21 +0900
commit27fae1d4adfef26d30d43f2d0d6653e99aaaba3d (patch)
treebb3fda9986b843aeea2cf1036bcfb7587ff7212b /configure.ac
parentb884eb59eb22172b5d8af9f33ece093c8f917176 (diff)
disable ccache if $CC is in /usr/lib/ccache/$CC.
MJIT with ccache has a problem on docker environment, so we need to use original CC (/usr/bin/gcc, for example). Ubuntu system provides /usr/lib/ccache/gcc and so on to use gcc with ccache. It is easy to setup ccache by adding /usr/lib/ccache to $PATH. However we need to use /usr/bin/gcc (and so on) for MJIT_CC. We can specify MJIT_CC option at configure, but specifying them is troublesome. This patch choose original $CC (/usr/bin/gcc, for example) if $CC is /usr/lib/ccache/$CC.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e8d9aa6d5e..98bc48854f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -274,6 +274,11 @@ AC_SUBST(CSRCFLAG)
: ${MJIT_CC=$CC}
AS_IF([test "x$cross_compiling" = xno], [
AC_PATH_PROG([MJIT_CC], ${MJIT_CC})
+
+ # if $CC is in /usr/lib/ccache/$CC, search original $CC (disable ccache)
+ AS_IF([echo $MJIT_CC | grep ^/usr/lib/ccache > /dev/null], [
+ PATH=`echo $PATH | sed "s/\/usr\/lib\/ccache://"` MJIT_CC=`which $CC`])
+
AS_CASE([$target_os],
[*mingw*], [command -v cygpath > /dev/null && MJIT_CC=`cygpath -ma $MJIT_CC`])
shift 2