move the iriver ifp7xx and other pnx0101 related files together in the target tree
[Rockbox.git] / tools / configure
blobba464472b5dfc07aa52b46ea7955e40df1ddaecf
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"
14 use_logf="#undef ROCKBOX_HAS_LOGF"
15 use_simsound="#undef ROCKBOX_HAS_SIMSOUND"
17 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
20 # Begin Function Definitions
22 input() {
23 read response
24 echo $response
27 prefixtools () {
28 prefix="$1"
29 CC=${prefix}gcc
30 WINDRES=${prefix}windres
31 DLLTOOL=${prefix}dlltool
32 DLLWRAP=${prefix}dllwrap
33 RANLIB=${prefix}ranlib
34 LD=${prefix}ld
35 AR=${prefix}ar
36 AS=${prefix}as
37 OC=${prefix}objcopy
40 crosswincc () {
41 # naive approach to selecting a mingw cross-compiler on linux/*nix
42 echo "Enabling win32 crosscompiling"
44 prefixtools i586-mingw32msvc-
46 LDOPTS="-lgdi32 -luser32 -mwindows"
47 # add cross-compiler option(s)
48 GCCOPTS="$GCCOPTS -mno-cygwin"
50 output="rockboxui.exe" # use this as output binary name
51 crosscompile="yes"
52 endian="little" # windows is little endian
55 checksoundcard () {
56 if test -n "$codecs"; then
57 if test -f "/usr/include/sys/soundcard.h"; then
58 # We have a header file so we can build the sound code
59 use_simsound="#define ROCKBOX_HAS_SIMSOUND 1"
60 echo "Enabled PCM sound playback in simulator"
61 fi # header file present
62 fi # has codecs
65 # scan the $PATH for the given command
66 findtool(){
67 file="$1"
69 IFS=":"
70 for path in $PATH
72 # echo "checks for $file in $path" >&2
73 if test -f "$path/$file"; then
74 echo "$path/$file"
75 return
77 done
81 simcc () {
83 # default tool setup for native building
84 prefixtools ""
86 GCCOPTS='-W -Wall -g -fno-builtin'
88 output="rockboxui" # use this as default output binary name
90 if [ "$simver" = "sdl" ]; then
91 # generic sdl-config checker
92 sdl=`findtool sdl-config`
94 if [ -z "$sdl" ]; then
95 echo "configure didn't find sdl-config, which indicates that you"
96 echo "don't have SDL (properly) installed. Please correct and"
97 echo "re-run configure!"
98 exit
102 case $uname in
103 CYGWIN*)
104 echo "Cygwin host detected"
106 SHARED_FLAG="-shared"
107 if [ "$simver" = "win32" ]; then
108 # win32 version
109 GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
110 LDOPTS="-lgdi32 -luser32 -mno-cygwin"
111 elif [ "$simver" = "sdl" ]; then
112 # sdl version
113 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
114 LDOPTS="`sdl-config --libs` -mconsole"
115 checksoundcard
116 else
117 # x11 version
118 GCCOPTS="$GCCOPTS"
119 LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
120 checksoundcard
122 output="rockboxui.exe" # use this as output binary name
125 Linux)
126 echo "Linux host detected"
127 GCCOPTS="$GCCOPTS"
128 SHARED_FLAG="-shared"
129 if [ "$simver" = "win32" ]; then
130 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
131 crosswincc # setup cross-compiler
132 elif [ "$simver" = "sdl" ]; then
133 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
134 # Enable crosscompiling if sdl-config is from Windows SDL
135 crosswincc
137 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
138 LDOPTS="`sdl-config --libs`"
139 checksoundcard
140 else
141 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
142 checksoundcard
143 fi # not a cross-compiler
146 FreeBSD)
147 echo "FreeBSD host detected"
148 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
149 SHARED_FLAG="-shared"
150 if [ "$simver" = "win32" ]; then
151 crosswincc # setup cross-compiler
155 Darwin)
156 echo "Darwin host detected"
157 # sdl version
158 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
159 LDOPTS="`sdl-config --libs`"
160 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
161 use_simsound="#define ROCKBOX_HAS_SIMSOUND 1"
162 echo "Enabled PCM sound playback in simulator"
166 echo "Unsupported system: $uname, fix configure and retry"
167 exit
169 esac
171 if [ "`uname -m`" = "x86_64" ]; then
172 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
175 if test "X$crosscompile" != "Xyes"; then
176 id=$$
177 cat >/tmp/conftest-$id.c <<EOF
178 #include <stdio.h>
179 int main(int argc, char **argv)
181 int var=0;
182 char *varp = (char *)&var;
183 *varp=1;
185 printf("%d\n", var);
186 return 0;
190 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
192 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
193 # big endian
194 endian="big"
195 else
196 # little endian
197 endian="little"
199 echo "Simulator environment deemed $endian endian"
201 # use wildcard here to make it work even if it was named *.exe like
202 # on cygwin
203 rm -f /tmp/conftest-$id*
207 shcc () {
208 prefixtools sh-elf-
209 GCCOPTS="$CCOPTS -m1"
210 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
211 endian="big"
214 calmrisccc () {
215 prefixtools calmrisc16-unknown-elf-
216 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
217 GCCOPTIMIZE="-fomit-frame-pointer"
218 endian="big"
221 coldfirecc () {
222 prefixtools m68k-elf-
223 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
224 GCCOPTIMIZE="-fomit-frame-pointer"
225 endian="big"
228 arm7tdmicc () {
229 prefixtools arm-elf-
230 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
231 if test "X$1" != "Xshort"; then
232 GCCOPTS="$GCCOPTS -mlong-calls"
234 GCCOPTIMIZE="-fomit-frame-pointer"
235 endian="little"
238 arm9tdmicc () {
239 prefixtools arm-elf-
240 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
241 GCCOPTIMIZE="-fomit-frame-pointer"
242 endian="little"
245 whichadvanced () {
246 ##################################################################
247 # Prompt for specific developer options
249 echo ""
250 echo "Enter your developer options (press enter when done)"
251 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
252 if [ "$memory" = "2" ]; then
253 echo -n ", (8)MB MOD"
255 if [ "$archos" = "h120" ]; then
256 echo -n ", (R)TC MOD"
258 echo ""
260 cont=1
262 while [ $cont = "1" ]; do
264 option=`input`;
266 case $option in
267 [Dd])
268 if [ "yes" = "$profile" ]; then
269 echo "Debug is incompatible with profiling"
270 else
271 echo "define DEBUG"
272 use_debug="yes"
275 [Ll])
276 echo "logf() support enabled"
277 logf="yes"
279 [Ss])
280 echo "Simulator build enabled"
281 simulator="yes"
283 [Pp])
284 if [ "yes" = "$use_debug" ]; then
285 echo "Profiling is incompatible with debug"
286 else
287 echo "Profiling support is enabled"
288 profile="yes"
292 if [ "$memory" = "2" ]; then
293 memory="8"
294 echo "Memory size selected: 8MB"
295 else
296 cont=0
299 [Rr])
300 if [ "$archos" = "h120" ]; then
301 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
302 have_rtc_alarm="#define HAVE_RTC_ALARM"
303 echo "RTC functions enabled (DS1339/DS3231)"
304 else
305 cont=0
309 cont=0
311 esac
312 done
313 echo "done"
315 if [ "yes" = "$use_debug" ]; then
316 debug="-DDEBUG"
317 GCCOPTS="$GCCOPTS -g -DDEBUG"
319 if [ "yes" = "$logf" ]; then
320 use_logf="#define ROCKBOX_HAS_LOGF 1"
322 if [ "yes" = "$simulator" ]; then
323 debug="-DDEBUG"
324 extradefines="$extradefines -DSIMULATOR"
325 whichsim
327 if [ "yes" = "$profile" ]; then
328 extradefines="$extradefines -DRB_PROFILE"
329 PROFILE_OPTS="-finstrument-functions"
333 whichsim () {
335 if [ -z "$simver" ]; then
337 ##################################################################
338 # Figure out what simulator version
340 # x11 is deprecated so hide it from the question
341 # win32 is also deprecated
343 echo ""
344 echo "Build (S)DL version? (S)"
346 option=`input`;
348 case $option in
349 [Ww])
350 simver="win32"
352 WINDRES=windres
353 DLLTOOL=dlltool
354 DLLWRAP=dllwrap
356 # make sure the code knows this is for win32
357 extradefines="$extradefines -DWIN32"
359 [Xx])
360 simver="x11"
361 extradefines="$extradefines -DX11"
363 [Ss]|*)
364 simver="sdl"
365 extradefines="$extradefines -DSDL"
367 esac
368 echo "Selected $simver simulator"
372 voiceconfig () {
373 echo "Building voice for $archos"
374 echo ""
376 if [ `which flite` ]; then
377 FLITE="F(l)ite "
378 FLITE_OPTS="FLITE_OPTS=\"\""
379 DEFAULT_TTS="flite"
380 DEFAULT_TTS_OPTS=$FLITE_OPTS
381 DEFAULT_NOISEFLOOR="500"
382 DEFAULT_CHOICE="L"
384 if [ `which speak` ]; then
385 ESPEAK="(e)Speak "
386 ESPEAK_OPTS="ESPEAK_OPTS=\"\""
387 DEFAULT_TTS="espeak"
388 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
389 DEFAULT_NOISEFLOOR="500"
390 DEFAULT_CHOICE="e"
392 if [ `which festival` ]; then
393 FESTIVAL="(F)estival "
394 FESTIVAL_OPTS="FLITE_OPTS=\"\""
395 DEFAULT_TTS="festival"
396 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
397 DEFAULT_NOISEFLOOR="500"
398 DEFAULT_CHOICE="F"
401 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ]; then
402 echo "You need Festival, eSpeak or Flite in your path to build voice files"
403 exit
406 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}(${DEFAULT_CHOICE})?"
407 option=`input`
408 case "$option" in
409 [Ll])
410 TTS_ENGINE="flite"
411 NOISEFLOOR="500" # TODO: check this value
412 TTS_OPTS=$FLITE_OPTS
414 [Ee])
415 TTS_ENGINE="espeak"
416 NOISEFLOOR="500"
417 TTS_OPTS=$ESPEAK_OPTS
419 [Ff])
420 TTS_ENGINE="festival"
421 NOISEFLOOR="500"
422 TTS_OPTS=$FESTIVAL_OPTS
425 TTS_ENGINE=$DEFAULT_TTS
426 TTS_OPTS=$DEFAULT_TTS_OPTS
427 NOISEFLOOR=$DEFAULT_NOISEFLOOR
428 esac
429 echo "Using $TTS_ENGINE for TTS"
431 echo ""
433 if [ `which oggenc` ]; then
434 OGGENC="(O)ggenc "
435 DEFAULT_ENC="oggenc"
436 VORBIS_OPTS="VORBIS_OPTS=\"-q0 --downmix\""
437 DEFAULT_ENC_OPTS=$VORBIS_OPTS
438 DEFAULT_CHOICE="O"
440 if [ `which speexenc` ]; then
441 SPEEXENC="(S)peexenc "
442 DEFAULT_ENC="speexenc"
443 SPEEX_OPTS="" # TODO: find appropriate options for speex
444 DEFAULT_ENC_OPTS=$SPEEX_OPTS
445 DEFAULT_CHOICE="S"
447 if [ `which lame` ]; then
448 LAME="(L)ame "
449 DEFAULT_ENC="lame"
450 LAME_OPTS="LAME_OPTS=\"--resample 12 -t -m m -h -V 9 -S\""
451 DEFAULT_ENC_OPTS=$LAME_OPTS
452 DEFAULT_CHOICE="L"
455 if [ "$LAME" = "" ]; then
456 echo "You need to have Lame installed to build voice files"
459 echo "Encoder to use: ${LAME}${OGGENC}${SPEEXENC}(${DEFAULT_CHOICE})?"
460 echo ""
461 echo "Note: Use Lame - the other options won't work"
462 option=`input`
463 case "$option" in
464 [Oo])
465 ENCODER="oggenc"
466 ENC_OPTS=$VORBIS_OPTS
468 [Ss])
469 ENCODER="speexenc"
470 ENC_OPTS=$SPEEX_OPTS
472 [Ll])
473 ENCODER="lame"
474 ENC_OPTS=$LAME_OPTS
477 ENCODER=$DEFAULT_ENC
478 ENC_OPTS=$DEFAULT_ENC_OPTS
479 esac
480 echo "Using $ENCODER for encoding voice clips"
482 cat > voicesettings.sh <<EOF
483 TTS_ENGINE="${TTS_ENGINE}"
484 ENCODER="${ENCODER}"
485 TEMPDIR="${pwd}"
486 NOISEFLOOR="${NOISEFLOOR}"
487 ${TTS_OPTS}
488 ${ENC_OPTS}
492 picklang() {
493 # figure out which languages that are around
494 for file in $rootdir/apps/lang/*.lang; do
495 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
496 langs="$langs $clean"
497 done
499 num=1
500 for one in $langs; do
501 echo "$num. $one"
502 num=`expr $num + 1`
503 done
505 read pick
506 return $pick;
509 whichlang() {
510 num=1
511 for one in $langs; do
512 if [ "$num" = "$pick" ]; then
513 echo $one
514 return
516 num=`expr $num + 1`
517 done
520 opt=$1
522 if test "$opt" = "--help"; then
523 echo "Rockbox configure script."
524 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
525 echo "Do *NOT* run this within the tools directory!"
526 echo ""
527 echo "Usage: configure [--ccache][--no-ccache]"
528 exit
531 if test -r "configure"; then
532 # this is a check for a configure script in the current directory, it there
533 # is one, try to figure out if it is this one!
535 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
536 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
537 echo "It will only cause you pain and grief. Instead do this:"
538 echo ""
539 echo " cd .."
540 echo " mkdir build-dir"
541 echo " cd build-dir"
542 echo " ../tools/configure"
543 echo ""
544 echo "Much happiness will arise from this. Enjoy"
545 exit
549 # get our current directory
550 pwd=`pwd`;
552 if [ -z "$rootdir" ]; then
553 ##################################################################
554 # Figure out where the source code root is!
556 rootdir=`dirname $0`/../
558 #####################################################################
559 # Convert the possibly relative directory name to an absolute version
561 now=`pwd`
562 cd $rootdir
563 rootdir=`pwd`
565 # cd back to the build dir
566 cd $now
569 apps="apps"
570 appsdir='\$(ROOTDIR)/apps'
571 firmdir='\$(ROOTDIR)/firmware'
572 toolsdir='\$(ROOTDIR)/tools'
575 ##################################################################
576 # Figure out target platform
579 echo "Enter target platform:"
580 cat <<EOF
581 ==Archos== ==iriver== ==Apple iPod==
582 0) Player/Studio 10) H120/H140 20) Color/Photo
583 1) Recorder 11) H320/H340 21) Nano
584 2) FM Recorder 12) iHP-100/110/115 22) Video
585 3) Recorder v2 13) iFP-790 23) 3G
586 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
587 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
588 6) AV300 26) Mini 2G
590 ==iAudio== ==Toshiba== ==SanDisk==
591 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
592 31) M5/M5L 51) Sansa e200R
594 ==Tatung==
595 60) Elio TPJ-1022
598 buildfor=`input`;
600 # Set of tools built for all target platforms:
601 toolset="rdf2binary convbdf codepages"
603 # Toolsets for some target families:
604 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
605 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
606 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
607 ipodbitmaptools="$toolset scramble ipod_fw bmp2rb codepages"
608 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
609 # generic is used by IFP, H10, Sansa-e200
610 genericbitmaptools="$toolset bmp2rb"
613 # ---- For each target ----
615 # *Variables*
616 # target_id: a unique number identifying this target, DOES NOT necessarily
617 # have to be the menu number. Just use the currently highest
618 # number+1 when you add a new target.
619 # archos: short model name used all over to identify this target
620 # target: -Ddefine passed to the build commands to make the correct
621 # config-*.h file get included etc
622 # tool: the tool that takes a plain binary and converts that into a
623 # working "firmware" file for your target
624 # output: the final output file name
625 # boottool: the tool that takes a plain binary and generates a bootloader
626 # file for your target (or blank to use $tool)
627 # bootoutput:the final output file name for the bootloader (or blank to use
628 # $output)
629 # appextra: passed to the APPEXTRA variable in the Makefiles.
630 # TODO: add proper explanation
631 # archosrom: used only for Archos targets that build a special flashable .ucl
632 # image. Set to blank for other builds.
633 # flash: the same as archosrom. These two should be merged
634 # plugins: set to 'yes' to build the plugins. Early development builds can
635 # set this to no in the early stages to have an easier life for a
636 # while
637 # codecs: lists codecs to build for this target
638 # toolset: lists what particular tools in the tools/ directory that this
639 # target needs to have built prior to building Rockbox
641 # *Functions*
642 # *cc: sets up gcc and compiler options for your target builds. Note
643 # that if you select a simulator build, the compiler selection is
644 # overridden later in the script.
646 case $buildfor in
648 0|player)
649 target_id=1
650 archos="player"
651 target="-DARCHOS_PLAYER"
652 memory="2"
653 shcc
654 tool="$rootdir/tools/scramble"
655 output="archos.mod"
656 appextra="player:gui"
657 archosrom="$pwd/rombox.ucl"
658 flash="$pwd/rockbox.ucl"
659 plugins="yes"
660 codecs=""
662 # toolset is the tools within the tools directory that we build for
663 # this particular target.
664 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
666 # Note: the convbdf is present in the toolset just because: 1) the
667 # firmware/Makefile assumes it is present always, and 2) we will need it when we
668 # build the player simulator
670 t_cpu="sh"
671 t_manufacturer="archos"
672 t_model="player"
675 1|recorder)
676 target_id=2
677 archos="recorder"
678 target="-DARCHOS_RECORDER"
679 memory="2"
680 shcc
681 tool="$rootdir/tools/scramble"
682 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
683 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
684 output="ajbrec.ajz"
685 appextra="recorder:gui"
686 archosrom="$pwd/rombox.ucl"
687 flash="$pwd/rockbox.ucl"
688 plugins="yes"
689 codecs=""
690 # toolset is the tools within the tools directory that we build for
691 # this particular target.
692 toolset=$archosbitmaptools
693 t_cpu="sh"
694 t_manufacturer="archos"
695 t_model="recorder"
698 2|fmrecorder)
699 target_id=3
700 archos="fmrecorder"
701 target="-DARCHOS_FMRECORDER"
702 memory="2"
703 shcc
704 tool="$rootdir/tools/scramble -fm"
705 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
706 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
707 output="ajbrec.ajz"
708 appextra="recorder:gui"
709 archosrom="$pwd/rombox.ucl"
710 flash="$pwd/rockbox.ucl"
711 plugins="yes"
712 codecs=""
713 # toolset is the tools within the tools directory that we build for
714 # this particular target.
715 toolset=$archosbitmaptools
716 t_cpu="sh"
717 t_manufacturer="archos"
718 t_model="fm_v2"
721 3|recorderv2)
722 target_id=4
723 archos="recorderv2"
724 target="-DARCHOS_RECORDERV2"
725 memory="2"
726 shcc
727 tool="$rootdir/tools/scramble -v2"
728 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
729 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
730 output="ajbrec.ajz"
731 appextra="recorder:gui"
732 archosrom="$pwd/rombox.ucl"
733 flash="$pwd/rockbox.ucl"
734 plugins="yes"
735 codecs=""
736 # toolset is the tools within the tools directory that we build for
737 # this particular target.
738 toolset=$archosbitmaptools
739 t_cpu="sh"
740 t_manufacturer="archos"
741 t_model="fm_v2"
744 4|ondiosp)
745 target_id=7
746 archos="ondiosp"
747 target="-DARCHOS_ONDIOSP"
748 memory="2"
749 shcc
750 tool="$rootdir/tools/scramble -osp"
751 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
752 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
753 output="ajbrec.ajz"
754 appextra="recorder:gui"
755 archosrom="$pwd/rombox.ucl"
756 flash="$pwd/rockbox.ucl"
757 plugins="yes"
758 codecs=""
759 # toolset is the tools within the tools directory that we build for
760 # this particular target.
761 toolset=$archosbitmaptools
762 t_cpu="sh"
763 t_manufacturer="archos"
764 t_model="ondio"
767 5|ondiofm)
768 target_id=8
769 archos="ondiofm"
770 target="-DARCHOS_ONDIOFM"
771 memory="2"
772 shcc
773 tool="$rootdir/tools/scramble -ofm"
774 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
775 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
776 output="ajbrec.ajz"
777 appextra="recorder:gui"
778 archosrom="$pwd/rombox.ucl"
779 flash="$pwd/rockbox.ucl"
780 plugins="yes"
781 codecs=""
782 toolset=$archosbitmaptools
783 t_cpu="sh"
784 t_manufacturer="archos"
785 t_model="ondio"
788 6|av300)
789 target_id=26
790 archos="av300"
791 target="-DARCHOS_AV300"
792 memory=16 # always
793 arm7tdmicc
794 tool="$rootdir/tools/scramble -mm=C"
795 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
796 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
797 output="cjbm.ajz"
798 appextra="recorder:gui"
799 archosrom=""
800 flash=""
801 plugins="yes"
802 codecs=""
803 # toolset is the tools within the tools directory that we build for
804 # this particular target.
805 toolset="$toolset scramble descramble bmp2rb codepages"
806 # architecture, manufacturer and model for the target-tree build
807 t_cpu="arm"
808 t_manufacturer="archos"
809 t_model="av300"
812 10|h120)
813 target_id=9
814 archos="h120"
815 target="-DIRIVER_H120"
816 memory=32 # always
817 coldfirecc
818 tool="$rootdir/tools/scramble -add=h120"
819 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
820 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
821 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
822 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
823 output="rockbox.iriver"
824 appextra="recorder:gui"
825 archosrom=""
826 flash="$pwd/rombox.iriver"
827 plugins="yes"
828 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
829 # toolset is the tools within the tools directory that we build for
830 # this particular target.
831 toolset=$iriverbitmaptools
832 t_cpu="coldfire"
833 t_manufacturer="iriver"
834 t_model="h100"
837 11|h300)
838 target_id=10
839 archos="h300"
840 target="-DIRIVER_H300"
841 memory=32 # always
842 coldfirecc
843 tool="$rootdir/tools/scramble -add=h300"
844 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
845 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
846 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
847 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
848 output="rockbox.iriver"
849 appextra="recorder:gui"
850 archosrom=""
851 flash=""
852 plugins="yes"
853 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
854 # toolset is the tools within the tools directory that we build for
855 # this particular target.
856 toolset=$iriverbitmaptools
857 t_cpu="coldfire"
858 t_manufacturer="iriver"
859 t_model="h300"
862 12|h100)
863 target_id=11
864 archos="h100"
865 target="-DIRIVER_H100"
866 memory=16 # always
867 coldfirecc
868 tool="$rootdir/tools/scramble -add=h100"
869 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
870 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
871 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
872 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
873 output="rockbox.iriver"
874 appextra="recorder:gui"
875 archosrom=""
876 flash=""
877 plugins="yes"
878 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
879 # toolset is the tools within the tools directory that we build for
880 # this particular target.
881 toolset=$iriverbitmaptools
882 t_cpu="coldfire"
883 t_manufacturer="iriver"
884 t_model="h100"
887 30|x5)
888 target_id=12
889 archos="x5"
890 target="-DIAUDIO_X5"
891 memory=16 # always
892 coldfirecc
893 tool="$rootdir/tools/scramble -add=iax5"
894 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
895 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
896 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
897 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
898 output="rockbox.iaudio"
899 appextra="recorder:gui"
900 archosrom=""
901 flash=""
902 plugins="yes"
903 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
904 # toolset is the tools within the tools directory that we build for
905 # this particular target.
906 toolset="$iaudiobitmaptools"
907 # architecture, manufacturer and model for the target-tree build
908 t_cpu="coldfire"
909 t_manufacturer="iaudio"
910 t_model="x5"
913 31|m5)
914 target_id=28
915 archos="m5"
916 target="-DIAUDIO_M5"
917 memory=16 # always
918 coldfirecc
919 tool="$rootdir/tools/scramble -add=iam5"
920 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
921 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
922 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
923 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
924 output="rockbox.iaudio"
925 appextra="recorder:gui"
926 archosrom=""
927 flash=""
928 plugins="yes"
929 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
930 # toolset is the tools within the tools directory that we build for
931 # this particular target.
932 toolset="$iaudiobitmaptools"
933 # architecture, manufacturer and model for the target-tree build
934 t_cpu="coldfire"
935 t_manufacturer="iaudio"
936 t_model="m5"
939 20|ipodcolor)
940 target_id=13
941 archos="ipodcolor"
942 target="-DIPOD_COLOR"
943 memory=32 # always
944 arm7tdmicc
945 tool="$rootdir/tools/scramble -add=ipco"
946 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
947 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
948 output="rockbox.ipod"
949 appextra="recorder:gui"
950 archosrom=""
951 flash=""
952 plugins="yes"
953 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
954 bootoutput="bootloader-$archos.ipod"
955 # toolset is the tools within the tools directory that we build for
956 # this particular target.
957 toolset=$ipodbitmaptools
958 # architecture, manufacturer and model for the target-tree build
959 t_cpu="arm"
960 t_manufacturer="ipod"
961 t_model="color"
964 21|ipodnano)
965 target_id=14
966 archos="ipodnano"
967 target="-DIPOD_NANO"
968 memory=32 # always
969 arm7tdmicc
970 tool="$rootdir/tools/scramble -add=nano"
971 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
972 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
973 output="rockbox.ipod"
974 appextra="recorder:gui"
975 archosrom=""
976 flash=""
977 plugins="yes"
978 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
979 bootoutput="bootloader-$archos.ipod"
980 # toolset is the tools within the tools directory that we build for
981 # this particular target.
982 toolset=$ipodbitmaptools
983 # architecture, manufacturer and model for the target-tree build
984 t_cpu="arm"
985 t_manufacturer="ipod"
986 t_model="nano"
989 22|ipodvideo)
990 target_id=15
991 archos="ipodvideo"
992 target="-DIPOD_VIDEO"
993 memory=32 # 30GB models have 32MB, 60GB have 64MB
994 arm7tdmicc
995 tool="$rootdir/tools/scramble -add=ipvd"
996 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
997 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
998 output="rockbox.ipod"
999 appextra="recorder:gui"
1000 archosrom=""
1001 flash=""
1002 plugins="yes"
1003 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1004 bootoutput="bootloader-$archos.ipod"
1005 # toolset is the tools within the tools directory that we build for
1006 # this particular target.
1007 toolset=$ipodbitmaptools
1008 # architecture, manufacturer and model for the target-tree build
1009 t_cpu="arm"
1010 t_manufacturer="ipod"
1011 t_model="video"
1014 23|ipod3g)
1015 target_id=16
1016 archos="ipod3g"
1017 target="-DIPOD_3G"
1018 memory=32 # always
1019 arm7tdmicc
1020 tool="$rootdir/tools/scramble -add=ip3g"
1021 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1022 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1023 output="rockbox.ipod"
1024 appextra="recorder:gui"
1025 archosrom=""
1026 flash=""
1027 plugins="yes"
1028 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1029 bootoutput="bootloader-$archos.ipod"
1030 # toolset is the tools within the tools directory that we build for
1031 # this particular target.
1032 toolset=$ipodbitmaptools
1033 # architecture, manufacturer and model for the target-tree build
1034 t_cpu="arm"
1035 t_manufacturer="ipod"
1036 t_model="3g"
1039 24|ipod4g)
1040 target_id=17
1041 archos="ipod4g"
1042 target="-DIPOD_4G"
1043 memory=32 # always
1044 arm7tdmicc
1045 tool="$rootdir/tools/scramble -add=ip4g"
1046 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1047 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1048 output="rockbox.ipod"
1049 appextra="recorder:gui"
1050 archosrom=""
1051 flash=""
1052 plugins="yes"
1053 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1054 bootoutput="bootloader-$archos.ipod"
1055 # toolset is the tools within the tools directory that we build for
1056 # this particular target.
1057 toolset=$ipodbitmaptools
1058 # architecture, manufacturer and model for the target-tree build
1059 t_cpu="arm"
1060 t_manufacturer="ipod"
1061 t_model="4g"
1064 25|ipodmini)
1065 target_id=18
1066 archos="ipodmini"
1067 target="-DIPOD_MINI"
1068 memory=32 # always
1069 arm7tdmicc
1070 tool="$rootdir/tools/scramble -add=mini"
1071 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1072 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1073 output="rockbox.ipod"
1074 appextra="recorder:gui"
1075 archosrom=""
1076 flash=""
1077 plugins="yes"
1078 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1079 bootoutput="bootloader-$archos.ipod"
1080 # toolset is the tools within the tools directory that we build for
1081 # this particular target.
1082 toolset=$ipodbitmaptools
1083 # architecture, manufacturer and model for the target-tree build
1084 t_cpu="arm"
1085 t_manufacturer="ipod"
1086 t_model="mini"
1089 13|ifp7xx)
1090 target_id=19
1091 archos="ifp7xx"
1092 target="-DIRIVER_IFP7XX"
1093 memory=1
1094 arm7tdmicc short
1095 tool="cp"
1096 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1097 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1098 output="rockbox.wma"
1099 appextra="recorder:gui"
1100 archosrom=""
1101 flash=""
1102 plugins="yes"
1103 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1104 # toolset is the tools within the tools directory that we build for
1105 # this particular target.
1106 toolset=$genericbitmaptools
1107 t_cpu="arm"
1108 t_manufacturer="pnx0101"
1109 t_model="iriver-ifp7xx"
1112 40|gigabeatf)
1113 target_id=20
1114 archos="gigabeatf"
1115 target="-DGIGABEAT_F"
1116 memory=32 # always
1117 arm9tdmicc
1118 tool="cp"
1119 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1120 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1121 output="rockbox.gigabeat"
1122 appextra="recorder:gui"
1123 archosrom=""
1124 flash=""
1125 plugins="yes"
1126 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1127 toolset=$gigabeatbitmaptools
1128 boottool="$rootdir/tools/scramble -gigabeat"
1129 bootoutput="FWIMG01.DAT"
1130 # architecture, manufacturer and model for the target-tree build
1131 t_cpu="arm"
1132 t_manufacturer="s3c2440"
1133 t_model="gigabeat-fx"
1136 26|ipodmini2g)
1137 target_id=21
1138 archos="ipodmini2g"
1139 target="-DIPOD_MINI2G"
1140 memory=32 # always
1141 arm7tdmicc
1142 tool="$rootdir/tools/scramble -add=mn2g"
1143 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1144 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1145 output="rockbox.ipod"
1146 appextra="recorder:gui"
1147 archosrom=""
1148 flash=""
1149 plugins="yes"
1150 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1151 bootoutput="bootloader-$archos.ipod"
1152 # toolset is the tools within the tools directory that we build for
1153 # this particular target.
1154 toolset=$ipodbitmaptools
1155 # architecture, manufacturer and model for the target-tree build
1156 t_cpu="arm"
1157 t_manufacturer="ipod"
1158 t_model="mini2g"
1161 14|h10)
1162 target_id=22
1163 archos="h10"
1164 target="-DIRIVER_H10"
1165 memory=32 # always
1166 arm7tdmicc
1167 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1168 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1169 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1170 output="rockbox.mi4"
1171 appextra="recorder:gui"
1172 archosrom=""
1173 flash=""
1174 plugins="yes"
1175 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1176 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1177 bootoutput="H10_20GC.mi4"
1178 # toolset is the tools within the tools directory that we build for
1179 # this particular target.
1180 toolset="$genericbitmaptools scramble"
1181 # architecture, manufacturer and model for the target-tree build
1182 t_cpu="arm"
1183 t_manufacturer="iriver"
1184 t_model="h10"
1187 15|h10_5gb)
1188 target_id=24
1189 archos="h10_5gb"
1190 target="-DIRIVER_H10_5GB"
1191 memory=32 # always
1192 arm7tdmicc
1193 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1194 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1195 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1196 output="rockbox.mi4"
1197 appextra="recorder:gui"
1198 archosrom=""
1199 flash=""
1200 plugins="yes"
1201 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1202 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1203 bootoutput="H10.mi4"
1204 # toolset is the tools within the tools directory that we build for
1205 # this particular target.
1206 toolset="$genericbitmaptools scramble"
1207 # architecture, manufacturer and model for the target-tree build
1208 t_cpu="arm"
1209 t_manufacturer="iriver"
1210 t_model="h10"
1213 50|e200)
1214 target_id=23
1215 archos="e200"
1216 target="-DSANSA_E200"
1217 memory=32 # supposedly
1218 arm7tdmicc
1219 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1220 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1221 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1222 output="rockbox.mi4"
1223 appextra="recorder:gui"
1224 archosrom=""
1225 flash=""
1226 plugins="yes"
1227 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1228 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1229 bootoutput="PP5022.mi4"
1230 # toolset is the tools within the tools directory that we build for
1231 # this particular target.
1232 toolset="$genericbitmaptools scramble"
1233 # architecture, manufacturer and model for the target-tree build
1234 t_cpu="arm"
1235 t_manufacturer="sandisk"
1236 t_model="sansa-e200"
1239 51|e200r)
1240 # the e200R model is pretty much identical to the e200, it only has a
1241 # different option to the scramble tool when building a bootloader and
1242 # makes the bootloader output file name in all lower case.
1243 target_id=27
1244 archos="e200r"
1245 target="-DSANSA_E200"
1246 memory=32 # supposedly
1247 arm7tdmicc
1248 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1249 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1250 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1251 output="rockbox.mi4"
1252 appextra="recorder:gui"
1253 archosrom=""
1254 flash=""
1255 plugins="yes"
1256 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1257 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1258 bootoutput="pp5022.mi4"
1259 # toolset is the tools within the tools directory that we build for
1260 # this particular target.
1261 toolset="$genericbitmaptools scramble"
1262 # architecture, manufacturer and model for the target-tree build
1263 t_cpu="arm"
1264 t_manufacturer="sandisk"
1265 t_model="sansa-e200"
1268 60|tpj1022)
1269 target_id=25
1270 archos="tpj1022"
1271 target="-DELIO_TPJ1022"
1272 memory=32 # always
1273 arm7tdmicc
1274 tool="$rootdir/tools/scramble -add tpj2"
1275 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1276 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1277 output="rockbox.elio"
1278 appextra="recorder:gui"
1279 archosrom=""
1280 flash=""
1281 plugins="yes"
1282 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a libspeex"
1283 boottool="$rootdir/tools/scramble -mi4v2"
1284 bootoutput="pp5020.mi4"
1285 # toolset is the tools within the tools directory that we build for
1286 # this particular target.
1287 toolset="$genericbitmaptools scramble"
1288 # architecture, manufacturer and model for the target-tree build
1289 t_cpu="arm"
1290 t_manufacturer="tatung"
1291 t_model="tpj1022"
1295 echo "Please select a supported target platform!"
1296 exit
1299 esac
1301 echo "Platform set to $archos"
1304 #remove start
1305 ############################################################################
1306 # Amount of memory, for those that can differ.
1309 if [ "$memory" = "2" ]; then
1310 size="2"
1311 if [ -z "$update" ]; then
1312 echo "Enter size of your RAM (in MB): (defaults to 2)"
1313 size=`input`;
1316 case $size in
1318 memory="8"
1321 memory="2"
1324 esac
1325 echo "Memory size selected: $memory MB"
1327 #remove end
1329 ##################################################################
1330 # Figure out build "type"
1333 # the ifp7x0 is the only platform that supports building a gdb stub like
1334 # this
1335 case $archos in
1336 ifp7xx)
1337 gdbstub="(G)DB stub, "
1341 esac
1343 echo ""
1344 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual, (V)oice? (N)"
1346 option=`input`;
1348 case $option in
1349 [Bb])
1350 if test -n "$archosrom"; then
1351 # Archos SH-based players do this somewhat differently for
1352 # some reason
1353 appsdir='\$(ROOTDIR)/flash/bootbox'
1354 apps="bootbox"
1355 else
1356 appsdir='\$(ROOTDIR)/bootloader'
1357 apps="bootloader"
1358 flash=""
1359 if test -n "$boottool"; then
1360 tool="$boottool"
1362 if test -n "$bootoutput"; then
1363 output=$bootoutput
1366 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1367 bootloader="1"
1368 echo "Bootloader build selected"
1370 [Ss])
1371 debug="-DDEBUG"
1372 simulator="yes"
1373 extradefines="-DSIMULATOR"
1374 echo "Simulator build selected"
1375 whichsim
1377 [Aa])
1378 echo "Advanced build selected"
1379 whichadvanced
1381 [Gg])
1382 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1383 appsdir='\$(ROOTDIR)/gdb'
1384 apps="stub"
1385 case $archos in
1386 ifp7xx)
1387 output="stub.wma"
1391 esac
1392 echo "GDB stub build selected"
1394 [Mm])
1395 appsdir='\$(ROOTDIR)/manual'
1396 firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1397 toolsdir=$firmdir;
1398 toolset='';
1399 apps="manual"
1400 echo "Manual build selected"
1402 [Vv])
1403 echo "Voice build selected"
1404 voiceconfig
1405 toolset="${toolset} voicefont wavtrim"
1406 voice="yes"
1409 debug=""
1410 echo "Normal build selected"
1413 esac
1414 # to be able running "make manual" from non-manual configuration
1415 case $archos in
1416 fmrecorder)
1417 manualdev="recorderv2fm"
1419 recorderv2)
1420 manualdev="recorderv2fm"
1422 h1??)
1423 manualdev="h1xx"
1425 ipodmini2g)
1426 manualdev="ipodmini"
1429 manualdev=$archos
1431 esac
1433 if [ -z "$debug" ]; then
1434 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
1437 echo "Using source code root directory: $rootdir"
1439 # this was once possible to change at build-time, but no more:
1440 language="english"
1442 # Ask about language if building voice
1443 if [ "yes" = "$voice" ]; then
1444 echo "Select a number for the language to use (default is english)"
1446 picklang
1447 language=`whichlang`
1449 if [ -z "$language" ]; then
1450 # pick a default
1451 language="english"
1453 echo "Language set to $language"
1456 uname=`uname`
1458 if [ "yes" = "$simulator" ]; then
1459 # setup compiler and things for simulator
1460 simcc
1462 if [ -d "archos" ]; then
1463 echo "sub directory archos already present"
1464 else
1465 mkdir archos
1466 echo "created an archos subdirectory for simulating the hard disk"
1470 # Now, figure out version number of the (gcc) compiler we are about to use
1471 gccver=`$CC -dumpversion`;
1473 if [ -z "$gccver" ]; then
1474 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1475 echo "WARNING: this may cause your build to fail since we cannot do the"
1476 echo "WARNING: checks we want now."
1477 else
1479 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1480 # DEPEND on it
1482 num1=`echo $gccver | cut -d . -f1`
1483 num2=`echo $gccver | cut -d . -f2`
1484 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1486 # This makes:
1487 # 3.3.X => 303
1488 # 3.4.X => 304
1489 # 2.95.3 => 295
1491 echo "Using $CC $gccver ($gccnum)"
1493 if test "$gccnum" -ge "400"; then
1494 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1495 # so we ignore that warnings for now
1496 # -Wno-pointer-sign
1497 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
1500 if test "$gccnum" -ge "401"; then
1501 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1502 # will break strict-aliasing rules"
1504 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
1509 # check the compiler for SH platforms
1510 if test "$CC" = "sh-elf-gcc"; then
1511 if test "$gccnum" -lt "400"; then
1512 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1513 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1514 else
1515 # figure out patch status
1516 gccpatch=`$CC --version`;
1518 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
1519 echo "gcc $gccver is rockbox patched"
1520 # then convert -O to -Os to get smaller binaries!
1521 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1522 else
1523 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1524 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1529 if test "$1" = "--ccache"; then
1530 echo "Enable ccache for building"
1531 ccache="ccache"
1532 else
1533 if test "$1" != "--no-ccache"; then
1534 ccache=`findtool ccache`
1535 if test -n "$ccache"; then
1536 echo "Found and uses ccache ($ccache)"
1541 if test -n "$ccache"; then
1542 CC="$ccache $CC"
1545 if test "X$endian" = "Xbig"; then
1546 defendian="ROCKBOX_BIG_ENDIAN"
1547 else
1548 defendian="ROCKBOX_LITTLE_ENDIAN"
1551 sed > autoconf.h \
1552 -e "s,@ENDIAN@,${defendian},g" \
1553 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1554 -e "s,@SIMSOUND@,$use_simsound,g" \
1555 -e "s,@config_rtc@,$config_rtc,g" \
1556 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
1557 <<EOF
1558 /* This header was made by configure */
1559 #ifndef __BUILD_AUTOCONF_H
1560 #define __BUILD_AUTOCONF_H
1562 /* Define endianess for the target or simulator platform */
1563 #define @ENDIAN@ 1
1565 /* Define this if you build rockbox to support the logf logging and display */
1566 #undef ROCKBOX_HAS_LOGF
1568 /* Define this if you have the linux/soundcard.h header and thus can compile
1569 the sound-playing code in the X11 sim */
1570 @SIMSOUND@
1572 /* optional defines for RTC mod for h1x0 */
1573 @config_rtc@
1574 @have_rtc_alarm@
1576 #endif /* __BUILD_AUTOCONF_H */
1579 if test -n "$t_cpu"; then
1580 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1581 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1582 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1583 GCCOPTS="$GCCOPTS"
1586 if test "$simulator" = "yes"; then
1587 # add simul make stuff on the #SIMUL# line
1588 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1589 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1590 else
1591 # delete the lines that match
1592 simmagic1='/@SIMUL1@/D'
1593 simmagic2='/@SIMUL2@/D'
1596 sed > Makefile \
1597 -e "s,@ROOTDIR@,${rootdir},g" \
1598 -e "s,@DEBUG@,${debug},g" \
1599 -e "s,@MEMORY@,${memory},g" \
1600 -e "s,@TARGET_ID@,${target_id},g" \
1601 -e "s,@TARGET@,${target},g" \
1602 -e "s,@ARCHOS@,${archos},g" \
1603 -e "s,@LANGUAGE@,${language},g" \
1604 -e "s,@PWD@,${pwd},g" \
1605 -e "s,@CC@,${CC},g" \
1606 -e "s,@LD@,${LD},g" \
1607 -e "s,@AR@,${AR},g" \
1608 -e "s,@AS@,${AS},g" \
1609 -e "s,@OC@,${OC},g" \
1610 -e "s,@WINDRES@,${WINDRES},g" \
1611 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1612 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1613 -e "s,@RANLIB@,${RANLIB},g" \
1614 -e "s,@TOOL@,${tool},g" \
1615 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1616 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1617 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1618 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1619 -e "s,@OUTPUT@,${output},g" \
1620 -e "s,@APPEXTRA@,${appextra},g" \
1621 -e "s,@ARCHOSROM@,${archosrom},g" \
1622 -e "s,@FLASHFILE@,${flash},g" \
1623 -e "s,@PLUGINS@,${plugins},g" \
1624 -e "s,@CODECS@,${codecs},g" \
1625 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
1626 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
1627 -e "s,@GCCOPTS@,${GCCOPTS},g" \
1628 -e "s,@TARGET_INC@,${TARGET_INC},g" \
1629 -e "s!@LDOPTS@!${LDOPTS}!g" \
1630 -e "s,@LOADADDRESS@,${loadaddress},g" \
1631 -e "s,@EXTRADEF@,${extradefines},g" \
1632 -e "s,@APPSDIR@,${appsdir},g" \
1633 -e "s,@FIRMDIR@,${firmdir},g" \
1634 -e "s,@TOOLSDIR@,${toolsdir},g" \
1635 -e "s,@APPS@,${apps},g" \
1636 -e "s,@SIMVER@,${simver},g" \
1637 -e "s,@GCCVER@,${gccver},g" \
1638 -e "s,@GCCNUM@,${gccnum},g" \
1639 -e "s,@UNAME@,${uname},g" \
1640 -e "s,@ENDIAN@,${defendian},g" \
1641 -e "s,@TOOLSET@,${toolset},g" \
1642 -e "${simmagic1}" \
1643 -e "${simmagic2}" \
1644 -e "s,@MANUALDEV@,${manualdev},g" \
1645 <<EOF
1646 ## Automaticly generated. http://www.rockbox.org/
1648 ifndef V
1649 SILENT=@
1650 else
1651 VERBOSEOPT=-v
1652 endif
1654 # old 'make' versions don't have the built-in 'info' function
1655 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
1656 ifeq (\$(call info),old)
1657 export info=echo "\$\$(1)";
1658 endif
1660 export ROOTDIR=@ROOTDIR@
1661 export FIRMDIR=@FIRMDIR@
1662 export APPSDIR=@APPSDIR@
1663 export TOOLSDIR=@TOOLSDIR@
1664 export DOCSDIR=\$(ROOTDIR)/docs
1665 export MANUALDIR=\${ROOTDIR}/manual
1666 export DEBUG=@DEBUG@
1667 export ARCHOS=@ARCHOS@
1668 export ARCHOSROM=@ARCHOSROM@
1669 export FLASHFILE=@FLASHFILE@
1670 export TARGET_ID=@TARGET_ID@
1671 export TARGET=@TARGET@
1672 export OBJDIR=@PWD@
1673 export BUILDDIR=@PWD@
1674 export LANGUAGE=@LANGUAGE@
1675 export MEMORYSIZE=@MEMORY@
1676 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
1677 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
1678 export MKFIRMWARE=@TOOL@
1679 export BMP2RB_MONO=@BMP2RB_MONO@
1680 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
1681 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
1682 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
1683 export BINARY=@OUTPUT@
1684 export APPEXTRA=@APPEXTRA@
1685 export ENABLEDPLUGINS=@PLUGINS@
1686 export SOFTWARECODECS=@CODECS@
1687 export EXTRA_DEFINES=@EXTRADEF@
1688 export HOSTCC=gcc
1689 export CC=@CC@
1690 export LD=@LD@
1691 export AR=@AR@
1692 export AS=@AS@
1693 export OC=@OC@
1694 export WINDRES=@WINDRES@
1695 export DLLTOOL=@DLLTOOL@
1696 export DLLWRAP=@DLLWRAP@
1697 export RANLIB=@RANLIB@
1698 export PROFILE_OPTS=@PROFILE_OPTS@
1699 export GCCOPTS=@GCCOPTS@
1700 export TARGET_INC=@TARGET_INC@
1701 export LOADADDRESS=@LOADADDRESS@
1702 export SIMVER=@SIMVER@
1703 export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
1704 export SHARED_FLAG=@SHARED_FLAG@
1705 export LDOPTS=@LDOPTS@
1706 export GCCVER=@GCCVER@
1707 export GCCNUM=@GCCNUM@
1708 export UNAME=@UNAME@
1709 export MANUALDEV=@MANUALDEV@
1711 # Do not print "Entering directory ..."
1712 MAKEFLAGS += --no-print-directory
1714 .PHONY: all clean tags zip tools manual
1716 all: tools
1717 @SIMUL1@
1718 @SIMUL2@
1719 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1720 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1722 bin: tools
1723 @SIMUL1@
1724 @SIMUL2@
1725 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1726 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1728 rocks: tools
1729 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
1731 veryclean: clean toolsclean
1733 toolsclean:
1734 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1736 clean:
1737 \$(SILENT)echo Cleaning build directory
1738 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
1739 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
1740 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
1741 html txt rockbox-manual*.zip sysfont.h
1743 voice: tools
1744 \$(TOOLSDIR)/genvoice.sh \$(ROOTDIR) \$(LANGUAGE) \$(ARCHOS) voicesettings.sh
1746 tools:
1747 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1749 tags:
1750 \$(SILENT)rm -f TAGS
1751 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
1752 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
1753 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1754 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1756 fontzip:
1757 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1759 zip:
1760 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1762 mapzip:
1763 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
1765 fullzip:
1766 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1768 7zip:
1769 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1771 tar:
1772 \$(SILENT)rm -f rockbox.tar
1773 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1775 bzip2: tar
1776 \$(SILENT)bzip2 -f9 rockbox.tar
1778 gzip: tar
1779 \$(SILENT)gzip -f9 rockbox.tar
1781 manual: manual-pdf
1782 manual-pdf:
1783 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1784 manual-html:
1785 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1786 manual-zhtml: manual-zip
1787 manual-txt:
1788 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
1789 manual-ztxt:
1790 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
1791 manual-zip:
1792 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1794 help:
1795 @echo "A few helpful make targets"
1796 @echo ""
1797 @echo "all - builds a full Rockbox (default), including tools"
1798 @echo "bin - builds only the Rockbox.<target name> file"
1799 @echo "clean - cleans a build directory (not tools)"
1800 @echo "veryclean - cleans the build and tools directories"
1801 @echo "manual - builds a manual"
1802 @echo "manual-html - HTML manual"
1803 @echo "manual-zip - HTML manual (zipped)"
1804 @echo "manual-txt - txt manual"
1805 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1806 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1807 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1808 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1809 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1810 @echo "fontzip - creates rockbox-fonts.zip"
1811 @echo "mapzip - creates rockbox-maps.zip with all .map files"
1812 @echo "tools - builds the tools only"
1813 @echo "install - installs your build (for simulator builds only)"
1817 if [ "yes" = "$simulator" ]; then
1819 cat >> Makefile <<EOF
1821 install:
1822 @echo "installing a full setup in your archos dir"
1823 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1828 echo "Created Makefile"