Remove unnecessary (and incorrect) acks after stalling the control endpoint
[kugel-rb.git] / tools / configure
blob9a98bff55002a88a067e93e29d4fdf71a42da4ae
1 #!/bin/sh
2 # __________ __ ___.
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 # \/ \/ \/ \/ \/
8 # $Id$
11 # global CC options for all platforms
12 CCOPTS="-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes -pipe"
14 use_logf="#undef ROCKBOX_HAS_LOGF"
16 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
18 rbdir=".rockbox"
21 # Begin Function Definitions
23 input() {
24 read response
25 echo $response
28 prefixtools () {
29 prefix="$1"
30 CC=${prefix}gcc
31 WINDRES=${prefix}windres
32 DLLTOOL=${prefix}dlltool
33 DLLWRAP=${prefix}dllwrap
34 RANLIB=${prefix}ranlib
35 LD=${prefix}ld
36 AR=${prefix}ar
37 AS=${prefix}as
38 OC=${prefix}objcopy
41 findarmgcc() {
42 if [ "$ARG_ARM_EABI" = "1" ]; then
43 prefixtools arm-elf-eabi-
44 gccchoice="4.4.3"
45 else
46 prefixtools arm-elf-
47 gccchoice="4.0.3"
51 # scan the $PATH for the given command
52 findtool(){
53 file="$1"
55 IFS=":"
56 for path in $PATH
58 # echo "checks for $file in $path" >&2
59 if test -f "$path/$file"; then
60 echo "$path/$file"
61 return
63 done
64 # check whether caller wants literal return value if not found
65 if [ "$2" = "--lit" ]; then
66 echo "$file"
70 # scan the $PATH for sdl-config - if crosscompiling, require that it is
71 # a mingw32 sdl-config
72 findsdl(){
73 file="sdl-config"
75 IFS=":"
76 for path in $PATH
78 #echo "checks for $file in $path" >&2
79 if test -f "$path/$file"; then
80 if [ "yes" = "${crosscompile}" ]; then
81 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then
82 echo "$path/$file"
83 return
85 else
86 echo "$path/$file"
87 return
90 done
93 simcc () {
95 # default tool setup for native building
96 prefixtools ""
98 simver=sdl
99 GCCOPTS='-W -Wall -g -fno-builtin'
100 GCCOPTIMIZE=''
102 output="rockboxui" # use this as default output binary name
103 sdl=`findsdl`
104 sdl_cflags=""
105 sdl_libs=""
107 if [ $1 = "sdl" ]; then
108 if [ -z "$sdl" ]; then
109 echo "configure didn't find sdl-config, which indicates that you"
110 echo "don't have SDL (properly) installed. Please correct and"
111 echo "re-run configure!"
112 exit 1
113 else
114 # generic sdl-config checker
115 sdl_cflags=`$sdl --cflags`
116 sdl_libs=`$sdl --libs`
120 # default share option, override below if needed
121 SHARED_FLAG="-shared"
123 case $uname in
124 CYGWIN*)
125 echo "Cygwin host detected"
127 # sdl version
128 GCCOPTS="$GCCOPTS $sdl_cflags"
129 LDOPTS="-mconsole $sdl_libs"
131 output="rockboxui.exe" # use this as output binary name
134 MINGW*)
135 echo "MinGW host detected"
137 # sdl version
138 GCCOPTS="$GCCOPTS $sdl_cflags"
139 LDOPTS="-mconsole $sdl_libs"
141 output="rockboxui.exe" # use this as output binary name
144 Linux)
145 echo "Linux host detected"
146 GCCOPTS="$GCCOPTS $sdl_cflags"
147 LDOPTS="$sdl_libs"
150 FreeBSD)
151 echo "FreeBSD host detected"
152 # sdl version
153 GCCOPTS="$GCCOPTS $sdl_cflags"
154 LDOPTS="$sdl_libs"
157 Darwin)
158 echo "Darwin host detected"
159 # sdl version
160 GCCOPTS="$GCCOPTS $sdl_cflags"
161 LDOPTS="$sdl_libs"
162 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
165 SunOS)
166 echo "*Solaris host detected"
167 GCCOPTS="$GCCOPTS $sdl_cflags"
168 LDOPTS="$sdl_libs"
172 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
173 exit 2
175 esac
177 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
179 if test "X$crosscompile" != "Xyes"; then
180 case `uname -m` in
181 x86_64|amd64)
182 # fPIC is needed to make shared objects link
183 # setting visibility to hidden is necessary to avoid strange crashes
184 # due to symbol clashing
185 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
186 # x86_64 supports MMX by default
189 i686)
190 echo "Enabling MMX support"
191 GCCOPTS="$GCCOPTS -mmmx"
193 esac
195 id=$$
196 cat >$tmpdir/conftest-$id.c <<EOF
197 #include <stdio.h>
198 int main(int argc, char **argv)
200 int var=0;
201 char *varp = (char *)&var;
202 *varp=1;
204 printf("%d\n", var);
205 return 0;
209 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
211 if test `$tmpdir/conftest-$id 2>/dev/null` -gt "1"; then
212 # big endian
213 endian="big"
214 else
215 # little endian
216 endian="little"
219 if [ $1 = "sdl" ]; then
220 echo "Simulator environment deemed $endian endian"
221 elif [ $1 = "checkwps" ]; then
222 echo "CheckWPS environment deemed $endian endian"
225 # use wildcard here to make it work even if it was named *.exe like
226 # on cygwin
227 rm -f $tmpdir/conftest-$id*
228 else
229 # We are crosscompiling
230 # add cross-compiler option(s)
231 prefixtools i586-mingw32msvc-
232 LDOPTS="-mconsole $sdl_libs"
233 output="rockboxui.exe" # use this as output binary name
234 endian="little" # windows is little endian
235 echo "Enabling MMX support"
236 GCCOPTS="$GCCOPTS -mmmx"
241 # functions for setting up cross-compiler names and options
242 # also set endianess and what the exact recommended gcc version is
243 # the gcc version should most likely match what versions we build with
244 # rockboxdev.sh
246 shcc () {
247 prefixtools sh-elf-
248 GCCOPTS="$CCOPTS -m1"
249 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
250 endian="big"
251 gccchoice="4.0.3"
254 calmrisccc () {
255 prefixtools calmrisc16-unknown-elf-
256 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
257 GCCOPTIMIZE="-fomit-frame-pointer"
258 endian="big"
261 coldfirecc () {
262 prefixtools m68k-elf-
263 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
264 GCCOPTIMIZE="-fomit-frame-pointer"
265 endian="big"
266 gccchoice="3.4.6"
269 arm7tdmicc () {
270 findarmgcc
271 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
272 if test "X$1" != "Xshort" -a "$ARG_ARM_EABI" != "1"; then
273 GCCOPTS="$GCCOPTS -mlong-calls"
275 GCCOPTIMIZE="-fomit-frame-pointer"
276 endian="little"
279 arm9tdmicc () {
280 findarmgcc
281 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
282 if test "$modelname" != "gigabeatfx" -a "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
283 GCCOPTS="$GCCOPTS -mlong-calls"
285 GCCOPTIMIZE="-fomit-frame-pointer"
286 endian="little"
289 arm940tbecc () {
290 findarmgcc
291 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
292 if test "$ARG_ARM_EABI" != "1"; then
293 GCCOPTS="$GCCOPTS -mlong-calls"
295 GCCOPTIMIZE="-fomit-frame-pointer"
296 endian="big"
299 arm940tcc () {
300 findarmgcc
301 GCCOPTS="$CCOPTS -mcpu=arm940t"
302 if test "$ARG_ARM_EABI" != "1"; then
303 GCCOPTS="$GCCOPTS -mlong-calls"
305 GCCOPTIMIZE="-fomit-frame-pointer"
306 endian="little"
309 arm946cc () {
310 findarmgcc
311 GCCOPTS="$CCOPTS -mcpu=arm9e"
312 if test "$ARG_ARM_EABI" != "1"; then
313 GCCOPTS="$GCCOPTS -mlong-calls"
315 GCCOPTIMIZE="-fomit-frame-pointer"
316 endian="little"
319 arm926ejscc () {
320 findarmgcc
321 GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
322 if test "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
323 GCCOPTS="$GCCOPTS -mlong-calls"
325 GCCOPTIMIZE="-fomit-frame-pointer"
326 endian="little"
329 arm1136jfscc () {
330 findarmgcc
331 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
332 if test "$modelname" != "gigabeats" -a "$ARG_ARM_EABI" != "1"; then
333 GCCOPTS="$GCCOPTS -mlong-calls"
335 GCCOPTIMIZE="-fomit-frame-pointer"
336 endian="little"
339 arm1176jzscc () {
340 findarmgcc
341 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
342 if test "$ARG_ARM_EABI" != "1"; then
343 GCCOPTS="$GCCOPTS -mlong-calls"
345 GCCOPTIMIZE="-fomit-frame-pointer"
346 endian="little"
349 mipselcc () {
350 prefixtools mipsel-elf-
351 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
352 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
353 GCCOPTIMIZE="-fomit-frame-pointer"
354 endian="little"
355 gccchoice="4.1.2"
358 whichadvanced () {
359 atype=`echo "$1" | cut -c 2-`
360 ##################################################################
361 # Prompt for specific developer options
363 if [ "$atype" ]; then
364 interact=
365 else
366 interact=1
367 echo ""
368 echo "Enter your developer options (press enter when done)"
369 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile"
370 if [ "$memory" = "2" ]; then
371 printf ", (8)MB MOD"
373 if [ "$modelname" = "archosplayer" ]; then
374 printf ", Use (A)TA poweroff"
376 if [ "$t_model" = "ondio" ]; then
377 printf ", (B)acklight MOD"
379 if [ "$modelname" = "iaudiom5" ]; then
380 printf ", (F)M radio MOD"
382 if [ "$modelname" = "iriverh120" ]; then
383 printf ", (R)TC MOD"
385 echo ""
388 cont=1
389 while [ $cont = "1" ]; do
391 if [ "$interact" ]; then
392 option=`input`
393 else
394 option=`echo "$atype" | cut -c 1`
397 case $option in
398 [Dd])
399 if [ "yes" = "$profile" ]; then
400 echo "Debug is incompatible with profiling"
401 else
402 echo "DEBUG build enabled"
403 use_debug="yes"
406 [Ll])
407 echo "logf() support enabled"
408 logf="yes"
410 [Ss])
411 echo "Simulator build enabled"
412 simulator="yes"
414 [Pp])
415 if [ "yes" = "$use_debug" ]; then
416 echo "Profiling is incompatible with debug"
417 else
418 echo "Profiling support is enabled"
419 profile="yes"
422 [Vv])
423 echo "Voice build selected"
424 voice="yes"
427 if [ "$memory" = "2" ]; then
428 memory="8"
429 echo "Memory size selected: 8MB"
432 [Aa])
433 if [ "$modelname" = "archosplayer" ]; then
434 have_ata_poweroff="#define HAVE_ATA_POWEROFF"
435 echo "ATA poweroff enabled"
438 [Bb])
439 if [ "$t_model" = "ondio" ]; then
440 have_backlight="#define HAVE_BACKLIGHT"
441 echo "Backlight functions enabled"
444 [Ff])
445 if [ "$modelname" = "iaudiom5" ]; then
446 have_fmradio_in="#define HAVE_FMRADIO_IN"
447 echo "FM radio functions enabled"
450 [Rr])
451 if [ "$modelname" = "iriverh120" ]; then
452 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
453 have_rtc_alarm="#define HAVE_RTC_ALARM"
454 echo "RTC functions enabled (DS1339/DS3231)"
457 [Ww])
458 echo "Enabling Windows 32 cross-compiling"
459 crosscompile="yes"
462 if [ "$interact" ]; then
463 cont=0
464 else
465 echo "[ERROR] Option $option unsupported"
468 esac
469 if [ "$interact" ]; then
470 btype="$btype$option"
471 else
472 atype=`echo "$atype" | cut -c 2-`
473 [ "$atype" ] || cont=0
475 done
476 echo "done"
478 if [ "yes" = "$voice" ]; then
479 # Ask about languages to build
480 picklang
481 voicelanguage=`whichlang`
482 echo "Voice language set to $voicelanguage"
484 # Configure encoder and TTS engine for each language
485 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
486 voiceconfig "$thislang"
487 done
489 if [ "yes" = "$use_debug" ]; then
490 debug="-DDEBUG"
491 GCCOPTS="$GCCOPTS -g -DDEBUG"
493 if [ "yes" = "$logf" ]; then
494 use_logf="#define ROCKBOX_HAS_LOGF 1"
496 if [ "yes" = "$simulator" ]; then
497 debug="-DDEBUG"
498 extradefines="$extradefines -DSIMULATOR"
499 archosrom=""
500 flash=""
502 if [ "yes" = "$profile" ]; then
503 extradefines="$extradefines -DRB_PROFILE"
504 PROFILE_OPTS="-finstrument-functions"
508 # Configure voice settings
509 voiceconfig () {
510 thislang=$1
511 if [ ! "$ARG_TTS" ]; then
512 echo "Building $thislang voice for $modelname. Select options"
513 echo ""
516 if [ -n "`findtool flite`" ]; then
517 FLITE="F(l)ite "
518 FLITE_OPTS=""
519 DEFAULT_TTS="flite"
520 DEFAULT_TTS_OPTS=$FLITE_OPTS
521 DEFAULT_NOISEFLOOR="500"
522 DEFAULT_CHOICE="L"
524 if [ -n "`findtool espeak`" ]; then
525 ESPEAK="(e)Speak "
526 ESPEAK_OPTS=""
527 DEFAULT_TTS="espeak"
528 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
529 DEFAULT_NOISEFLOOR="500"
530 DEFAULT_CHOICE="e"
532 if [ -n "`findtool festival`" ]; then
533 FESTIVAL="(F)estival "
534 case "$thislang" in
535 "italiano")
536 FESTIVAL_OPTS="--language italian"
538 "espanol")
539 FESTIVAL_OPTS="--language spanish"
541 "finnish")
542 FESTIVAL_OPTS="--language finnish"
544 "czech")
545 FESTIVAL_OPTS="--language czech"
548 FESTIVAL_OPTS=""
550 esac
551 DEFAULT_TTS="festival"
552 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
553 DEFAULT_NOISEFLOOR="500"
554 DEFAULT_CHOICE="F"
556 if [ -n "`findtool swift`" ]; then
557 SWIFT="S(w)ift "
558 SWIFT_OPTS=""
559 DEFAULT_TTS="swift"
560 DEFAULT_TTS_OPTS=$SWIFT_OPTS
561 DEFAULT_NOISEFLOOR="500"
562 DEFAULT_CHOICE="w"
564 # Allow SAPI if Windows is in use
565 if [ -n "`findtool winver`" ]; then
566 SAPI="(S)API "
567 SAPI_OPTS=""
568 DEFAULT_TTS="sapi"
569 DEFAULT_TTS_OPTS=$SAPI_OPTS
570 DEFAULT_NOISEFLOOR="500"
571 DEFAULT_CHOICE="S"
574 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
575 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
576 exit 3
579 if [ "$ARG_TTS" ]; then
580 option=$ARG_TTS
581 else
582 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
583 option=`input`
585 advopts="$advopts --tts=$option"
586 case "$option" in
587 [Ll])
588 TTS_ENGINE="flite"
589 NOISEFLOOR="500" # TODO: check this value
590 TTS_OPTS=$FLITE_OPTS
592 [Ee])
593 TTS_ENGINE="espeak"
594 NOISEFLOOR="500"
595 TTS_OPTS=$ESPEAK_OPTS
597 [Ff])
598 TTS_ENGINE="festival"
599 NOISEFLOOR="500"
600 TTS_OPTS=$FESTIVAL_OPTS
602 [Ss])
603 TTS_ENGINE="sapi"
604 NOISEFLOOR="500"
605 TTS_OPTS=$SAPI_OPTS
607 [Ww])
608 TTS_ENGINE="swift"
609 NOISEFLOOR="500"
610 TTS_OPTS=$SWIFT_OPTS
613 TTS_ENGINE=$DEFAULT_TTS
614 TTS_OPTS=$DEFAULT_TTS_OPTS
615 NOISEFLOOR=$DEFAULT_NOISEFLOOR
616 esac
617 echo "Using $TTS_ENGINE for TTS"
619 # Select which voice to use for Festival
620 if [ "$TTS_ENGINE" = "festival" ]; then
621 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
622 for voice in $voicelist; do
623 TTS_FESTIVAL_VOICE="$voice" # Default choice
624 break
625 done
626 if [ "$ARG_VOICE" ]; then
627 CHOICE=$ARG_VOICE
628 else
630 for voice in $voicelist; do
631 printf "%3d. %s\n" "$i" "$voice"
632 i=`expr $i + 1`
633 done
634 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
635 CHOICE=`input`
638 for voice in $voicelist; do
639 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
640 TTS_FESTIVAL_VOICE="$voice"
642 i=`expr $i + 1`
643 done
644 advopts="$advopts --voice=$CHOICE"
645 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
646 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
649 # Read custom tts options from command line
650 if [ "$ARG_TTSOPTS" ]; then
651 TTS_OPTS="$ARG_TTSOPTS"
652 advopts="$advopts --ttsopts='$TTS_OPTS'"
653 echo "$TTS_ENGINE options set to $TTS_OPTS"
656 if [ "$swcodec" = "yes" ]; then
657 ENCODER="rbspeexenc"
658 ENC_CMD="rbspeexenc"
659 ENC_OPTS="-q 4 -c 10"
660 else
661 if [ -n "`findtool lame`" ]; then
662 ENCODER="lame"
663 ENC_CMD="lame"
664 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
665 else
666 echo "You need LAME in the system path to build voice files for"
667 echo "HWCODEC targets."
668 exit 4
672 echo "Using $ENCODER for encoding voice clips"
674 # Read custom encoder options from command line
675 if [ "$ARG_ENCOPTS" ]; then
676 ENC_OPTS="$ARG_ENCOPTS"
677 advopts="$advopts --encopts='$ENC_OPTS'"
678 echo "$ENCODER options set to $ENC_OPTS"
681 TEMPDIR="${pwd}"
682 if [ -n "`findtool cygpath`" ]; then
683 TEMPDIR=`cygpath . -a -w`
687 picklang() {
688 # figure out which languages that are around
689 for file in $rootdir/apps/lang/*.lang; do
690 clean=`basename $file .lang`
691 langs="$langs $clean"
692 done
694 if [ "$ARG_LANG" ]; then
695 pick=$ARG_LANG
696 else
697 echo "Select a number for the language to use (default is english)"
698 # FIXME The multiple-language feature is currently broken
699 # echo "You may enter a comma-separated list of languages to build"
701 num=1
702 for one in $langs; do
703 echo "$num. $one"
704 num=`expr $num + 1`
705 done
706 pick=`input`
708 advopts="$advopts --language=$pick"
711 whichlang() {
712 output=""
713 # Allow the user to pass a comma-separated list of langauges
714 for thispick in `echo $pick | sed 's/,/ /g'`; do
715 num=1
716 for one in $langs; do
717 # Accept both the language number and name
718 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
719 if [ "$output" = "" ]; then
720 output=$one
721 else
722 output=$output,$one
725 num=`expr $num + 1`
726 done
727 done
728 if [ -z "$output" ]; then
729 # pick a default
730 output="english"
732 echo $output
735 help() {
736 echo "Rockbox configure script."
737 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
738 echo "Do *NOT* run this within the tools directory!"
739 echo ""
740 cat <<EOF
741 Usage: configure [OPTION]...
742 Options:
743 --target=TARGET Sets the target, TARGET can be either the target ID or
744 corresponding string. Run without this option to see all
745 available targets.
747 --ram=RAM Sets the RAM for certain targets. Even though any number
748 is accepted, not every number is correct. The default
749 value will be applied, if you entered a wrong number
750 (which depends on the target). Watch the output. Run
751 without this option if you are not sure which the right
752 number is.
754 --type=TYPE Sets the build type. Shortcuts are also valid.
755 Run without this option to see all available types.
756 Multiple values are allowed and managed in the input
757 order. So --type=b stands for Bootloader build, while
758 --type=ab stands for "Backlight MOD" build.
760 --language=LANG Set the language used for voice generation (used only if
761 TYPE is AV).
763 --tts=ENGINE Set the TTS engine used for voice generation (used only
764 if TYPE is AV).
766 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
767 AV).
769 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
771 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
773 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
774 This is useful for having multiple alternate builds on
775 your device that you can load with ROLO. However as the
776 bootloader looks for .rockbox you won't be able to boot
777 into this build.
779 --ccache Enable ccache use (done by default these days)
780 --no-ccache Disable ccache use
782 --eabi Make configure prefer toolchains that are able to compile
783 for the new ARM standard abi EABI
784 --no-eabi The opposite of --eabi (prefer old non-eabi toolchains)
785 --help Shows this message (must not be used with other options)
789 exit
792 ARG_CCACHE=
793 ARG_ENCOPTS=
794 ARG_LANG=
795 ARG_RAM=
796 ARG_RBDIR=
797 ARG_TARGET=
798 ARG_TTS=
799 ARG_TTSOPTS=
800 ARG_TYPE=
801 ARG_VOICE=
802 ARG_ARM_EABI=
803 err=
804 for arg in "$@"; do
805 case "$arg" in
806 --ccache) ARG_CCACHE=1;;
807 --no-ccache) ARG_CCACHE=0;;
808 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
809 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
810 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
811 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
812 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
813 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
814 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
815 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
816 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
817 --eabi) ARG_ARM_EABI=1;;
818 --no-eabi) ARG_ARM_EABI=0;;
819 --help) help;;
820 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
821 esac
822 done
823 [ "$err" ] && exit 1
825 advopts=
827 if [ "$TMPDIR" != "" ]; then
828 tmpdir=$TMPDIR
829 else
830 tmpdir=/tmp
832 echo Using temporary directory $tmpdir
834 if test -r "configure"; then
835 # this is a check for a configure script in the current directory, it there
836 # is one, try to figure out if it is this one!
838 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
839 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
840 echo "It will only cause you pain and grief. Instead do this:"
841 echo ""
842 echo " cd .."
843 echo " mkdir build-dir"
844 echo " cd build-dir"
845 echo " ../tools/configure"
846 echo ""
847 echo "Much happiness will arise from this. Enjoy"
848 exit 5
852 # get our current directory
853 pwd=`pwd`;
855 if { echo $pwd | grep " "; } then
856 echo "You're running this script in a path that contains space. The build"
857 echo "system is unfortunately not clever enough to deal with this. Please"
858 echo "run the script from a different path, rename the path or fix the build"
859 echo "system!"
860 exit 6
863 if [ -z "$rootdir" ]; then
864 ##################################################################
865 # Figure out where the source code root is!
867 rootdir=`dirname $0`/../
869 #####################################################################
870 # Convert the possibly relative directory name to an absolute version
872 now=`pwd`
873 cd $rootdir
874 rootdir=`pwd`
876 # cd back to the build dir
877 cd $now
880 apps="apps"
881 appsdir='\$(ROOTDIR)/apps'
882 firmdir='\$(ROOTDIR)/firmware'
883 toolsdir='\$(ROOTDIR)/tools'
886 ##################################################################
887 # Figure out target platform
890 if [ "$ARG_TARGET" ]; then
891 buildfor=$ARG_TARGET
892 else
893 echo "Enter target platform:"
894 cat <<EOF
895 ==Archos== ==iriver== ==Apple iPod==
896 0) Player/Studio 10) H120/H140 20) Color/Photo
897 1) Recorder 11) H320/H340 21) Nano 1G
898 2) FM Recorder 12) iHP-100/110/115 22) Video
899 3) Recorder v2 13) iFP-790 23) 3G
900 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
901 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
902 6) AV300 26) Mini 2G
903 ==Toshiba== 27) 1G, 2G
904 ==Cowon/iAudio== 40) Gigabeat F/X 28) Nano 2G
905 30) X5/X5V/X5L 41) Gigabeat S
906 31) M5/M5L ==SanDisk==
907 32) 7 ==Olympus= 50) Sansa e200
908 33) D2 70) M:Robe 500 51) Sansa e200R
909 34) M3/M3L 71) M:Robe 100 52) Sansa c200
910 53) Sansa m200
911 ==Creative== ==Philips== 54) Sansa c100
912 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
913 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
914 92) Zen Vision HDD1830 57) Sansa m200v4
915 102) GoGear HDD6330 58) Sansa Fuze
916 ==Onda== 59) Sansa c200v2
917 120) VX747 ==Meizu== 60) Sansa Clipv2
918 121) VX767 110) M6SL 61) Sansa View
919 122) VX747+ 111) M6SP 62) Sansa Clip+
920 123) VX777 112) M3 63) Sansa Fuze v2
922 ==Logik==
923 ==Samsung== ==Tatung== 80) DAX 1GB MP3/DAB
924 140) YH-820 150) Elio TPJ-1022
925 141) YH-920 ==Lyre project==1
926 142) YH-925 ==Packard Bell== 130) Lyre proto 1
927 143) YP-S3 160) Vibe 500 131) Mini2440
930 buildfor=`input`;
933 # Set of tools built for all target platforms:
934 toolset="rdf2binary convbdf codepages"
936 # Toolsets for some target families:
937 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
938 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
939 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
940 ipodbitmaptools="$toolset scramble bmp2rb"
941 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
942 tccbitmaptools="$toolset scramble bmp2rb"
943 # generic is used by IFP, Meizu and Onda
944 genericbitmaptools="$toolset bmp2rb"
945 # scramble is used by all other targets
946 scramblebitmaptools="$genericbitmaptools scramble"
949 # ---- For each target ----
951 # *Variables*
952 # target_id: a unique number identifying this target, IS NOT the menu number.
953 # Just use the currently highest number+1 when you add a new
954 # target.
955 # modelname: short model name used all over to identify this target
956 # memory: number of megabytes of RAM this target has. If the amount can
957 # be selected by the size prompt, let memory be unset here
958 # target: -Ddefine passed to the build commands to make the correct
959 # config-*.h file get included etc
960 # tool: the tool that takes a plain binary and converts that into a
961 # working "firmware" file for your target
962 # output: the final output file name
963 # boottool: the tool that takes a plain binary and generates a bootloader
964 # file for your target (or blank to use $tool)
965 # bootoutput:the final output file name for the bootloader (or blank to use
966 # $output)
967 # appextra: passed to the APPEXTRA variable in the Makefiles.
968 # TODO: add proper explanation
969 # archosrom: used only for Archos targets that build a special flashable .ucl
970 # image.
971 # flash: name of output for flashing, for targets where there's a special
972 # file output for this.
973 # plugins: set to 'yes' to build the plugins. Early development builds can
974 # set this to no in the early stages to have an easier life for a
975 # while
976 # swcodec: set 'yes' on swcodec targets
977 # toolset: lists what particular tools in the tools/ directory that this
978 # target needs to have built prior to building Rockbox
980 # *Functions*
981 # *cc: sets up gcc and compiler options for your target builds. Note
982 # that if you select a simulator build, the compiler selection is
983 # overridden later in the script.
985 case $buildfor in
987 0|archosplayer)
988 target_id=1
989 modelname="archosplayer"
990 target="-DARCHOS_PLAYER"
991 shcc
992 tool="$rootdir/tools/scramble"
993 output="archos.mod"
994 appextra="player:gui"
995 archosrom="$pwd/rombox.ucl"
996 flash="$pwd/rockbox.ucl"
997 plugins="yes"
998 swcodec=""
1000 # toolset is the tools within the tools directory that we build for
1001 # this particular target.
1002 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
1004 # Note: the convbdf is present in the toolset just because: 1) the
1005 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1006 # build the player simulator
1008 t_cpu="sh"
1009 t_manufacturer="archos"
1010 t_model="player"
1013 1|archosrecorder)
1014 target_id=2
1015 modelname="archosrecorder"
1016 target="-DARCHOS_RECORDER"
1017 shcc
1018 tool="$rootdir/tools/scramble"
1019 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1020 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1021 output="ajbrec.ajz"
1022 appextra="recorder:gui"
1023 #archosrom="$pwd/rombox.ucl"
1024 flash="$pwd/rockbox.ucl"
1025 plugins="yes"
1026 swcodec=""
1027 # toolset is the tools within the tools directory that we build for
1028 # this particular target.
1029 toolset=$archosbitmaptools
1030 t_cpu="sh"
1031 t_manufacturer="archos"
1032 t_model="recorder"
1035 2|archosfmrecorder)
1036 target_id=3
1037 modelname="archosfmrecorder"
1038 target="-DARCHOS_FMRECORDER"
1039 shcc
1040 tool="$rootdir/tools/scramble -fm"
1041 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1042 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1043 output="ajbrec.ajz"
1044 appextra="recorder:gui"
1045 #archosrom="$pwd/rombox.ucl"
1046 flash="$pwd/rockbox.ucl"
1047 plugins="yes"
1048 swcodec=""
1049 # toolset is the tools within the tools directory that we build for
1050 # this particular target.
1051 toolset=$archosbitmaptools
1052 t_cpu="sh"
1053 t_manufacturer="archos"
1054 t_model="fm_v2"
1057 3|archosrecorderv2)
1058 target_id=4
1059 modelname="archosrecorderv2"
1060 target="-DARCHOS_RECORDERV2"
1061 shcc
1062 tool="$rootdir/tools/scramble -v2"
1063 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1064 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1065 output="ajbrec.ajz"
1066 appextra="recorder:gui"
1067 #archosrom="$pwd/rombox.ucl"
1068 flash="$pwd/rockbox.ucl"
1069 plugins="yes"
1070 swcodec=""
1071 # toolset is the tools within the tools directory that we build for
1072 # this particular target.
1073 toolset=$archosbitmaptools
1074 t_cpu="sh"
1075 t_manufacturer="archos"
1076 t_model="fm_v2"
1079 4|archosondiosp)
1080 target_id=7
1081 modelname="archosondiosp"
1082 target="-DARCHOS_ONDIOSP"
1083 shcc
1084 tool="$rootdir/tools/scramble -osp"
1085 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1086 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1087 output="ajbrec.ajz"
1088 appextra="recorder:gui"
1089 #archosrom="$pwd/rombox.ucl"
1090 flash="$pwd/rockbox.ucl"
1091 plugins="yes"
1092 swcodec=""
1093 # toolset is the tools within the tools directory that we build for
1094 # this particular target.
1095 toolset=$archosbitmaptools
1096 t_cpu="sh"
1097 t_manufacturer="archos"
1098 t_model="ondio"
1101 5|archosondiofm)
1102 target_id=8
1103 modelname="archosondiofm"
1104 target="-DARCHOS_ONDIOFM"
1105 shcc
1106 tool="$rootdir/tools/scramble -ofm"
1107 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1108 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1109 output="ajbrec.ajz"
1110 appextra="recorder:gui"
1111 #archosrom="$pwd/rombox.ucl"
1112 flash="$pwd/rockbox.ucl"
1113 plugins="yes"
1114 swcodec=""
1115 toolset=$archosbitmaptools
1116 t_cpu="sh"
1117 t_manufacturer="archos"
1118 t_model="ondio"
1121 6|archosav300)
1122 target_id=38
1123 modelname="archosav300"
1124 target="-DARCHOS_AV300"
1125 memory=16 # always
1126 arm7tdmicc
1127 tool="$rootdir/tools/scramble -mm=C"
1128 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1129 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1130 output="cjbm.ajz"
1131 appextra="recorder:gui"
1132 plugins="yes"
1133 swcodec=""
1134 # toolset is the tools within the tools directory that we build for
1135 # this particular target.
1136 toolset="$toolset scramble descramble bmp2rb"
1137 # architecture, manufacturer and model for the target-tree build
1138 t_cpu="arm"
1139 t_manufacturer="archos"
1140 t_model="av300"
1143 10|iriverh120)
1144 target_id=9
1145 modelname="iriverh120"
1146 target="-DIRIVER_H120"
1147 memory=32 # always
1148 coldfirecc
1149 tool="$rootdir/tools/scramble -add=h120"
1150 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1151 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1152 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1153 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1154 output="rockbox.iriver"
1155 bootoutput="bootloader.iriver"
1156 appextra="recorder:gui"
1157 flash="$pwd/rombox.iriver"
1158 plugins="yes"
1159 swcodec="yes"
1160 # toolset is the tools within the tools directory that we build for
1161 # this particular target.
1162 toolset=$iriverbitmaptools
1163 t_cpu="coldfire"
1164 t_manufacturer="iriver"
1165 t_model="h100"
1168 11|iriverh300)
1169 target_id=10
1170 modelname="iriverh300"
1171 target="-DIRIVER_H300"
1172 memory=32 # always
1173 coldfirecc
1174 tool="$rootdir/tools/scramble -add=h300"
1175 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1176 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1177 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1178 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1179 output="rockbox.iriver"
1180 appextra="recorder:gui"
1181 plugins="yes"
1182 swcodec="yes"
1183 # toolset is the tools within the tools directory that we build for
1184 # this particular target.
1185 toolset=$iriverbitmaptools
1186 t_cpu="coldfire"
1187 t_manufacturer="iriver"
1188 t_model="h300"
1191 12|iriverh100)
1192 target_id=11
1193 modelname="iriverh100"
1194 target="-DIRIVER_H100"
1195 memory=16 # always
1196 coldfirecc
1197 tool="$rootdir/tools/scramble -add=h100"
1198 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1199 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1200 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1201 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1202 output="rockbox.iriver"
1203 bootoutput="bootloader.iriver"
1204 appextra="recorder:gui"
1205 flash="$pwd/rombox.iriver"
1206 plugins="yes"
1207 swcodec="yes"
1208 # toolset is the tools within the tools directory that we build for
1209 # this particular target.
1210 toolset=$iriverbitmaptools
1211 t_cpu="coldfire"
1212 t_manufacturer="iriver"
1213 t_model="h100"
1216 13|iriverifp7xx)
1217 target_id=19
1218 modelname="iriverifp7xx"
1219 target="-DIRIVER_IFP7XX"
1220 memory=1
1221 arm7tdmicc short
1222 tool="cp"
1223 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1224 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1225 output="rockbox.wma"
1226 appextra="recorder:gui"
1227 plugins="yes"
1228 swcodec="yes"
1229 # toolset is the tools within the tools directory that we build for
1230 # this particular target.
1231 toolset=$genericbitmaptools
1232 t_cpu="arm"
1233 t_manufacturer="pnx0101"
1234 t_model="iriver-ifp7xx"
1237 14|iriverh10)
1238 target_id=22
1239 modelname="iriverh10"
1240 target="-DIRIVER_H10"
1241 memory=32 # always
1242 arm7tdmicc
1243 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1244 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1245 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1246 output="rockbox.mi4"
1247 appextra="recorder:gui"
1248 plugins="yes"
1249 swcodec="yes"
1250 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1251 bootoutput="H10_20GC.mi4"
1252 # toolset is the tools within the tools directory that we build for
1253 # this particular target.
1254 toolset=$scramblebitmaptools
1255 # architecture, manufacturer and model for the target-tree build
1256 t_cpu="arm"
1257 t_manufacturer="iriver"
1258 t_model="h10"
1261 15|iriverh10_5gb)
1262 target_id=24
1263 modelname="iriverh10_5gb"
1264 target="-DIRIVER_H10_5GB"
1265 memory=32 # always
1266 arm7tdmicc
1267 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1268 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1269 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1270 output="rockbox.mi4"
1271 appextra="recorder:gui"
1272 plugins="yes"
1273 swcodec="yes"
1274 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1275 bootoutput="H10.mi4"
1276 # toolset is the tools within the tools directory that we build for
1277 # this particular target.
1278 toolset=$scramblebitmaptools
1279 # architecture, manufacturer and model for the target-tree build
1280 t_cpu="arm"
1281 t_manufacturer="iriver"
1282 t_model="h10"
1285 20|ipodcolor)
1286 target_id=13
1287 modelname="ipodcolor"
1288 target="-DIPOD_COLOR"
1289 memory=32 # always
1290 arm7tdmicc
1291 tool="$rootdir/tools/scramble -add=ipco"
1292 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1293 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1294 output="rockbox.ipod"
1295 appextra="recorder:gui"
1296 plugins="yes"
1297 swcodec="yes"
1298 bootoutput="bootloader-$modelname.ipod"
1299 # toolset is the tools within the tools directory that we build for
1300 # this particular target.
1301 toolset=$ipodbitmaptools
1302 # architecture, manufacturer and model for the target-tree build
1303 t_cpu="arm"
1304 t_manufacturer="ipod"
1305 t_model="color"
1308 21|ipodnano1g)
1309 target_id=14
1310 modelname="ipodnano1g"
1311 target="-DIPOD_NANO"
1312 memory=32 # always
1313 arm7tdmicc
1314 tool="$rootdir/tools/scramble -add=nano"
1315 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1316 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1317 output="rockbox.ipod"
1318 appextra="recorder:gui"
1319 plugins="yes"
1320 swcodec="yes"
1321 bootoutput="bootloader-$modelname.ipod"
1322 # toolset is the tools within the tools directory that we build for
1323 # this particular target.
1324 toolset=$ipodbitmaptools
1325 # architecture, manufacturer and model for the target-tree build
1326 t_cpu="arm"
1327 t_manufacturer="ipod"
1328 t_model="nano"
1331 22|ipodvideo)
1332 target_id=15
1333 modelname="ipodvideo"
1334 target="-DIPOD_VIDEO"
1335 arm7tdmicc
1336 tool="$rootdir/tools/scramble -add=ipvd"
1337 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1338 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1339 output="rockbox.ipod"
1340 appextra="recorder:gui"
1341 plugins="yes"
1342 swcodec="yes"
1343 bootoutput="bootloader-$modelname.ipod"
1344 # toolset is the tools within the tools directory that we build for
1345 # this particular target.
1346 toolset=$ipodbitmaptools
1347 # architecture, manufacturer and model for the target-tree build
1348 t_cpu="arm"
1349 t_manufacturer="ipod"
1350 t_model="video"
1353 23|ipod3g)
1354 target_id=16
1355 modelname="ipod3g"
1356 target="-DIPOD_3G"
1357 memory=32 # always
1358 arm7tdmicc
1359 tool="$rootdir/tools/scramble -add=ip3g"
1360 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1361 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1362 output="rockbox.ipod"
1363 appextra="recorder:gui"
1364 plugins="yes"
1365 swcodec="yes"
1366 bootoutput="bootloader-$modelname.ipod"
1367 # toolset is the tools within the tools directory that we build for
1368 # this particular target.
1369 toolset=$ipodbitmaptools
1370 # architecture, manufacturer and model for the target-tree build
1371 t_cpu="arm"
1372 t_manufacturer="ipod"
1373 t_model="3g"
1376 24|ipod4g)
1377 target_id=17
1378 modelname="ipod4g"
1379 target="-DIPOD_4G"
1380 memory=32 # always
1381 arm7tdmicc
1382 tool="$rootdir/tools/scramble -add=ip4g"
1383 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1384 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1385 output="rockbox.ipod"
1386 appextra="recorder:gui"
1387 plugins="yes"
1388 swcodec="yes"
1389 bootoutput="bootloader-$modelname.ipod"
1390 # toolset is the tools within the tools directory that we build for
1391 # this particular target.
1392 toolset=$ipodbitmaptools
1393 # architecture, manufacturer and model for the target-tree build
1394 t_cpu="arm"
1395 t_manufacturer="ipod"
1396 t_model="4g"
1399 25|ipodmini1g)
1400 target_id=18
1401 modelname="ipodmini1g"
1402 target="-DIPOD_MINI"
1403 memory=32 # always
1404 arm7tdmicc
1405 tool="$rootdir/tools/scramble -add=mini"
1406 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1407 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1408 output="rockbox.ipod"
1409 appextra="recorder:gui"
1410 plugins="yes"
1411 swcodec="yes"
1412 bootoutput="bootloader-$modelname.ipod"
1413 # toolset is the tools within the tools directory that we build for
1414 # this particular target.
1415 toolset=$ipodbitmaptools
1416 # architecture, manufacturer and model for the target-tree build
1417 t_cpu="arm"
1418 t_manufacturer="ipod"
1419 t_model="mini"
1422 26|ipodmini2g)
1423 target_id=21
1424 modelname="ipodmini2g"
1425 target="-DIPOD_MINI2G"
1426 memory=32 # always
1427 arm7tdmicc
1428 tool="$rootdir/tools/scramble -add=mn2g"
1429 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1430 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1431 output="rockbox.ipod"
1432 appextra="recorder:gui"
1433 plugins="yes"
1434 swcodec="yes"
1435 bootoutput="bootloader-$modelname.ipod"
1436 # toolset is the tools within the tools directory that we build for
1437 # this particular target.
1438 toolset=$ipodbitmaptools
1439 # architecture, manufacturer and model for the target-tree build
1440 t_cpu="arm"
1441 t_manufacturer="ipod"
1442 t_model="mini2g"
1445 27|ipod1g2g)
1446 target_id=29
1447 modelname="ipod1g2g"
1448 target="-DIPOD_1G2G"
1449 memory=32 # always
1450 arm7tdmicc
1451 tool="$rootdir/tools/scramble -add=1g2g"
1452 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1453 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1454 output="rockbox.ipod"
1455 appextra="recorder:gui"
1456 plugins="yes"
1457 swcodec="yes"
1458 bootoutput="bootloader-$modelname.ipod"
1459 # toolset is the tools within the tools directory that we build for
1460 # this particular target.
1461 toolset=$ipodbitmaptools
1462 # architecture, manufacturer and model for the target-tree build
1463 t_cpu="arm"
1464 t_manufacturer="ipod"
1465 t_model="1g2g"
1468 28|ipodnano2g)
1469 target_id=62
1470 modelname="ipodnano2g"
1471 target="-DIPOD_NANO2G"
1472 memory=32 # always
1473 arm940tcc
1474 tool="$rootdir/tools/scramble -add=nn2g"
1475 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1476 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1477 output="rockbox.ipod"
1478 appextra="recorder:gui"
1479 plugins="yes"
1480 swcodec="yes"
1481 bootoutput="bootloader-$modelname.ipod"
1482 # toolset is the tools within the tools directory that we build for
1483 # this particular target.
1484 toolset=$ipodbitmaptools
1485 # architecture, manufacturer and model for the target-tree build
1486 t_cpu="arm"
1487 t_manufacturer="s5l8700"
1488 t_model="ipodnano2g"
1491 30|iaudiox5)
1492 target_id=12
1493 modelname="iaudiox5"
1494 target="-DIAUDIO_X5"
1495 memory=16 # always
1496 coldfirecc
1497 tool="$rootdir/tools/scramble -add=iax5"
1498 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1499 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1500 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1501 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1502 output="rockbox.iaudio"
1503 appextra="recorder:gui"
1504 plugins="yes"
1505 swcodec="yes"
1506 # toolset is the tools within the tools directory that we build for
1507 # this particular target.
1508 toolset="$iaudiobitmaptools"
1509 # architecture, manufacturer and model for the target-tree build
1510 t_cpu="coldfire"
1511 t_manufacturer="iaudio"
1512 t_model="x5"
1515 31|iaudiom5)
1516 target_id=28
1517 modelname="iaudiom5"
1518 target="-DIAUDIO_M5"
1519 memory=16 # always
1520 coldfirecc
1521 tool="$rootdir/tools/scramble -add=iam5"
1522 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1523 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1524 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1525 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1526 output="rockbox.iaudio"
1527 appextra="recorder:gui"
1528 plugins="yes"
1529 swcodec="yes"
1530 # toolset is the tools within the tools directory that we build for
1531 # this particular target.
1532 toolset="$iaudiobitmaptools"
1533 # architecture, manufacturer and model for the target-tree build
1534 t_cpu="coldfire"
1535 t_manufacturer="iaudio"
1536 t_model="m5"
1539 32|iaudio7)
1540 target_id=32
1541 modelname="iaudio7"
1542 target="-DIAUDIO_7"
1543 memory=16 # always
1544 arm946cc
1545 tool="$rootdir/tools/scramble -add=i7"
1546 boottool="$rootdir/tools/scramble -tcc=crc"
1547 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1548 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1549 output="rockbox.iaudio"
1550 appextra="recorder:gui"
1551 plugins="yes"
1552 swcodec="yes"
1553 bootoutput="I7_FW.BIN"
1554 # toolset is the tools within the tools directory that we build for
1555 # this particular target.
1556 toolset="$tccbitmaptools"
1557 # architecture, manufacturer and model for the target-tree build
1558 t_cpu="arm"
1559 t_manufacturer="tcc77x"
1560 t_model="iaudio7"
1563 33|cowond2)
1564 target_id=34
1565 modelname="cowond2"
1566 target="-DCOWON_D2"
1567 memory=32
1568 arm926ejscc
1569 tool="$rootdir/tools/scramble -add=d2"
1570 boottool="cp "
1571 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1572 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1573 output="rockbox.d2"
1574 bootoutput="bootloader-cowond2.bin"
1575 appextra="recorder:gui"
1576 plugins="yes"
1577 swcodec="yes"
1578 toolset="$tccbitmaptools"
1579 # architecture, manufacturer and model for the target-tree build
1580 t_cpu="arm"
1581 t_manufacturer="tcc780x"
1582 t_model="cowond2"
1585 34|iaudiom3)
1586 target_id=37
1587 modelname="iaudiom3"
1588 target="-DIAUDIO_M3"
1589 memory=16 # always
1590 coldfirecc
1591 tool="$rootdir/tools/scramble -add=iam3"
1592 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1593 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1594 output="rockbox.iaudio"
1595 appextra="recorder:gui"
1596 plugins="yes"
1597 swcodec="yes"
1598 # toolset is the tools within the tools directory that we build for
1599 # this particular target.
1600 toolset="$iaudiobitmaptools"
1601 # architecture, manufacturer and model for the target-tree build
1602 t_cpu="coldfire"
1603 t_manufacturer="iaudio"
1604 t_model="m3"
1607 40|gigabeatfx)
1608 target_id=20
1609 modelname="gigabeatfx"
1610 target="-DGIGABEAT_F"
1611 memory=32 # always
1612 arm9tdmicc
1613 tool="$rootdir/tools/scramble -add=giga"
1614 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1615 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1616 output="rockbox.gigabeat"
1617 appextra="recorder:gui"
1618 plugins="yes"
1619 swcodec="yes"
1620 toolset=$gigabeatbitmaptools
1621 boottool="$rootdir/tools/scramble -gigabeat"
1622 bootoutput="FWIMG01.DAT"
1623 # architecture, manufacturer and model for the target-tree build
1624 t_cpu="arm"
1625 t_manufacturer="s3c2440"
1626 t_model="gigabeat-fx"
1629 41|gigabeats)
1630 target_id=26
1631 modelname="gigabeats"
1632 target="-DGIGABEAT_S"
1633 memory=64
1634 arm1136jfscc
1635 tool="$rootdir/tools/scramble -add=gigs"
1636 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1637 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1638 output="rockbox.gigabeat"
1639 appextra="recorder:gui"
1640 plugins="yes"
1641 swcodec="yes"
1642 toolset="$gigabeatbitmaptools"
1643 boottool="$rootdir/tools/scramble -gigabeats"
1644 bootoutput="nk.bin"
1645 # architecture, manufacturer and model for the target-tree build
1646 t_cpu="arm"
1647 t_manufacturer="imx31"
1648 t_model="gigabeat-s"
1651 70|mrobe500)
1652 target_id=36
1653 modelname="mrobe500"
1654 target="-DMROBE_500"
1655 memory=64 # always
1656 arm926ejscc
1657 tool="$rootdir/tools/scramble -add=m500"
1658 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1659 bmp2rb_native="$rootdir/tools/bmp2rb -f 8"
1660 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1661 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1662 output="rockbox.mrobe500"
1663 appextra="recorder:gui"
1664 plugins="yes"
1665 swcodec="yes"
1666 toolset=$gigabeatbitmaptools
1667 boottool="cp "
1668 bootoutput="rockbox.mrboot"
1669 # architecture, manufacturer and model for the target-tree build
1670 t_cpu="arm"
1671 t_manufacturer="tms320dm320"
1672 t_model="mrobe-500"
1675 71|mrobe100)
1676 target_id=33
1677 modelname="mrobe100"
1678 target="-DMROBE_100"
1679 memory=32 # always
1680 arm7tdmicc
1681 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1682 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1683 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1684 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1685 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1686 output="rockbox.mi4"
1687 appextra="recorder:gui"
1688 plugins="yes"
1689 swcodec="yes"
1690 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1691 bootoutput="pp5020.mi4"
1692 # toolset is the tools within the tools directory that we build for
1693 # this particular target.
1694 toolset=$scramblebitmaptools
1695 # architecture, manufacturer and model for the target-tree build
1696 t_cpu="arm"
1697 t_manufacturer="olympus"
1698 t_model="mrobe-100"
1701 80|logikdax)
1702 target_id=31
1703 modelname="logikdax"
1704 target="-DLOGIK_DAX"
1705 memory=2 # always
1706 arm946cc
1707 tool="$rootdir/tools/scramble -add=ldax"
1708 boottool="$rootdir/tools/scramble -tcc=crc"
1709 bootoutput="player.rom"
1710 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1711 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1712 output="rockbox.logik"
1713 appextra="recorder:gui"
1714 plugins=""
1715 swcodec="yes"
1716 # toolset is the tools within the tools directory that we build for
1717 # this particular target.
1718 toolset=$tccbitmaptools
1719 # architecture, manufacturer and model for the target-tree build
1720 t_cpu="arm"
1721 t_manufacturer="tcc77x"
1722 t_model="logikdax"
1725 90|zenvisionm30gb)
1726 target_id=35
1727 modelname="zenvisionm30gb"
1728 target="-DCREATIVE_ZVM"
1729 memory=64
1730 arm926ejscc
1731 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1732 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1733 tool="$rootdir/tools/scramble -creative=zvm"
1734 USE_ELF="yes"
1735 output="rockbox.zvm"
1736 appextra="recorder:gui"
1737 plugins="yes"
1738 swcodec="yes"
1739 toolset=$ipodbitmaptools
1740 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1741 bootoutput="rockbox.zvmboot"
1742 # architecture, manufacturer and model for the target-tree build
1743 t_cpu="arm"
1744 t_manufacturer="tms320dm320"
1745 t_model="creative-zvm"
1748 91|zenvisionm60gb)
1749 target_id=40
1750 modelname="zenvisionm60gb"
1751 target="-DCREATIVE_ZVM60GB"
1752 memory=64
1753 arm926ejscc
1754 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1755 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1756 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1757 USE_ELF="yes"
1758 output="rockbox.zvm60"
1759 appextra="recorder:gui"
1760 plugins="yes"
1761 swcodec="yes"
1762 toolset=$ipodbitmaptools
1763 boottool="$rootdir/tools/scramble -creative=zvm60"
1764 bootoutput="rockbox.zvm60boot"
1765 # architecture, manufacturer and model for the target-tree build
1766 t_cpu="arm"
1767 t_manufacturer="tms320dm320"
1768 t_model="creative-zvm"
1771 92|zenvision)
1772 target_id=39
1773 modelname="zenvision"
1774 target="-DCREATIVE_ZV"
1775 memory=64
1776 arm926ejscc
1777 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1778 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1779 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1780 USE_ELF="yes"
1781 output="rockbox.zv"
1782 appextra="recorder:gui"
1783 plugins=""
1784 swcodec="yes"
1785 toolset=$ipodbitmaptools
1786 boottool="$rootdir/tools/scramble -creative=zenvision"
1787 bootoutput="rockbox.zvboot"
1788 # architecture, manufacturer and model for the target-tree build
1789 t_cpu="arm"
1790 t_manufacturer="tms320dm320"
1791 t_model="creative-zvm"
1794 50|sansae200)
1795 target_id=23
1796 modelname="sansae200"
1797 target="-DSANSA_E200"
1798 memory=32 # supposedly
1799 arm7tdmicc
1800 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1801 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1802 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1803 output="rockbox.mi4"
1804 appextra="recorder:gui"
1805 plugins="yes"
1806 swcodec="yes"
1807 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1808 bootoutput="PP5022.mi4"
1809 # toolset is the tools within the tools directory that we build for
1810 # this particular target.
1811 toolset=$scramblebitmaptools
1812 # architecture, manufacturer and model for the target-tree build
1813 t_cpu="arm"
1814 t_manufacturer="sandisk"
1815 t_model="sansa-e200"
1818 51|sansae200r)
1819 # the e200R model is pretty much identical to the e200, it only has a
1820 # different option to the scramble tool when building a bootloader and
1821 # makes the bootloader output file name in all lower case.
1822 target_id=27
1823 modelname="sansae200r"
1824 target="-DSANSA_E200"
1825 memory=32 # supposedly
1826 arm7tdmicc
1827 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1828 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1829 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1830 output="rockbox.mi4"
1831 appextra="recorder:gui"
1832 plugins="yes"
1833 swcodec="yes"
1834 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1835 bootoutput="pp5022.mi4"
1836 # toolset is the tools within the tools directory that we build for
1837 # this particular target.
1838 toolset=$scramblebitmaptools
1839 # architecture, manufacturer and model for the target-tree build
1840 t_cpu="arm"
1841 t_manufacturer="sandisk"
1842 t_model="sansa-e200"
1845 52|sansac200)
1846 target_id=30
1847 modelname="sansac200"
1848 target="-DSANSA_C200"
1849 memory=32 # supposedly
1850 arm7tdmicc
1851 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1852 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1853 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1854 output="rockbox.mi4"
1855 appextra="recorder:gui"
1856 plugins="yes"
1857 swcodec="yes"
1858 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1859 bootoutput="firmware.mi4"
1860 # toolset is the tools within the tools directory that we build for
1861 # this particular target.
1862 toolset=$scramblebitmaptools
1863 # architecture, manufacturer and model for the target-tree build
1864 t_cpu="arm"
1865 t_manufacturer="sandisk"
1866 t_model="sansa-c200"
1869 53|sansam200)
1870 target_id=48
1871 modelname="sansam200"
1872 target="-DSANSA_M200"
1873 memory=1 # always
1874 arm946cc
1875 tool="$rootdir/tools/scramble -add=m200"
1876 boottool="$rootdir/tools/scramble -tcc=crc"
1877 bootoutput="player.rom"
1878 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1879 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1880 output="rockbox.m200"
1881 appextra="recorder:gui"
1882 plugins=""
1883 swcodec="yes"
1884 # toolset is the tools within the tools directory that we build for
1885 # this particular target.
1886 toolset=$tccbitmaptools
1887 # architecture, manufacturer and model for the target-tree build
1888 t_cpu="arm"
1889 t_manufacturer="tcc77x"
1890 t_model="m200"
1893 54|sansac100)
1894 target_id=42
1895 modelname="sansac100"
1896 target="-DSANSA_C100"
1897 memory=2
1898 arm946cc
1899 tool="$rootdir/tools/scramble -add=c100"
1900 boottool="$rootdir/tools/scramble -tcc=crc"
1901 bootoutput="player.rom"
1902 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1903 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1904 output="rockbox.c100"
1905 appextra="recorder:gui"
1906 plugins=""
1907 swcodec="yes"
1908 # toolset is the tools within the tools directory that we build for
1909 # this particular target.
1910 toolset=$tccbitmaptools
1911 # architecture, manufacturer and model for the target-tree build
1912 t_cpu="arm"
1913 t_manufacturer="tcc77x"
1914 t_model="c100"
1917 55|sansaclip)
1918 target_id=50
1919 modelname="sansaclip"
1920 target="-DSANSA_CLIP"
1921 memory=2
1922 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1923 bmp2rb_native="$bmp2rb_mono"
1924 tool="$rootdir/tools/scramble -add=clip"
1925 output="rockbox.sansa"
1926 bootoutput="bootloader-clip.sansa"
1927 appextra="recorder:gui"
1928 plugins="yes"
1929 swcodec="yes"
1930 toolset=$scramblebitmaptools
1931 t_cpu="arm"
1932 t_manufacturer="as3525"
1933 t_model="sansa-clip"
1934 arm9tdmicc
1938 56|sansae200v2)
1939 target_id=51
1940 modelname="sansae200v2"
1941 target="-DSANSA_E200V2"
1942 memory=8
1943 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1944 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1945 tool="$rootdir/tools/scramble -add=e2v2"
1946 output="rockbox.sansa"
1947 bootoutput="bootloader-e200v2.sansa"
1948 appextra="recorder:gui"
1949 plugins="yes"
1950 swcodec="yes"
1951 toolset=$scramblebitmaptools
1952 t_cpu="arm"
1953 t_manufacturer="as3525"
1954 t_model="sansa-e200v2"
1955 arm9tdmicc
1959 57|sansam200v4)
1960 target_id=52
1961 modelname="sansam200v4"
1962 target="-DSANSA_M200V4"
1963 memory=2
1964 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1965 bmp2rb_native="$bmp2rb_mono"
1966 tool="$rootdir/tools/scramble -add=m2v4"
1967 output="rockbox.sansa"
1968 bootoutput="bootloader-m200v4.sansa"
1969 appextra="recorder:gui"
1970 plugins="yes"
1971 swcodec="yes"
1972 toolset=$scramblebitmaptools
1973 t_cpu="arm"
1974 t_manufacturer="as3525"
1975 t_model="sansa-m200v4"
1976 arm9tdmicc
1980 58|sansafuze)
1981 target_id=53
1982 modelname="sansafuze"
1983 target="-DSANSA_FUZE"
1984 memory=8
1985 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1986 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1987 tool="$rootdir/tools/scramble -add=fuze"
1988 output="rockbox.sansa"
1989 bootoutput="bootloader-fuze.sansa"
1990 appextra="recorder:gui"
1991 plugins="yes"
1992 swcodec="yes"
1993 toolset=$scramblebitmaptools
1994 t_cpu="arm"
1995 t_manufacturer="as3525"
1996 t_model="sansa-fuze"
1997 arm9tdmicc
2001 59|sansac200v2)
2002 target_id=55
2003 modelname="sansac200v2"
2004 target="-DSANSA_C200V2"
2005 memory=2 # as per OF diagnosis mode
2006 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2007 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2008 tool="$rootdir/tools/scramble -add=c2v2"
2009 output="rockbox.sansa"
2010 bootoutput="bootloader-c200v2.sansa"
2011 appextra="recorder:gui"
2012 plugins="yes"
2013 swcodec="yes"
2014 # toolset is the tools within the tools directory that we build for
2015 # this particular target.
2016 toolset=$scramblebitmaptools
2017 # architecture, manufacturer and model for the target-tree build
2018 t_cpu="arm"
2019 t_manufacturer="as3525"
2020 t_model="sansa-c200v2"
2021 arm9tdmicc
2024 60|sansaclipv2)
2025 target_id=60
2026 modelname="sansaclipv2"
2027 target="-DSANSA_CLIPV2"
2028 memory=8
2029 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2030 bmp2rb_native="$bmp2rb_mono"
2031 tool="$rootdir/tools/scramble -add=clv2"
2032 output="rockbox.sansa"
2033 bootoutput="bootloader-clipv2.sansa"
2034 appextra="recorder:gui"
2035 plugins="yes"
2036 swcodec="yes"
2037 toolset=$scramblebitmaptools
2038 t_cpu="arm"
2039 t_manufacturer="as3525"
2040 t_model="sansa-clipv2"
2041 arm926ejscc
2044 61|sansaview)
2045 echo "Sansa View is not yet supported!"
2046 exit 1
2047 target_id=63
2048 modelname="sansaview"
2049 target="-DSANSA_VIEW"
2050 memory=32
2051 arm1176jzscc
2052 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2053 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2054 output="rockbox.mi4"
2055 appextra="gui"
2056 plugins=""
2057 swcodec="yes"
2058 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2059 bootoutput="firmware.mi4"
2060 # toolset is the tools within the tools directory that we build for
2061 # this particular target.
2062 toolset=$scramblebitmaptools
2063 t_cpu="arm"
2064 t_manufacturer="sandisk"
2065 t_model="sansa-view"
2068 62|sansaclipplus)
2069 target_id=66
2070 modelname="sansaclipplus"
2071 target="-DSANSA_CLIPPLUS"
2072 memory=8
2073 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2074 bmp2rb_native="$bmp2rb_mono"
2075 tool="$rootdir/tools/scramble -add=cli+"
2076 output="rockbox.sansa"
2077 bootoutput="bootloader-clipplus.sansa"
2078 appextra="recorder:gui"
2079 plugins="yes"
2080 swcodec="yes"
2081 toolset=$scramblebitmaptools
2082 t_cpu="arm"
2083 t_manufacturer="as3525"
2084 t_model="sansa-clipplus"
2085 arm926ejscc
2088 63|sansafuzev2)
2089 target_id=68
2090 modelname="sansafuzev2"
2091 target="-DSANSA_FUZEV2"
2092 memory=8 # not sure
2093 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2094 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2095 tool="$rootdir/tools/scramble -add=fuz2"
2096 output="rockbox.sansa"
2097 bootoutput="bootloader-fuzev2.sansa"
2098 appextra="recorder:gui"
2099 plugins=#"yes"
2100 swcodec="yes"
2101 toolset=$scramblebitmaptools
2102 t_cpu="arm"
2103 t_manufacturer="as3525"
2104 t_model="sansa-fuzev2"
2105 arm926ejscc
2108 150|tatungtpj1022)
2109 target_id=25
2110 modelname="tatungtpj1022"
2111 target="-DTATUNG_TPJ1022"
2112 memory=32 # always
2113 arm7tdmicc
2114 tool="$rootdir/tools/scramble -add tpj2"
2115 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2116 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2117 output="rockbox.elio"
2118 appextra="recorder:gui"
2119 plugins="yes"
2120 swcodec="yes"
2121 boottool="$rootdir/tools/scramble -mi4v2"
2122 bootoutput="pp5020.mi4"
2123 # toolset is the tools within the tools directory that we build for
2124 # this particular target.
2125 toolset=$scramblebitmaptools
2126 # architecture, manufacturer and model for the target-tree build
2127 t_cpu="arm"
2128 t_manufacturer="tatung"
2129 t_model="tpj1022"
2132 100|gogearsa9200)
2133 target_id=41
2134 modelname="gogearsa9200"
2135 target="-DPHILIPS_SA9200"
2136 memory=32 # supposedly
2137 arm7tdmicc
2138 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2139 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2140 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2141 output="rockbox.mi4"
2142 appextra="recorder:gui"
2143 plugins=""
2144 swcodec="yes"
2145 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2146 bootoutput="FWImage.ebn"
2147 # toolset is the tools within the tools directory that we build for
2148 # this particular target.
2149 toolset=$scramblebitmaptools
2150 # architecture, manufacturer and model for the target-tree build
2151 t_cpu="arm"
2152 t_manufacturer="philips"
2153 t_model="sa9200"
2156 101|gogearhdd1630)
2157 target_id=43
2158 modelname="gogearhdd1630"
2159 target="-DPHILIPS_HDD1630"
2160 memory=32 # supposedly
2161 arm7tdmicc
2162 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2163 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2164 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2165 output="rockbox.mi4"
2166 appextra="recorder:gui"
2167 plugins="yes"
2168 swcodec="yes"
2169 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2170 bootoutput="FWImage.ebn"
2171 # toolset is the tools within the tools directory that we build for
2172 # this particular target.
2173 toolset=$scramblebitmaptools
2174 # architecture, manufacturer and model for the target-tree build
2175 t_cpu="arm"
2176 t_manufacturer="philips"
2177 t_model="hdd1630"
2180 102|gogearhdd6330)
2181 target_id=65
2182 modelname="gogearhdd6330"
2183 target="-DPHILIPS_HDD6330"
2184 memory=32 # supposedly
2185 arm7tdmicc
2186 tool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBOS"
2187 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2188 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2189 output="rockbox.mi4"
2190 appextra="recorder:gui"
2191 plugins=""
2192 swcodec="yes"
2193 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL"
2194 bootoutput="FWImage.ebn"
2195 # toolset is the tools within the tools directory that we build for
2196 # this particular target.
2197 toolset=$scramblebitmaptools
2198 # architecture, manufacturer and model for the target-tree build
2199 t_cpu="arm"
2200 t_manufacturer="philips"
2201 t_model="hdd6330"
2204 110|meizum6sl)
2205 target_id=49
2206 modelname="meizum6sl"
2207 target="-DMEIZU_M6SL"
2208 memory=16 # always
2209 arm940tbecc
2210 tool="cp"
2211 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2212 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2213 output="rockbox.meizu"
2214 appextra="recorder:gui"
2215 plugins="no" #FIXME
2216 swcodec="yes"
2217 toolset=$genericbitmaptools
2218 boottool="cp"
2219 bootoutput="rockboot.ebn"
2220 # architecture, manufacturer and model for the target-tree build
2221 t_cpu="arm"
2222 t_manufacturer="s5l8700"
2223 t_model="meizu-m6sl"
2226 111|meizum6sp)
2227 target_id=46
2228 modelname="meizum6sp"
2229 target="-DMEIZU_M6SP"
2230 memory=16 # always
2231 arm940tbecc
2232 tool="cp"
2233 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2234 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2235 output="rockbox.meizu"
2236 appextra="recorder:gui"
2237 plugins="no" #FIXME
2238 swcodec="yes"
2239 toolset=$genericbitmaptools
2240 boottool="cp"
2241 bootoutput="rockboot.ebn"
2242 # architecture, manufacturer and model for the target-tree build
2243 t_cpu="arm"
2244 t_manufacturer="s5l8700"
2245 t_model="meizu-m6sp"
2248 112|meizum3)
2249 target_id=47
2250 modelname="meizum3"
2251 target="-DMEIZU_M3"
2252 memory=16 # always
2253 arm940tbecc
2254 tool="cp"
2255 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2256 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2257 output="rockbox.meizu"
2258 appextra="recorder:gui"
2259 plugins="no" #FIXME
2260 swcodec="yes"
2261 toolset=$genericbitmaptools
2262 boottool="cp"
2263 bootoutput="rockboot.ebn"
2264 # architecture, manufacturer and model for the target-tree build
2265 t_cpu="arm"
2266 t_manufacturer="s5l8700"
2267 t_model="meizu-m3"
2270 120|ondavx747)
2271 target_id=45
2272 modelname="ondavx747"
2273 target="-DONDA_VX747"
2274 memory=16
2275 mipselcc
2276 tool="$rootdir/tools/scramble -add=x747"
2277 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2278 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2279 output="rockbox.vx747"
2280 appextra="recorder:gui"
2281 plugins="yes"
2282 swcodec="yes"
2283 toolset=$genericbitmaptools
2284 boottool="$rootdir/tools/scramble -ccpmp"
2285 bootoutput="ccpmp.bin"
2286 # architecture, manufacturer and model for the target-tree build
2287 t_cpu="mips"
2288 t_manufacturer="ingenic_jz47xx"
2289 t_model="onda_vx747"
2292 121|ondavx767)
2293 target_id=64
2294 modelname="ondavx767"
2295 target="-DONDA_VX767"
2296 memory=16 #FIXME
2297 mipselcc
2298 tool="cp"
2299 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2300 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2301 output="rockbox.vx767"
2302 appextra="recorder:gui"
2303 plugins="" #FIXME
2304 swcodec="yes"
2305 toolset=$genericbitmaptools
2306 boottool="$rootdir/tools/scramble -ccpmp"
2307 bootoutput="ccpmp.bin"
2308 # architecture, manufacturer and model for the target-tree build
2309 t_cpu="mips"
2310 t_manufacturer="ingenic_jz47xx"
2311 t_model="onda_vx767"
2314 122|ondavx747p)
2315 target_id=54
2316 modelname="ondavx747p"
2317 target="-DONDA_VX747P"
2318 memory=16
2319 mipselcc
2320 tool="$rootdir/tools/scramble -add=747p"
2321 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2322 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2323 output="rockbox.vx747p"
2324 appextra="recorder:gui"
2325 plugins="yes"
2326 swcodec="yes"
2327 toolset=$genericbitmaptools
2328 boottool="$rootdir/tools/scramble -ccpmp"
2329 bootoutput="ccpmp.bin"
2330 # architecture, manufacturer and model for the target-tree build
2331 t_cpu="mips"
2332 t_manufacturer="ingenic_jz47xx"
2333 t_model="onda_vx747"
2336 123|ondavx777)
2337 target_id=61
2338 modelname="ondavx777"
2339 target="-DONDA_VX777"
2340 memory=16
2341 mipselcc
2342 tool="$rootdir/tools/scramble -add=x777"
2343 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2344 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2345 output="rockbox.vx777"
2346 appextra="recorder:gui"
2347 plugins="yes"
2348 swcodec="yes"
2349 toolset=$genericbitmaptools
2350 boottool="$rootdir/tools/scramble -ccpmp"
2351 bootoutput="ccpmp.bin"
2352 # architecture, manufacturer and model for the target-tree build
2353 t_cpu="mips"
2354 t_manufacturer="ingenic_jz47xx"
2355 t_model="onda_vx747"
2358 130|lyreproto1)
2359 target_id=56
2360 modelname="lyreproto1"
2361 target="-DLYRE_PROTO1"
2362 memory=64
2363 arm926ejscc
2364 tool="cp"
2365 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2366 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2367 output="rockbox.lyre"
2368 appextra="recorder:gui"
2369 plugins=""
2370 swcodec="yes"
2371 toolset=$scramblebitmaptools
2372 boottool="cp"
2373 bootoutput="bootloader-proto1.lyre"
2374 # architecture, manufacturer and model for the target-tree build
2375 t_cpu="arm"
2376 t_manufacturer="at91sam"
2377 t_model="lyre_proto1"
2380 131|mini2440)
2381 target_id=99
2382 modelname="mini2440"
2383 target="-DMINI2440"
2384 memory=64
2385 arm9tdmicc
2386 tool="$rootdir/tools/scramble -add=m244"
2387 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2388 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2389 output="rockbox.mini2440"
2390 appextra="recorder:gui"
2391 plugins=""
2392 swcodec="yes"
2393 toolset=$scramblebitmaptools
2394 boottool="cp"
2395 bootoutput="bootloader-mini2440.lyre"
2396 # architecture, manufacturer and model for the target-tree build
2397 t_cpu="arm"
2398 t_manufacturer="s3c2440"
2399 t_model="mini2440"
2402 140|samsungyh820)
2403 target_id=57
2404 modelname="samsungyh820"
2405 target="-DSAMSUNG_YH820"
2406 memory=32 # always
2407 arm7tdmicc
2408 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2409 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2410 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2411 output="rockbox.mi4"
2412 appextra="recorder:gui"
2413 plugins="yes"
2414 swcodec="yes"
2415 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2416 bootoutput="FW_YH820.mi4"
2417 # toolset is the tools within the tools directory that we build for
2418 # this particular target.
2419 toolset=$scramblebitmaptools
2420 # architecture, manufacturer and model for the target-tree build
2421 t_cpu="arm"
2422 t_manufacturer="samsung"
2423 t_model="yh820"
2426 141|samsungyh920)
2427 target_id=58
2428 modelname="samsungyh920"
2429 target="-DSAMSUNG_YH920"
2430 memory=32 # always
2431 arm7tdmicc
2432 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2433 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2434 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2435 output="rockbox.mi4"
2436 appextra="recorder:gui"
2437 plugins="yes"
2438 swcodec="yes"
2439 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2440 bootoutput="PP5020.mi4"
2441 # toolset is the tools within the tools directory that we build for
2442 # this particular target.
2443 toolset=$scramblebitmaptools
2444 # architecture, manufacturer and model for the target-tree build
2445 t_cpu="arm"
2446 t_manufacturer="samsung"
2447 t_model="yh920"
2450 142|samsungyh925)
2451 target_id=59
2452 modelname="samsungyh925"
2453 target="-DSAMSUNG_YH925"
2454 memory=32 # always
2455 arm7tdmicc
2456 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2457 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2458 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2459 output="rockbox.mi4"
2460 appextra="recorder:gui"
2461 plugins="yes"
2462 swcodec="yes"
2463 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2464 bootoutput="FW_YH925.mi4"
2465 # toolset is the tools within the tools directory that we build for
2466 # this particular target.
2467 toolset=$scramblebitmaptools
2468 # architecture, manufacturer and model for the target-tree build
2469 t_cpu="arm"
2470 t_manufacturer="samsung"
2471 t_model="yh925"
2474 143|samsungyps3)
2475 target_id=60
2476 modelname="samsungyps3"
2477 target="-DSAMSUNG_YPS3"
2478 memory=16 # always
2479 arm940tbecc
2480 tool="cp"
2481 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2482 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2483 output="rockbox.yps3"
2484 appextra="recorder:gui"
2485 plugins="no" #FIXME
2486 swcodec="yes"
2487 toolset=$genericbitmaptools
2488 boottool="cp"
2489 bootoutput="rockboot.ebn"
2490 # architecture, manufacturer and model for the target-tree build
2491 t_cpu="arm"
2492 t_manufacturer="s5l8700"
2493 t_model="yps3"
2496 160|vibe500)
2497 target_id=67
2498 modelname="vibe500"
2499 target="-DPBELL_VIBE500"
2500 memory=32 # always
2501 arm7tdmicc
2502 tool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBOS"
2503 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2504 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2505 output="rockbox.mi4"
2506 appextra="recorder:gui"
2507 plugins="yes"
2508 swcodec="yes"
2509 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL"
2510 bootoutput="jukebox.mi4"
2511 # toolset is the tools within the tools directory that we build for
2512 # this particular target.
2513 toolset=$scramblebitmaptools
2514 # architecture, manufacturer and model for the target-tree build
2515 t_cpu="arm"
2516 t_manufacturer="pbell"
2517 t_model="vibe500"
2521 echo "Please select a supported target platform!"
2522 exit 7
2525 esac
2527 echo "Platform set to $modelname"
2530 #remove start
2531 ############################################################################
2532 # Amount of memory, for those that can differ. They have $memory unset at
2533 # this point.
2536 if [ -z "$memory" ]; then
2537 case $target_id in
2539 if [ "$ARG_RAM" ]; then
2540 size=$ARG_RAM
2541 else
2542 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2543 size=`input`;
2545 case $size in
2546 60|64)
2547 memory="64"
2550 memory="32"
2552 esac
2555 if [ "$ARG_RAM" ]; then
2556 size=$ARG_RAM
2557 else
2558 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2559 size=`input`;
2561 case $size in
2563 memory="8"
2566 memory="2"
2568 esac
2570 esac
2571 echo "Memory size selected: $memory MB"
2572 [ "$ARG_TYPE" ] || echo ""
2574 #remove end
2576 ##################################################################
2577 # Figure out build "type"
2580 # the ifp7x0 is the only platform that supports building a gdb stub like
2581 # this
2582 case $modelname in
2583 iriverifp7xx)
2584 gdbstub="(G)DB stub, "
2586 sansae200r|sansae200)
2587 gdbstub="(I)nstaller, "
2589 sansac200)
2590 gdbstub="(E)raser, "
2594 esac
2595 if [ "$ARG_TYPE" ]; then
2596 btype=$ARG_TYPE
2597 else
2598 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2599 btype=`input`;
2602 case $btype in
2603 [Ii])
2604 appsdir='\$(ROOTDIR)/bootloader'
2605 apps="bootloader"
2606 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2607 bootloader="1"
2608 echo "e200R-installer build selected"
2610 [Ee])
2611 appsdir='\$(ROOTDIR)/bootloader'
2612 apps="bootloader"
2613 echo "C2(4)0 or C2(5)0"
2614 variant=`input`
2615 case $variant in
2617 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2618 echo "c240 eraser build selected"
2621 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2622 echo "c240 eraser build selected"
2624 esac
2625 bootloader="1"
2626 echo "c200 eraser build selected"
2628 [Bb])
2629 if test $t_manufacturer = "archos"; then
2630 # Archos SH-based players do this somewhat differently for
2631 # some reason
2632 appsdir='\$(ROOTDIR)/flash/bootbox'
2633 apps="bootbox"
2634 else
2635 appsdir='\$(ROOTDIR)/bootloader'
2636 apps="bootloader"
2637 flash=""
2638 if test -n "$boottool"; then
2639 tool="$boottool"
2641 if test -n "$bootoutput"; then
2642 output=$bootoutput
2645 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2646 bootloader="1"
2647 echo "Bootloader build selected"
2649 [Ss])
2650 if [ "$modelname" = "sansae200r" ]; then
2651 echo "Do not use the e200R target for simulator builds. Use e200 instead."
2652 exit 8
2654 debug="-DDEBUG"
2655 simulator="yes"
2656 extradefines="-DSIMULATOR"
2657 archosrom=""
2658 flash=""
2659 echo "Simulator build selected"
2661 [Aa]*)
2662 echo "Advanced build selected"
2663 whichadvanced $btype
2665 [Gg])
2666 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2667 appsdir='\$(ROOTDIR)/gdb'
2668 apps="stub"
2669 case $modelname in
2670 iriverifp7xx)
2671 output="stub.wma"
2675 esac
2676 echo "GDB stub build selected"
2678 [Mm])
2679 toolset='';
2680 apps="manual"
2681 echo "Manual build selected"
2683 [Cc])
2684 uname=`uname`
2685 simcc "checkwps"
2686 toolset='';
2687 t_cpu='';
2688 GCCOPTS='';
2689 extradefines="-DDEBUG"
2690 appsdir='\$(ROOTDIR)/tools/checkwps';
2691 output='checkwps.'${modelname};
2692 archosrom='';
2693 echo "CheckWPS build selected"
2695 [Dd])
2696 uname=`uname`
2697 simcc "database"
2698 toolset='';
2699 t_cpu='';
2700 GCCOPTS='';
2701 appsdir='\$(ROOTDIR)/tools/database';
2702 archosrom='';
2704 case $uname in
2705 CYGWIN*|MINGW*)
2706 output="database_${modelname}.exe"
2709 output='database.'${modelname};
2711 esac
2713 echo "Database tool build selected"
2716 if [ "$modelname" = "sansae200r" ]; then
2717 echo "Do not use the e200R target for regular builds. Use e200 instead."
2718 exit 8
2720 debug=""
2721 btype="N" # set it explicitly since RET only gets here as well
2722 echo "Normal build selected"
2725 esac
2726 # to be able running "make manual" from non-manual configuration
2727 case $modelname in
2728 archosrecorderv2)
2729 manualdev="archosfmrecorder"
2731 iriverh1??)
2732 manualdev="iriverh100"
2734 ipodmini2g)
2735 manualdev="ipodmini1g"
2738 manualdev=$modelname
2740 esac
2742 if [ -z "$debug" ]; then
2743 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2746 echo "Using source code root directory: $rootdir"
2748 # this was once possible to change at build-time, but no more:
2749 language="english"
2751 uname=`uname`
2753 if [ "yes" = "$simulator" ]; then
2754 # setup compiler and things for simulator
2755 simcc "sdl"
2757 if [ -d "simdisk" ]; then
2758 echo "Subdirectory 'simdisk' already present"
2759 else
2760 mkdir simdisk
2761 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2765 # Now, figure out version number of the (gcc) compiler we are about to use
2766 gccver=`$CC -dumpversion`;
2768 # figure out the binutil version too and display it, mostly for the build
2769 # system etc to be able to see it easier
2770 if [ $uname = "Darwin" ]; then
2771 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2772 else
2773 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2776 if [ -z "$gccver" ]; then
2777 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2778 echo "[WARNING] this may cause your build to fail since we cannot do the"
2779 echo "[WARNING] checks we want now."
2780 else
2782 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2783 # DEPEND on it
2785 num1=`echo $gccver | cut -d . -f1`
2786 num2=`echo $gccver | cut -d . -f2`
2787 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2789 # This makes:
2790 # 3.3.X => 303
2791 # 3.4.X => 304
2792 # 2.95.3 => 295
2794 echo "Using $CC $gccver ($gccnum)"
2796 if test "$gccnum" -ge "400"; then
2797 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2798 # so we ignore that warnings for now
2799 # -Wno-pointer-sign
2800 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2803 if test "$gccnum" -ge "401"; then
2804 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2805 # will break strict-aliasing rules"
2807 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2810 if test "$gccnum" -ge "402"; then
2811 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2812 # and later would throw it for several valid cases
2813 GCCOPTS="$GCCOPTS -Wno-override-init"
2816 case $prefix in
2818 # simulator
2820 i586-mingw32msvc-)
2821 # cross-compile for win32
2824 # Verify that the cross-compiler is of a recommended version!
2825 if test "$gccver" != "$gccchoice"; then
2826 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2827 echo "WARNING: version $gccchoice!"
2828 echo "WARNING: This may cause your build to fail since it may be a version"
2829 echo "WARNING: that isn't functional or known to not be the best choice."
2830 echo "WARNING: If you suffer from build problems, you know that this is"
2831 echo "WARNING: a likely source for them..."
2834 esac
2839 echo "Using $LD $ldver"
2841 # check the compiler for SH platforms
2842 if test "$CC" = "sh-elf-gcc"; then
2843 if test "$gccnum" -lt "400"; then
2844 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2845 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2846 else
2847 # figure out patch status
2848 gccpatch=`$CC --version`;
2850 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2851 echo "gcc $gccver is rockbox patched"
2852 # then convert -O to -Os to get smaller binaries!
2853 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2854 else
2855 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2856 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2861 if test "$CC" = "m68k-elf-gcc"; then
2862 # convert -O to -Os to get smaller binaries!
2863 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2866 if [ "$ARG_CCACHE" = "1" ]; then
2867 echo "Enable ccache for building"
2868 ccache="ccache"
2869 elif [ "$ARG_CCACHE" != "0" ]; then
2870 ccache=`findtool ccache`
2871 if test -n "$ccache"; then
2872 echo "Found and uses ccache ($ccache)"
2876 # figure out the full path to the various commands if possible
2877 HOSTCC=`findtool gcc --lit`
2878 HOSTAR=`findtool ar --lit`
2879 CC=`findtool ${CC} --lit`
2880 LD=`findtool ${AR} --lit`
2881 AR=`findtool ${AR} --lit`
2882 AS=`findtool ${AS} --lit`
2883 OC=`findtool ${OC} --lit`
2884 WINDRES=`findtool ${WINDRES} --lit`
2885 DLLTOOL=`findtool ${DLLTOOL} --lit`
2886 DLLWRAP=`findtool ${DLLWRAP} --lit`
2887 RANLIB=`findtool ${RANLIB} --lit`
2889 if test -n "$ccache"; then
2890 CC="$ccache $CC"
2893 if test "X$endian" = "Xbig"; then
2894 defendian="ROCKBOX_BIG_ENDIAN"
2895 else
2896 defendian="ROCKBOX_LITTLE_ENDIAN"
2899 if [ "$ARG_RBDIR" ]; then
2900 rbdir=$ARG_RBDIR
2901 echo "Using alternate rockbox dir: ${rbdir}"
2904 sed > autoconf.h \
2905 -e "s,@ENDIAN@,${defendian},g" \
2906 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2907 -e "s,@config_rtc@,$config_rtc,g" \
2908 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2909 -e "s,@RBDIR@,${rbdir},g" \
2910 -e "s,@have_backlight@,$have_backlight,g" \
2911 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2912 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2913 <<EOF
2914 /* This header was made by configure */
2915 #ifndef __BUILD_AUTOCONF_H
2916 #define __BUILD_AUTOCONF_H
2918 /* Define endianess for the target or simulator platform */
2919 #define @ENDIAN@ 1
2921 /* Define this if you build rockbox to support the logf logging and display */
2922 #undef ROCKBOX_HAS_LOGF
2924 /* optional define for a backlight modded Ondio */
2925 @have_backlight@
2927 /* optional define for FM radio mod for iAudio M5 */
2928 @have_fmradio_in@
2930 /* optional define for ATA poweroff on Player */
2931 @have_ata_poweroff@
2933 /* optional defines for RTC mod for h1x0 */
2934 @config_rtc@
2935 @have_rtc_alarm@
2937 /* root of Rockbox */
2938 #define ROCKBOX_DIR "/@RBDIR@"
2940 #endif /* __BUILD_AUTOCONF_H */
2943 if test -n "$t_cpu"; then
2944 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2945 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2946 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2947 GCCOPTS="$GCCOPTS"
2950 if test "$simulator" = "yes"; then
2951 # add simul make stuff on the #SIMUL# line
2952 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2953 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2954 else
2955 # delete the lines that match
2956 simmagic1='/@SIMUL1@/D'
2957 simmagic2='/@SIMUL2@/D'
2960 if test "$swcodec" = "yes"; then
2961 voicetoolset="rbspeexenc voicefont wavtrim"
2962 else
2963 voicetoolset="voicefont wavtrim"
2966 if test "$apps" = "apps"; then
2967 # only when we build "real" apps we build the .lng files
2968 buildlangs="langs"
2971 #### Fix the cmdline ###
2972 if test -n "$ccache"; then
2973 cmdline="--ccache "
2975 if [ "$ARG_ARM_EABI" = "1" ]; then
2976 cmdline="$cmdline--eabi "
2979 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
2980 ### end of cmdline
2982 sed > Makefile \
2983 -e "s,@ROOTDIR@,${rootdir},g" \
2984 -e "s,@DEBUG@,${debug},g" \
2985 -e "s,@MEMORY@,${memory},g" \
2986 -e "s,@TARGET_ID@,${target_id},g" \
2987 -e "s,@TARGET@,${target},g" \
2988 -e "s,@CPU@,${t_cpu},g" \
2989 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2990 -e "s,@MODELNAME@,${modelname},g" \
2991 -e "s,@LANGUAGE@,${language},g" \
2992 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2993 -e "s,@PWD@,${pwd},g" \
2994 -e "s,@HOSTCC@,${HOSTCC},g" \
2995 -e "s,@HOSTAR@,${HOSTAR},g" \
2996 -e "s,@CC@,${CC},g" \
2997 -e "s,@LD@,${LD},g" \
2998 -e "s,@AR@,${AR},g" \
2999 -e "s,@AS@,${AS},g" \
3000 -e "s,@OC@,${OC},g" \
3001 -e "s,@WINDRES@,${WINDRES},g" \
3002 -e "s,@DLLTOOL@,${DLLTOOL},g" \
3003 -e "s,@DLLWRAP@,${DLLWRAP},g" \
3004 -e "s,@RANLIB@,${RANLIB},g" \
3005 -e "s,@TOOL@,${tool},g" \
3006 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
3007 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
3008 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
3009 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
3010 -e "s,@OUTPUT@,${output},g" \
3011 -e "s,@APPEXTRA@,${appextra},g" \
3012 -e "s,@ARCHOSROM@,${archosrom},g" \
3013 -e "s,@FLASHFILE@,${flash},g" \
3014 -e "s,@PLUGINS@,${plugins},g" \
3015 -e "s,@CODECS@,${swcodec},g" \
3016 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
3017 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
3018 -e "s,@GCCOPTS@,${GCCOPTS},g" \
3019 -e "s,@TARGET_INC@,${TARGET_INC},g" \
3020 -e "s!@LDOPTS@!${LDOPTS}!g" \
3021 -e "s,@LOADADDRESS@,${loadaddress},g" \
3022 -e "s,@EXTRADEF@,${extradefines},g" \
3023 -e "s,@APPSDIR@,${appsdir},g" \
3024 -e "s,@FIRMDIR@,${firmdir},g" \
3025 -e "s,@TOOLSDIR@,${toolsdir},g" \
3026 -e "s,@APPS@,${apps},g" \
3027 -e "s,@SIMVER@,${simver},g" \
3028 -e "s,@GCCVER@,${gccver},g" \
3029 -e "s,@GCCNUM@,${gccnum},g" \
3030 -e "s,@UNAME@,${uname},g" \
3031 -e "s,@ENDIAN@,${defendian},g" \
3032 -e "s,@TOOLSET@,${toolset},g" \
3033 -e "${simmagic1}" \
3034 -e "${simmagic2}" \
3035 -e "s,@MANUALDEV@,${manualdev},g" \
3036 -e "s,@ENCODER@,${ENC_CMD},g" \
3037 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
3038 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
3039 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
3040 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
3041 -e "s,@LANGS@,${buildlangs},g" \
3042 -e "s,@USE_ELF@,${USE_ELF},g" \
3043 -e "s,@RBDIR@,${rbdir},g" \
3044 -e "s,@PREFIX@,$PREFIX,g" \
3045 -e "s,@CMDLINE@,$cmdline,g" \
3046 -e "s,@SDLCONFIG@,$sdl,g" \
3047 <<EOF
3048 ## Automatically generated. http://www.rockbox.org/
3050 export ROOTDIR=@ROOTDIR@
3051 export FIRMDIR=@FIRMDIR@
3052 export APPSDIR=@APPSDIR@
3053 export TOOLSDIR=@TOOLSDIR@
3054 export DOCSDIR=\$(ROOTDIR)/docs
3055 export MANUALDIR=\${ROOTDIR}/manual
3056 export DEBUG=@DEBUG@
3057 export MODELNAME=@MODELNAME@
3058 export ARCHOSROM=@ARCHOSROM@
3059 export FLASHFILE=@FLASHFILE@
3060 export TARGET_ID=@TARGET_ID@
3061 export TARGET=@TARGET@
3062 export CPU=@CPU@
3063 export MANUFACTURER=@MANUFACTURER@
3064 export OBJDIR=@PWD@
3065 export BUILDDIR=@PWD@
3066 export LANGUAGE=@LANGUAGE@
3067 export VOICELANGUAGE=@VOICELANGUAGE@
3068 export MEMORYSIZE=@MEMORY@
3069 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
3070 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
3071 export MKFIRMWARE=@TOOL@
3072 export BMP2RB_MONO=@BMP2RB_MONO@
3073 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
3074 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
3075 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
3076 export BINARY=@OUTPUT@
3077 export APPEXTRA=@APPEXTRA@
3078 export ENABLEDPLUGINS=@PLUGINS@
3079 export SOFTWARECODECS=@CODECS@
3080 export EXTRA_DEFINES=@EXTRADEF@
3081 export HOSTCC=@HOSTCC@
3082 export HOSTAR=@HOSTAR@
3083 export CC=@CC@
3084 export LD=@LD@
3085 export AR=@AR@
3086 export AS=@AS@
3087 export OC=@OC@
3088 export WINDRES=@WINDRES@
3089 export DLLTOOL=@DLLTOOL@
3090 export DLLWRAP=@DLLWRAP@
3091 export RANLIB=@RANLIB@
3092 export PREFIX=@PREFIX@
3093 export PROFILE_OPTS=@PROFILE_OPTS@
3094 export SIMVER=@SIMVER@
3095 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
3096 export GCCOPTS=@GCCOPTS@
3097 export TARGET_INC=@TARGET_INC@
3098 export LOADADDRESS=@LOADADDRESS@
3099 export SHARED_FLAG=@SHARED_FLAG@
3100 export LDOPTS=@LDOPTS@
3101 export GCCVER=@GCCVER@
3102 export GCCNUM=@GCCNUM@
3103 export UNAME=@UNAME@
3104 export MANUALDEV=@MANUALDEV@
3105 export TTS_OPTS=@TTS_OPTS@
3106 export TTS_ENGINE=@TTS_ENGINE@
3107 export ENC_OPTS=@ENC_OPTS@
3108 export ENCODER=@ENCODER@
3109 export USE_ELF=@USE_ELF@
3110 export RBDIR=@RBDIR@
3111 export SDLCONFIG=@SDLCONFIG@
3113 CONFIGURE_OPTIONS=@CMDLINE@
3115 include \$(TOOLSDIR)/root.make
3119 echo "Created Makefile"