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