Index: tools/configure =================================================================== --- tools/configure (revisione 18508) +++ tools/configure (copia locale) @@ -76,7 +76,7 @@ parse_args() { ret="1" - for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9 + for i in "$arg1" "$arg2" "$arg3" "$arg4" "$arg5" "$arg6" "$arg7" "$arg8" "$arg9" do if [ "$1" = "--ccache" ]; then if [ "$i" = "--ccache" ]; then @@ -86,7 +86,7 @@ if [ "$i" = "--no-ccache" ]; then ret="0" fi - elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then + elif [ "$1" = "`echo $i|cut -d'=' -f1`" ]; then ret=`echo $i|cut -d'=' -f2` fi done @@ -293,22 +293,31 @@ ################################################################## # Prompt for specific developer options # - echo "" - echo "Enter your developer options (press enter when done)" - echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" - if [ "$memory" = "2" ]; then - echo -n ", (8)MB MOD" + if [ "1" != "`parse_args --atype`" ]; then + aoptions=`parse_args --atype` + atype=1 + else + echo "" + echo "Enter your developer options (press enter when done)" + echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" + if [ "$memory" = "2" ]; then + echo -n ", (8)MB MOD" + fi + if [ "$modelname" = "h120" ]; then + echo -n ", (R)TC MOD" + fi + echo "" fi - if [ "$modelname" = "h120" ]; then - echo -n ", (R)TC MOD" - fi - echo "" cont=1 while [ $cont = "1" ]; do - option=`input`; + if [ "$atype" ]; then + option=`echo "$aoptions" | cut -c 1` + else + option=`input` + fi case $option in [Dd]) @@ -344,7 +353,7 @@ memory="8" echo "Memory size selected: 8MB" else - cont=0 + [ "$atype" ] || cont=0 fi ;; [Rr]) @@ -353,19 +362,21 @@ have_rtc_alarm="#define HAVE_RTC_ALARM" echo "RTC functions enabled (DS1339/DS3231)" else - cont=0 + [ "$atype" ] || cont=0 fi ;; *) - cont=0 + [ "$atype" ] || cont=0 ;; esac + [ "$aoptions" ] && aoptions=`echo "$aoptions" | cut -c 2-` + [ "$aoptions" ] || cont=0 done - echo "done" + [ "$atype" ] || echo "done" if [ "yes" = "$voice" ]; then # Ask about languages to build - echo "Select a number for the language to use (default is english)" + [ "1" != "`parse_args --atype`" ] || echo "Select a number for the language to use (default is english)" # The multiple-language feature is currently broken # echo "You may enter a comma-separated list of languages to build" @@ -403,8 +414,10 @@ # Configure voice settings voiceconfig () { thislang=$1 - echo "Building $thislang voice for $modelname. Select options" - echo "" + if [ "1" = "`parse_args --tts`" ]; then + echo "Building $thislang voice for $modelname. Select options" + echo "" + fi if [ -f "`which flite`" ]; then FLITE="F(l)ite " @@ -469,8 +482,12 @@ exit fi - echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" - option=`input` + if [ "1" != "`parse_args --tts`" ]; then + option=`parse_args --tts`; + else + echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" + option=`input` + fi case "$option" in [Ll]) TTS_ENGINE="flite" @@ -505,13 +522,17 @@ echo "Using $TTS_ENGINE for TTS" # Allow the user to input manual commandline options - printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " - USER_TTS_OPTS=`input` + if [ "1" != "`parse_args --ttsopts`" ]; then + USER_TTS_OPTS=`parse_args --ttsopts`; + else + printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " + USER_TTS_OPTS=`input` + echo "" + fi if [ -n "$USER_TTS_OPTS" ]; then TTS_OPTS="$USER_TTS_OPTS" fi - echo "" if [ "$swcodec" = "yes" ]; then ENCODER="rbspeexenc" @@ -532,8 +553,12 @@ echo "Using $ENCODER for encoding voice clips" # Allow the user to input manual commandline options - printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): " - USER_ENC_OPTS=`input` + if [ "1" != "`parse_args --encopts`" ]; then + USER_ENC_OPTS=`parse_args --encopts`; + else + printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): " + USER_ENC_OPTS=`input` + fi if [ -n "$USER_ENC_OPTS" ]; then ENC_OPTS=$USER_ENC_OPTS fi @@ -551,13 +576,16 @@ langs="$langs $clean" done - num=1 - for one in $langs; do - echo "$num. $one" - num=`expr $num + 1` - done - - read pick + if [ "1" != "`parse_args --language`" ]; then + pick=`parse_args --language`; + else + num=1 + for one in $langs; do + echo "$num. $one" + num=`expr $num + 1` + done + pick=`input` + fi } whichlang() { @@ -602,11 +630,25 @@ number is. --type=TYPE Sets the build type. The shortcut is also valid. - Run without this option to see available types. - --ccache Enable ccache use (done by default these days) - --no-ccache Disable ccache use - --help Shows this message (must not be used with other options) + Run without this option to see all available types. + --atype=ATYPE Sets the advanced build type. The shortcut is also valid. + Run without this option to see all available types. + + --language=LANG Set the language used for voice generation (used only if + TYPE is V). + + --tts=ENGINE Set the TTS engine used for voice generation (used only + if TYPE is V). + + --ttsopts=OPTS Set TTS engine manual options (used only if ATYPE is V). + + --encopts=OPTS Set encoder manual options (used only if ATYPE is V). + + --ccache Enable ccache use (done by default these days). + --no-ccache Disable ccache use. + --help Shows this message (must not be used with other options). + EOF exit @@ -668,7 +710,7 @@ # Figure out target platform # -if [ "1" != `parse_args --target` ]; then +if [ "1" != "`parse_args --target`" ]; then buildfor=`parse_args --target`; else echo "Enter target platform:" @@ -1823,10 +1865,10 @@ if [ -z "$memory" ]; then case $target_id in 15) - echo "Enter size of your RAM (in MB): (Defaults to 32)" - if [ "1" != `parse_args --ram` ]; then + if [ "1" != "`parse_args --ram`" ]; then size=`parse_args --ram`; else + echo "Enter size of your RAM (in MB): (Defaults to 32)" size=`input`; fi case $size in @@ -1839,24 +1881,24 @@ esac ;; *) - echo "Enter size of your RAM (in MB): (Defaults to 2)" - if [ "1" != `parse_args --ram` ]; then - size=`parse_args --ram`; - else - size=`input`; - fi - case $size in - 8) - memory="8" - ;; - *) - memory="2" - ;; - esac + if [ "1" != "`parse_args --ram`" ]; then + size=`parse_args --ram`; + else + echo "Enter size of your RAM (in MB): (Defaults to 2)" + size=`input`; + fi + case $size in + 8) + memory="8" + ;; + *) + memory="2" + ;; + esac ;; esac echo "Memory size selected: $memory MB" - echo "" + [ "1" != "`parse_args --type`" ] || echo "" fi #remove end @@ -1876,7 +1918,7 @@ *) ;; esac -if [ "1" != `parse_args --type` ]; then +if [ "1" != "`parse_args --type`" ]; then option=`parse_args --type`; else echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)" @@ -2089,11 +2131,11 @@ GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'` fi -if [ "1" != `parse_args --ccache` ]; then +if [ "1" != "`parse_args --ccache`" ]; then echo "Enable ccache for building" ccache="ccache" else - if [ "1" = `parse_args --no-ccache` ]; then + if [ "1" = "`parse_args --no-ccache`" ]; then ccache=`findtool ccache` if test -n "$ccache"; then echo "Found and uses ccache ($ccache)"