summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-05-23 18:20:57 +0200
committerunknown <guilhem@mysql.com>2003-05-23 18:20:57 +0200
commit3ccee65503bc32457b7cdad4216fa964282533e5 (patch)
treed9c82dd4b92dfe56116d81830fec90257d51dd56
parentfa6c97dfe1a574fbd2cf052caec3878c7ad1ac37 (diff)
downloadmariadb-git-3ccee65503bc32457b7cdad4216fa964282533e5.tar.gz
Outcome of discussions with Lenz and Monty about handling ccache in the build commands.
BUILD/SETUP.sh: Quote $CXX to make a test work even if CXX had spaces in it. Automatically add ccache to CC and CXX if ccache is present. configure.in: Accept "ccache gcc" in the test.
-rw-r--r--BUILD/SETUP.sh18
-rw-r--r--configure.in2
2 files changed, 18 insertions, 2 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 55b82e38d63..150f9e28b41 100644
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -71,6 +71,22 @@ else
make=make
fi
-if test -z $CXX ; then
+if test -z "$CXX" ; then
CXX=gcc
fi
+
+# If ccache (a compiler cache which reduces build time)
+# (http://samba.org/ccache) is installed, use it.
+# We use 'grep' and hope 'grep' will work as expected
+# (returns 0 if finds lines)
+if ccache -V > /dev/null 2>&1
+then
+ if ! (echo "$CC" | grep "ccache" > /dev/null)
+ then
+ CC="ccache $CC"
+ fi
+ if ! (echo "$CXX" | grep "ccache" > /dev/null)
+ then
+ CXX="ccache $CXX"
+ fi
+fi
diff --git a/configure.in b/configure.in
index c7cf4f66b70..5c794714889 100644
--- a/configure.in
+++ b/configure.in
@@ -361,7 +361,7 @@ then
# we will gets some problems when linking static programs.
# The following code is used to fix this problem.
- if test "$CXX" = "gcc"
+ if test "$CXX" = "gcc" -o "$CXX" = "ccache gcc"
then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
then