summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2007-08-13 12:31:18 +0000
committerJonas Häggqvist <rasher@rasher.dk>2007-08-13 12:31:18 +0000
commit8a6383884bb3ff25edffe1853deedec6094a8811 (patch)
tree65b4584022fd538f60d7dbbd007706c5ee2294fa /tools
parent45ffc87030f1fa3d49b10cc61c1d2d748ffd3e3f (diff)
downloadrockbox-8a6383884bb3ff25edffe1853deedec6094a8811.tar.gz
rockbox-8a6383884bb3ff25edffe1853deedec6094a8811.zip
More elegant (and robust) check for program availability.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14311 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/configure16
-rw-r--r--tools/voicecommon.sh16
2 files changed, 16 insertions, 16 deletions
diff --git a/tools/configure b/tools/configure
index 041c7d3f8d..0bbb9584a7 100755
--- a/tools/configure
+++ b/tools/configure
@@ -327,7 +327,7 @@ voiceconfig () {
327 echo "Building $thislang voice for $archos. Select options" 327 echo "Building $thislang voice for $archos. Select options"
328 echo "" 328 echo ""
329 329
330 if [ "`which flite`" != "" ]; then 330 if [ -f "`which flite`" ]; then
331 FLITE="F(l)ite " 331 FLITE="F(l)ite "
332 FLITE_OPTS="FLITE_OPTS=\"\"" 332 FLITE_OPTS="FLITE_OPTS=\"\""
333 DEFAULT_TTS="flite" 333 DEFAULT_TTS="flite"
@@ -335,7 +335,7 @@ voiceconfig () {
335 DEFAULT_NOISEFLOOR="500" 335 DEFAULT_NOISEFLOOR="500"
336 DEFAULT_CHOICE="L" 336 DEFAULT_CHOICE="L"
337 fi 337 fi
338 if [ "`which espeak`" != "" ]; then 338 if [ -f "`which espeak`" ]; then
339 ESPEAK="(e)Speak " 339 ESPEAK="(e)Speak "
340 ESPEAK_OPTS="ESPEAK_OPTS=\"\"" 340 ESPEAK_OPTS="ESPEAK_OPTS=\"\""
341 DEFAULT_TTS="espeak" 341 DEFAULT_TTS="espeak"
@@ -343,7 +343,7 @@ voiceconfig () {
343 DEFAULT_NOISEFLOOR="500" 343 DEFAULT_NOISEFLOOR="500"
344 DEFAULT_CHOICE="e" 344 DEFAULT_CHOICE="e"
345 fi 345 fi
346 if [ "`which festival`" != "" ]; then 346 if [ -f "`which festival`" ]; then
347 FESTIVAL="(F)estival " 347 FESTIVAL="(F)estival "
348 FESTIVAL_OPTS="FESTIVAL_OPTS=\"\"" 348 FESTIVAL_OPTS="FESTIVAL_OPTS=\"\""
349 DEFAULT_TTS="festival" 349 DEFAULT_TTS="festival"
@@ -352,7 +352,7 @@ voiceconfig () {
352 DEFAULT_CHOICE="F" 352 DEFAULT_CHOICE="F"
353 fi 353 fi
354 # Allow SAPI if Windows is in use 354 # Allow SAPI if Windows is in use
355 if [ "`which winver`" != "" ]; then 355 if [ -f "`which winver`" ]; then
356 SAPI5="(S)API5 " 356 SAPI5="(S)API5 "
357 SAPI5_OPTS="SAPI5_OPTS=\"\"" 357 SAPI5_OPTS="SAPI5_OPTS=\"\""
358 DEFAULT_TTS="sapi5" 358 DEFAULT_TTS="sapi5"
@@ -405,21 +405,21 @@ voiceconfig () {
405 405
406 echo "" 406 echo ""
407 407
408 if [ "`which oggenc`" != "" ]; then 408 if [ -f "`which oggenc`" ]; then
409 OGGENC="(O)ggenc " 409 OGGENC="(O)ggenc "
410 DEFAULT_ENC="oggenc" 410 DEFAULT_ENC="oggenc"
411 VORBIS_OPTS="VORBIS_OPTS=\"-q0 --downmix\"" 411 VORBIS_OPTS="VORBIS_OPTS=\"-q0 --downmix\""
412 DEFAULT_ENC_OPTS=$VORBIS_OPTS 412 DEFAULT_ENC_OPTS=$VORBIS_OPTS
413 DEFAULT_CHOICE="O" 413 DEFAULT_CHOICE="O"
414 fi 414 fi
415 if [ "`which speexenc`" != "" ]; then 415 if [ -f "`which speexenc`" ]; then
416 SPEEXENC="(S)peexenc " 416 SPEEXENC="(S)peexenc "
417 DEFAULT_ENC="speexenc" 417 DEFAULT_ENC="speexenc"
418 SPEEX_OPTS="" # TODO: find appropriate options for speex 418 SPEEX_OPTS="" # TODO: find appropriate options for speex
419 DEFAULT_ENC_OPTS=$SPEEX_OPTS 419 DEFAULT_ENC_OPTS=$SPEEX_OPTS
420 DEFAULT_CHOICE="S" 420 DEFAULT_CHOICE="S"
421 fi 421 fi
422 if [ "`which lame`" != "" ]; then 422 if [ -f "`which lame`" ]; then
423 LAME="(L)ame " 423 LAME="(L)ame "
424 DEFAULT_ENC="lame" 424 DEFAULT_ENC="lame"
425 LAME_OPTS="LAME_OPTS=\"--resample 12 -t -m m -h -V 9 -S\"" 425 LAME_OPTS="LAME_OPTS=\"--resample 12 -t -m m -h -V 9 -S\""
@@ -463,7 +463,7 @@ voiceconfig () {
463 fi 463 fi
464 464
465 TEMPDIR="${pwd}" 465 TEMPDIR="${pwd}"
466 if [ "`which cygpath`" != "" ]; then 466 if [ -f "`which cygpath`" ]; then
467 TEMPDIR=`cygpath . -a -w` 467 TEMPDIR=`cygpath . -a -w`
468 fi 468 fi
469 469
diff --git a/tools/voicecommon.sh b/tools/voicecommon.sh
index 61e0d07bdd..052e73b67a 100644
--- a/tools/voicecommon.sh
+++ b/tools/voicecommon.sh
@@ -53,7 +53,7 @@ TOOLSDIR=`dirname $0`
53WAVTRIM=$TOOLSDIR/wavtrim 53WAVTRIM=$TOOLSDIR/wavtrim
54 54
55# The SAPI5 script directory 55# The SAPI5 script directory
56if [ "`which cygpath`" != "" ]; then 56if [ -f "`which cygpath`" ]; then
57 SAPI5DIR=`cygpath $TOOLSDIR -a -w` 57 SAPI5DIR=`cygpath $TOOLSDIR -a -w`
58fi 58fi
59 59
@@ -128,14 +128,14 @@ init_tts() {
128 case $TTS_ENGINE in 128 case $TTS_ENGINE in
129 festival) 129 festival)
130 # Check for festival_client 130 # Check for festival_client
131 if [ "`which $FESTIVAL_CLIENT`" = "" ]; then 131 if [ -f "`which $FESTIVAL_CLIENT`" ]; then
132 echo "Error: $FESTIVAL_CLIENT not found" 132 echo "Error: $FESTIVAL_CLIENT not found"
133 exit 4 133 exit 4
134 fi 134 fi
135 135
136 # Check for, and start festival server if specified 136 # Check for, and start festival server if specified
137 if [ X$FESTIVAL_START = XY ]; then 137 if [ X$FESTIVAL_START = XY ]; then
138 if [ "`which $FESTIVAL_BIN`" = "" ]; then 138 if [ -f "`which $FESTIVAL_BIN`" ]; then
139 echo "Error: $FESTIVAL_BIN not found" 139 echo "Error: $FESTIVAL_BIN not found"
140 exit 3 140 exit 3
141 fi 141 fi
@@ -160,14 +160,14 @@ init_tts() {
160 ;; 160 ;;
161 flite) 161 flite)
162 # Check for flite 162 # Check for flite
163 if [ "`which $FLITE_BIN`" = "" ]; then 163 if [ -f "`which $FLITE_BIN`" ]; then
164 echo "Error: $FLITE_BIN not found" 164 echo "Error: $FLITE_BIN not found"
165 exit 5 165 exit 5
166 fi 166 fi
167 ;; 167 ;;
168 espeak) 168 espeak)
169 # Check for espeak 169 # Check for espeak
170 if [ "`which $ESPEAK_BIN`" = "" ]; then 170 if [ -f "`which $ESPEAK_BIN`" ]; then
171 echo "Error: $ESPEAK_BIN not found" 171 echo "Error: $ESPEAK_BIN not found"
172 exit 5 172 exit 5
173 fi 173 fi
@@ -208,21 +208,21 @@ init_encoder() {
208 case $ENCODER in 208 case $ENCODER in
209 lame) 209 lame)
210 # Check for lame binary 210 # Check for lame binary
211 if [ "" = "`which $LAME_BIN`" ]; then 211 if [ -f "`which $LAME_BIN`" ]; then
212 echo "Error: $LAME_BIN not found" 212 echo "Error: $LAME_BIN not found"
213 exit 6 213 exit 6
214 fi 214 fi
215 ;; 215 ;;
216 speex) 216 speex)
217 # Check for speexenc binary 217 # Check for speexenc binary
218 if [ "" = "`which $SPEEX_BIN`" ]; then 218 if [ -f "`which $SPEEX_BIN`" ]; then
219 echo "Error: $SPEEX_BIN not found" 219 echo "Error: $SPEEX_BIN not found"
220 exit 7 220 exit 7
221 fi 221 fi
222 ;; 222 ;;
223 vorbis) 223 vorbis)
224 # Check for vorbis encoder binary 224 # Check for vorbis encoder binary
225 if [ "" = "`which $VORBIS_BIN`" ]; then 225 if [ -f "`which $VORBIS_BIN`" ]; then
226 echo "Error: $VORBIS_BIN not found" 226 echo "Error: $VORBIS_BIN not found"
227 exit 10 227 exit 10
228 fi 228 fi