summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/configure132
1 files changed, 34 insertions, 98 deletions
diff --git a/tools/configure b/tools/configure
index 2554dfe3c4..2960e0c439 100755
--- a/tools/configure
+++ b/tools/configure
@@ -44,30 +44,8 @@ fi
44 44
45simul () { 45simul () {
46 46
47 ##################################################################
48 # Figure out where the firmware code is!
49 #
50
51 # a file to check for in the uisimulator root dir
52 simfile="$simver/lcd-$simver.c"
53
54 for dir in uisimulator . .. ../uisimulator ../../uisimulator; do
55 if [ -f "$dir/$simfile" ]; then
56 simdir="$dir/$simver"
57 break
58 fi
59 done
60
61 if [ -z "$simdir" ]; then
62 echo "This script couldn't find your uisimulator/$simver directory. Please enter the"
63 echo "full path to your uisimulator/$simver directory here:"
64
65 simdir=`input`
66 fi
67
68sed > Makefile \ 47sed > Makefile \
69 -e "s,@SIMDIR@,${simdir},g" \ 48 -e "s,@ROOTDIR@,${rootdir},g" \
70 -e "s,@TOOLSDIR@,${toolsdir},g" \
71 -e "s,@TARGET@,${target},g" \ 49 -e "s,@TARGET@,${target},g" \
72 -e "s,@ARCHOS@,${archos},g" \ 50 -e "s,@ARCHOS@,${archos},g" \
73 -e "s,@DEBUG@,${debug},g" \ 51 -e "s,@DEBUG@,${debug},g" \
@@ -80,8 +58,9 @@ sed > Makefile \
80## Automaticly generated. http://rockbox.haxx.se 58## Automaticly generated. http://rockbox.haxx.se
81 59
82ARCHOS=@ARCHOS@ 60ARCHOS=@ARCHOS@
83SIMDIR=@SIMDIR@ 61ROOTDIR=@ROOTDIR@
84TOOLSDIR=@TOOLSDIR@ 62SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
63TOOLSDIR=\$(ROOTDIR)/tools
85DEBUG=@DEBUG@ 64DEBUG=@DEBUG@
86TARGET=@TARGET@ 65TARGET=@TARGET@
87DISPLAY=@DISPLAY@ 66DISPLAY=@DISPLAY@
@@ -120,7 +99,7 @@ EOF
120 99
121picklang() { 100picklang() {
122 # figure out which languages that are around 101 # figure out which languages that are around
123 for file in $appsdir/lang/*.lang; do 102 for file in $rootdir/apps/lang/*.lang; do
124 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` 103 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
125 langs="$langs $clean" 104 langs="$langs $clean"
126 done 105 done
@@ -200,6 +179,7 @@ if [ "$target" = "update" ]; then
200 debug=`grep "^DEBUG=" Makefile | cut -d= -f2-` 179 debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
201 language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-` 180 language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
202 memory=`grep "^MEMORYSIZE=" Makefile | cut -d= -f2-` 181 memory=`grep "^MEMORYSIZE=" Makefile | cut -d= -f2-`
182 rootdir=`grep "^ROOTDIR=" Makefile | cut -d= -f2-`
203 183
204 if [ "$debug" = "SIMULATOR=1" ]; then 184 if [ "$debug" = "SIMULATOR=1" ]; then
205 simulator="yes" 185 simulator="yes"
@@ -330,81 +310,38 @@ if [ -z "$debug" ]; then
330 esac 310 esac
331fi 311fi
332 312
333################################################################## 313if [ -z "$rootdir" ]; then
334# Figure out where the firmware code is! 314 ##################################################################
335# 315 # Figure out where the source code root is!
336 316 #
337firmfile="crt0.S" # a file to check for in the firmware root dir
338
339for dir in firmware . .. ../firmware ../../firmware; do
340 if [ -f $dir/$firmfile ]; then
341 firmdir=$dir
342 break
343 fi
344done
345
346if [ -z "$firmdir" ]; then
347 echo "This script couldn't find your firmware directory. Please enter the"
348 echo "full path to the firmware directory here:"
349
350 firmdir=`input`
351fi
352
353##################################################################
354# Figure out where the apps code is!
355#
356
357appsfile="credits.c" # a file to check for in the apps root dir
358
359for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do
360 if [ -f $dir/$appsfile ]; then
361 appsdir=$dir
362 break
363 fi
364done
365
366if [ -z "$appsdir" ]; then
367 echo "This script couldn't find your apps directory. Please enter the"
368 echo "full path to the apps directory here:"
369
370 appsdir=`input`
371fi
372
373##################################################################
374# Figure out where the tools directory is!
375#
376 317
377toolsfile="descramble.c" # a file to check for in the tools root dir 318 firmfile="crt0.S" # a file to check for in the firmware root dir
378 319
379for dir in tools . .. ../tools ../../tools $firmdir/tools $firmdir/../tools; do 320 for dir in . .. ../..; do
380 if [ -f $dir/$toolsfile ]; then 321 if [ -f $dir/firmware/$firmfile ]; then
381 toolsdir="$dir" 322 rootdir=$dir
382 break 323 break
383 fi 324 fi
384done 325 done
385 326
386if [ -z "$toolsdir" ]; then 327 if [ -z "$rootdir" ]; then
387 # no file found, check if (some of) the necessary tools are in the PATH 328 echo "This script couldn't find your source code root directory. Please enter the"
388 # already 329 echo "full path to the source code directory here:"
389 330
390 toolsexe="scramble" 331 firmdir=`input`
332 fi
391 333
392 for dir in `echo $PATH | tr ':' ' '`; do 334 #####################################################################
393 if [ -x "$dir/$toolsexe" ]; then 335 # Convert the possibly relative directory name to an absolute version
394 echo "found $toolsexe in $dir" 336 #
395 toolsdir="$dir" 337 now=`pwd`
396 break 338 cd $rootdir
397 fi 339 rootdir=`pwd`
398 done
399 340
341 # cd back to the build dir
342 cd $now
400fi 343fi
401 344
402if [ -z "$toolsdir" ]; then
403 echo "This script couldn't find your tools directory. Please enter the"
404 echo "full path to the tools directory here:"
405
406 toolsdir=`input`
407fi
408 345
409if [ -z "$language" ]; then 346if [ -z "$language" ]; then
410 347
@@ -427,9 +364,7 @@ if [ "yes" = "$simulator" ]; then
427fi 364fi
428 365
429sed > Makefile \ 366sed > Makefile \
430 -e "s,@FIRMDIR@,${firmdir},g" \ 367 -e "s,@ROOTDIR@,${rootdir},g" \
431 -e "s,@APPSDIR@,${appsdir},g" \
432 -e "s,@TOOLSDIR@,${toolsdir},g" \
433 -e "s,@DEBUG@,${debug},g" \ 368 -e "s,@DEBUG@,${debug},g" \
434 -e "s,@MEMORY@,${memory},g" \ 369 -e "s,@MEMORY@,${memory},g" \
435 -e "s,@TARGET@,${target},g" \ 370 -e "s,@TARGET@,${target},g" \
@@ -439,9 +374,10 @@ sed > Makefile \
439<<EOF 374<<EOF
440## Automaticly generated. http://rockbox.haxx.se 375## Automaticly generated. http://rockbox.haxx.se
441 376
442FIRMDIR=@FIRMDIR@ 377ROOTDIR=@ROOTDIR@
443APPSDIR=@APPSDIR@ 378FIRMDIR=\$(ROOTDIR)/firmware
444TOOLSDIR=@TOOLSDIR@ 379APPSDIR=\$(ROOTDIR)/apps
380TOOLSDIR=\$(ROOTDIR)/tools
445DEBUG=@DEBUG@ 381DEBUG=@DEBUG@
446ARCHOS=@ARCHOS@ 382ARCHOS=@ARCHOS@
447TARGET=@TARGET@ 383TARGET=@TARGET@