Bug 580175: Make --with-ccache more powerful. r=khuey
authorTakanori Matsuura <t.matsuu@gmail.com>
Mon, 26 Jul 2010 12:31:52 -0700
changeset 48218 55002e95d9e636f8eb8036106dbee890c0d529a1
parent 48217 9f24227e27b2aae2e9b6facfdca48a9a0354601d
child 48219 7302b93dbf4dbe47c68c58ca753aeb27b01c1bbf
push id14630
push userme@kylehuey.com
push dateMon, 26 Jul 2010 19:39:25 +0000
treeherdermozilla-central@aa52fe38c972 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs580175
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 580175: Make --with-ccache more powerful. r=khuey
configure.in
js/src/configure.in
--- a/configure.in
+++ b/configure.in
@@ -7397,23 +7397,37 @@ MOZ_ARG_ENABLE_BOOL(gczeal,
 if test -n "$JS_GC_ZEAL"; then
     AC_DEFINE(JS_GC_ZEAL)
 fi
 
 dnl ======================================================
 dnl = Enable compiling with ccache
 dnl ======================================================
 MOZ_ARG_WITH_STRING(ccache,
-[  --with-ccache=path/to/ccache
+[  --with-ccache[=path/to/ccache]
                           Enable compiling with ccache],
-    CCACHE_PATH=$withval,)
-
-if test -n "$CCACHE_PATH"; then
-  CC="$CCACHE_PATH $CC"
-  CXX="$CCACHE_PATH $CXX"
+    CCACHE=$withval, CCACHE="no")
+
+if test "$CCACHE" != "no"; then
+    if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
+        CCACHE=
+    else
+        if test ! -e "$CCACHE"; then
+            AC_MSG_ERROR([$CCACHE not found])
+        fi
+    fi
+    MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
+    if test -z "$CCACHE" -o "$CCACHE" = ":"; then
+        AC_MSG_ERROR([ccache not found])
+    elif test -x "$CCACHE"; then
+        CC="$CCACHE $CC"
+        CXX="$CCACHE $CXX"
+    else
+        AC_MSG_ERROR([$CCACHE is not executable])
+    fi
 fi
 
 dnl ========================================================
 dnl = Enable static checking using gcc-dehydra
 dnl ========================================================
 
 MOZ_ARG_WITH_STRING(static-checking,
 [  --with-static-checking=path/to/gcc_dehydra.so
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4450,23 +4450,39 @@ MOZ_ARG_ENABLE_BOOL(gczeal,
 if test -n "$JS_GC_ZEAL"; then
     AC_DEFINE(JS_GC_ZEAL)
 fi
 
 dnl ======================================================
 dnl = Enable compiling with ccache
 dnl ======================================================
 MOZ_ARG_WITH_STRING(ccache,
-[  --with-ccache=path/to/ccache
+[  --with-ccache[=path/to/ccache]
                           Enable compiling with ccache],
-    CCACHE_PATH=$withval,)
-
-if test -n "$CCACHE_PATH"; then
-  CC="$CCACHE_PATH $CC"
-  CXX="$CCACHE_PATH $CXX"
+    CCACHE=$withval, CCACHE="no")
+
+if test "$CCACHE" != "no"; then
+    if test -n "$CCACHE"; then
+        if test "$CCACHE" = "yes"; then
+            CCACHE=
+        else
+            if test ! -e "$CCACHE"; then
+                AC_MSG_ERROR([$CCACHE not found])
+            fi
+        fi
+    fi
+    MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
+    if test -z "$CCACHE" -o "$CCACHE" = ":"; then
+        AC_MSG_ERROR([ccache not found])
+    elif test -x "$CCACHE"; then
+        CC="$CCACHE $CC"
+        CXX="$CCACHE $CXX"
+    else
+        AC_MSG_ERROR([$CCACHE is not executable])
+    fi
 fi
 
 dnl ========================================================
 dnl = Enable static checking using gcc-dehydra
 dnl ========================================================
 
 MOZ_ARG_WITH_STRING(static-checking,
 [  --with-static-checking=path/to/gcc_dehydra.so