diff options
-rw-r--r-- | docs/CREDITS | 1 | ||||
-rwxr-xr-x | tools/configure | 349 |
2 files changed, 200 insertions, 150 deletions
diff --git a/docs/CREDITS b/docs/CREDITS index 9326b865c0..f5de05b600 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -485,6 +485,7 @@ Mykhailo Radzievskyi | |||
485 | Christophe Gouiran | 485 | Christophe Gouiran |
486 | Asael Reiter | 486 | Asael Reiter |
487 | Jens Erdmann | 487 | Jens Erdmann |
488 | Rosso Maltese | ||
488 | 489 | ||
489 | The libmad team | 490 | The libmad team |
490 | The wavpack team | 491 | The wavpack team |
diff --git a/tools/configure b/tools/configure index 5b535e70c8..7c0853f457 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -72,33 +72,6 @@ findtool(){ | |||
72 | fi | 72 | fi |
73 | } | 73 | } |
74 | 74 | ||
75 | # parse the argument list, returns the value after the = in case of a | ||
76 | # option=value type option, returns 0 in case of --ccache or --no-ccache, | ||
77 | # returns 1 if the searched argument type wasn't fount in the argument list | ||
78 | # Usage [var = ]`parse_args <argumenttype>`, e.g. `parse_args --target` | ||
79 | |||
80 | # var definitons below are needed so that parse_args can see the arguments | ||
81 | arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9 | ||
82 | |||
83 | parse_args() { | ||
84 | ret="1" | ||
85 | for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9 | ||
86 | do | ||
87 | if [ "$1" = "--ccache" ]; then | ||
88 | if [ "$i" = "--ccache" ]; then | ||
89 | ret="0" | ||
90 | fi | ||
91 | elif [ "$1" = "--no-ccache" ]; then | ||
92 | if [ "$i" = "--no-ccache" ]; then | ||
93 | ret="0" | ||
94 | fi | ||
95 | elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then | ||
96 | ret=`echo $i|cut -d'=' -f2` | ||
97 | fi | ||
98 | done | ||
99 | echo "$ret" | ||
100 | } | ||
101 | |||
102 | simcc () { | 75 | simcc () { |
103 | 76 | ||
104 | # default tool setup for native building | 77 | # default tool setup for native building |
@@ -170,7 +143,7 @@ simcc () { | |||
170 | ;; | 143 | ;; |
171 | 144 | ||
172 | *) | 145 | *) |
173 | echo "Unsupported system: $uname, fix configure and retry" | 146 | echo "[ERROR] Unsupported system: $uname, fix configure and retry" |
174 | exit 2 | 147 | exit 2 |
175 | ;; | 148 | ;; |
176 | esac | 149 | esac |
@@ -328,41 +301,50 @@ mipselcc () { | |||
328 | } | 301 | } |
329 | 302 | ||
330 | whichadvanced () { | 303 | whichadvanced () { |
304 | atype=`echo "$1" | cut -c 2-` | ||
331 | ################################################################## | 305 | ################################################################## |
332 | # Prompt for specific developer options | 306 | # Prompt for specific developer options |
333 | # | 307 | # |
334 | echo "" | 308 | if [ "$atype" ]; then |
335 | echo "Enter your developer options (press enter when done)" | 309 | interact= |
336 | printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" | 310 | else |
337 | if [ "$memory" = "2" ]; then | 311 | interact=1 |
338 | printf ", (8)MB MOD" | 312 | echo "" |
339 | fi | 313 | echo "Enter your developer options (press enter when done)" |
340 | if [ "$modelname" = "player" ]; then | 314 | printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice" |
341 | printf ", Use (A)TA poweroff" | 315 | if [ "$memory" = "2" ]; then |
342 | fi | 316 | printf ", (8)MB MOD" |
343 | if [ "$t_model" = "ondio" ]; then | 317 | fi |
344 | printf ", (B)acklight MOD" | 318 | if [ "$modelname" = "player" ]; then |
345 | fi | 319 | printf ", Use (A)TA poweroff" |
346 | if [ "$modelname" = "m5" ]; then | 320 | fi |
347 | printf ", (F)M radio MOD" | 321 | if [ "$t_model" = "ondio" ]; then |
348 | fi | 322 | printf ", (B)acklight MOD" |
349 | if [ "$modelname" = "h120" ]; then | 323 | fi |
350 | printf ", (R)TC MOD" | 324 | if [ "$modelname" = "m5" ]; then |
325 | printf ", (F)M radio MOD" | ||
326 | fi | ||
327 | if [ "$modelname" = "h120" ]; then | ||
328 | printf ", (R)TC MOD" | ||
329 | fi | ||
330 | echo "" | ||
351 | fi | 331 | fi |
352 | echo "" | ||
353 | 332 | ||
354 | cont=1 | 333 | cont=1 |
355 | |||
356 | while [ $cont = "1" ]; do | 334 | while [ $cont = "1" ]; do |
357 | 335 | ||
358 | option=`input`; | 336 | if [ "$interact" ]; then |
337 | option=`input` | ||
338 | else | ||
339 | option=`echo "$atype" | cut -c 1` | ||
340 | fi | ||
359 | 341 | ||
360 | case $option in | 342 | case $option in |
361 | [Dd]) | 343 | [Dd]) |
362 | if [ "yes" = "$profile" ]; then | 344 | if [ "yes" = "$profile" ]; then |
363 | echo "Debug is incompatible with profiling" | 345 | echo "Debug is incompatible with profiling" |
364 | else | 346 | else |
365 | echo "define DEBUG" | 347 | echo "DEBUG build enabled" |
366 | use_debug="yes" | 348 | use_debug="yes" |
367 | fi | 349 | fi |
368 | ;; | 350 | ;; |
@@ -390,32 +372,24 @@ whichadvanced () { | |||
390 | if [ "$memory" = "2" ]; then | 372 | if [ "$memory" = "2" ]; then |
391 | memory="8" | 373 | memory="8" |
392 | echo "Memory size selected: 8MB" | 374 | echo "Memory size selected: 8MB" |
393 | else | ||
394 | cont=0 | ||
395 | fi | 375 | fi |
396 | ;; | 376 | ;; |
397 | [Aa]) | 377 | [Aa]) |
398 | if [ "$modelname" = "player" ]; then | 378 | if [ "$modelname" = "player" ]; then |
399 | have_ata_poweroff="#define HAVE_ATA_POWEROFF" | 379 | have_ata_poweroff="#define HAVE_ATA_POWEROFF" |
400 | echo "ATA poweroff enabled" | 380 | echo "ATA poweroff enabled" |
401 | else | ||
402 | cont=0 | ||
403 | fi | 381 | fi |
404 | ;; | 382 | ;; |
405 | [Bb]) | 383 | [Bb]) |
406 | if [ "$t_model" = "ondio" ]; then | 384 | if [ "$t_model" = "ondio" ]; then |
407 | have_backlight="#define HAVE_BACKLIGHT" | 385 | have_backlight="#define HAVE_BACKLIGHT" |
408 | echo "Backlight functions enabled" | 386 | echo "Backlight functions enabled" |
409 | else | ||
410 | cont=0 | ||
411 | fi | 387 | fi |
412 | ;; | 388 | ;; |
413 | [Ff]) | 389 | [Ff]) |
414 | if [ "$modelname" = "m5" ]; then | 390 | if [ "$modelname" = "m5" ]; then |
415 | have_fmradio_in="#define HAVE_FMRADIO_IN" | 391 | have_fmradio_in="#define HAVE_FMRADIO_IN" |
416 | echo "FM radio functions enabled" | 392 | echo "FM radio functions enabled" |
417 | else | ||
418 | cont=0 | ||
419 | fi | 393 | fi |
420 | ;; | 394 | ;; |
421 | [Rr]) | 395 | [Rr]) |
@@ -423,30 +397,27 @@ whichadvanced () { | |||
423 | config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231" | 397 | config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231" |
424 | have_rtc_alarm="#define HAVE_RTC_ALARM" | 398 | have_rtc_alarm="#define HAVE_RTC_ALARM" |
425 | echo "RTC functions enabled (DS1339/DS3231)" | 399 | echo "RTC functions enabled (DS1339/DS3231)" |
426 | else | ||
427 | cont=0 | ||
428 | fi | 400 | fi |
429 | ;; | 401 | ;; |
430 | *) | 402 | *) |
431 | cont=0 | 403 | if [ "$interact" ]; then |
404 | cont=0 | ||
405 | else | ||
406 | echo "[ERROR] Option $option unsupported" | ||
407 | fi | ||
432 | ;; | 408 | ;; |
433 | esac | 409 | esac |
410 | if [ ! "$interact" ]; then | ||
411 | atype=`echo "$atype" | cut -c 2-` | ||
412 | [ "$atype" ] || cont=0 | ||
413 | fi | ||
434 | done | 414 | done |
435 | echo "done" | 415 | echo "done" |
436 | 416 | ||
437 | if [ "yes" = "$voice" ]; then | 417 | if [ "yes" = "$voice" ]; then |
438 | # Ask about languages to build | 418 | # Ask about languages to build |
439 | echo "Select a number for the language to use (default is english)" | ||
440 | # The multiple-language feature is currently broken | ||
441 | # echo "You may enter a comma-separated list of languages to build" | ||
442 | |||
443 | picklang | 419 | picklang |
444 | voicelanguage=`whichlang` | 420 | voicelanguage=`whichlang` |
445 | |||
446 | if [ -z "$voicelanguage" ]; then | ||
447 | # pick a default | ||
448 | voicelanguage="english" | ||
449 | fi | ||
450 | echo "Voice language set to $voicelanguage" | 421 | echo "Voice language set to $voicelanguage" |
451 | 422 | ||
452 | # Configure encoder and TTS engine for each language | 423 | # Configure encoder and TTS engine for each language |
@@ -476,8 +447,10 @@ whichadvanced () { | |||
476 | # Configure voice settings | 447 | # Configure voice settings |
477 | voiceconfig () { | 448 | voiceconfig () { |
478 | thislang=$1 | 449 | thislang=$1 |
479 | echo "Building $thislang voice for $modelname. Select options" | 450 | if [ ! "$ARG_TTS" ]; then |
480 | echo "" | 451 | echo "Building $thislang voice for $modelname. Select options" |
452 | echo "" | ||
453 | fi | ||
481 | 454 | ||
482 | if [ -n "`findtool flite`" ]; then | 455 | if [ -n "`findtool flite`" ]; then |
483 | FLITE="F(l)ite " | 456 | FLITE="F(l)ite " |
@@ -542,8 +515,13 @@ voiceconfig () { | |||
542 | exit 3 | 515 | exit 3 |
543 | fi | 516 | fi |
544 | 517 | ||
545 | echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" | 518 | if [ "$ARG_TTS" ]; then |
546 | option=`input` | 519 | option=$ARG_TTS |
520 | else | ||
521 | echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" | ||
522 | option=`input` | ||
523 | fi | ||
524 | advopts="$advopts --tts=$option" | ||
547 | case "$option" in | 525 | case "$option" in |
548 | [Ll]) | 526 | [Ll]) |
549 | TTS_ENGINE="flite" | 527 | TTS_ENGINE="flite" |
@@ -579,35 +557,47 @@ voiceconfig () { | |||
579 | 557 | ||
580 | # Select which voice to use for Festival | 558 | # Select which voice to use for Festival |
581 | if [ "$TTS_ENGINE" = "festival" ]; then | 559 | if [ "$TTS_ENGINE" = "festival" ]; then |
582 | i=1 | 560 | voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort` |
583 | for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do | 561 | for voice in $voicelist; do |
584 | if [ "$i" = "1" ]; then | 562 | TTS_FESTIVAL_VOICE="$voice" # Default choice |
585 | TTS_FESTIVAL_VOICE="$voice" # Default choice | 563 | break |
586 | fi | ||
587 | printf "%3d. %s\n" "$i" "$voice" | ||
588 | i=`expr $i + 1` | ||
589 | done | 564 | done |
590 | printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " | 565 | if [ "$ARG_VOICE" ]; then |
591 | CHOICE=`input` | 566 | CHOICE=$ARG_VOICE |
567 | else | ||
568 | i=1 | ||
569 | for voice in $voicelist; do | ||
570 | printf "%3d. %s\n" "$i" "$voice" | ||
571 | i=`expr $i + 1` | ||
572 | done | ||
573 | printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " | ||
574 | CHOICE=`input` | ||
575 | fi | ||
592 | i=1 | 576 | i=1 |
593 | for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do | 577 | for voice in $voicelist; do |
594 | if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then | 578 | if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then |
595 | TTS_FESTIVAL_VOICE="$voice" | 579 | TTS_FESTIVAL_VOICE="$voice" |
596 | fi | 580 | fi |
597 | i=`expr $i + 1` | 581 | i=`expr $i + 1` |
598 | done | 582 | done |
583 | advopts="$advopts --voice=$CHOICE" | ||
599 | echo "Festival voice set to $TTS_FESTIVAL_VOICE" | 584 | echo "Festival voice set to $TTS_FESTIVAL_VOICE" |
600 | echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm | 585 | echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm |
601 | fi | 586 | fi |
602 | 587 | ||
603 | # Allow the user to input manual commandline options | 588 | # Allow the user to input manual commandline options |
604 | printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " | 589 | if [ "$ARG_TTSOPTS" ]; then |
605 | USER_TTS_OPTS=`input` | 590 | USER_TTS_OPTS=$ARG_TTSOPTS |
591 | else | ||
592 | printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " | ||
593 | USER_TTS_OPTS=`input` | ||
594 | echo "" | ||
595 | fi | ||
596 | advopts="$advopts --ttsopts='$USER_TTS_OPTS'" | ||
606 | if [ -n "$USER_TTS_OPTS" ]; then | 597 | if [ -n "$USER_TTS_OPTS" ]; then |
607 | TTS_OPTS="$USER_TTS_OPTS" | 598 | TTS_OPTS="$USER_TTS_OPTS" |
608 | fi | 599 | fi |
609 | 600 | echo "$TTS_ENGINE options set to $TTS_OPTS" | |
610 | echo "" | ||
611 | 601 | ||
612 | if [ "$swcodec" = "yes" ]; then | 602 | if [ "$swcodec" = "yes" ]; then |
613 | ENCODER="rbspeexenc" | 603 | ENCODER="rbspeexenc" |
@@ -628,11 +618,17 @@ voiceconfig () { | |||
628 | echo "Using $ENCODER for encoding voice clips" | 618 | echo "Using $ENCODER for encoding voice clips" |
629 | 619 | ||
630 | # Allow the user to input manual commandline options | 620 | # Allow the user to input manual commandline options |
631 | printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): " | 621 | if [ "$ARG_ENCOPTS" ]; then |
632 | USER_ENC_OPTS=`input` | 622 | USER_ENC_OPTS=$ARG_ENCOPTS |
623 | else | ||
624 | printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): " | ||
625 | USER_ENC_OPTS=`input` | ||
626 | fi | ||
627 | advopts="$advopts --encopts='$USER_ENC_OPTS'" | ||
633 | if [ -n "$USER_ENC_OPTS" ]; then | 628 | if [ -n "$USER_ENC_OPTS" ]; then |
634 | ENC_OPTS=$USER_ENC_OPTS | 629 | ENC_OPTS=$USER_ENC_OPTS |
635 | fi | 630 | fi |
631 | echo "$ENCODER options set to $ENC_OPTS" | ||
636 | 632 | ||
637 | TEMPDIR="${pwd}" | 633 | TEMPDIR="${pwd}" |
638 | if [ -n "`findtool cygpath`" ]; then | 634 | if [ -n "`findtool cygpath`" ]; then |
@@ -643,17 +639,25 @@ voiceconfig () { | |||
643 | picklang() { | 639 | picklang() { |
644 | # figure out which languages that are around | 640 | # figure out which languages that are around |
645 | for file in $rootdir/apps/lang/*.lang; do | 641 | for file in $rootdir/apps/lang/*.lang; do |
646 | clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` | 642 | clean=`basename $file .lang` |
647 | langs="$langs $clean" | 643 | langs="$langs $clean" |
648 | done | 644 | done |
649 | 645 | ||
650 | num=1 | 646 | if [ "$ARG_LANG" ]; then |
651 | for one in $langs; do | 647 | pick=$ARG_LANG |
652 | echo "$num. $one" | 648 | else |
653 | num=`expr $num + 1` | 649 | echo "Select a number for the language to use (default is english)" |
654 | done | 650 | # FIXME The multiple-language feature is currently broken |
651 | # echo "You may enter a comma-separated list of languages to build" | ||
655 | 652 | ||
656 | read pick | 653 | num=1 |
654 | for one in $langs; do | ||
655 | echo "$num. $one" | ||
656 | num=`expr $num + 1` | ||
657 | done | ||
658 | pick=`input` | ||
659 | fi | ||
660 | advopts="$advopts --language=$pick" | ||
657 | } | 661 | } |
658 | 662 | ||
659 | whichlang() { | 663 | whichlang() { |
@@ -673,25 +677,19 @@ whichlang() { | |||
673 | num=`expr $num + 1` | 677 | num=`expr $num + 1` |
674 | done | 678 | done |
675 | done | 679 | done |
680 | if [ -z "$output" ]; then | ||
681 | # pick a default | ||
682 | output="english" | ||
683 | fi | ||
676 | echo $output | 684 | echo $output |
677 | } | 685 | } |
678 | 686 | ||
679 | opt=$1 | 687 | help() { |
680 | |||
681 | |||
682 | if [ "$TMPDIR" != "" ]; then | ||
683 | tmpdir=$TMPDIR | ||
684 | else | ||
685 | tmpdir=/tmp | ||
686 | fi | ||
687 | |||
688 | echo $tmpdir | ||
689 | if test "$opt" = "--help"; then | ||
690 | echo "Rockbox configure script." | 688 | echo "Rockbox configure script." |
691 | echo "Invoke this in a directory to generate a Makefile to build Rockbox" | 689 | echo "Invoke this in a directory to generate a Makefile to build Rockbox" |
692 | echo "Do *NOT* run this within the tools directory!" | 690 | echo "Do *NOT* run this within the tools directory!" |
693 | echo "" | 691 | echo "" |
694 | cat <<EOF | 692 | cat <<EOF |
695 | Usage: configure [OPTION]... | 693 | Usage: configure [OPTION]... |
696 | Options: | 694 | Options: |
697 | --target=TARGET Sets the target, TARGET can be either the target ID or | 695 | --target=TARGET Sets the target, TARGET can be either the target ID or |
@@ -705,8 +703,24 @@ cat <<EOF | |||
705 | without this option if you are not sure which the right | 703 | without this option if you are not sure which the right |
706 | number is. | 704 | number is. |
707 | 705 | ||
708 | --type=TYPE Sets the build type. The shortcut is also valid. | 706 | --type=TYPE Sets the build type. Shortcuts are also valid. |
709 | Run without this option to see available types. | 707 | Run without this option to see all available types. |
708 | Multiple values are allowed and managed in the input | ||
709 | order. So --type=b stands for Bootloader build, while | ||
710 | --type=ab stands for "Backlight MOD" build. | ||
711 | |||
712 | --language=LANG Set the language used for voice generation (used only if | ||
713 | TYPE is AV). | ||
714 | |||
715 | --tts=ENGINE Set the TTS engine used for voice generation (used only | ||
716 | if TYPE is AV). | ||
717 | |||
718 | --voice=VOICE Set voice to use with selected TTS (used only if TYPE is | ||
719 | AV). | ||
720 | |||
721 | --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV). | ||
722 | |||
723 | --encopts=OPTS Set encoder manual options (used only if ATYPE is AV). | ||
710 | 724 | ||
711 | --rbdir=dir Use alternative rockbox directory (default: ${rbdir}). | 725 | --rbdir=dir Use alternative rockbox directory (default: ${rbdir}). |
712 | This is useful for having multiple alternate builds on | 726 | This is useful for having multiple alternate builds on |
@@ -721,7 +735,46 @@ cat <<EOF | |||
721 | EOF | 735 | EOF |
722 | 736 | ||
723 | exit | 737 | exit |
738 | } | ||
739 | |||
740 | ARG_CCACHE= | ||
741 | ARG_ENCOPTS= | ||
742 | ARG_LANG= | ||
743 | ARG_RAM= | ||
744 | ARG_RBDIR= | ||
745 | ARG_TARGET= | ||
746 | ARG_TTS= | ||
747 | ARG_TTSOPTS= | ||
748 | ARG_TYPE= | ||
749 | ARG_VOICE= | ||
750 | err= | ||
751 | for arg in "$@"; do | ||
752 | case "$arg" in | ||
753 | --ccache) ARG_CCACHE=1;; | ||
754 | --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;; | ||
755 | --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;; | ||
756 | --no-ccache) ARG_CCACHE=0;; | ||
757 | --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;; | ||
758 | --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;; | ||
759 | --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;; | ||
760 | --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;; | ||
761 | --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;; | ||
762 | --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;; | ||
763 | --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;; | ||
764 | --help) help;; | ||
765 | *) err=1; echo "[ERROR] Option '$arg' unsupported";; | ||
766 | esac | ||
767 | done | ||
768 | [ "$err" ] && exit 1 | ||
769 | |||
770 | advopts= | ||
771 | |||
772 | if [ "$TMPDIR" != "" ]; then | ||
773 | tmpdir=$TMPDIR | ||
774 | else | ||
775 | tmpdir=/tmp | ||
724 | fi | 776 | fi |
777 | echo Using temporary directory $tmpdir | ||
725 | 778 | ||
726 | if test -r "configure"; then | 779 | if test -r "configure"; then |
727 | # this is a check for a configure script in the current directory, it there | 780 | # this is a check for a configure script in the current directory, it there |
@@ -779,8 +832,8 @@ toolsdir='\$(ROOTDIR)/tools' | |||
779 | # Figure out target platform | 832 | # Figure out target platform |
780 | # | 833 | # |
781 | 834 | ||
782 | if [ "1" != `parse_args --target` ]; then | 835 | if [ "$ARG_TARGET" ]; then |
783 | buildfor=`parse_args --target`; | 836 | buildfor=$ARG_TARGET |
784 | else | 837 | else |
785 | echo "Enter target platform:" | 838 | echo "Enter target platform:" |
786 | cat <<EOF | 839 | cat <<EOF |
@@ -2318,10 +2371,10 @@ fi | |||
2318 | if [ -z "$memory" ]; then | 2371 | if [ -z "$memory" ]; then |
2319 | case $target_id in | 2372 | case $target_id in |
2320 | 15) | 2373 | 15) |
2321 | echo "Enter size of your RAM (in MB): (Defaults to 32)" | 2374 | if [ "$ARG_RAM" ]; then |
2322 | if [ "1" != `parse_args --ram` ]; then | 2375 | size=$ARG_RAM |
2323 | size=`parse_args --ram`; | ||
2324 | else | 2376 | else |
2377 | echo "Enter size of your RAM (in MB): (Defaults to 32)" | ||
2325 | size=`input`; | 2378 | size=`input`; |
2326 | fi | 2379 | fi |
2327 | case $size in | 2380 | case $size in |
@@ -2334,24 +2387,24 @@ if [ -z "$memory" ]; then | |||
2334 | esac | 2387 | esac |
2335 | ;; | 2388 | ;; |
2336 | *) | 2389 | *) |
2337 | echo "Enter size of your RAM (in MB): (Defaults to 2)" | 2390 | if [ "$ARG_RAM" ]; then |
2338 | if [ "1" != `parse_args --ram` ]; then | 2391 | size=$ARG_RAM |
2339 | size=`parse_args --ram`; | 2392 | else |
2340 | else | 2393 | echo "Enter size of your RAM (in MB): (Defaults to 2)" |
2341 | size=`input`; | 2394 | size=`input`; |
2342 | fi | 2395 | fi |
2343 | case $size in | 2396 | case $size in |
2344 | 8) | 2397 | 8) |
2345 | memory="8" | 2398 | memory="8" |
2346 | ;; | 2399 | ;; |
2347 | *) | 2400 | *) |
2348 | memory="2" | 2401 | memory="2" |
2349 | ;; | 2402 | ;; |
2350 | esac | 2403 | esac |
2351 | ;; | 2404 | ;; |
2352 | esac | 2405 | esac |
2353 | echo "Memory size selected: $memory MB" | 2406 | echo "Memory size selected: $memory MB" |
2354 | echo "" | 2407 | [ "$ARG_TYPE" ] || echo "" |
2355 | fi | 2408 | fi |
2356 | #remove end | 2409 | #remove end |
2357 | 2410 | ||
@@ -2374,8 +2427,8 @@ case $modelname in | |||
2374 | *) | 2427 | *) |
2375 | ;; | 2428 | ;; |
2376 | esac | 2429 | esac |
2377 | if [ "1" != `parse_args --type` ]; then | 2430 | if [ "$ARG_TYPE" ]; then |
2378 | btype=`parse_args --type`; | 2431 | btype=$ARG_TYPE |
2379 | else | 2432 | else |
2380 | echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)" | 2433 | echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)" |
2381 | btype=`input`; | 2434 | btype=`input`; |
@@ -2436,9 +2489,9 @@ fi | |||
2436 | flash="" | 2489 | flash="" |
2437 | echo "Simulator build selected" | 2490 | echo "Simulator build selected" |
2438 | ;; | 2491 | ;; |
2439 | [Aa]) | 2492 | [Aa]*) |
2440 | echo "Advanced build selected" | 2493 | echo "Advanced build selected" |
2441 | whichadvanced | 2494 | whichadvanced $btype |
2442 | ;; | 2495 | ;; |
2443 | [Gg]) | 2496 | [Gg]) |
2444 | extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES | 2497 | extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES |
@@ -2523,9 +2576,9 @@ else | |||
2523 | fi | 2576 | fi |
2524 | 2577 | ||
2525 | if [ -z "$gccver" ]; then | 2578 | if [ -z "$gccver" ]; then |
2526 | echo "WARNING: The compiler you must use ($CC) is not in your path!" | 2579 | echo "[WARNING] The compiler you must use ($CC) is not in your path!" |
2527 | echo "WARNING: this may cause your build to fail since we cannot do the" | 2580 | echo "[WARNING] this may cause your build to fail since we cannot do the" |
2528 | echo "WARNING: checks we want now." | 2581 | echo "[WARNING] checks we want now." |
2529 | else | 2582 | else |
2530 | 2583 | ||
2531 | # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't | 2584 | # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't |
@@ -2612,15 +2665,13 @@ if test "$CC" = "m68k-elf-gcc"; then | |||
2612 | GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'` | 2665 | GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'` |
2613 | fi | 2666 | fi |
2614 | 2667 | ||
2615 | if [ "1" != `parse_args --ccache` ]; then | 2668 | if [ "$ARG_CCACHE" = "1" ]; then |
2616 | echo "Enable ccache for building" | 2669 | echo "Enable ccache for building" |
2617 | ccache="ccache" | 2670 | ccache="ccache" |
2618 | else | 2671 | elif [ "$ARG_CCACHE" = "0" ]; then |
2619 | if [ "1" = `parse_args --no-ccache` ]; then | 2672 | ccache=`findtool ccache` |
2620 | ccache=`findtool ccache` | 2673 | if test -n "$ccache"; then |
2621 | if test -n "$ccache"; then | 2674 | echo "Found and uses ccache ($ccache)" |
2622 | echo "Found and uses ccache ($ccache)" | ||
2623 | fi | ||
2624 | fi | 2675 | fi |
2625 | fi | 2676 | fi |
2626 | 2677 | ||
@@ -2647,8 +2698,8 @@ else | |||
2647 | defendian="ROCKBOX_LITTLE_ENDIAN" | 2698 | defendian="ROCKBOX_LITTLE_ENDIAN" |
2648 | fi | 2699 | fi |
2649 | 2700 | ||
2650 | if [ "1" != `parse_args --rbdir` ]; then | 2701 | if [ "$ARG_RBDIR" ]; then |
2651 | rbdir=`parse_args --rbdir`; | 2702 | rbdir=$ARG_RBDIR |
2652 | echo "Using alternate rockbox dir: ${rbdir}" | 2703 | echo "Using alternate rockbox dir: ${rbdir}" |
2653 | fi | 2704 | fi |
2654 | 2705 | ||
@@ -2721,12 +2772,10 @@ fi | |||
2721 | 2772 | ||
2722 | #### Fix the cmdline ### | 2773 | #### Fix the cmdline ### |
2723 | if test -n "$ccache"; then | 2774 | if test -n "$ccache"; then |
2724 | cmdline="--ccache" | 2775 | cmdline="--ccache " |
2725 | fi | 2776 | fi |
2726 | 2777 | ||
2727 | cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype" | 2778 | cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts" |
2728 | |||
2729 | |||
2730 | ### end of cmdline | 2779 | ### end of cmdline |
2731 | 2780 | ||
2732 | sed > Makefile \ | 2781 | sed > Makefile \ |