diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2013-04-09 02:02:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-04-09 02:02:49 +0000 |
commit | 604a721180f17ec3c55b63cc3188097885603d4e (patch) | |
tree | 2666a4fe60da15f67c8fb19049c5869d85e876d6 | |
parent | adc7c454fb498cdd392a662185e98eedfd4eb5ee (diff) | |
parent | 2905b20226f06f50140804fe130764e98f2bd975 (diff) | |
download | qemu-tools_r22.tar.gz |
Merge "build-kernel.sh: add ccache option"tools_r22
-rwxr-xr-x | distrib/build-kernel.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/distrib/build-kernel.sh b/distrib/build-kernel.sh index a09119eb02..d96fa8bdf7 100755 --- a/distrib/build-kernel.sh +++ b/distrib/build-kernel.sh @@ -44,6 +44,18 @@ OPTION_CONFIG= OPTION_SAVEDEFCONFIG=no OPTION_JOBS= OPTION_VERBOSE= +CCACHE= + +case "$USE_CCACHE" in + "") + CCACHE= + ;; + *) + # use ccache bundled in AOSP source tree + CCACHE=${ANDROID_BUILD_TOP:-$(dirname $0)/../../..}/prebuilts/misc/$HOST_TAG/ccache/ccache + [ -x $CCACHE ] || CCACHE= + ;; +esac for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') @@ -71,6 +83,9 @@ for opt do --savedefconfig) OPTION_SAVEDEFCONFIG=yes ;; + --ccache=*) + CCACHE=$optarg + ;; --verbose) OPTION_VERBOSE=true ;; @@ -96,6 +111,7 @@ if [ $OPTION_HELP = "yes" ] ; then echo " --cross=<prefix> cross-toolchain prefix [$CROSSPREFIX]" echo " --config=<name> kernel config name [$CONFIG]" echo " --savedefconfig run savedefconfig" + echo " --ccache=<path> use compiler cache [${CCACHE:-not set}]" echo " --verbose show build commands" echo " -j<number> launch <number> parallel build jobs [$JOBS]" echo "" @@ -195,6 +211,11 @@ if [ $? != 0 ] ; then fi fi +if [ "$CCACHE" ] ; then + echo "Using ccache program: $CCACHE" + CROSSPREFIX="$CCACHE $CROSSPREFIX" +fi + export CROSS_COMPILE="$CROSSPREFIX" ARCH SUBARCH=$ARCH if [ "$OPTION_JOBS" ]; then |