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