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