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