Index: tools/configure =================================================================== --- tools/configure (Revision 16929) +++ tools/configure (Arbeitskopie) @@ -66,7 +66,33 @@ done } +# parse the argument list, returns the value after the = in case of a +# option=value type option, returns 0 in case of --ccache or --no-ccache, +# returns 1 if the searched argument type wasn't fount in the argument list +# Usage [var = ]`parse_args `, i.e. `parse_args target` +# var definitons below are needed so that parse_args can see the arguments +arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9 + +parse_args() { + ret="1" + for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9 + do + if [ "$1" = "--ccache" ]; then + if [ "$i" = "--ccache" ]; then + ret="0" + fi + elif [ "$1" = "--no-ccache" ]; then + if [ "$i" = "--no-ccache" ]; then + ret="0" + fi + elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then + ret=`echo $i|cut -d'=' -f2` + fi + done + echo "$ret" +} + simcc () { # default tool setup for native building @@ -544,7 +570,26 @@ echo "Invoke this in a directory to generate a Makefile to build Rockbox" echo "Do *NOT* run this within the tools directory!" echo "" - echo "Usage: configure [--ccache][--no-ccache]" +cat <&2 + if test -f "$path/$file"; then + echo "$path/$file" + return + fi + done -if test "$1" = "--ccache"; then +if [ "1" != `parse_args --ccache` ]; then echo "Enable ccache for building" ccache="ccache" else - if test "$1" != "--no-ccache"; then + if [ "1" = `parse_args --no-ccache` ]; then ccache=`findtool ccache` if test -n "$ccache"; then echo "Found and uses ccache ($ccache)"