diff options
author | Thomas Jarosch <tomj@simonv.com> | 2011-02-08 20:05:25 +0000 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2011-02-08 20:05:25 +0000 |
commit | 5f037ac015e6d76d030a163753db5ff58cdff49b (patch) | |
tree | f5eb7dcdc0e0c3e373227e45061c1d99a14a0819 /tools/configure | |
parent | 4d129044390a087b6193b6ce63e035b2550b3ce4 (diff) | |
download | rockbox-5f037ac015e6d76d030a163753db5ff58cdff49b.tar.gz rockbox-5f037ac015e6d76d030a163753db5ff58cdff49b.zip |
Initial maemo platform support
Adds Nokia N900, N810 and N800 support.
Features:
- Introduce maemo specific platform defines
- Play audio in silent mode
- Stop playback on incoming calls
- Battery level readout
- Bluetooth headset support
- Save CPU by disabling screen updates if the display
is off or the app doesn't have input focus
- N900: GStreamer audio backend
Kudos to kugel for the code review.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29248 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/configure')
-rwxr-xr-x | tools/configure | 106 |
1 files changed, 102 insertions, 4 deletions
diff --git a/tools/configure b/tools/configure index aa37ef7d71..26425ffe10 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -51,7 +51,7 @@ prefixtools () { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | app_get_platform() { | 53 | app_get_platform() { |
54 | echo "Select your platform: (S)DL, (A)ndroid (default: Android)" | 54 | echo "Select your platform: (S)DL, (A)ndroid, (M)aemo (default: Android)" |
55 | if [ -z "$ARG_PLATFORM" ]; then | 55 | if [ -z "$ARG_PLATFORM" ]; then |
56 | choice=`input` | 56 | choice=`input` |
57 | else | 57 | else |
@@ -60,6 +60,7 @@ app_get_platform() { | |||
60 | 60 | ||
61 | case $choice in | 61 | case $choice in |
62 | s|S*) app_platform="sdl" ;; | 62 | s|S*) app_platform="sdl" ;; |
63 | m|M*) app_platform="maemo" ;; | ||
63 | *|a|A*) app_platform="android" ;; | 64 | *|a|A*) app_platform="android" ;; |
64 | esac | 65 | esac |
65 | 66 | ||
@@ -128,6 +129,31 @@ app_get_platform() { | |||
128 | libdir="/data/data/org.rockbox/app_rockbox" | 129 | libdir="/data/data/org.rockbox/app_rockbox" |
129 | output="librockbox.so" | 130 | output="librockbox.so" |
130 | bootoutput="librockbox.so" | 131 | bootoutput="librockbox.so" |
132 | elif [ "$app_platform" = "maemo" ]; then | ||
133 | if [ -z "$ARG_PREFIX" ]; then | ||
134 | # Rockbox is in /opt as there is enough free space for it on the N900. | ||
135 | sharedir="/opt/rockbox/share/rockbox" | ||
136 | bindir="/opt/rockbox/bin" | ||
137 | libdir="/opt/rockbox/lib" | ||
138 | else | ||
139 | if [ -d "$ARG_PREFIX" ]; then | ||
140 | if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then | ||
141 | ARG_PREFIX=`realpath $ARG_PREFIX` | ||
142 | if [ "0" != "$?" ]; then | ||
143 | echo "ERROR: Could not get prefix path (is realpath installed?)." | ||
144 | exit | ||
145 | fi | ||
146 | fi | ||
147 | sharedir="$ARG_PREFIX/share/rockbox" | ||
148 | bindir="$ARG_PREFIX/bin" | ||
149 | libdir="$ARG_PREFIX/lib" | ||
150 | else | ||
151 | echo "ERROR: PREFIX does not exist" | ||
152 | exit | ||
153 | fi | ||
154 | fi | ||
155 | output="rockbox" | ||
156 | bootoutput="rockbox" | ||
131 | fi | 157 | fi |
132 | } | 158 | } |
133 | 159 | ||
@@ -189,6 +215,9 @@ findsdl(){ | |||
189 | appcc () { | 215 | appcc () { |
190 | if [ "$1" = "sdl" ]; then | 216 | if [ "$1" = "sdl" ]; then |
191 | simcc "sdl-app" | 217 | simcc "sdl-app" |
218 | elif [ "$1" = "maemo" ]; then | ||
219 | app_type="sdl-app" | ||
220 | maemocc | ||
192 | elif [ "$1" = "android" ]; then | 221 | elif [ "$1" = "android" ]; then |
193 | app_type=$1 | 222 | app_type=$1 |
194 | androidcc | 223 | androidcc |
@@ -477,6 +506,68 @@ mipselcc () { | |||
477 | gccchoice="4.1.2" | 506 | gccchoice="4.1.2" |
478 | } | 507 | } |
479 | 508 | ||
509 | maemocc () { | ||
510 | # Scratchbox sets up "gcc" based on the active target | ||
511 | prefixtools "" | ||
512 | |||
513 | GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//` | ||
514 | GCCOPTS="$GCCOPTS -fno-builtin -g -I\$(SIMDIR)" | ||
515 | GCCOPTIMIZE='' | ||
516 | LDOPTS="-lm -ldl $LDOPTS" | ||
517 | GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" | ||
518 | SHARED_FLAG="-shared" | ||
519 | endian="little" | ||
520 | |||
521 | is_n900=0 | ||
522 | # Determine maemo version | ||
523 | if pkg-config --atleast-version=5 maemo-version; then | ||
524 | extradefines="$extradefines -DMAEMO5" | ||
525 | echo "Found N900 maemo version" | ||
526 | is_n900=1 | ||
527 | elif pkg-config --atleast-version=4 maemo-version; then | ||
528 | extradefines="$extradefines -DMAEMO4" | ||
529 | echo "Found N8xx maemo version" | ||
530 | else | ||
531 | echo "Unable to determine maemo version. Is the maemo-version-dev package installed?" | ||
532 | exit 1 | ||
533 | fi | ||
534 | |||
535 | # SDL | ||
536 | GCCOPTS="$GCCOPTS `pkg-config --cflags sdl`" | ||
537 | LDOPTS="$LDOPTS `pkg-config --libs sdl`" | ||
538 | |||
539 | # glib and libosso support | ||
540 | GCCOPTS="$GCCOPTS `pkg-config --cflags libosso glib-2.0 gthread-2.0`" | ||
541 | LDOPTS="$LDOPTS `pkg-config --libs libosso glib-2.0 gthread-2.0`" | ||
542 | |||
543 | # libhal support: Battery monitoring | ||
544 | GCCOPTS="$GCCOPTS `pkg-config --cflags hal`" | ||
545 | LDOPTS="$LDOPTS `pkg-config --libs hal`" | ||
546 | |||
547 | GCCOPTS="$GCCOPTS -O2 -fno-strict-aliasing" | ||
548 | if [ $is_n900 -eq 1 ]; then | ||
549 | # gstreamer support: Audio output. | ||
550 | GCCOPTS="$GCCOPTS `pkg-config --cflags gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" | ||
551 | LDOPTS="$LDOPTS `pkg-config --libs gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" | ||
552 | |||
553 | # N900 specific: libplayback support | ||
554 | GCCOPTS="$GCCOPTS `pkg-config --cflags libplayback-1`" | ||
555 | LDOPTS="$LDOPTS `pkg-config --libs libplayback-1`" | ||
556 | |||
557 | # N900 specific: Enable ARMv7 NEON support | ||
558 | if sb-conf current |grep ARMEL; then | ||
559 | GCCOPTS="$GCCOPTS -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp" | ||
560 | extradefines="$extradefines -DMAEMO_ARM_BUILD" | ||
561 | fi | ||
562 | else | ||
563 | # N8xx specific: Enable armv5te instructions | ||
564 | if sb-conf current |grep ARMEL; then | ||
565 | GCCOPTS="$GCCOPTS -mcpu=arm1136jf-s -mfloat-abi=softfp -mfpu=vfp" | ||
566 | extradefines="$extradefines -DMAEMO_ARM_BUILD" | ||
567 | fi | ||
568 | fi | ||
569 | } | ||
570 | |||
480 | androidcc () { | 571 | androidcc () { |
481 | buildhost=`uname | tr [:upper:] [:lower:]` | 572 | buildhost=`uname | tr [:upper:] [:lower:]` |
482 | gccchoice="4.4.3" | 573 | gccchoice="4.4.3" |
@@ -3239,9 +3330,14 @@ EOF | |||
3239 | 3330 | ||
3240 | if test -n "$t_cpu"; then | 3331 | if test -n "$t_cpu"; then |
3241 | TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model" | 3332 | TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model" |
3242 | if [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree | 3333 | |
3243 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/" | 3334 | if [ "$t_cpu" = "hosted" ] && [ "$t_manufacturer" = "maemo" ]; then |
3244 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/" | 3335 | # Maemo needs the SDL port, too |
3336 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app" | ||
3337 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" | ||
3338 | elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree | ||
3339 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" | ||
3340 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" | ||
3245 | fi | 3341 | fi |
3246 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" | 3342 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" |
3247 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu" | 3343 | TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu" |
@@ -3282,6 +3378,8 @@ if [ "$app_platform" = "sdl" ]; then | |||
3282 | cmdline="$cmdline--platform=S " | 3378 | cmdline="$cmdline--platform=S " |
3283 | elif [ "$app_platform" = "android" ]; then | 3379 | elif [ "$app_platform" = "android" ]; then |
3284 | cmdline="$cmdline--platform=A " | 3380 | cmdline="$cmdline--platform=A " |
3381 | elif [ "$app_platform" = "maemo" ]; then | ||
3382 | cmdline="$cmdline--platform=M " | ||
3285 | fi | 3383 | fi |
3286 | if [ "$modelname" = "application" ]; then | 3384 | if [ "$modelname" = "application" ]; then |
3287 | cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT " | 3385 | cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT " |