diff options
Diffstat (limited to 'tools/configure')
-rwxr-xr-x | tools/configure | 132 |
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 | ||
45 | simul () { | 45 | simul () { |
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 | |||
68 | sed > Makefile \ | 47 | sed > 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 | ||
82 | ARCHOS=@ARCHOS@ | 60 | ARCHOS=@ARCHOS@ |
83 | SIMDIR=@SIMDIR@ | 61 | ROOTDIR=@ROOTDIR@ |
84 | TOOLSDIR=@TOOLSDIR@ | 62 | SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@ |
63 | TOOLSDIR=\$(ROOTDIR)/tools | ||
85 | DEBUG=@DEBUG@ | 64 | DEBUG=@DEBUG@ |
86 | TARGET=@TARGET@ | 65 | TARGET=@TARGET@ |
87 | DISPLAY=@DISPLAY@ | 66 | DISPLAY=@DISPLAY@ |
@@ -120,7 +99,7 @@ EOF | |||
120 | 99 | ||
121 | picklang() { | 100 | picklang() { |
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 |
331 | fi | 311 | fi |
332 | 312 | ||
333 | ################################################################## | 313 | if [ -z "$rootdir" ]; then |
334 | # Figure out where the firmware code is! | 314 | ################################################################## |
335 | # | 315 | # Figure out where the source code root is! |
336 | 316 | # | |
337 | firmfile="crt0.S" # a file to check for in the firmware root dir | ||
338 | |||
339 | for dir in firmware . .. ../firmware ../../firmware; do | ||
340 | if [ -f $dir/$firmfile ]; then | ||
341 | firmdir=$dir | ||
342 | break | ||
343 | fi | ||
344 | done | ||
345 | |||
346 | if [ -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` | ||
351 | fi | ||
352 | |||
353 | ################################################################## | ||
354 | # Figure out where the apps code is! | ||
355 | # | ||
356 | |||
357 | appsfile="credits.c" # a file to check for in the apps root dir | ||
358 | |||
359 | for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do | ||
360 | if [ -f $dir/$appsfile ]; then | ||
361 | appsdir=$dir | ||
362 | break | ||
363 | fi | ||
364 | done | ||
365 | |||
366 | if [ -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` | ||
371 | fi | ||
372 | |||
373 | ################################################################## | ||
374 | # Figure out where the tools directory is! | ||
375 | # | ||
376 | 317 | ||
377 | toolsfile="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 | ||
379 | for 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 |
384 | done | 325 | done |
385 | 326 | ||
386 | if [ -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 | ||
400 | fi | 343 | fi |
401 | 344 | ||
402 | if [ -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` | ||
407 | fi | ||
408 | 345 | ||
409 | if [ -z "$language" ]; then | 346 | if [ -z "$language" ]; then |
410 | 347 | ||
@@ -427,9 +364,7 @@ if [ "yes" = "$simulator" ]; then | |||
427 | fi | 364 | fi |
428 | 365 | ||
429 | sed > Makefile \ | 366 | sed > 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 | ||
442 | FIRMDIR=@FIRMDIR@ | 377 | ROOTDIR=@ROOTDIR@ |
443 | APPSDIR=@APPSDIR@ | 378 | FIRMDIR=\$(ROOTDIR)/firmware |
444 | TOOLSDIR=@TOOLSDIR@ | 379 | APPSDIR=\$(ROOTDIR)/apps |
380 | TOOLSDIR=\$(ROOTDIR)/tools | ||
445 | DEBUG=@DEBUG@ | 381 | DEBUG=@DEBUG@ |
446 | ARCHOS=@ARCHOS@ | 382 | ARCHOS=@ARCHOS@ |
447 | TARGET=@TARGET@ | 383 | TARGET=@TARGET@ |