fix errors
[kugel-rb.git] / tools / configure
blob7c41a0b1823bcd5a8a7eb2532162bb6b3d537260
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"
15 use_bootchart="#undef DO_BOOTCHART"
17 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
19 rbdir=".rockbox"
22 # Begin Function Definitions
24 input() {
25 read response
26 echo $response
29 prefixtools () {
30 prefix="$1"
31 CC=${prefix}gcc
32 WINDRES=${prefix}windres
33 DLLTOOL=${prefix}dlltool
34 DLLWRAP=${prefix}dllwrap
35 RANLIB=${prefix}ranlib
36 LD=${prefix}ld
37 AR=${prefix}ar
38 AS=${prefix}as
39 OC=${prefix}objcopy
42 findarmgcc() {
43 if [ "$ARG_ARM_EABI" = "1" ]; then
44 prefixtools arm-elf-eabi-
45 gccchoice="4.4.4"
46 else
47 prefixtools arm-elf-
48 gccchoice="4.0.3"
52 # scan the $PATH for the given command
53 findtool(){
54 file="$1"
56 IFS=":"
57 for path in $PATH
59 # echo "checks for $file in $path" >&2
60 if test -f "$path/$file"; then
61 echo "$path/$file"
62 return
64 done
65 # check whether caller wants literal return value if not found
66 if [ "$2" = "--lit" ]; then
67 echo "$file"
71 # scan the $PATH for sdl-config - check whether for a (cross-)win32
72 # sdl as requested
73 findsdl(){
74 file="sdl-config"
75 winbuild="$1"
77 IFS=":"
78 for path in $PATH
80 #echo "checks for $file in $path" >&2
81 if test -f "$path/$file"; then
82 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then
83 if [ "yes" = "${winbuild}" ]; then
84 echo "$path/$file"
85 return
87 else
88 if [ "yes" != "${winbuild}" ]; then
89 echo "$path/$file"
90 return
94 done
97 simcc () {
99 # default tool setup for native building
100 prefixtools "$CROSS_COMPILE"
102 simver=sdl
103 winbuild="$crosscompile"
104 GCCOPTS='-W -Wall -g -fno-builtin'
105 GCCOPTIMIZE=''
106 LDOPTS=''
108 # default output binary name
109 output="rockboxui"
111 # default share option, override below if needed
112 SHARED_FLAG="-shared"
114 case $uname in
115 CYGWIN*)
116 echo "Cygwin host detected"
118 LDOPTS="-mconsole"
119 output="rockboxui.exe"
120 winbuild="yes"
123 MINGW*)
124 echo "MinGW host detected"
126 LDOPTS="-mconsole"
127 output="rockboxui.exe"
128 winbuild="yes"
131 Linux)
132 echo "Linux host detected"
135 FreeBSD)
136 echo "FreeBSD host detected"
139 Darwin)
140 echo "Darwin host detected"
142 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
145 SunOS)
146 echo "*Solaris host detected"
148 GCCOPTS="$GCCOPTS -fPIC"
149 LDOPTS="-lm"
153 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
154 exit 1
156 esac
158 sdl=`findsdl $winbuild`
160 if [ $1 = "sdl" ]; then
161 if [ -z "$sdl" ]; then
162 echo "configure didn't find sdl-config, which indicates that you"
163 echo "don't have SDL (properly) installed. Please correct and"
164 echo "re-run configure!"
165 exit 2
166 else
167 # generic sdl-config checker
168 GCCOPTS="$GCCOPTS `$sdl --cflags`"
169 LDOPTS="$LDOPTS `$sdl --libs`"
173 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
175 if test "X$crosscompile" != "Xyes"; then
176 case `uname -m` in
177 x86_64|amd64)
178 # fPIC is needed to make shared objects link
179 # setting visibility to hidden is necessary to avoid strange crashes
180 # due to symbol clashing
181 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
182 # x86_64 supports MMX by default
185 i686)
186 echo "Enabling MMX support"
187 GCCOPTS="$GCCOPTS -mmmx"
189 esac
191 id=$$
192 cat >$tmpdir/conftest-$id.c <<EOF
193 #include <stdio.h>
194 int main(int argc, char **argv)
196 int var=0;
197 char *varp = (char *)&var;
198 *varp=1;
200 printf("%d\n", var);
201 return 0;
205 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
207 # when cross compiling, the endianess cannot be detected because the above program doesn't run
208 # on the local machine. assume little endian but print a warning
209 endian=`$tmpdir/conftest-$id 2> /dev/null`
210 if [ "$endian" != "" ] && [ $endian -gt "1" ]; then
211 # big endian
212 endian="big"
213 else
214 # little endian
215 endian="little"
218 if [ "$CROSS_COMPILE" != "" ]; then
219 echo "WARNING: Cross Compiling, cannot detect endianess. Assuming little endian!"
222 if [ $1 = "sdl" ]; then
223 echo "Simulator environment deemed $endian endian"
224 elif [ $1 = "checkwps" ]; then
225 echo "CheckWPS environment deemed $endian endian"
228 # use wildcard here to make it work even if it was named *.exe like
229 # on cygwin
230 rm -f $tmpdir/conftest-$id*
231 else
232 # We are crosscompiling
233 # add cross-compiler option(s)
234 prefixtools i586-mingw32msvc-
235 LDOPTS="$LDOPTS -mconsole"
236 output="rockboxui.exe"
237 endian="little" # windows is little endian
238 echo "Enabling MMX support"
239 GCCOPTS="$GCCOPTS -mmmx"
244 # functions for setting up cross-compiler names and options
245 # also set endianess and what the exact recommended gcc version is
246 # the gcc version should most likely match what versions we build with
247 # rockboxdev.sh
249 shcc () {
250 prefixtools sh-elf-
251 GCCOPTS="$CCOPTS -m1"
252 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
253 endian="big"
254 gccchoice="4.0.3"
257 calmrisccc () {
258 prefixtools calmrisc16-unknown-elf-
259 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
260 GCCOPTIMIZE="-fomit-frame-pointer"
261 endian="big"
264 coldfirecc () {
265 prefixtools m68k-elf-
266 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
267 GCCOPTIMIZE="-fomit-frame-pointer"
268 endian="big"
269 gccchoice="3.4.6"
272 arm7tdmicc () {
273 findarmgcc
274 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
275 if test "X$1" != "Xshort" -a "$ARG_ARM_EABI" != "1"; then
276 GCCOPTS="$GCCOPTS -mlong-calls"
278 GCCOPTIMIZE="-fomit-frame-pointer"
279 endian="little"
282 arm9tdmicc () {
283 findarmgcc
284 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
285 if test "$modelname" != "gigabeatfx" -a "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
286 GCCOPTS="$GCCOPTS -mlong-calls"
288 GCCOPTIMIZE="-fomit-frame-pointer"
289 endian="little"
292 arm940tbecc () {
293 findarmgcc
294 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
295 if test "$ARG_ARM_EABI" != "1"; then
296 GCCOPTS="$GCCOPTS -mlong-calls"
298 GCCOPTIMIZE="-fomit-frame-pointer"
299 endian="big"
302 arm940tcc () {
303 findarmgcc
304 GCCOPTS="$CCOPTS -mcpu=arm940t"
305 if test "$ARG_ARM_EABI" != "1"; then
306 GCCOPTS="$GCCOPTS -mlong-calls"
308 GCCOPTIMIZE="-fomit-frame-pointer"
309 endian="little"
312 arm946cc () {
313 findarmgcc
314 GCCOPTS="$CCOPTS -mcpu=arm9e"
315 if test "$ARG_ARM_EABI" != "1"; then
316 GCCOPTS="$GCCOPTS -mlong-calls"
318 GCCOPTIMIZE="-fomit-frame-pointer"
319 endian="little"
322 arm926ejscc () {
323 findarmgcc
324 GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
325 if test "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
326 GCCOPTS="$GCCOPTS -mlong-calls"
328 GCCOPTIMIZE="-fomit-frame-pointer"
329 endian="little"
332 arm1136jfscc () {
333 findarmgcc
334 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
335 if test "$modelname" != "gigabeats" -a "$ARG_ARM_EABI" != "1"; then
336 GCCOPTS="$GCCOPTS -mlong-calls"
338 GCCOPTIMIZE="-fomit-frame-pointer"
339 endian="little"
342 arm1176jzscc () {
343 findarmgcc
344 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
345 if test "$ARG_ARM_EABI" != "1"; then
346 GCCOPTS="$GCCOPTS -mlong-calls"
348 GCCOPTIMIZE="-fomit-frame-pointer"
349 endian="little"
352 mipselcc () {
353 prefixtools mipsel-elf-
354 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
355 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
356 GCCOPTIMIZE="-fomit-frame-pointer"
357 endian="little"
358 gccchoice="4.1.2"
361 whichadvanced () {
362 atype=`echo "$1" | cut -c 2-`
363 ##################################################################
364 # Prompt for specific developer options
366 if [ "$atype" ]; then
367 interact=
368 else
369 interact=1
370 echo ""
371 echo "Enter your developer options (press enter when done)"
372 printf "(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile, (T)est plugins"
373 if [ "$memory" = "2" ]; then
374 printf ", (8)MB MOD"
376 if [ "$modelname" = "archosplayer" ]; then
377 printf ", Use (A)TA poweroff"
379 if [ "$t_model" = "ondio" ]; then
380 printf ", (B)acklight MOD"
382 if [ "$modelname" = "iaudiom5" ]; then
383 printf ", (F)M radio MOD"
385 if [ "$modelname" = "iriverh120" ]; then
386 printf ", (R)TC MOD"
388 echo ""
391 cont=1
392 while [ $cont = "1" ]; do
394 if [ "$interact" ]; then
395 option=`input`
396 else
397 option=`echo "$atype" | cut -c 1`
400 case $option in
401 [Dd])
402 if [ "yes" = "$profile" ]; then
403 echo "Debug is incompatible with profiling"
404 else
405 echo "DEBUG build enabled"
406 use_debug="yes"
409 [Ll])
410 echo "logf() support enabled"
411 logf="yes"
413 [Tt])
414 echo "Including test plugins"
415 extradefines="$extradefines -DHAVE_TEST_PLUGINS"
417 [Cc])
418 echo "bootchart enabled (logf also enabled)"
419 bootchart="yes"
420 logf="yes"
422 [Ss])
423 echo "Simulator build enabled"
424 simulator="yes"
426 [Pp])
427 if [ "yes" = "$use_debug" ]; then
428 echo "Profiling is incompatible with debug"
429 else
430 echo "Profiling support is enabled"
431 profile="yes"
434 [Vv])
435 echo "Voice build selected"
436 voice="yes"
439 if [ "$memory" = "2" ]; then
440 memory="8"
441 echo "Memory size selected: 8MB"
444 [Aa])
445 if [ "$modelname" = "archosplayer" ]; then
446 have_ata_poweroff="#define HAVE_ATA_POWER_OFF"
447 echo "ATA power off enabled"
450 [Bb])
451 if [ "$t_model" = "ondio" ]; then
452 have_backlight="#define HAVE_BACKLIGHT"
453 echo "Backlight functions enabled"
456 [Ff])
457 if [ "$modelname" = "iaudiom5" ]; then
458 have_fmradio_in="#define HAVE_FMRADIO_IN"
459 echo "FM radio functions enabled"
462 [Rr])
463 if [ "$modelname" = "iriverh120" ]; then
464 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
465 have_rtc_alarm="#define HAVE_RTC_ALARM"
466 echo "RTC functions enabled (DS1339/DS3231)"
469 [Ww])
470 echo "Enabling Windows 32 cross-compiling"
471 crosscompile="yes"
474 if [ "$interact" ]; then
475 cont=0
476 else
477 echo "[ERROR] Option $option unsupported"
480 esac
481 if [ "$interact" ]; then
482 btype="$btype$option"
483 else
484 atype=`echo "$atype" | cut -c 2-`
485 [ "$atype" ] || cont=0
487 done
488 echo "done"
490 if [ "yes" = "$voice" ]; then
491 # Ask about languages to build
492 picklang
493 voicelanguage=`whichlang`
494 echo "Voice language set to $voicelanguage"
496 # Configure encoder and TTS engine for each language
497 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
498 voiceconfig "$thislang"
499 done
501 if [ "yes" = "$use_debug" ]; then
502 debug="-DDEBUG"
503 GCCOPTS="$GCCOPTS -g -DDEBUG"
505 if [ "yes" = "$logf" ]; then
506 use_logf="#define ROCKBOX_HAS_LOGF 1"
508 if [ "yes" = "$bootchart" ]; then
509 use_bootchart="#define DO_BOOTCHART 1"
511 if [ "yes" = "$simulator" ]; then
512 debug="-DDEBUG"
513 extradefines="$extradefines -DSIMULATOR"
514 archosrom=""
515 flash=""
517 if [ "yes" = "$profile" ]; then
518 extradefines="$extradefines -DRB_PROFILE"
519 PROFILE_OPTS="-finstrument-functions"
523 # Configure voice settings
524 voiceconfig () {
525 thislang=$1
526 if [ ! "$ARG_TTS" ]; then
527 echo "Building $thislang voice for $modelname. Select options"
528 echo ""
531 if [ -n "`findtool flite`" ]; then
532 FLITE="F(l)ite "
533 FLITE_OPTS=""
534 DEFAULT_TTS="flite"
535 DEFAULT_TTS_OPTS=$FLITE_OPTS
536 DEFAULT_NOISEFLOOR="500"
537 DEFAULT_CHOICE="L"
539 if [ -n "`findtool espeak`" ]; then
540 ESPEAK="(e)Speak "
541 ESPEAK_OPTS=""
542 DEFAULT_TTS="espeak"
543 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
544 DEFAULT_NOISEFLOOR="500"
545 DEFAULT_CHOICE="e"
547 if [ -n "`findtool festival`" ]; then
548 FESTIVAL="(F)estival "
549 case "$thislang" in
550 "italiano")
551 FESTIVAL_OPTS="--language italian"
553 "espanol")
554 FESTIVAL_OPTS="--language spanish"
556 "finnish")
557 FESTIVAL_OPTS="--language finnish"
559 "czech")
560 FESTIVAL_OPTS="--language czech"
563 FESTIVAL_OPTS=""
565 esac
566 DEFAULT_TTS="festival"
567 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
568 DEFAULT_NOISEFLOOR="500"
569 DEFAULT_CHOICE="F"
571 if [ -n "`findtool swift`" ]; then
572 SWIFT="S(w)ift "
573 SWIFT_OPTS=""
574 DEFAULT_TTS="swift"
575 DEFAULT_TTS_OPTS=$SWIFT_OPTS
576 DEFAULT_NOISEFLOOR="500"
577 DEFAULT_CHOICE="w"
579 # Allow SAPI if Windows is in use
580 if [ -n "`findtool winver`" ]; then
581 SAPI="(S)API "
582 SAPI_OPTS=""
583 DEFAULT_TTS="sapi"
584 DEFAULT_TTS_OPTS=$SAPI_OPTS
585 DEFAULT_NOISEFLOOR="500"
586 DEFAULT_CHOICE="S"
589 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
590 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
591 exit 3
594 if [ "$ARG_TTS" ]; then
595 option=$ARG_TTS
596 else
597 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
598 option=`input`
600 advopts="$advopts --tts=$option"
601 case "$option" in
602 [Ll])
603 TTS_ENGINE="flite"
604 NOISEFLOOR="500" # TODO: check this value
605 TTS_OPTS=$FLITE_OPTS
607 [Ee])
608 TTS_ENGINE="espeak"
609 NOISEFLOOR="500"
610 TTS_OPTS=$ESPEAK_OPTS
612 [Ff])
613 TTS_ENGINE="festival"
614 NOISEFLOOR="500"
615 TTS_OPTS=$FESTIVAL_OPTS
617 [Ss])
618 TTS_ENGINE="sapi"
619 NOISEFLOOR="500"
620 TTS_OPTS=$SAPI_OPTS
622 [Ww])
623 TTS_ENGINE="swift"
624 NOISEFLOOR="500"
625 TTS_OPTS=$SWIFT_OPTS
628 TTS_ENGINE=$DEFAULT_TTS
629 TTS_OPTS=$DEFAULT_TTS_OPTS
630 NOISEFLOOR=$DEFAULT_NOISEFLOOR
631 esac
632 echo "Using $TTS_ENGINE for TTS"
634 # Select which voice to use for Festival
635 if [ "$TTS_ENGINE" = "festival" ]; then
636 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
637 for voice in $voicelist; do
638 TTS_FESTIVAL_VOICE="$voice" # Default choice
639 break
640 done
641 if [ "$ARG_VOICE" ]; then
642 CHOICE=$ARG_VOICE
643 else
645 for voice in $voicelist; do
646 printf "%3d. %s\n" "$i" "$voice"
647 i=`expr $i + 1`
648 done
649 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
650 CHOICE=`input`
653 for voice in $voicelist; do
654 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
655 TTS_FESTIVAL_VOICE="$voice"
657 i=`expr $i + 1`
658 done
659 advopts="$advopts --voice=$CHOICE"
660 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
661 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
664 # Read custom tts options from command line
665 if [ "$ARG_TTSOPTS" ]; then
666 TTS_OPTS="$ARG_TTSOPTS"
667 advopts="$advopts --ttsopts='$TTS_OPTS'"
668 echo "$TTS_ENGINE options set to $TTS_OPTS"
671 if [ "$swcodec" = "yes" ]; then
672 ENCODER="rbspeexenc"
673 ENC_CMD="rbspeexenc"
674 ENC_OPTS="-q 4 -c 10"
675 else
676 if [ -n "`findtool lame`" ]; then
677 ENCODER="lame"
678 ENC_CMD="lame"
679 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
680 else
681 echo "You need LAME in the system path to build voice files for"
682 echo "HWCODEC targets."
683 exit 4
687 echo "Using $ENCODER for encoding voice clips"
689 # Read custom encoder options from command line
690 if [ "$ARG_ENCOPTS" ]; then
691 ENC_OPTS="$ARG_ENCOPTS"
692 advopts="$advopts --encopts='$ENC_OPTS'"
693 echo "$ENCODER options set to $ENC_OPTS"
696 TEMPDIR="${pwd}"
697 if [ -n "`findtool cygpath`" ]; then
698 TEMPDIR=`cygpath . -a -w`
702 picklang() {
703 # figure out which languages that are around
704 for file in $rootdir/apps/lang/*.lang; do
705 clean=`basename $file .lang`
706 langs="$langs $clean"
707 done
709 if [ "$ARG_LANG" ]; then
710 pick=$ARG_LANG
711 else
712 echo "Select a number for the language to use (default is english)"
713 # FIXME The multiple-language feature is currently broken
714 # echo "You may enter a comma-separated list of languages to build"
716 num=1
717 for one in $langs; do
718 echo "$num. $one"
719 num=`expr $num + 1`
720 done
721 pick=`input`
723 advopts="$advopts --language=$pick"
726 whichlang() {
727 output=""
728 # Allow the user to pass a comma-separated list of langauges
729 for thispick in `echo $pick | sed 's/,/ /g'`; do
730 num=1
731 for one in $langs; do
732 # Accept both the language number and name
733 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
734 if [ "$output" = "" ]; then
735 output=$one
736 else
737 output=$output,$one
740 num=`expr $num + 1`
741 done
742 done
743 if [ -z "$output" ]; then
744 # pick a default
745 output="english"
747 echo $output
750 help() {
751 echo "Rockbox configure script."
752 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
753 echo "Do *NOT* run this within the tools directory!"
754 echo ""
755 cat <<EOF
756 Usage: configure [OPTION]...
757 Options:
758 --target=TARGET Sets the target, TARGET can be either the target ID or
759 corresponding string. Run without this option to see all
760 available targets.
762 --ram=RAM Sets the RAM for certain targets. Even though any number
763 is accepted, not every number is correct. The default
764 value will be applied, if you entered a wrong number
765 (which depends on the target). Watch the output. Run
766 without this option if you are not sure which the right
767 number is.
769 --type=TYPE Sets the build type. Shortcuts are also valid.
770 Run without this option to see all available types.
771 Multiple values are allowed and managed in the input
772 order. So --type=b stands for Bootloader build, while
773 --type=ab stands for "Backlight MOD" build.
775 --language=LANG Set the language used for voice generation (used only if
776 TYPE is AV).
778 --tts=ENGINE Set the TTS engine used for voice generation (used only
779 if TYPE is AV).
781 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
782 AV).
784 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
786 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
788 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
789 This is useful for having multiple alternate builds on
790 your device that you can load with ROLO. However as the
791 bootloader looks for .rockbox you won't be able to boot
792 into this build.
794 --ccache Enable ccache use (done by default these days)
795 --no-ccache Disable ccache use
797 --eabi Make configure prefer toolchains that are able to compile
798 for the new ARM standard abi EABI
799 --no-eabi The opposite of --eabi (prefer old non-eabi toolchains)
800 --help Shows this message (must not be used with other options)
804 exit
807 ARG_CCACHE=
808 ARG_ENCOPTS=
809 ARG_LANG=
810 ARG_RAM=
811 ARG_RBDIR=
812 ARG_TARGET=
813 ARG_TTS=
814 ARG_TTSOPTS=
815 ARG_TYPE=
816 ARG_VOICE=
817 ARG_ARM_EABI=
818 err=
819 for arg in "$@"; do
820 case "$arg" in
821 --ccache) ARG_CCACHE=1;;
822 --no-ccache) ARG_CCACHE=0;;
823 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
824 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
825 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
826 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
827 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
828 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
829 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
830 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
831 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
832 --eabi) ARG_ARM_EABI=1;;
833 --no-eabi) ARG_ARM_EABI=0;;
834 --help) help;;
835 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
836 esac
837 done
838 [ "$err" ] && exit 1
840 advopts=
842 if [ "$TMPDIR" != "" ]; then
843 tmpdir=$TMPDIR
844 else
845 tmpdir=/tmp
847 echo Using temporary directory $tmpdir
849 if test -r "configure"; then
850 # this is a check for a configure script in the current directory, it there
851 # is one, try to figure out if it is this one!
853 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
854 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
855 echo "It will only cause you pain and grief. Instead do this:"
856 echo ""
857 echo " cd .."
858 echo " mkdir build-dir"
859 echo " cd build-dir"
860 echo " ../tools/configure"
861 echo ""
862 echo "Much happiness will arise from this. Enjoy"
863 exit 5
867 # get our current directory
868 pwd=`pwd`;
870 if { echo $pwd | grep " "; } then
871 echo "You're running this script in a path that contains space. The build"
872 echo "system is unfortunately not clever enough to deal with this. Please"
873 echo "run the script from a different path, rename the path or fix the build"
874 echo "system!"
875 exit 6
878 if [ -z "$rootdir" ]; then
879 ##################################################################
880 # Figure out where the source code root is!
882 rootdir=`dirname $0`/../
884 #####################################################################
885 # Convert the possibly relative directory name to an absolute version
887 now=`pwd`
888 cd $rootdir
889 rootdir=`pwd`
891 # cd back to the build dir
892 cd $now
895 apps="apps"
896 appsdir='\$(ROOTDIR)/apps'
897 firmdir='\$(ROOTDIR)/firmware'
898 toolsdir='\$(ROOTDIR)/tools'
901 ##################################################################
902 # Figure out target platform
905 if [ "$ARG_TARGET" ]; then
906 buildfor=$ARG_TARGET
907 else
908 echo "Enter target platform:"
909 cat <<EOF
910 ==Archos== ==iriver== ==Apple iPod==
911 0) Player/Studio 10) H120/H140 20) Color/Photo
912 1) Recorder 11) H320/H340 21) Nano 1G
913 2) FM Recorder 12) iHP-100/110/115 22) Video
914 3) Recorder v2 13) iFP-790 23) 3G
915 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
916 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
917 6) AV300 26) Mini 2G
918 ==Toshiba== 27) 1G, 2G
919 ==Cowon/iAudio== 40) Gigabeat F/X 28) Nano 2G
920 30) X5/X5V/X5L 41) Gigabeat S
921 31) M5/M5L ==SanDisk==
922 32) 7 ==Olympus= 50) Sansa e200
923 33) D2 70) M:Robe 500 51) Sansa e200R
924 34) M3/M3L 71) M:Robe 100 52) Sansa c200
925 53) Sansa m200
926 ==Creative== ==Philips== 54) Sansa c100
927 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
928 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
929 92) Zen Vision HDD1830 57) Sansa m200v4
930 102) GoGear HDD6330 58) Sansa Fuze
931 ==Onda== 59) Sansa c200v2
932 120) VX747 ==Meizu== 60) Sansa Clipv2
933 121) VX767 110) M6SL 61) Sansa View
934 122) VX747+ 111) M6SP 62) Sansa Clip+
935 123) VX777 112) M3 63) Sansa Fuze v2
937 ==Logik==
938 ==Samsung== ==Tatung== 80) DAX 1GB MP3/DAB
939 140) YH-820 150) Elio TPJ-1022
940 141) YH-920 ==Lyre project==
941 142) YH-925 ==Packard Bell== 130) Lyre proto 1
942 143) YP-S3 160) Vibe 500 131) Mini2440
944 ==MPIO==
945 170) HD200
948 buildfor=`input`;
951 # Set of tools built for all target platforms:
952 toolset="rdf2binary convbdf codepages"
954 # Toolsets for some target families:
955 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
956 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
957 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
958 ipodbitmaptools="$toolset scramble bmp2rb"
959 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
960 tccbitmaptools="$toolset scramble bmp2rb"
961 # generic is used by IFP, Meizu and Onda
962 genericbitmaptools="$toolset bmp2rb"
963 # scramble is used by all other targets
964 scramblebitmaptools="$genericbitmaptools scramble"
967 # ---- For each target ----
969 # *Variables*
970 # target_id: a unique number identifying this target, IS NOT the menu number.
971 # Just use the currently highest number+1 when you add a new
972 # target.
973 # modelname: short model name used all over to identify this target
974 # memory: number of megabytes of RAM this target has. If the amount can
975 # be selected by the size prompt, let memory be unset here
976 # target: -Ddefine passed to the build commands to make the correct
977 # config-*.h file get included etc
978 # tool: the tool that takes a plain binary and converts that into a
979 # working "firmware" file for your target
980 # output: the final output file name
981 # boottool: the tool that takes a plain binary and generates a bootloader
982 # file for your target (or blank to use $tool)
983 # bootoutput:the final output file name for the bootloader (or blank to use
984 # $output)
985 # appextra: passed to the APPEXTRA variable in the Makefiles.
986 # TODO: add proper explanation
987 # archosrom: used only for Archos targets that build a special flashable .ucl
988 # image.
989 # flash: name of output for flashing, for targets where there's a special
990 # file output for this.
991 # plugins: set to 'yes' to build the plugins. Early development builds can
992 # set this to no in the early stages to have an easier life for a
993 # while
994 # swcodec: set 'yes' on swcodec targets
995 # toolset: lists what particular tools in the tools/ directory that this
996 # target needs to have built prior to building Rockbox
998 # *Functions*
999 # *cc: sets up gcc and compiler options for your target builds. Note
1000 # that if you select a simulator build, the compiler selection is
1001 # overridden later in the script.
1003 case $buildfor in
1005 0|archosplayer)
1006 target_id=1
1007 modelname="archosplayer"
1008 target="-DARCHOS_PLAYER"
1009 shcc
1010 tool="$rootdir/tools/scramble"
1011 output="archos.mod"
1012 appextra="player:gui"
1013 archosrom="$pwd/rombox.ucl"
1014 flash="$pwd/rockbox.ucl"
1015 plugins="yes"
1016 swcodec=""
1018 # toolset is the tools within the tools directory that we build for
1019 # this particular target.
1020 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
1022 # Note: the convbdf is present in the toolset just because: 1) the
1023 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1024 # build the player simulator
1026 t_cpu="sh"
1027 t_manufacturer="archos"
1028 t_model="player"
1031 1|archosrecorder)
1032 target_id=2
1033 modelname="archosrecorder"
1034 target="-DARCHOS_RECORDER"
1035 shcc
1036 tool="$rootdir/tools/scramble"
1037 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1038 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1039 output="ajbrec.ajz"
1040 appextra="recorder:gui:radio"
1041 #archosrom="$pwd/rombox.ucl"
1042 flash="$pwd/rockbox.ucl"
1043 plugins="yes"
1044 swcodec=""
1045 # toolset is the tools within the tools directory that we build for
1046 # this particular target.
1047 toolset=$archosbitmaptools
1048 t_cpu="sh"
1049 t_manufacturer="archos"
1050 t_model="recorder"
1053 2|archosfmrecorder)
1054 target_id=3
1055 modelname="archosfmrecorder"
1056 target="-DARCHOS_FMRECORDER"
1057 shcc
1058 tool="$rootdir/tools/scramble -fm"
1059 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1060 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1061 output="ajbrec.ajz"
1062 appextra="recorder:gui:radio"
1063 #archosrom="$pwd/rombox.ucl"
1064 flash="$pwd/rockbox.ucl"
1065 plugins="yes"
1066 swcodec=""
1067 # toolset is the tools within the tools directory that we build for
1068 # this particular target.
1069 toolset=$archosbitmaptools
1070 t_cpu="sh"
1071 t_manufacturer="archos"
1072 t_model="fm_v2"
1075 3|archosrecorderv2)
1076 target_id=4
1077 modelname="archosrecorderv2"
1078 target="-DARCHOS_RECORDERV2"
1079 shcc
1080 tool="$rootdir/tools/scramble -v2"
1081 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1082 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1083 output="ajbrec.ajz"
1084 appextra="recorder:gui:radio"
1085 #archosrom="$pwd/rombox.ucl"
1086 flash="$pwd/rockbox.ucl"
1087 plugins="yes"
1088 swcodec=""
1089 # toolset is the tools within the tools directory that we build for
1090 # this particular target.
1091 toolset=$archosbitmaptools
1092 t_cpu="sh"
1093 t_manufacturer="archos"
1094 t_model="fm_v2"
1097 4|archosondiosp)
1098 target_id=7
1099 modelname="archosondiosp"
1100 target="-DARCHOS_ONDIOSP"
1101 shcc
1102 tool="$rootdir/tools/scramble -osp"
1103 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1104 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1105 output="ajbrec.ajz"
1106 appextra="recorder:gui:radio"
1107 #archosrom="$pwd/rombox.ucl"
1108 flash="$pwd/rockbox.ucl"
1109 plugins="yes"
1110 swcodec=""
1111 # toolset is the tools within the tools directory that we build for
1112 # this particular target.
1113 toolset=$archosbitmaptools
1114 t_cpu="sh"
1115 t_manufacturer="archos"
1116 t_model="ondio"
1119 5|archosondiofm)
1120 target_id=8
1121 modelname="archosondiofm"
1122 target="-DARCHOS_ONDIOFM"
1123 shcc
1124 tool="$rootdir/tools/scramble -ofm"
1125 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1126 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1127 output="ajbrec.ajz"
1128 appextra="recorder:gui:radio"
1129 #archosrom="$pwd/rombox.ucl"
1130 flash="$pwd/rockbox.ucl"
1131 plugins="yes"
1132 swcodec=""
1133 toolset=$archosbitmaptools
1134 t_cpu="sh"
1135 t_manufacturer="archos"
1136 t_model="ondio"
1139 6|archosav300)
1140 target_id=38
1141 modelname="archosav300"
1142 target="-DARCHOS_AV300"
1143 memory=16 # always
1144 arm7tdmicc
1145 tool="$rootdir/tools/scramble -mm=C"
1146 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1147 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1148 output="cjbm.ajz"
1149 appextra="recorder:gui:radio"
1150 plugins="yes"
1151 swcodec=""
1152 # toolset is the tools within the tools directory that we build for
1153 # this particular target.
1154 toolset="$toolset scramble descramble bmp2rb"
1155 # architecture, manufacturer and model for the target-tree build
1156 t_cpu="arm"
1157 t_manufacturer="archos"
1158 t_model="av300"
1161 10|iriverh120)
1162 target_id=9
1163 modelname="iriverh120"
1164 target="-DIRIVER_H120"
1165 memory=32 # always
1166 coldfirecc
1167 tool="$rootdir/tools/scramble -add=h120"
1168 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1169 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1170 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1171 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1172 output="rockbox.iriver"
1173 bootoutput="bootloader.iriver"
1174 appextra="recorder:gui:radio"
1175 flash="$pwd/rombox.iriver"
1176 plugins="yes"
1177 swcodec="yes"
1178 # toolset is the tools within the tools directory that we build for
1179 # this particular target.
1180 toolset=$iriverbitmaptools
1181 t_cpu="coldfire"
1182 t_manufacturer="iriver"
1183 t_model="h100"
1186 11|iriverh300)
1187 target_id=10
1188 modelname="iriverh300"
1189 target="-DIRIVER_H300"
1190 memory=32 # always
1191 coldfirecc
1192 tool="$rootdir/tools/scramble -add=h300"
1193 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1194 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1195 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1196 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1197 output="rockbox.iriver"
1198 appextra="recorder:gui:radio"
1199 plugins="yes"
1200 swcodec="yes"
1201 # toolset is the tools within the tools directory that we build for
1202 # this particular target.
1203 toolset=$iriverbitmaptools
1204 t_cpu="coldfire"
1205 t_manufacturer="iriver"
1206 t_model="h300"
1209 12|iriverh100)
1210 target_id=11
1211 modelname="iriverh100"
1212 target="-DIRIVER_H100"
1213 memory=16 # always
1214 coldfirecc
1215 tool="$rootdir/tools/scramble -add=h100"
1216 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1217 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1218 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1219 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1220 output="rockbox.iriver"
1221 bootoutput="bootloader.iriver"
1222 appextra="recorder:gui:radio"
1223 flash="$pwd/rombox.iriver"
1224 plugins="yes"
1225 swcodec="yes"
1226 # toolset is the tools within the tools directory that we build for
1227 # this particular target.
1228 toolset=$iriverbitmaptools
1229 t_cpu="coldfire"
1230 t_manufacturer="iriver"
1231 t_model="h100"
1234 13|iriverifp7xx)
1235 target_id=19
1236 modelname="iriverifp7xx"
1237 target="-DIRIVER_IFP7XX"
1238 memory=1
1239 arm7tdmicc short
1240 tool="cp"
1241 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1242 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1243 output="rockbox.wma"
1244 appextra="recorder:gui:radio"
1245 plugins="yes"
1246 swcodec="yes"
1247 # toolset is the tools within the tools directory that we build for
1248 # this particular target.
1249 toolset=$genericbitmaptools
1250 t_cpu="arm"
1251 t_manufacturer="pnx0101"
1252 t_model="iriver-ifp7xx"
1255 14|iriverh10)
1256 target_id=22
1257 modelname="iriverh10"
1258 target="-DIRIVER_H10"
1259 memory=32 # always
1260 arm7tdmicc
1261 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1262 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1263 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1264 output="rockbox.mi4"
1265 appextra="recorder:gui:radio"
1266 plugins="yes"
1267 swcodec="yes"
1268 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1269 bootoutput="H10_20GC.mi4"
1270 # toolset is the tools within the tools directory that we build for
1271 # this particular target.
1272 toolset=$scramblebitmaptools
1273 # architecture, manufacturer and model for the target-tree build
1274 t_cpu="arm"
1275 t_manufacturer="iriver"
1276 t_model="h10"
1279 15|iriverh10_5gb)
1280 target_id=24
1281 modelname="iriverh10_5gb"
1282 target="-DIRIVER_H10_5GB"
1283 memory=32 # always
1284 arm7tdmicc
1285 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1286 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1287 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1288 output="rockbox.mi4"
1289 appextra="recorder:gui:radio"
1290 plugins="yes"
1291 swcodec="yes"
1292 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1293 bootoutput="H10.mi4"
1294 # toolset is the tools within the tools directory that we build for
1295 # this particular target.
1296 toolset=$scramblebitmaptools
1297 # architecture, manufacturer and model for the target-tree build
1298 t_cpu="arm"
1299 t_manufacturer="iriver"
1300 t_model="h10"
1303 20|ipodcolor)
1304 target_id=13
1305 modelname="ipodcolor"
1306 target="-DIPOD_COLOR"
1307 memory=32 # always
1308 arm7tdmicc
1309 tool="$rootdir/tools/scramble -add=ipco"
1310 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1311 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1312 output="rockbox.ipod"
1313 appextra="recorder:gui:radio"
1314 plugins="yes"
1315 swcodec="yes"
1316 bootoutput="bootloader-$modelname.ipod"
1317 # toolset is the tools within the tools directory that we build for
1318 # this particular target.
1319 toolset=$ipodbitmaptools
1320 # architecture, manufacturer and model for the target-tree build
1321 t_cpu="arm"
1322 t_manufacturer="ipod"
1323 t_model="color"
1326 21|ipodnano1g)
1327 target_id=14
1328 modelname="ipodnano1g"
1329 target="-DIPOD_NANO"
1330 memory=32 # always
1331 arm7tdmicc
1332 tool="$rootdir/tools/scramble -add=nano"
1333 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1334 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1335 output="rockbox.ipod"
1336 appextra="recorder:gui:radio"
1337 plugins="yes"
1338 swcodec="yes"
1339 bootoutput="bootloader-$modelname.ipod"
1340 # toolset is the tools within the tools directory that we build for
1341 # this particular target.
1342 toolset=$ipodbitmaptools
1343 # architecture, manufacturer and model for the target-tree build
1344 t_cpu="arm"
1345 t_manufacturer="ipod"
1346 t_model="nano"
1349 22|ipodvideo)
1350 target_id=15
1351 modelname="ipodvideo"
1352 target="-DIPOD_VIDEO"
1353 arm7tdmicc
1354 tool="$rootdir/tools/scramble -add=ipvd"
1355 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1356 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1357 output="rockbox.ipod"
1358 appextra="recorder:gui:radio"
1359 plugins="yes"
1360 swcodec="yes"
1361 bootoutput="bootloader-$modelname.ipod"
1362 # toolset is the tools within the tools directory that we build for
1363 # this particular target.
1364 toolset=$ipodbitmaptools
1365 # architecture, manufacturer and model for the target-tree build
1366 t_cpu="arm"
1367 t_manufacturer="ipod"
1368 t_model="video"
1371 23|ipod3g)
1372 target_id=16
1373 modelname="ipod3g"
1374 target="-DIPOD_3G"
1375 memory=32 # always
1376 arm7tdmicc
1377 tool="$rootdir/tools/scramble -add=ip3g"
1378 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1379 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1380 output="rockbox.ipod"
1381 appextra="recorder:gui:radio"
1382 plugins="yes"
1383 swcodec="yes"
1384 bootoutput="bootloader-$modelname.ipod"
1385 # toolset is the tools within the tools directory that we build for
1386 # this particular target.
1387 toolset=$ipodbitmaptools
1388 # architecture, manufacturer and model for the target-tree build
1389 t_cpu="arm"
1390 t_manufacturer="ipod"
1391 t_model="3g"
1394 24|ipod4g)
1395 target_id=17
1396 modelname="ipod4g"
1397 target="-DIPOD_4G"
1398 memory=32 # always
1399 arm7tdmicc
1400 tool="$rootdir/tools/scramble -add=ip4g"
1401 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1402 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1403 output="rockbox.ipod"
1404 appextra="recorder:gui:radio"
1405 plugins="yes"
1406 swcodec="yes"
1407 bootoutput="bootloader-$modelname.ipod"
1408 # toolset is the tools within the tools directory that we build for
1409 # this particular target.
1410 toolset=$ipodbitmaptools
1411 # architecture, manufacturer and model for the target-tree build
1412 t_cpu="arm"
1413 t_manufacturer="ipod"
1414 t_model="4g"
1417 25|ipodmini1g)
1418 target_id=18
1419 modelname="ipodmini1g"
1420 target="-DIPOD_MINI"
1421 memory=32 # always
1422 arm7tdmicc
1423 tool="$rootdir/tools/scramble -add=mini"
1424 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1425 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1426 output="rockbox.ipod"
1427 appextra="recorder:gui:radio"
1428 plugins="yes"
1429 swcodec="yes"
1430 bootoutput="bootloader-$modelname.ipod"
1431 # toolset is the tools within the tools directory that we build for
1432 # this particular target.
1433 toolset=$ipodbitmaptools
1434 # architecture, manufacturer and model for the target-tree build
1435 t_cpu="arm"
1436 t_manufacturer="ipod"
1437 t_model="mini"
1440 26|ipodmini2g)
1441 target_id=21
1442 modelname="ipodmini2g"
1443 target="-DIPOD_MINI2G"
1444 memory=32 # always
1445 arm7tdmicc
1446 tool="$rootdir/tools/scramble -add=mn2g"
1447 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1448 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1449 output="rockbox.ipod"
1450 appextra="recorder:gui:radio"
1451 plugins="yes"
1452 swcodec="yes"
1453 bootoutput="bootloader-$modelname.ipod"
1454 # toolset is the tools within the tools directory that we build for
1455 # this particular target.
1456 toolset=$ipodbitmaptools
1457 # architecture, manufacturer and model for the target-tree build
1458 t_cpu="arm"
1459 t_manufacturer="ipod"
1460 t_model="mini2g"
1463 27|ipod1g2g)
1464 target_id=29
1465 modelname="ipod1g2g"
1466 target="-DIPOD_1G2G"
1467 memory=32 # always
1468 arm7tdmicc
1469 tool="$rootdir/tools/scramble -add=1g2g"
1470 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1471 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1472 output="rockbox.ipod"
1473 appextra="recorder:gui:radio"
1474 plugins="yes"
1475 swcodec="yes"
1476 bootoutput="bootloader-$modelname.ipod"
1477 # toolset is the tools within the tools directory that we build for
1478 # this particular target.
1479 toolset=$ipodbitmaptools
1480 # architecture, manufacturer and model for the target-tree build
1481 t_cpu="arm"
1482 t_manufacturer="ipod"
1483 t_model="1g2g"
1486 28|ipodnano2g)
1487 target_id=62
1488 modelname="ipodnano2g"
1489 target="-DIPOD_NANO2G"
1490 memory=32 # always
1491 arm940tcc
1492 tool="$rootdir/tools/scramble -add=nn2g"
1493 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1494 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1495 output="rockbox.ipod"
1496 appextra="recorder:gui:radio"
1497 plugins="yes"
1498 swcodec="yes"
1499 bootoutput="bootloader-$modelname.ipod"
1500 # toolset is the tools within the tools directory that we build for
1501 # this particular target.
1502 toolset=$ipodbitmaptools
1503 # architecture, manufacturer and model for the target-tree build
1504 t_cpu="arm"
1505 t_manufacturer="s5l8700"
1506 t_model="ipodnano2g"
1509 30|iaudiox5)
1510 target_id=12
1511 modelname="iaudiox5"
1512 target="-DIAUDIO_X5"
1513 memory=16 # always
1514 coldfirecc
1515 tool="$rootdir/tools/scramble -add=iax5"
1516 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1517 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1518 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1519 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1520 output="rockbox.iaudio"
1521 appextra="recorder:gui:radio"
1522 plugins="yes"
1523 swcodec="yes"
1524 # toolset is the tools within the tools directory that we build for
1525 # this particular target.
1526 toolset="$iaudiobitmaptools"
1527 # architecture, manufacturer and model for the target-tree build
1528 t_cpu="coldfire"
1529 t_manufacturer="iaudio"
1530 t_model="x5"
1533 31|iaudiom5)
1534 target_id=28
1535 modelname="iaudiom5"
1536 target="-DIAUDIO_M5"
1537 memory=16 # always
1538 coldfirecc
1539 tool="$rootdir/tools/scramble -add=iam5"
1540 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1541 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1542 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1543 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1544 output="rockbox.iaudio"
1545 appextra="recorder:gui:radio"
1546 plugins="yes"
1547 swcodec="yes"
1548 # toolset is the tools within the tools directory that we build for
1549 # this particular target.
1550 toolset="$iaudiobitmaptools"
1551 # architecture, manufacturer and model for the target-tree build
1552 t_cpu="coldfire"
1553 t_manufacturer="iaudio"
1554 t_model="m5"
1557 32|iaudio7)
1558 target_id=32
1559 modelname="iaudio7"
1560 target="-DIAUDIO_7"
1561 memory=16 # always
1562 arm946cc
1563 tool="$rootdir/tools/scramble -add=i7"
1564 boottool="$rootdir/tools/scramble -tcc=crc"
1565 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1566 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1567 output="rockbox.iaudio"
1568 appextra="recorder:gui:radio"
1569 plugins="yes"
1570 swcodec="yes"
1571 bootoutput="I7_FW.BIN"
1572 # toolset is the tools within the tools directory that we build for
1573 # this particular target.
1574 toolset="$tccbitmaptools"
1575 # architecture, manufacturer and model for the target-tree build
1576 t_cpu="arm"
1577 t_manufacturer="tcc77x"
1578 t_model="iaudio7"
1581 33|cowond2)
1582 target_id=34
1583 modelname="cowond2"
1584 target="-DCOWON_D2"
1585 memory=32
1586 arm926ejscc
1587 tool="$rootdir/tools/scramble -add=d2"
1588 boottool="cp "
1589 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1590 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1591 output="rockbox.d2"
1592 bootoutput="bootloader-cowond2.bin"
1593 appextra="recorder:gui:radio"
1594 plugins="yes"
1595 swcodec="yes"
1596 toolset="$tccbitmaptools"
1597 # architecture, manufacturer and model for the target-tree build
1598 t_cpu="arm"
1599 t_manufacturer="tcc780x"
1600 t_model="cowond2"
1603 34|iaudiom3)
1604 target_id=37
1605 modelname="iaudiom3"
1606 target="-DIAUDIO_M3"
1607 memory=16 # always
1608 coldfirecc
1609 tool="$rootdir/tools/scramble -add=iam3"
1610 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1611 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1612 output="rockbox.iaudio"
1613 appextra="recorder:gui:radio"
1614 plugins="yes"
1615 swcodec="yes"
1616 # toolset is the tools within the tools directory that we build for
1617 # this particular target.
1618 toolset="$iaudiobitmaptools"
1619 # architecture, manufacturer and model for the target-tree build
1620 t_cpu="coldfire"
1621 t_manufacturer="iaudio"
1622 t_model="m3"
1625 40|gigabeatfx)
1626 target_id=20
1627 modelname="gigabeatfx"
1628 target="-DGIGABEAT_F"
1629 memory=32 # always
1630 arm9tdmicc
1631 tool="$rootdir/tools/scramble -add=giga"
1632 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1633 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1634 output="rockbox.gigabeat"
1635 appextra="recorder:gui:radio"
1636 plugins="yes"
1637 swcodec="yes"
1638 toolset=$gigabeatbitmaptools
1639 boottool="$rootdir/tools/scramble -gigabeat"
1640 bootoutput="FWIMG01.DAT"
1641 # architecture, manufacturer and model for the target-tree build
1642 t_cpu="arm"
1643 t_manufacturer="s3c2440"
1644 t_model="gigabeat-fx"
1647 41|gigabeats)
1648 target_id=26
1649 modelname="gigabeats"
1650 target="-DGIGABEAT_S"
1651 memory=64
1652 arm1136jfscc
1653 tool="$rootdir/tools/scramble -add=gigs"
1654 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1655 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1656 output="rockbox.gigabeat"
1657 appextra="recorder:gui:radio"
1658 plugins="yes"
1659 swcodec="yes"
1660 toolset="$gigabeatbitmaptools"
1661 boottool="$rootdir/tools/scramble -gigabeats"
1662 bootoutput="nk.bin"
1663 # architecture, manufacturer and model for the target-tree build
1664 t_cpu="arm"
1665 t_manufacturer="imx31"
1666 t_model="gigabeat-s"
1669 70|mrobe500)
1670 target_id=36
1671 modelname="mrobe500"
1672 target="-DMROBE_500"
1673 memory=64 # always
1674 arm926ejscc
1675 tool="$rootdir/tools/scramble -add=m500"
1676 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1677 bmp2rb_native="$rootdir/tools/bmp2rb -f 8"
1678 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1679 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1680 output="rockbox.mrobe500"
1681 appextra="recorder:gui:radio"
1682 plugins="yes"
1683 swcodec="yes"
1684 toolset=$gigabeatbitmaptools
1685 boottool="cp "
1686 bootoutput="rockbox.mrboot"
1687 # architecture, manufacturer and model for the target-tree build
1688 t_cpu="arm"
1689 t_manufacturer="tms320dm320"
1690 t_model="mrobe-500"
1693 71|mrobe100)
1694 target_id=33
1695 modelname="mrobe100"
1696 target="-DMROBE_100"
1697 memory=32 # always
1698 arm7tdmicc
1699 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1700 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1701 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1702 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1703 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1704 output="rockbox.mi4"
1705 appextra="recorder:gui:radio"
1706 plugins="yes"
1707 swcodec="yes"
1708 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1709 bootoutput="pp5020.mi4"
1710 # toolset is the tools within the tools directory that we build for
1711 # this particular target.
1712 toolset=$scramblebitmaptools
1713 # architecture, manufacturer and model for the target-tree build
1714 t_cpu="arm"
1715 t_manufacturer="olympus"
1716 t_model="mrobe-100"
1719 80|logikdax)
1720 target_id=31
1721 modelname="logikdax"
1722 target="-DLOGIK_DAX"
1723 memory=2 # always
1724 arm946cc
1725 tool="$rootdir/tools/scramble -add=ldax"
1726 boottool="$rootdir/tools/scramble -tcc=crc"
1727 bootoutput="player.rom"
1728 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1729 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1730 output="rockbox.logik"
1731 appextra="recorder:gui:radio"
1732 plugins=""
1733 swcodec="yes"
1734 # toolset is the tools within the tools directory that we build for
1735 # this particular target.
1736 toolset=$tccbitmaptools
1737 # architecture, manufacturer and model for the target-tree build
1738 t_cpu="arm"
1739 t_manufacturer="tcc77x"
1740 t_model="logikdax"
1743 90|zenvisionm30gb)
1744 target_id=35
1745 modelname="zenvisionm30gb"
1746 target="-DCREATIVE_ZVM"
1747 memory=64
1748 arm926ejscc
1749 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1750 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1751 tool="$rootdir/tools/scramble -creative=zvm"
1752 USE_ELF="yes"
1753 output="rockbox.zvm"
1754 appextra="recorder:gui:radio"
1755 plugins="yes"
1756 swcodec="yes"
1757 toolset=$ipodbitmaptools
1758 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1759 bootoutput="rockbox.zvmboot"
1760 # architecture, manufacturer and model for the target-tree build
1761 t_cpu="arm"
1762 t_manufacturer="tms320dm320"
1763 t_model="creative-zvm"
1766 91|zenvisionm60gb)
1767 target_id=40
1768 modelname="zenvisionm60gb"
1769 target="-DCREATIVE_ZVM60GB"
1770 memory=64
1771 arm926ejscc
1772 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1773 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1774 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1775 USE_ELF="yes"
1776 output="rockbox.zvm60"
1777 appextra="recorder:gui:radio"
1778 plugins="yes"
1779 swcodec="yes"
1780 toolset=$ipodbitmaptools
1781 boottool="$rootdir/tools/scramble -creative=zvm60"
1782 bootoutput="rockbox.zvm60boot"
1783 # architecture, manufacturer and model for the target-tree build
1784 t_cpu="arm"
1785 t_manufacturer="tms320dm320"
1786 t_model="creative-zvm"
1789 92|zenvision)
1790 target_id=39
1791 modelname="zenvision"
1792 target="-DCREATIVE_ZV"
1793 memory=64
1794 arm926ejscc
1795 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1796 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1797 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1798 USE_ELF="yes"
1799 output="rockbox.zv"
1800 appextra="recorder:gui:radio"
1801 plugins=""
1802 swcodec="yes"
1803 toolset=$ipodbitmaptools
1804 boottool="$rootdir/tools/scramble -creative=zenvision"
1805 bootoutput="rockbox.zvboot"
1806 # architecture, manufacturer and model for the target-tree build
1807 t_cpu="arm"
1808 t_manufacturer="tms320dm320"
1809 t_model="creative-zvm"
1812 50|sansae200)
1813 target_id=23
1814 modelname="sansae200"
1815 target="-DSANSA_E200"
1816 memory=32 # supposedly
1817 arm7tdmicc
1818 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1819 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1820 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1821 output="rockbox.mi4"
1822 appextra="recorder:gui:radio"
1823 plugins="yes"
1824 swcodec="yes"
1825 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1826 bootoutput="PP5022.mi4"
1827 # toolset is the tools within the tools directory that we build for
1828 # this particular target.
1829 toolset=$scramblebitmaptools
1830 # architecture, manufacturer and model for the target-tree build
1831 t_cpu="arm"
1832 t_manufacturer="sandisk"
1833 t_model="sansa-e200"
1836 51|sansae200r)
1837 # the e200R model is pretty much identical to the e200, it only has a
1838 # different option to the scramble tool when building a bootloader and
1839 # makes the bootloader output file name in all lower case.
1840 target_id=27
1841 modelname="sansae200r"
1842 target="-DSANSA_E200"
1843 memory=32 # supposedly
1844 arm7tdmicc
1845 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1846 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1847 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1848 output="rockbox.mi4"
1849 appextra="recorder:gui:radio"
1850 plugins="yes"
1851 swcodec="yes"
1852 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1853 bootoutput="pp5022.mi4"
1854 # toolset is the tools within the tools directory that we build for
1855 # this particular target.
1856 toolset=$scramblebitmaptools
1857 # architecture, manufacturer and model for the target-tree build
1858 t_cpu="arm"
1859 t_manufacturer="sandisk"
1860 t_model="sansa-e200"
1863 52|sansac200)
1864 target_id=30
1865 modelname="sansac200"
1866 target="-DSANSA_C200"
1867 memory=32 # supposedly
1868 arm7tdmicc
1869 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1870 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1871 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1872 output="rockbox.mi4"
1873 appextra="recorder:gui:radio"
1874 plugins="yes"
1875 swcodec="yes"
1876 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1877 bootoutput="firmware.mi4"
1878 # toolset is the tools within the tools directory that we build for
1879 # this particular target.
1880 toolset=$scramblebitmaptools
1881 # architecture, manufacturer and model for the target-tree build
1882 t_cpu="arm"
1883 t_manufacturer="sandisk"
1884 t_model="sansa-c200"
1887 53|sansam200)
1888 target_id=48
1889 modelname="sansam200"
1890 target="-DSANSA_M200"
1891 memory=1 # always
1892 arm946cc
1893 tool="$rootdir/tools/scramble -add=m200"
1894 boottool="$rootdir/tools/scramble -tcc=crc"
1895 bootoutput="player.rom"
1896 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1897 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1898 output="rockbox.m200"
1899 appextra="recorder:gui:radio"
1900 plugins=""
1901 swcodec="yes"
1902 # toolset is the tools within the tools directory that we build for
1903 # this particular target.
1904 toolset=$tccbitmaptools
1905 # architecture, manufacturer and model for the target-tree build
1906 t_cpu="arm"
1907 t_manufacturer="tcc77x"
1908 t_model="m200"
1911 54|sansac100)
1912 target_id=42
1913 modelname="sansac100"
1914 target="-DSANSA_C100"
1915 memory=2
1916 arm946cc
1917 tool="$rootdir/tools/scramble -add=c100"
1918 boottool="$rootdir/tools/scramble -tcc=crc"
1919 bootoutput="player.rom"
1920 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1921 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1922 output="rockbox.c100"
1923 appextra="recorder:gui:radio"
1924 plugins=""
1925 swcodec="yes"
1926 # toolset is the tools within the tools directory that we build for
1927 # this particular target.
1928 toolset=$tccbitmaptools
1929 # architecture, manufacturer and model for the target-tree build
1930 t_cpu="arm"
1931 t_manufacturer="tcc77x"
1932 t_model="c100"
1935 55|sansaclip)
1936 target_id=50
1937 modelname="sansaclip"
1938 target="-DSANSA_CLIP"
1939 memory=2
1940 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1941 bmp2rb_native="$bmp2rb_mono"
1942 tool="$rootdir/tools/scramble -add=clip"
1943 output="rockbox.sansa"
1944 bootoutput="bootloader-clip.sansa"
1945 appextra="recorder:gui:radio"
1946 plugins="yes"
1947 swcodec="yes"
1948 toolset=$scramblebitmaptools
1949 t_cpu="arm"
1950 t_manufacturer="as3525"
1951 t_model="sansa-clip"
1952 arm9tdmicc
1956 56|sansae200v2)
1957 target_id=51
1958 modelname="sansae200v2"
1959 target="-DSANSA_E200V2"
1960 memory=8
1961 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1962 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1963 tool="$rootdir/tools/scramble -add=e2v2"
1964 output="rockbox.sansa"
1965 bootoutput="bootloader-e200v2.sansa"
1966 appextra="recorder:gui:radio"
1967 plugins="yes"
1968 swcodec="yes"
1969 toolset=$scramblebitmaptools
1970 t_cpu="arm"
1971 t_manufacturer="as3525"
1972 t_model="sansa-e200v2"
1973 arm9tdmicc
1977 57|sansam200v4)
1978 target_id=52
1979 modelname="sansam200v4"
1980 target="-DSANSA_M200V4"
1981 memory=2
1982 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1983 bmp2rb_native="$bmp2rb_mono"
1984 tool="$rootdir/tools/scramble -add=m2v4"
1985 output="rockbox.sansa"
1986 bootoutput="bootloader-m200v4.sansa"
1987 appextra="recorder:gui:radio"
1988 plugins="yes"
1989 swcodec="yes"
1990 toolset=$scramblebitmaptools
1991 t_cpu="arm"
1992 t_manufacturer="as3525"
1993 t_model="sansa-m200v4"
1994 arm9tdmicc
1998 58|sansafuze)
1999 target_id=53
2000 modelname="sansafuze"
2001 target="-DSANSA_FUZE"
2002 memory=8
2003 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2004 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2005 tool="$rootdir/tools/scramble -add=fuze"
2006 output="rockbox.sansa"
2007 bootoutput="bootloader-fuze.sansa"
2008 appextra="recorder:gui:radio"
2009 plugins="yes"
2010 swcodec="yes"
2011 toolset=$scramblebitmaptools
2012 t_cpu="arm"
2013 t_manufacturer="as3525"
2014 t_model="sansa-fuze"
2015 arm9tdmicc
2019 59|sansac200v2)
2020 target_id=55
2021 modelname="sansac200v2"
2022 target="-DSANSA_C200V2"
2023 memory=2 # as per OF diagnosis mode
2024 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2025 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2026 tool="$rootdir/tools/scramble -add=c2v2"
2027 output="rockbox.sansa"
2028 bootoutput="bootloader-c200v2.sansa"
2029 appextra="recorder:gui:radio"
2030 plugins="yes"
2031 swcodec="yes"
2032 # toolset is the tools within the tools directory that we build for
2033 # this particular target.
2034 toolset=$scramblebitmaptools
2035 # architecture, manufacturer and model for the target-tree build
2036 t_cpu="arm"
2037 t_manufacturer="as3525"
2038 t_model="sansa-c200v2"
2039 arm9tdmicc
2042 60|sansaclipv2)
2043 target_id=60
2044 modelname="sansaclipv2"
2045 target="-DSANSA_CLIPV2"
2046 memory=8
2047 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2048 bmp2rb_native="$bmp2rb_mono"
2049 tool="$rootdir/tools/scramble -add=clv2"
2050 output="rockbox.sansa"
2051 bootoutput="bootloader-clipv2.sansa"
2052 appextra="recorder:gui:radio"
2053 plugins="yes"
2054 swcodec="yes"
2055 toolset=$scramblebitmaptools
2056 t_cpu="arm"
2057 t_manufacturer="as3525"
2058 t_model="sansa-clipv2"
2059 arm926ejscc
2062 61|sansaview)
2063 echo "Sansa View is not yet supported!"
2064 exit 1
2065 target_id=63
2066 modelname="sansaview"
2067 target="-DSANSA_VIEW"
2068 memory=32
2069 arm1176jzscc
2070 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2071 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2072 output="rockbox.mi4"
2073 appextra="gui"
2074 plugins=""
2075 swcodec="yes"
2076 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2077 bootoutput="firmware.mi4"
2078 # toolset is the tools within the tools directory that we build for
2079 # this particular target.
2080 toolset=$scramblebitmaptools
2081 t_cpu="arm"
2082 t_manufacturer="sandisk"
2083 t_model="sansa-view"
2086 62|sansaclipplus)
2087 target_id=66
2088 modelname="sansaclipplus"
2089 target="-DSANSA_CLIPPLUS"
2090 memory=8
2091 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2092 bmp2rb_native="$bmp2rb_mono"
2093 tool="$rootdir/tools/scramble -add=cli+"
2094 output="rockbox.sansa"
2095 bootoutput="bootloader-clipplus.sansa"
2096 appextra="recorder:gui:radio"
2097 plugins="yes"
2098 swcodec="yes"
2099 toolset=$scramblebitmaptools
2100 t_cpu="arm"
2101 t_manufacturer="as3525"
2102 t_model="sansa-clipplus"
2103 arm926ejscc
2106 63|sansafuzev2)
2107 target_id=68
2108 modelname="sansafuzev2"
2109 target="-DSANSA_FUZEV2"
2110 memory=8 # not sure
2111 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2112 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2113 tool="$rootdir/tools/scramble -add=fuz2"
2114 output="rockbox.sansa"
2115 bootoutput="bootloader-fuzev2.sansa"
2116 appextra="recorder:gui:radio"
2117 plugins="yes"
2118 swcodec="yes"
2119 toolset=$scramblebitmaptools
2120 t_cpu="arm"
2121 t_manufacturer="as3525"
2122 t_model="sansa-fuzev2"
2123 arm926ejscc
2126 150|tatungtpj1022)
2127 target_id=25
2128 modelname="tatungtpj1022"
2129 target="-DTATUNG_TPJ1022"
2130 memory=32 # always
2131 arm7tdmicc
2132 tool="$rootdir/tools/scramble -add tpj2"
2133 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2134 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2135 output="rockbox.elio"
2136 appextra="recorder:gui:radio"
2137 plugins="yes"
2138 swcodec="yes"
2139 boottool="$rootdir/tools/scramble -mi4v2"
2140 bootoutput="pp5020.mi4"
2141 # toolset is the tools within the tools directory that we build for
2142 # this particular target.
2143 toolset=$scramblebitmaptools
2144 # architecture, manufacturer and model for the target-tree build
2145 t_cpu="arm"
2146 t_manufacturer="tatung"
2147 t_model="tpj1022"
2150 100|gogearsa9200)
2151 target_id=41
2152 modelname="gogearsa9200"
2153 target="-DPHILIPS_SA9200"
2154 memory=32 # supposedly
2155 arm7tdmicc
2156 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2157 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2158 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2159 output="rockbox.mi4"
2160 appextra="recorder:gui:radio"
2161 plugins=""
2162 swcodec="yes"
2163 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2164 bootoutput="FWImage.ebn"
2165 # toolset is the tools within the tools directory that we build for
2166 # this particular target.
2167 toolset=$scramblebitmaptools
2168 # architecture, manufacturer and model for the target-tree build
2169 t_cpu="arm"
2170 t_manufacturer="philips"
2171 t_model="sa9200"
2174 101|gogearhdd1630)
2175 target_id=43
2176 modelname="gogearhdd1630"
2177 target="-DPHILIPS_HDD1630"
2178 memory=32 # supposedly
2179 arm7tdmicc
2180 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2181 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2182 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2183 output="rockbox.mi4"
2184 appextra="recorder:gui:radio"
2185 plugins="yes"
2186 swcodec="yes"
2187 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2188 bootoutput="FWImage.ebn"
2189 # toolset is the tools within the tools directory that we build for
2190 # this particular target.
2191 toolset=$scramblebitmaptools
2192 # architecture, manufacturer and model for the target-tree build
2193 t_cpu="arm"
2194 t_manufacturer="philips"
2195 t_model="hdd1630"
2198 102|gogearhdd6330)
2199 target_id=65
2200 modelname="gogearhdd6330"
2201 target="-DPHILIPS_HDD6330"
2202 memory=32 # supposedly
2203 arm7tdmicc
2204 tool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBOS"
2205 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2206 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2207 output="rockbox.mi4"
2208 appextra="recorder:gui:radio"
2209 plugins=""
2210 swcodec="yes"
2211 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL"
2212 bootoutput="FWImage.ebn"
2213 # toolset is the tools within the tools directory that we build for
2214 # this particular target.
2215 toolset=$scramblebitmaptools
2216 # architecture, manufacturer and model for the target-tree build
2217 t_cpu="arm"
2218 t_manufacturer="philips"
2219 t_model="hdd6330"
2222 110|meizum6sl)
2223 target_id=49
2224 modelname="meizum6sl"
2225 target="-DMEIZU_M6SL"
2226 memory=16 # always
2227 arm940tbecc
2228 tool="cp"
2229 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2230 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2231 output="rockbox.meizu"
2232 appextra="recorder:gui:radio"
2233 plugins="no" #FIXME
2234 swcodec="yes"
2235 toolset=$genericbitmaptools
2236 boottool="cp"
2237 bootoutput="rockboot.ebn"
2238 # architecture, manufacturer and model for the target-tree build
2239 t_cpu="arm"
2240 t_manufacturer="s5l8700"
2241 t_model="meizu-m6sl"
2244 111|meizum6sp)
2245 target_id=46
2246 modelname="meizum6sp"
2247 target="-DMEIZU_M6SP"
2248 memory=16 # always
2249 arm940tbecc
2250 tool="cp"
2251 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2252 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2253 output="rockbox.meizu"
2254 appextra="recorder:gui:radio"
2255 plugins="no" #FIXME
2256 swcodec="yes"
2257 toolset=$genericbitmaptools
2258 boottool="cp"
2259 bootoutput="rockboot.ebn"
2260 # architecture, manufacturer and model for the target-tree build
2261 t_cpu="arm"
2262 t_manufacturer="s5l8700"
2263 t_model="meizu-m6sp"
2266 112|meizum3)
2267 target_id=47
2268 modelname="meizum3"
2269 target="-DMEIZU_M3"
2270 memory=16 # always
2271 arm940tbecc
2272 tool="cp"
2273 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2274 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2275 output="rockbox.meizu"
2276 appextra="recorder:gui:radio"
2277 plugins="no" #FIXME
2278 swcodec="yes"
2279 toolset=$genericbitmaptools
2280 boottool="cp"
2281 bootoutput="rockboot.ebn"
2282 # architecture, manufacturer and model for the target-tree build
2283 t_cpu="arm"
2284 t_manufacturer="s5l8700"
2285 t_model="meizu-m3"
2288 120|ondavx747)
2289 target_id=45
2290 modelname="ondavx747"
2291 target="-DONDA_VX747"
2292 memory=16
2293 mipselcc
2294 tool="$rootdir/tools/scramble -add=x747"
2295 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2296 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2297 output="rockbox.vx747"
2298 appextra="recorder:gui:radio"
2299 plugins="yes"
2300 swcodec="yes"
2301 toolset=$genericbitmaptools
2302 boottool="$rootdir/tools/scramble -ccpmp"
2303 bootoutput="ccpmp.bin"
2304 # architecture, manufacturer and model for the target-tree build
2305 t_cpu="mips"
2306 t_manufacturer="ingenic_jz47xx"
2307 t_model="onda_vx747"
2310 121|ondavx767)
2311 target_id=64
2312 modelname="ondavx767"
2313 target="-DONDA_VX767"
2314 memory=16 #FIXME
2315 mipselcc
2316 tool="cp"
2317 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2318 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2319 output="rockbox.vx767"
2320 appextra="recorder:gui:radio"
2321 plugins="" #FIXME
2322 swcodec="yes"
2323 toolset=$genericbitmaptools
2324 boottool="$rootdir/tools/scramble -ccpmp"
2325 bootoutput="ccpmp.bin"
2326 # architecture, manufacturer and model for the target-tree build
2327 t_cpu="mips"
2328 t_manufacturer="ingenic_jz47xx"
2329 t_model="onda_vx767"
2332 122|ondavx747p)
2333 target_id=54
2334 modelname="ondavx747p"
2335 target="-DONDA_VX747P"
2336 memory=16
2337 mipselcc
2338 tool="$rootdir/tools/scramble -add=747p"
2339 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2340 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2341 output="rockbox.vx747p"
2342 appextra="recorder:gui:radio"
2343 plugins="yes"
2344 swcodec="yes"
2345 toolset=$genericbitmaptools
2346 boottool="$rootdir/tools/scramble -ccpmp"
2347 bootoutput="ccpmp.bin"
2348 # architecture, manufacturer and model for the target-tree build
2349 t_cpu="mips"
2350 t_manufacturer="ingenic_jz47xx"
2351 t_model="onda_vx747"
2354 123|ondavx777)
2355 target_id=61
2356 modelname="ondavx777"
2357 target="-DONDA_VX777"
2358 memory=16
2359 mipselcc
2360 tool="$rootdir/tools/scramble -add=x777"
2361 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2362 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2363 output="rockbox.vx777"
2364 appextra="recorder:gui:radio"
2365 plugins="yes"
2366 swcodec="yes"
2367 toolset=$genericbitmaptools
2368 boottool="$rootdir/tools/scramble -ccpmp"
2369 bootoutput="ccpmp.bin"
2370 # architecture, manufacturer and model for the target-tree build
2371 t_cpu="mips"
2372 t_manufacturer="ingenic_jz47xx"
2373 t_model="onda_vx747"
2376 130|lyreproto1)
2377 target_id=56
2378 modelname="lyreproto1"
2379 target="-DLYRE_PROTO1"
2380 memory=64
2381 arm926ejscc
2382 tool="cp"
2383 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2384 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2385 output="rockbox.lyre"
2386 appextra="recorder:gui:radio"
2387 plugins=""
2388 swcodec="yes"
2389 toolset=$scramblebitmaptools
2390 boottool="cp"
2391 bootoutput="bootloader-proto1.lyre"
2392 # architecture, manufacturer and model for the target-tree build
2393 t_cpu="arm"
2394 t_manufacturer="at91sam"
2395 t_model="lyre_proto1"
2398 131|mini2440)
2399 target_id=99
2400 modelname="mini2440"
2401 target="-DMINI2440"
2402 memory=64
2403 arm9tdmicc
2404 tool="$rootdir/tools/scramble -add=m244"
2405 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2406 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2407 output="rockbox.mini2440"
2408 appextra="recorder:gui:radio"
2409 plugins=""
2410 swcodec="yes"
2411 toolset=$scramblebitmaptools
2412 boottool="cp"
2413 bootoutput="bootloader-mini2440.lyre"
2414 # architecture, manufacturer and model for the target-tree build
2415 t_cpu="arm"
2416 t_manufacturer="s3c2440"
2417 t_model="mini2440"
2420 140|samsungyh820)
2421 target_id=57
2422 modelname="samsungyh820"
2423 target="-DSAMSUNG_YH820"
2424 memory=32 # always
2425 arm7tdmicc
2426 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2427 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2428 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2429 output="rockbox.mi4"
2430 appextra="recorder:gui:radio"
2431 plugins="yes"
2432 swcodec="yes"
2433 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2434 bootoutput="FW_YH820.mi4"
2435 # toolset is the tools within the tools directory that we build for
2436 # this particular target.
2437 toolset=$scramblebitmaptools
2438 # architecture, manufacturer and model for the target-tree build
2439 t_cpu="arm"
2440 t_manufacturer="samsung"
2441 t_model="yh820"
2444 141|samsungyh920)
2445 target_id=58
2446 modelname="samsungyh920"
2447 target="-DSAMSUNG_YH920"
2448 memory=32 # always
2449 arm7tdmicc
2450 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2451 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2452 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2453 output="rockbox.mi4"
2454 appextra="recorder:gui:radio"
2455 plugins="yes"
2456 swcodec="yes"
2457 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2458 bootoutput="PP5020.mi4"
2459 # toolset is the tools within the tools directory that we build for
2460 # this particular target.
2461 toolset=$scramblebitmaptools
2462 # architecture, manufacturer and model for the target-tree build
2463 t_cpu="arm"
2464 t_manufacturer="samsung"
2465 t_model="yh920"
2468 142|samsungyh925)
2469 target_id=59
2470 modelname="samsungyh925"
2471 target="-DSAMSUNG_YH925"
2472 memory=32 # always
2473 arm7tdmicc
2474 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2475 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2476 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2477 output="rockbox.mi4"
2478 appextra="recorder:gui:radio"
2479 plugins="yes"
2480 swcodec="yes"
2481 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2482 bootoutput="FW_YH925.mi4"
2483 # toolset is the tools within the tools directory that we build for
2484 # this particular target.
2485 toolset=$scramblebitmaptools
2486 # architecture, manufacturer and model for the target-tree build
2487 t_cpu="arm"
2488 t_manufacturer="samsung"
2489 t_model="yh925"
2492 143|samsungyps3)
2493 target_id=60
2494 modelname="samsungyps3"
2495 target="-DSAMSUNG_YPS3"
2496 memory=16 # always
2497 arm940tbecc
2498 tool="cp"
2499 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2500 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2501 output="rockbox.yps3"
2502 appextra="recorder:gui:radio"
2503 plugins="no" #FIXME
2504 swcodec="yes"
2505 toolset=$genericbitmaptools
2506 boottool="cp"
2507 bootoutput="rockboot.ebn"
2508 # architecture, manufacturer and model for the target-tree build
2509 t_cpu="arm"
2510 t_manufacturer="s5l8700"
2511 t_model="yps3"
2514 160|vibe500)
2515 target_id=67
2516 modelname="vibe500"
2517 target="-DPBELL_VIBE500"
2518 memory=32 # always
2519 arm7tdmicc
2520 tool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBOS"
2521 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2522 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2523 output="rockbox.mi4"
2524 appextra="recorder:gui:radio"
2525 plugins="yes"
2526 swcodec="yes"
2527 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL"
2528 bootoutput="jukebox.mi4"
2529 # toolset is the tools within the tools directory that we build for
2530 # this particular target.
2531 toolset=$scramblebitmaptools
2532 # architecture, manufacturer and model for the target-tree build
2533 t_cpu="arm"
2534 t_manufacturer="pbell"
2535 t_model="vibe500"
2538 170|hd200)
2539 target_id=69
2540 modelname="mpiohd200"
2541 target="-DMPIO_HD200"
2542 memory=16 # always
2543 coldfirecc
2544 tool="$rootdir/tools/scramble -add=hd20"
2545 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2546 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
2547 output="rockbox.mpio"
2548 bootoutput="bootloader.mpio"
2549 appextra="recorder:gui:radio"
2550 plugins="yes"
2551 swcodec="yes"
2552 # toolset is the tools within the tools directory that we build for
2553 # this particular target.
2554 toolset="$genericbitmaptools"
2555 # architecture, manufacturer and model for the target-tree build
2556 t_cpu="coldfire"
2557 t_manufacturer="mpio"
2558 t_model="hd200"
2562 echo "Please select a supported target platform!"
2563 exit 7
2566 esac
2568 echo "Platform set to $modelname"
2571 #remove start
2572 ############################################################################
2573 # Amount of memory, for those that can differ. They have $memory unset at
2574 # this point.
2577 if [ -z "$memory" ]; then
2578 case $target_id in
2580 if [ "$ARG_RAM" ]; then
2581 size=$ARG_RAM
2582 else
2583 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2584 size=`input`;
2586 case $size in
2587 60|64)
2588 memory="64"
2591 memory="32"
2593 esac
2596 if [ "$ARG_RAM" ]; then
2597 size=$ARG_RAM
2598 else
2599 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2600 size=`input`;
2602 case $size in
2604 memory="8"
2607 memory="2"
2609 esac
2611 esac
2612 echo "Memory size selected: $memory MB"
2613 [ "$ARG_TYPE" ] || echo ""
2615 #remove end
2617 ##################################################################
2618 # Figure out build "type"
2621 # the ifp7x0 is the only platform that supports building a gdb stub like
2622 # this
2623 case $modelname in
2624 iriverifp7xx)
2625 gdbstub="(G)DB stub, "
2627 sansae200r|sansae200)
2628 gdbstub="(I)nstaller, "
2630 sansac200)
2631 gdbstub="(E)raser, "
2635 esac
2636 if [ "$ARG_TYPE" ]; then
2637 btype=$ARG_TYPE
2638 else
2639 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2640 btype=`input`;
2643 case $btype in
2644 [Ii])
2645 appsdir='\$(ROOTDIR)/bootloader'
2646 apps="bootloader"
2647 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2648 bootloader="1"
2649 echo "e200R-installer build selected"
2651 [Ee])
2652 appsdir='\$(ROOTDIR)/bootloader'
2653 apps="bootloader"
2654 echo "C2(4)0 or C2(5)0"
2655 variant=`input`
2656 case $variant in
2658 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2659 echo "c240 eraser build selected"
2662 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2663 echo "c240 eraser build selected"
2665 esac
2666 bootloader="1"
2667 echo "c200 eraser build selected"
2669 [Bb])
2670 if test $t_manufacturer = "archos"; then
2671 # Archos SH-based players do this somewhat differently for
2672 # some reason
2673 appsdir='\$(ROOTDIR)/flash/bootbox'
2674 apps="bootbox"
2675 else
2676 appsdir='\$(ROOTDIR)/bootloader'
2677 apps="bootloader"
2678 flash=""
2679 if test -n "$boottool"; then
2680 tool="$boottool"
2682 if test -n "$bootoutput"; then
2683 output=$bootoutput
2686 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2687 bootloader="1"
2688 echo "Bootloader build selected"
2690 [Ss])
2691 if [ "$modelname" = "sansae200r" ]; then
2692 echo "Do not use the e200R target for simulator builds. Use e200 instead."
2693 exit 8
2695 debug="-DDEBUG"
2696 simulator="yes"
2697 extradefines="-DSIMULATOR"
2698 archosrom=""
2699 flash=""
2700 echo "Simulator build selected"
2702 [Aa]*)
2703 echo "Advanced build selected"
2704 whichadvanced $btype
2706 [Gg])
2707 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2708 appsdir='\$(ROOTDIR)/gdb'
2709 apps="stub"
2710 case $modelname in
2711 iriverifp7xx)
2712 output="stub.wma"
2716 esac
2717 echo "GDB stub build selected"
2719 [Mm])
2720 toolset='';
2721 apps="manual"
2722 echo "Manual build selected"
2724 [Cc])
2725 uname=`uname`
2726 simcc "checkwps"
2727 toolset='';
2728 t_cpu='';
2729 GCCOPTS='';
2730 extradefines="-DDEBUG"
2731 appsdir='\$(ROOTDIR)/tools/checkwps';
2732 output='checkwps.'${modelname};
2733 archosrom='';
2734 echo "CheckWPS build selected"
2736 [Dd])
2737 uname=`uname`
2738 simcc "database"
2739 toolset='';
2740 t_cpu='';
2741 GCCOPTS='';
2742 appsdir='\$(ROOTDIR)/tools/database';
2743 archosrom='';
2745 case $uname in
2746 CYGWIN*|MINGW*)
2747 output="database_${modelname}.exe"
2750 output='database.'${modelname};
2752 esac
2754 echo "Database tool build selected"
2757 if [ "$modelname" = "sansae200r" ]; then
2758 echo "Do not use the e200R target for regular builds. Use e200 instead."
2759 exit 8
2761 debug=""
2762 btype="N" # set it explicitly since RET only gets here as well
2763 echo "Normal build selected"
2766 esac
2767 # to be able running "make manual" from non-manual configuration
2768 case $modelname in
2769 archosrecorderv2)
2770 manualdev="archosfmrecorder"
2772 iriverh1??)
2773 manualdev="iriverh100"
2775 ipodmini2g)
2776 manualdev="ipodmini1g"
2779 manualdev=$modelname
2781 esac
2783 if [ -z "$debug" ]; then
2784 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2787 echo "Using source code root directory: $rootdir"
2789 # this was once possible to change at build-time, but no more:
2790 language="english"
2792 uname=`uname`
2794 if [ "yes" = "$simulator" ]; then
2795 # setup compiler and things for simulator
2796 simcc "sdl"
2798 if [ -d "simdisk" ]; then
2799 echo "Subdirectory 'simdisk' already present"
2800 else
2801 mkdir simdisk
2802 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2806 # Now, figure out version number of the (gcc) compiler we are about to use
2807 gccver=`$CC -dumpversion`;
2809 # figure out the binutil version too and display it, mostly for the build
2810 # system etc to be able to see it easier
2811 if [ $uname = "Darwin" ]; then
2812 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2813 else
2814 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2817 if [ -z "$gccver" ]; then
2818 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2819 echo "[WARNING] this may cause your build to fail since we cannot do the"
2820 echo "[WARNING] checks we want now."
2821 else
2823 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2824 # DEPEND on it
2826 num1=`echo $gccver | cut -d . -f1`
2827 num2=`echo $gccver | cut -d . -f2`
2828 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2830 # This makes:
2831 # 3.3.X => 303
2832 # 3.4.X => 304
2833 # 2.95.3 => 295
2835 echo "Using $CC $gccver ($gccnum)"
2837 if test "$gccnum" -ge "400"; then
2838 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2839 # so we ignore that warnings for now
2840 # -Wno-pointer-sign
2841 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2844 if test "$gccnum" -ge "402"; then
2845 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2846 # and later would throw it for several valid cases
2847 GCCOPTS="$GCCOPTS -Wno-override-init"
2850 case $prefix in
2851 ""|"$CROSS_COMPILE")
2852 # simulator
2854 i586-mingw32msvc-)
2855 # cross-compile for win32
2858 # Verify that the cross-compiler is of a recommended version!
2859 if test "$gccver" != "$gccchoice"; then
2860 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2861 echo "WARNING: version $gccchoice!"
2862 echo "WARNING: This may cause your build to fail since it may be a version"
2863 echo "WARNING: that isn't functional or known to not be the best choice."
2864 echo "WARNING: If you suffer from build problems, you know that this is"
2865 echo "WARNING: a likely source for them..."
2868 esac
2873 echo "Using $LD $ldver"
2875 # check the compiler for SH platforms
2876 if test "$CC" = "sh-elf-gcc"; then
2877 if test "$gccnum" -lt "400"; then
2878 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2879 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2880 else
2881 # figure out patch status
2882 gccpatch=`$CC --version`;
2884 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2885 echo "gcc $gccver is rockbox patched"
2886 # then convert -O to -Os to get smaller binaries!
2887 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2888 else
2889 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2890 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2895 if test "$CC" = "m68k-elf-gcc"; then
2896 # convert -O to -Os to get smaller binaries!
2897 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2900 if [ "$ARG_CCACHE" = "1" ]; then
2901 echo "Enable ccache for building"
2902 ccache="ccache"
2903 elif [ "$ARG_CCACHE" != "0" ]; then
2904 ccache=`findtool ccache`
2905 if test -n "$ccache"; then
2906 echo "Found and uses ccache ($ccache)"
2910 # figure out the full path to the various commands if possible
2911 HOSTCC=`findtool gcc --lit`
2912 HOSTAR=`findtool ar --lit`
2913 CC=`findtool ${CC} --lit`
2914 LD=`findtool ${AR} --lit`
2915 AR=`findtool ${AR} --lit`
2916 AS=`findtool ${AS} --lit`
2917 OC=`findtool ${OC} --lit`
2918 WINDRES=`findtool ${WINDRES} --lit`
2919 DLLTOOL=`findtool ${DLLTOOL} --lit`
2920 DLLWRAP=`findtool ${DLLWRAP} --lit`
2921 RANLIB=`findtool ${RANLIB} --lit`
2923 if test -n "$ccache"; then
2924 CC="$ccache $CC"
2927 if test "X$endian" = "Xbig"; then
2928 defendian="ROCKBOX_BIG_ENDIAN"
2929 else
2930 defendian="ROCKBOX_LITTLE_ENDIAN"
2933 if [ "$ARG_RBDIR" ]; then
2934 rbdir=$ARG_RBDIR
2935 echo "Using alternate rockbox dir: ${rbdir}"
2938 sed > autoconf.h \
2939 -e "s,@ENDIAN@,${defendian},g" \
2940 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2941 -e "s,^#undef DO_BOOTCHART,$use_bootchart,g" \
2942 -e "s,@config_rtc@,$config_rtc,g" \
2943 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2944 -e "s,@RBDIR@,${rbdir},g" \
2945 -e "s,@have_backlight@,$have_backlight,g" \
2946 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2947 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2948 <<EOF
2949 /* This header was made by configure */
2950 #ifndef __BUILD_AUTOCONF_H
2951 #define __BUILD_AUTOCONF_H
2953 /* Define endianess for the target or simulator platform */
2954 #define @ENDIAN@ 1
2956 /* Define this if you build rockbox to support the logf logging and display */
2957 #undef ROCKBOX_HAS_LOGF
2959 /* Define this to record a chart with timings for the stages of boot */
2960 #undef DO_BOOTCHART
2962 /* optional define for a backlight modded Ondio */
2963 @have_backlight@
2965 /* optional define for FM radio mod for iAudio M5 */
2966 @have_fmradio_in@
2968 /* optional define for ATA poweroff on Player */
2969 @have_ata_poweroff@
2971 /* optional defines for RTC mod for h1x0 */
2972 @config_rtc@
2973 @have_rtc_alarm@
2975 /* root of Rockbox */
2976 #define ROCKBOX_DIR "/@RBDIR@"
2978 #endif /* __BUILD_AUTOCONF_H */
2981 if test -n "$t_cpu"; then
2982 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2983 if [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree
2984 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/"
2985 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/"
2987 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2988 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2989 GCCOPTS="$GCCOPTS"
2992 if test "$simulator" = "yes"; then
2993 # add simul make stuff on the #SIMUL# line
2994 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2995 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2996 else
2997 # delete the lines that match
2998 simmagic1='/@SIMUL1@/D'
2999 simmagic2='/@SIMUL2@/D'
3002 if test "$swcodec" = "yes"; then
3003 voicetoolset="rbspeexenc voicefont wavtrim"
3004 else
3005 voicetoolset="voicefont wavtrim"
3008 if test "$apps" = "apps"; then
3009 # only when we build "real" apps we build the .lng files
3010 buildlangs="langs"
3013 #### Fix the cmdline ###
3014 if [ "$ARG_CCACHE" = "1" ]; then
3015 cmdline="--ccache "
3016 elif [ "$ARG_CCACHE" = "0" ]; then
3017 cmdline="--no-ccache "
3019 if [ "$ARG_ARM_EABI" = "1" ]; then
3020 cmdline="$cmdline--eabi "
3023 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
3024 ### end of cmdline
3026 sed > Makefile \
3027 -e "s,@ROOTDIR@,${rootdir},g" \
3028 -e "s,@DEBUG@,${debug},g" \
3029 -e "s,@MEMORY@,${memory},g" \
3030 -e "s,@TARGET_ID@,${target_id},g" \
3031 -e "s,@TARGET@,${target},g" \
3032 -e "s,@CPU@,${t_cpu},g" \
3033 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
3034 -e "s,@MODELNAME@,${modelname},g" \
3035 -e "s,@LANGUAGE@,${language},g" \
3036 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
3037 -e "s,@PWD@,${pwd},g" \
3038 -e "s,@HOSTCC@,${HOSTCC},g" \
3039 -e "s,@HOSTAR@,${HOSTAR},g" \
3040 -e "s,@CC@,${CC},g" \
3041 -e "s,@LD@,${LD},g" \
3042 -e "s,@AR@,${AR},g" \
3043 -e "s,@AS@,${AS},g" \
3044 -e "s,@OC@,${OC},g" \
3045 -e "s,@WINDRES@,${WINDRES},g" \
3046 -e "s,@DLLTOOL@,${DLLTOOL},g" \
3047 -e "s,@DLLWRAP@,${DLLWRAP},g" \
3048 -e "s,@RANLIB@,${RANLIB},g" \
3049 -e "s,@TOOL@,${tool},g" \
3050 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
3051 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
3052 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
3053 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
3054 -e "s,@OUTPUT@,${output},g" \
3055 -e "s,@APPEXTRA@,${appextra},g" \
3056 -e "s,@ARCHOSROM@,${archosrom},g" \
3057 -e "s,@FLASHFILE@,${flash},g" \
3058 -e "s,@PLUGINS@,${plugins},g" \
3059 -e "s,@CODECS@,${swcodec},g" \
3060 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
3061 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
3062 -e "s,@GCCOPTS@,${GCCOPTS},g" \
3063 -e "s,@TARGET_INC@,${TARGET_INC},g" \
3064 -e "s!@LDOPTS@!${LDOPTS}!g" \
3065 -e "s,@LOADADDRESS@,${loadaddress},g" \
3066 -e "s,@EXTRADEF@,${extradefines},g" \
3067 -e "s,@APPSDIR@,${appsdir},g" \
3068 -e "s,@FIRMDIR@,${firmdir},g" \
3069 -e "s,@TOOLSDIR@,${toolsdir},g" \
3070 -e "s,@APPS@,${apps},g" \
3071 -e "s,@SIMVER@,${simver},g" \
3072 -e "s,@GCCVER@,${gccver},g" \
3073 -e "s,@GCCNUM@,${gccnum},g" \
3074 -e "s,@UNAME@,${uname},g" \
3075 -e "s,@ENDIAN@,${defendian},g" \
3076 -e "s,@TOOLSET@,${toolset},g" \
3077 -e "${simmagic1}" \
3078 -e "${simmagic2}" \
3079 -e "s,@MANUALDEV@,${manualdev},g" \
3080 -e "s,@ENCODER@,${ENC_CMD},g" \
3081 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
3082 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
3083 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
3084 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
3085 -e "s,@LANGS@,${buildlangs},g" \
3086 -e "s,@USE_ELF@,${USE_ELF},g" \
3087 -e "s,@RBDIR@,${rbdir},g" \
3088 -e "s,@PREFIX@,$PREFIX,g" \
3089 -e "s,@CMDLINE@,$cmdline,g" \
3090 -e "s,@SDLCONFIG@,$sdl,g" \
3091 <<EOF
3092 ## Automatically generated. http://www.rockbox.org/
3094 export ROOTDIR=@ROOTDIR@
3095 export FIRMDIR=@FIRMDIR@
3096 export APPSDIR=@APPSDIR@
3097 export TOOLSDIR=@TOOLSDIR@
3098 export DOCSDIR=\$(ROOTDIR)/docs
3099 export MANUALDIR=\${ROOTDIR}/manual
3100 export DEBUG=@DEBUG@
3101 export MODELNAME=@MODELNAME@
3102 export ARCHOSROM=@ARCHOSROM@
3103 export FLASHFILE=@FLASHFILE@
3104 export TARGET_ID=@TARGET_ID@
3105 export TARGET=@TARGET@
3106 export CPU=@CPU@
3107 export MANUFACTURER=@MANUFACTURER@
3108 export OBJDIR=@PWD@
3109 export BUILDDIR=@PWD@
3110 export LANGUAGE=@LANGUAGE@
3111 export VOICELANGUAGE=@VOICELANGUAGE@
3112 export MEMORYSIZE=@MEMORY@
3113 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
3114 export MKFIRMWARE=@TOOL@
3115 export BMP2RB_MONO=@BMP2RB_MONO@
3116 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
3117 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
3118 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
3119 export BINARY=@OUTPUT@
3120 export APPEXTRA=@APPEXTRA@
3121 export ENABLEDPLUGINS=@PLUGINS@
3122 export SOFTWARECODECS=@CODECS@
3123 export EXTRA_DEFINES=@EXTRADEF@
3124 export HOSTCC=@HOSTCC@
3125 export HOSTAR=@HOSTAR@
3126 export CC=@CC@
3127 export LD=@LD@
3128 export AR=@AR@
3129 export AS=@AS@
3130 export OC=@OC@
3131 export WINDRES=@WINDRES@
3132 export DLLTOOL=@DLLTOOL@
3133 export DLLWRAP=@DLLWRAP@
3134 export RANLIB=@RANLIB@
3135 export PREFIX=@PREFIX@
3136 export PROFILE_OPTS=@PROFILE_OPTS@
3137 export SIMVER=@SIMVER@
3138 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
3139 export GCCOPTS=@GCCOPTS@
3140 export TARGET_INC=@TARGET_INC@
3141 export LOADADDRESS=@LOADADDRESS@
3142 export SHARED_FLAG=@SHARED_FLAG@
3143 export LDOPTS=@LDOPTS@
3144 export GCCVER=@GCCVER@
3145 export GCCNUM=@GCCNUM@
3146 export UNAME=@UNAME@
3147 export MANUALDEV=@MANUALDEV@
3148 export TTS_OPTS=@TTS_OPTS@
3149 export TTS_ENGINE=@TTS_ENGINE@
3150 export ENC_OPTS=@ENC_OPTS@
3151 export ENCODER=@ENCODER@
3152 export USE_ELF=@USE_ELF@
3153 export RBDIR=@RBDIR@
3154 export SDLCONFIG=@SDLCONFIG@
3156 CONFIGURE_OPTIONS=@CMDLINE@
3158 include \$(TOOLSDIR)/root.make
3162 echo "Created Makefile"