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