Index: tools/configure =================================================================== --- tools/configure (revisione 22232) +++ tools/configure (copia locale) @@ -151,7 +151,7 @@ GCCOPTS="$GCCOPTS -I\$(SIMDIR)" if test "X$crosscompile" != "Xyes"; then - if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then + if [ `uname -m` = "x86_64" -o `uname -m` = "amd64" ]; then # fPIC is needed to make shared objects link # setting visibility to hidden is necessary to avoid strange crashes # due to symbol clashing @@ -403,7 +403,7 @@ if [ "$interact" ]; then cont=0 else - echo "[ERROR] Option $option unsupported" + echo "[WARNING] Option $option unsupported" fi ;; esac @@ -412,17 +412,19 @@ [ "$atype" ] || cont=0 fi done - echo "done" + [ "$interact" ] && echo "done" if [ "yes" = "$voice" ]; then # Ask about languages to build picklang voicelanguage=`whichlang` - echo "Voice language set to $voicelanguage" + echo "Voice languages set to $voicelanguage" # Configure encoder and TTS engine for each language - for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do - voiceconfig "$thislang" + ilang=1 + for thislang in `echo $voicelanguage | tr , ' '`; do + voiceconfig $thislang $ilang + ilang=`expr $ilang + 1` done fi if [ "yes" = "$use_debug" ]; then @@ -447,8 +449,10 @@ # Configure voice settings voiceconfig () { thislang=$1 + thisnum=$2 + echo "Building voice $thislang for $modelname" if [ ! "$ARG_TTS" ]; then - echo "Building $thislang voice for $modelname. Select options" + echo "Select options" echo "" fi @@ -458,7 +462,7 @@ DEFAULT_TTS="flite" DEFAULT_TTS_OPTS=$FLITE_OPTS DEFAULT_NOISEFLOOR="500" - DEFAULT_CHOICE="L" + DEFAULT_CHOICE="l" fi if [ -n "`findtool espeak`" ]; then ESPEAK="(e)Speak " @@ -490,7 +494,7 @@ DEFAULT_TTS="festival" DEFAULT_TTS_OPTS=$FESTIVAL_OPTS DEFAULT_NOISEFLOOR="500" - DEFAULT_CHOICE="F" + DEFAULT_CHOICE="f" fi if [ -n "`findtool swift`" ]; then SWIFT="S(w)ift " @@ -507,69 +511,72 @@ DEFAULT_TTS="sapi" DEFAULT_TTS_OPTS=$SAPI_OPTS DEFAULT_NOISEFLOOR="500" - DEFAULT_CHOICE="S" + DEFAULT_CHOICE="s" fi - if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then + if [ "$FESTIVAL" = "$FLITE" -a "$FLITE" = "$ESPEAK" -a "$ESPEAK" = "$SAPI" -a "$SAPI" = "$SWIFT" ]; then echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files" exit 3 fi if [ "$ARG_TTS" ]; then - option=$ARG_TTS + option=`echo "$ARG_TTS" | cut -d , -f $thisnum` else echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" option=`input` fi - advopts="$advopts --tts=$option" + if [ "$CMDLINE_TTS" ]; then + CMDLINE_TTS=$CMDLINE_TTS,$option + else + CMDLINE_TTS=$option + fi case "$option" in [Ll]) - TTS_ENGINE="flite" - NOISEFLOOR="500" # TODO: check this value - TTS_OPTS=$FLITE_OPTS - ;; + TTS_ENGINE="flite" + NOISEFLOOR="500" # TODO: check this value + TTS_OPTS=$FLITE_OPTS + ;; [Ee]) - TTS_ENGINE="espeak" - NOISEFLOOR="500" - TTS_OPTS=$ESPEAK_OPTS - ;; + TTS_ENGINE="espeak" + NOISEFLOOR="500" + TTS_OPTS=$ESPEAK_OPTS + ;; [Ff]) - TTS_ENGINE="festival" - NOISEFLOOR="500" - TTS_OPTS=$FESTIVAL_OPTS - ;; + TTS_ENGINE="festival" + NOISEFLOOR="500" + TTS_OPTS=$FESTIVAL_OPTS + ;; [Ss]) - TTS_ENGINE="sapi" - NOISEFLOOR="500" - TTS_OPTS=$SAPI_OPTS - ;; - [Ww]) - TTS_ENGINE="swift" - NOISEFLOOR="500" - TTS_OPTS=$SWIFT_OPTS - ;; + TTS_ENGINE="sapi" + NOISEFLOOR="500" + TTS_OPTS=$SAPI_OPTS + ;; + [Ww]) + TTS_ENGINE="swift" + NOISEFLOOR="500" + TTS_OPTS=$SWIFT_OPTS + ;; *) - TTS_ENGINE=$DEFAULT_TTS - TTS_OPTS=$DEFAULT_TTS_OPTS - NOISEFLOOR=$DEFAULT_NOISEFLOOR + TTS_ENGINE=$DEFAULT_TTS + TTS_OPTS=$DEFAULT_TTS_OPTS + NOISEFLOOR=$DEFAULT_NOISEFLOOR + ;; esac + if [ "$CMDLINE_TTSENGINE" ]; then + CMDLINE_TTSENGINE=$CMDLINE_TTSENGINE,$TTS_ENGINE + else + CMDLINE_TTSENGINE=$TTS_ENGINE + fi echo "Using $TTS_ENGINE for TTS" # Select which voice to use for Festival if [ "$TTS_ENGINE" = "festival" ]; then - 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 + voicelist=`echo '(voice.list)' | festival -i 2> /dev/null | grep '^festival> (.*)$' | sed 's/.*(\(.*\))/\1/' | tr ' ' '\n'` + TTS_FESTIVAL_VOICE=`echo "$voicelist" | head -n 1` # Default choice if [ "$ARG_VOICE" ]; then - CHOICE=$ARG_VOICE + CHOICE=`echo "$ARG_VOICE" | cut -d , -f $thisnum` else - i=1 - for voice in $voicelist; do - printf "%3d. %s\n" "$i" "$voice" - i=`expr $i + 1` - done + echo "$voicelist" | nl -w 3 -n rn -s '. ' printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " CHOICE=`input` fi @@ -577,27 +584,36 @@ for voice in $voicelist; do if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then TTS_FESTIVAL_VOICE="$voice" + break fi i=`expr $i + 1` done - advopts="$advopts --voice=$CHOICE" + if [ "$CMDLINE_VOICE" ]; then + CMDLINE_VOICE=$CMDLINE_VOICE,$TTS_FESTIVAL_VOICE + else + CMDLINE_VOICE=$TTS_FESTIVAL_VOICE + fi 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 if [ "$ARG_TTSOPTS" ]; then - USER_TTS_OPTS=$ARG_TTSOPTS + USER_TTS_OPTS=`echo "$ARG_TTSOPTS" | cut -d , -f $thisnum` 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" + if [ "$CMDLINE_TTSOPTS" ]; then + CMDLINE_TTSOPTS=$CMDLINE_TTSOPTS,$TTS_OPTS + else + CMDLINE_TTSOPTS=$TTS_OPTS + fi + [ `echo "$TTS_OPTS" | tr -d ' '` ] && echo "$TTS_ENGINE options set to '$TTS_OPTS'" if [ "$swcodec" = "yes" ]; then ENCODER="rbspeexenc" @@ -614,21 +630,24 @@ exit 4 fi fi - echo "Using $ENCODER for encoding voice clips" # Allow the user to input manual commandline options if [ "$ARG_ENCOPTS" ]; then - USER_ENC_OPTS=$ARG_ENCOPTS + USER_ENC_OPTS=`echo "$ARG_ENCOPTS" | cut -d , -f $thisnum` 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" + if [ "$CMDLINE_ENCOPTS" ]; then + CMDLINE_ENCOPTS=$CMDLINE_ENCOPTS,$ENC_OPTS + else + CMDLINE_ENCOPTS=$ENC_OPTS + fi + [ `echo "$ENC_OPTS" | tr -d ' '` ] && echo "$ENCODER options set to '$ENC_OPTS'" TEMPDIR="${pwd}" if [ -n "`findtool cygpath`" ]; then @@ -638,48 +657,39 @@ picklang() { # figure out which languages that are around - for file in $rootdir/apps/lang/*.lang; do - clean=`basename $file .lang` - langs="$langs $clean" - done + langs=`ls $rootdir/apps/lang/*.lang 2> /dev/null | sed 's,.*/\(.*\)\.lang$,\1,'` if [ "$ARG_LANG" ]; then pick=$ARG_LANG 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" + echo "You may enter a comma-separated list of languages to build" - num=1 - for one in $langs; do - echo "$num. $one" - num=`expr $num + 1` - done + echo "$langs" | nl -w 3 -n rn -s '. ' pick=`input` fi - advopts="$advopts --language=$pick" } whichlang() { output="" # Allow the user to pass a comma-separated list of langauges - for thispick in `echo $pick | sed 's/,/ /g'`; do + for thispick in `echo $pick | tr , ' '`; do num=1 for one in $langs; do # Accept both the language number and name - if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then - if [ "$output" = "" ]; then + if [ "$num" = "$thispick" -o "$thispick" = "$one" ]; then + if [ "$output" ]; then + output=$output,$one + else output=$one - else - output=$output,$one fi fi num=`expr $num + 1` done done if [ -z "$output" ]; then - # pick a default - output="english" + # pick a default + output=english fi echo $output } @@ -734,7 +744,7 @@ EOF - exit + exit 0 } ARG_CCACHE= @@ -749,25 +759,30 @@ ARG_VOICE= err= for arg in "$@"; do - case "$arg" in - --ccache) ARG_CCACHE=1;; - --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;; - --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;; - --no-ccache) ARG_CCACHE=0;; - --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;; - --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;; - --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;; - --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;; - --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;; - --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;; - --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;; - --help) help;; - *) err=1; echo "[ERROR] Option '$arg' unsupported";; - esac + val=`echo "$arg" | cut -d = -f 2` + case "$arg" in + --ccache) ARG_CCACHE=1;; + --encopts=*) ARG_ENCOPTS=$val;; + --language=*) ARG_LANG=$val;; + --no-ccache) ARG_CCACHE=0;; + --ram=*) ARG_RAM=$val;; + --rbdir=*) ARG_RBDIR=$val;; + --target=*) ARG_TARGET=$val;; + --tts=*) ARG_TTS=$val;; + --ttsopts=*) ARG_TTSOPTS=$val;; + --type=*) ARG_TYPE=$val;; + --voice=*) ARG_VOICE=$val;; + --help) help;; + *) err=1; echo "[ERROR] Option '$arg' unsupported";; + esac done [ "$err" ] && exit 1 -advopts= +CMDLINE_ENCOPTS= +CMDLINE_TTS= +CMDLINE_TTSENGINE= +CMDLINE_TTSOPTS= +CMDLINE_VOICE= if [ "$TMPDIR" != "" ]; then tmpdir=$TMPDIR @@ -797,7 +812,7 @@ # get our current directory pwd=`pwd`; -if { echo $pwd | grep " "; } then +if echo $pwd | grep -q ' '; then echo "You're running this script in a path that contains space. The build" echo "system is unfortunately not clever enough to deal with this. Please" echo "run the script from a different path, rename the path or fix the build" @@ -809,17 +824,19 @@ ################################################################## # Figure out where the source code root is! # - rootdir=`dirname $0`/../ + rootdir=`dirname $0`/.. ##################################################################### # Convert the possibly relative directory name to an absolute version # - now=`pwd` - cd $rootdir - rootdir=`pwd` - - # cd back to the build dir - cd $now + rootdir=`cd "$rootdir"; pwd` + if echo $rootdir | grep -q ' '; then + echo "The source code root directory has a path that contains space. The build" + echo "system is unfortunately not clever enough to deal with this. Please" + echo "store the source tree in a different path, rename the path or fix the build" + echo "system!" + exit 6 + fi fi apps="apps" @@ -1663,7 +1680,7 @@ t_manufacturer="tcc77x" t_model="logikdax" ;; - + 90|creativezvm30gb) target_id=35 modelname="creativezvm30" @@ -2565,25 +2582,24 @@ fi # Now, figure out version number of the (gcc) compiler we are about to use -gccver=`$CC -dumpversion`; - -# figure out the binutil version too and display it, mostly for the build -# system etc to be able to see it easier -if [ $uname = "Darwin" ]; then - ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'` -else - ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'` -fi - +gccver=`$CC -dumpversion 2> /dev/null` if [ -z "$gccver" ]; then - echo "[WARNING] The compiler you must use ($CC) is not in your path!" - echo "[WARNING] this may cause your build to fail since we cannot do the" - echo "[WARNING] checks we want now." + echo "[WARNING] The compiler you must use ($CC) is not in your path!" + echo "[WARNING] this may cause your build to fail since we cannot do the" + echo "[WARNING] checks we want now." else - # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't - # DEPEND on it + # figure out the binutil version too and display it, mostly for the build + # system etc to be able to see it easier + if [ $uname = "Darwin" ]; then + ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'` + else + ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'` + fi + # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't + # DEPEND on it + num1=`echo $gccver | cut -d . -f1` num2=`echo $gccver | cut -d . -f2` gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` @@ -2700,6 +2716,7 @@ if [ "$ARG_RBDIR" ]; then rbdir=$ARG_RBDIR + cmdline='--rbdir=$(RBDIR) ' echo "Using alternate rockbox dir: ${rbdir}" fi @@ -2765,17 +2782,18 @@ voicetoolset="voicefont wavtrim" fi -if test "$apps" = "apps"; then - # only when we build "real" apps we build the .lng files - buildlangs="langs" -fi - #### Fix the cmdline ### if test -n "$ccache"; then - cmdline="--ccache " + cmdline="$cmdline--ccache " fi -cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts" +advopts= +[ "$voicelanguage" ] && advopts="$advopts --language='$voicelanguage'" +[ "$CMDLINE_TTS" ] && advopts="$advopts --tts='$CMDLINE_TTS'" +[ "$CMDLINE_VOICE" ] && advopts="$advopts --voice='$CMDLINE_VOICE'" +[ "$CMDLINE_TTSOPTS" ] && advopts="$advopts --ttsopts='$CMDLINE_TTSOPTS'" +[ "$CMDLINE_ENCOPTS" ] && advopts="$advopts --encopts='$CMDLINE_ENCOPTS'" +cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --type=$btype$advopts" ### end of cmdline sed > Makefile \ @@ -2788,7 +2806,7 @@ -e "s,@MANUFACTURER@,${t_manufacturer},g" \ -e "s,@MODELNAME@,${modelname},g" \ -e "s,@LANGUAGE@,${language},g" \ - -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \ + -e "s!@VOICELANGUAGE@!${voicelanguage}!g" \ -e "s,@PWD@,${pwd},g" \ -e "s,@HOSTCC@,${HOSTCC},g" \ -e "s,@HOSTAR@,${HOSTAR},g" \ @@ -2833,15 +2851,14 @@ -e "${simmagic2}" \ -e "s,@MANUALDEV@,${manualdev},g" \ -e "s,@ENCODER@,${ENC_CMD},g" \ - -e "s,@ENC_OPTS@,${ENC_OPTS},g" \ - -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \ - -e "s,@TTS_OPTS@,${TTS_OPTS},g" \ + -e "s!@ENC_OPTS@!${CMDLINE_ENCOPTS}!g" \ + -e "s!@TTS_ENGINE@!${CMDLINE_TTSENGINE}!g" \ + -e "s!@TTS_OPTS@!${CMDLINE_TTSOPTS}!g" \ -e "s,@VOICETOOLSET@,${voicetoolset},g" \ - -e "s,@LANGS@,${buildlangs},g" \ -e "s,@USE_ELF@,${USE_ELF},g" \ -e "s,@RBDIR@,${rbdir},g" \ -e "s,@PREFIX@,$PREFIX,g" \ - -e "s,@CMDLINE@,$cmdline,g" \ + -e "s!@CMDLINE@!$cmdline!g" \ <