summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-20 06:38:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-20 06:38:38 +0000
commitebe963d5540b7669ca30d747f17d1d37addf90de (patch)
tree7cdc0d2a0faf66338b4e3142f7321e717a71c2a9
parent20963dd8013b8d486b8a3a5155eaefda91d6d428 (diff)
downloadrockbox-ebe963d5540b7669ca30d747f17d1d37addf90de.tar.gz
rockbox-ebe963d5540b7669ca30d747f17d1d37addf90de.zip
Added "select a language" stuff
Made the extra_defines a bit different (to prevent it from growing all the time on "configure update" invokes) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2341 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/configure115
1 files changed, 76 insertions, 39 deletions
diff --git a/tools/configure b/tools/configure
index d5d20b3a12..5d1df355c2 100755
--- a/tools/configure
+++ b/tools/configure
@@ -11,8 +11,6 @@
11target=$1 11target=$1
12debug=$2 12debug=$2
13 13
14extra_defines="-"
15
16if test "$1" = "--help"; then 14if test "$1" = "--help"; then
17 echo "Rockbox configure script." 15 echo "Rockbox configure script."
18 echo "Invoke this in a directory to generate a Makefile to build Rockbox" 16 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
@@ -92,8 +90,9 @@ sed > Makefile \
92 -e "s,@DISPLAY@,${display},g" \ 90 -e "s,@DISPLAY@,${display},g" \
93 -e "s,@KEYPAD@,${keypad},g" \ 91 -e "s,@KEYPAD@,${keypad},g" \
94 -e "s,@PWD@,${pwd},g" \ 92 -e "s,@PWD@,${pwd},g" \
93 -e "s,@LANGUAGE@,${language},g" \
95 -e "s,@SIMVER@,${simver},g" \ 94 -e "s,@SIMVER@,${simver},g" \
96 -e "s,@EXTRA_DEFINES@,\"${extra_defines}\",g" \ 95 -e "s,@EXTRA_DEFINES@,${extra_defines},g" \
97<<EOF 96<<EOF
98## Automaticly generated. http://rockbox.haxx.se 97## Automaticly generated. http://rockbox.haxx.se
99 98
@@ -104,6 +103,7 @@ DISPLAY=@DISPLAY@
104KEYPAD=@KEYPAD@ 103KEYPAD=@KEYPAD@
105THISDIR="@PWD@" 104THISDIR="@PWD@"
106SIMVER=@SIMVER@ 105SIMVER=@SIMVER@
106LANGUAGE=@LANGUAGE@
107VERSION=\$(shell date +%y%m%d-%H%M) 107VERSION=\$(shell date +%y%m%d-%H%M)
108EXTRA_DEFINES=@EXTRA_DEFINES@ 108EXTRA_DEFINES=@EXTRA_DEFINES@
109 109
@@ -112,7 +112,7 @@ EXTRA_DEFINES=@EXTRA_DEFINES@
112all: sim 112all: sim
113 113
114sim: 114sim:
115 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) EXTRA_DEFINES=\$(EXTRA_DEFINES) 115 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
116 116
117clean: 117clean:
118 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean 118 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean
@@ -151,6 +151,7 @@ if [ "$target" = "update" ]; then
151 echo "Existing generated Makefile found. Getting defaults from it." 151 echo "Existing generated Makefile found. Getting defaults from it."
152 target=`grep "^TARGET=" Makefile | cut -d= -f2-` 152 target=`grep "^TARGET=" Makefile | cut -d= -f2-`
153 debug=`grep "^DEBUG=" Makefile | cut -d= -f2-` 153 debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
154 language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
154 extra_defines=`grep "^EXTRA_DEFINES=" Makefile | cut -d= -f2-` 155 extra_defines=`grep "^EXTRA_DEFINES=" Makefile | cut -d= -f2-`
155 156
156 if [ "$debug" = "SIMULATOR=1" ]; then 157 if [ "$debug" = "SIMULATOR=1" ]; then
@@ -206,28 +207,25 @@ if [ -z "$target" ]; then
206 esac 207 esac
207fi 208fi
208 209
209if [ "-" = "$extra_defines" ]; then 210if [ -z "$extra_defines" ]; then
210 extra_defines="" 211 if [ "-DARCHOS_RECORDER" = "$target" ] ; then
211 212 disable_demos="-DDISABLE_NOTHING"
212 if [ "-DARCHOS_RECORDER" = "$target" ] ; then 213 disable_games=""
213 214
214 echo "Do you want to use Demos? (Y)" 215 echo "Do you want to use Demos? (Y)"
215 getit=`input`; 216 getit=`input`;
216 if [ "n" = "$getit" -o "N" = "$getit" ] ; then 217 if [ "n" = "$getit" -o "N" = "$getit" ] ; then
217 extra_defines="$extra_defines -DDISABLE_DEMOS" 218 disable_demos="-DDISABLE_DEMOS"
218 else 219 fi
219 extra_defines="$extra_defines"
220 fi
221
222 echo "Do you want to play Games? (Y)"
223 getit=`input`;
224 if [ "n" = "$getit" -o "N" = "$getit" ] ; then
225 extra_defines="$extra_defines -DDISABLE_GAMES"
226 else
227 extra_defines="$extra_defines"
228 fi
229 220
230 fi 221 echo "Do you want to play Games? (Y)"
222 getit=`input`;
223 if [ "n" = "$getit" -o "N" = "$getit" ] ; then
224 disable_games=" -DDISABLE_GAMES"
225 fi
226
227 extra_defines="$disable_demos$disable_games"
228 fi
231fi 229fi
232 230
233 231
@@ -288,25 +286,68 @@ fi
288appsfile="credits.c" # a file to check for in the apps root dir 286appsfile="credits.c" # a file to check for in the apps root dir
289 287
290for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do 288for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do
291 if [ -f $dir/$appsfile ]; then 289 if [ -f $dir/$appsfile ]; then
292 appsdir=$dir 290 appsdir=$dir
293 break 291 break
294 fi 292 fi
295done 293done
296 294
297if [ -z "$appsdir" ]; then 295if [ -z "$appsdir" ]; then
298 echo "This script couldn't find your apps directory. Please enter the" 296 echo "This script couldn't find your apps directory. Please enter the"
299 echo "full path to the apps directory here:" 297 echo "full path to the apps directory here:"
300 298
301 appsdir=`input` 299 appsdir=`input`
302fi 300fi
303 301
302picklang() {
303 # figure out which languages that are around
304 for file in $appsdir/lang/*.lang; do
305 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
306 langs="$langs $clean"
307 done
308
309 num=1
310 for one in $langs; do
311 echo "$num. $one"
312 num=`expr $num + 1`
313 done
314
315 read pick
316 return $pick;
317}
318
319whichlang() {
320 num=1
321 for one in $langs; do
322 if [ "$num" = "$pick" ]; then
323 echo $one
324 return
325 fi
326 num=`expr $num + 1`
327 done
328}
329
330if [ -z "$language" ]; then
331
332 echo "Select a number for the language to use (default is english)"
333
334 picklang
335 language=`whichlang`
336
337 if [ -z "$language" ]; then
338 # pick a default
339 language="english"
340 fi
341fi
342
343
304sed > Makefile \ 344sed > Makefile \
305 -e "s,@FIRMDIR@,${firmdir},g" \ 345 -e "s,@FIRMDIR@,${firmdir},g" \
306 -e "s,@APPSDIR@,${appsdir},g" \ 346 -e "s,@APPSDIR@,${appsdir},g" \
307 -e "s,@DEBUG@,${debug},g" \ 347 -e "s,@DEBUG@,${debug},g" \
308 -e "s,@TARGET@,${target},g" \ 348 -e "s,@TARGET@,${target},g" \
309 -e "s,@EXTRA_DEFINES@,\"${extra_defines}\",g" \ 349 -e "s,@LANGUAGE@,${language},g" \
350 -e "s,@EXTRA_DEFINES@,${extra_defines},g" \
310 -e "s,@PWD@,${pwd},g" \ 351 -e "s,@PWD@,${pwd},g" \
311<<EOF 352<<EOF
312## Automaticly generated. http://rockbox.haxx.se 353## Automaticly generated. http://rockbox.haxx.se
@@ -316,6 +357,7 @@ APPSDIR=@APPSDIR@
316DEBUG=@DEBUG@ 357DEBUG=@DEBUG@
317TARGET=@TARGET@ 358TARGET=@TARGET@
318THISDIR="@PWD@" 359THISDIR="@PWD@"
360LANGUAGE=@LANGUAGE@
319VERSION=\$(shell date +%y%m%d-%H%M) 361VERSION=\$(shell date +%y%m%d-%H%M)
320 362
321EXTRA_DEFINES=@EXTRA_DEFINES@ 363EXTRA_DEFINES=@EXTRA_DEFINES@
@@ -324,10 +366,10 @@ EXTRA_DEFINES=@EXTRA_DEFINES@
324all: firmware apps 366all: firmware apps
325 367
326firmware: 368firmware:
327 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES=\$(EXTRA_DEFINES) 369 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
328 370
329apps: 371apps:
330 \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) EXTRA_DEFINES=\$(EXTRA_DEFINES) 372 \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES=\$(EXTRA_DEFINES)
331 373
332clean-firmware: 374clean-firmware:
333 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean 375 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
@@ -350,8 +392,3 @@ tags:
350EOF 392EOF
351 393
352echo "Created Makefile" 394echo "Created Makefile"
353
354
355
356
357