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