Index: tools/configure =================================================================== --- tools/configure (revisione 21388) +++ tools/configure (copia locale) @@ -82,7 +82,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 @@ -92,7 +92,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 @@ -312,31 +312,40 @@ } whichadvanced () { + atype=`echo "$1" | cut -c 2-` ################################################################## # Prompt for specific developer options # - echo "" - echo "Enter your developer options (press enter when done)" - printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" - if [ "$memory" = "2" ]; then - printf ", (8)MB MOD" + if [ "$atype" ]; then + interact= + else + interact=1 + echo "" + echo "Enter your developer options (press enter when done)" + printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" + if [ "$memory" = "2" ]; then + printf ", (8)MB MOD" + fi + if [ "$t_model" = "ondio" ]; then + printf ", (B)acklight MOD" + fi + if [ "$modelname" = "m5" ]; then + printf ", (F)M radio MOD" + fi + if [ "$modelname" = "h120" ]; then + printf ", (R)TC MOD" + fi + echo "" fi - if [ "$t_model" = "ondio" ]; then - printf ", (B)acklight MOD" - fi - if [ "$modelname" = "m5" ]; then - printf ", (F)M radio MOD" - fi - if [ "$modelname" = "h120" ]; then - printf ", (R)TC MOD" - fi - echo "" cont=1 - while [ $cont = "1" ]; do - option=`input`; + if [ "$interact" ]; then + option=`input` + else + option=`echo "$atype" | cut -c 1` + fi case $option in [Dd]) @@ -371,24 +380,18 @@ if [ "$memory" = "2" ]; then memory="8" echo "Memory size selected: 8MB" - else - cont=0 fi ;; [Bb]) if [ "$t_model" = "ondio" ]; then have_backlight="#define HAVE_BACKLIGHT" echo "Backlight functions enabled" - else - cont=0 fi ;; [Ff]) if [ "$modelname" = "m5" ]; then have_fmradio_in="#define HAVE_FMRADIO_IN" echo "FM radio functions enabled" - else - cont=0 fi ;; [Rr]) @@ -396,30 +399,27 @@ config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231" have_rtc_alarm="#define HAVE_RTC_ALARM" echo "RTC functions enabled (DS1339/DS3231)" - else - cont=0 fi ;; *) - cont=0 + if [ "$interact" ]; then + cont=0 + else + echo "Option $option not managed" + fi ;; esac + if [ ! "$interact" ]; then + atype=`echo "$atype" | cut -c 2-` + [ "$atype" ] || cont=0 + fi done echo "done" if [ "yes" = "$voice" ]; then # Ask about languages to build - 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" - picklang voicelanguage=`whichlang` - - if [ -z "$voicelanguage" ]; then - # pick a default - voicelanguage="english" - fi echo "Voice language set to $voicelanguage" # Configure encoder and TTS engine for each language @@ -449,8 +449,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 [ -n "`findtool flite`" ]; then FLITE="F(l)ite " @@ -515,8 +517,13 @@ exit 3 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 + advopts="$advopts --tts=$option" case "$option" in [Ll]) TTS_ENGINE="flite" @@ -552,36 +559,48 @@ # Select which voice to use for Festival if [ "$TTS_ENGINE" = "festival" ]; then - i=1 - for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do - if [ "$i" = "1" ]; then - TTS_FESTIVAL_VOICE="$voice" # Default choice - fi - printf "%3d. %s\n" "$i" "$voice" - i=`expr $i + 1` + voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort` + for voice in $voicelist; do + TTS_FESTIVAL_VOICE="$voice" # Default choice + break done - printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " - CHOICE=`input` + if [ "1" != "`parse_args --voice`" ]; then + CHOICE=`parse_args --voice`; + else + i=1 + for voice in $voicelist; do + printf "%3d. %s\n" "$i" "$voice" + i=`expr $i + 1` + done + printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " + CHOICE=`input` + fi i=1 - for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do + for voice in $voicelist; do if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then TTS_FESTIVAL_VOICE="$voice" fi i=`expr $i + 1` done + advopts="$advopts --voice=$CHOICE" echo "Festival voice set to $TTS_FESTIVAL_VOICE" echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm fi # 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 + advopts="$advopts --ttsopts='$USER_TTS_OPTS'" if [ -n "$USER_TTS_OPTS" ]; then TTS_OPTS="$USER_TTS_OPTS" fi + echo "$TTS_ENGINE options set to $TTS_OPTS" - echo "" - if [ "$swcodec" = "yes" ]; then ENCODER="rbspeexenc" ENC_CMD="rbspeexenc" @@ -601,11 +620,17 @@ 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 + advopts="$advopts --encopts='$USER_ENC_OPTS'" if [ -n "$USER_ENC_OPTS" ]; then ENC_OPTS=$USER_ENC_OPTS fi + echo "$ENCODER options set to $ENC_OPTS" TEMPDIR="${pwd}" if [ -n "`findtool cygpath`" ]; then @@ -620,13 +645,21 @@ langs="$langs $clean" done - num=1 - for one in $langs; do - echo "$num. $one" - num=`expr $num + 1` - done + if [ "1" != "`parse_args --language`" ]; then + pick=`parse_args --language`; + else + echo "Select a number for the language to use (default is english)" + # FIXME The multiple-language feature is currently broken + # echo "You may enter a comma-separated list of languages to build" - read pick + num=1 + for one in $langs; do + echo "$num. $one" + num=`expr $num + 1` + done + pick=`input` + fi + advopts="$advopts --language=$pick" } whichlang() { @@ -646,10 +679,15 @@ num=`expr $num + 1` done done + if [ -z "$output" ]; then + # pick a default + output="english" + fi echo $output } opt=$1 +advopts= if test "$opt" = "--help"; then echo "Rockbox configure script." @@ -670,9 +708,25 @@ without this option if you are not sure which the right number is. - --type=TYPE Sets the build type. The shortcut is also valid. - Run without this option to see available types. + --type=TYPE Sets the build type. Shortcuts are also valid. + Run without this option to see all available types. + Multiple values are allowed and managed in the input + order. So --type=b stands for Bootloader build, while + --type=ab stands for "Backlight MOD" build. + --language=LANG Set the language used for voice generation (used only if + TYPE is AV). + + --tts=ENGINE Set the TTS engine used for voice generation (used only + if TYPE is AV). + + --voice=VOICE Set voice to use with selected TTS (used only if TYPE is + AV). + + --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV). + + --encopts=OPTS Set encoder manual options (used only if ATYPE is AV). + --rbdir=dir Use alternative rockbox directory (default: ${rbdir}). This is useful for having multiple alternate builds on your device that you can load with ROLO. However as the @@ -744,7 +798,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:" @@ -2209,10 +2263,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 @@ -2225,24 +2279,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 @@ -2265,7 +2319,7 @@ *) ;; esac -if [ "1" != `parse_args --type` ]; then +if [ "1" != "`parse_args --type`" ]; then btype=`parse_args --type`; else echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)" @@ -2327,9 +2381,9 @@ flash="" echo "Simulator build selected" ;; - [Aa]) + [Aa]*) echo "Advanced build selected" - whichadvanced + whichadvanced $btype ;; [Gg]) extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES @@ -2503,11 +2557,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)" @@ -2608,12 +2662,10 @@ #### Fix the cmdline ### if test -n "$ccache"; then - cmdline="--ccache" + cmdline="--ccache " fi -cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype" - - +cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts" ### end of cmdline sed > Makefile \