Index: tools/configure =================================================================== --- tools/configure (revision 29255) +++ tools/configure (working copy) @@ -50,21 +50,43 @@ OC=${prefix}objcopy } -app_get_platform() { - echo "Select your platform: (S)DL, (A)ndroid, (M)aemo (default: Android)" - if [ -z "$ARG_PLATFORM" ]; then - choice=`input` +app_set_paths () { + # setup files and paths depending on the platform + if [ -z "$ARG_PREFIX" ]; then + sharedir="/usr/local/share/rockbox" + bindir="/usr/local/bin" + libdir="/usr/local/lib" else - choice="$ARG_PLATFORM" + if [ -d "$ARG_PREFIX" ]; then + if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then + ARG_PREFIX=`realpath $ARG_PREFIX` + if [ "0" != "$?" ]; then + echo "ERROR: Could not get prefix path (is realpath installed?)." + exit + fi + fi + sharedir="$ARG_PREFIX/share/rockbox" + bindir="$ARG_PREFIX/bin" + libdir="$ARG_PREFIX/lib" + else + echo "ERROR: PREFIX does not exist" + exit + fi fi +} - case $choice in - s|S*) app_platform="sdl" ;; - m|M*) app_platform="maemo" ;; - *|a|A*) app_platform="android" ;; - esac +# Set the application LCD size according to the following priorities: +# 1) If --lcdwidth and --lcdheight are set, use them +# 2) If a size is passed to the app_set_lcd_size() function, use that +# 3) Otherwise ask the user +app_set_lcd_size () { + if [ -z "$ARG_LCDWIDTH" ]; then + ARG_LCDWIDTH=$1 + fi + if [ -z "$ARG_LCDHEIGHT" ]; then + ARG_LCDHEIGHT=$2 + fi - echo "Selected $app_platform platform" echo "Enter the LCD width (default: 320)" if [ -z "$ARG_LCDWIDTH" ]; then app_lcd_width=`input` @@ -85,76 +107,6 @@ app_lcd_width="#define LCD_WIDTH $app_lcd_width" app_lcd_height="#define LCD_HEIGHT $app_lcd_height" - # setup files and paths depending on the platform - if [ "$app_platform" = "sdl" ]; then - if [ -z "$ARG_PREFIX" ]; then - sharedir="/usr/local/share/rockbox" - bindir="/usr/local/bin" - libdir="/usr/local/lib" - else - if [ -d "$ARG_PREFIX" ]; then - if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then - ARG_PREFIX=`realpath $ARG_PREFIX` - if [ "0" != "$?" ]; then - echo "ERROR: Could not get prefix path (is realpath installed?)." - exit - fi - fi - sharedir="$ARG_PREFIX/share/rockbox" - bindir="$ARG_PREFIX/bin" - libdir="$ARG_PREFIX/lib" - else - echo "ERROR: PREFIX does not exist" - exit - fi - fi - output="rockbox" - bootoutput="rockbox" - elif [ "$app_platform" = "android" ]; then - if [ -n "$PREFIX" ]; then - echo "WARNING: PREFIX not supported on Android. You can however use --rbdir" - fi - if [ -z "$ANDROID_SDK_PATH" ]; then - echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH" - echo "environment variable point to the root directory of the Android SDK." - exit - fi - if [ -z "$ANDROID_NDK_PATH" ]; then - echo "ERROR: You need the Android NDK installed (r5 or higher) and have the ANDROID_NDK_PATH" - echo "environment variable point to the root directory of the Android NDK." - exit - fi - sharedir="/data/data/org.rockbox/app_rockbox/rockbox" - bindir="/data/data/org.rockbox/lib" - libdir="/data/data/org.rockbox/app_rockbox" - output="librockbox.so" - bootoutput="librockbox.so" - elif [ "$app_platform" = "maemo" ]; then - if [ -z "$ARG_PREFIX" ]; then - # Rockbox is in /opt as there is enough free space for it on the N900. - sharedir="/opt/rockbox/share/rockbox" - bindir="/opt/rockbox/bin" - libdir="/opt/rockbox/lib" - else - if [ -d "$ARG_PREFIX" ]; then - if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then - ARG_PREFIX=`realpath $ARG_PREFIX` - if [ "0" != "$?" ]; then - echo "ERROR: Could not get prefix path (is realpath installed?)." - exit - fi - fi - sharedir="$ARG_PREFIX/share/rockbox" - bindir="$ARG_PREFIX/bin" - libdir="$ARG_PREFIX/lib" - else - echo "ERROR: PREFIX does not exist" - exit - fi - fi - output="rockbox" - bootoutput="rockbox" - fi } findarmgcc() { @@ -212,18 +164,6 @@ done } -appcc () { - if [ "$1" = "sdl" ]; then - simcc "sdl-app" - elif [ "$1" = "maemo" ]; then - app_type="sdl-app" - maemocc - elif [ "$1" = "android" ]; then - app_type=$1 - androidcc - fi -} - simcc () { # default tool setup for native building @@ -506,7 +446,19 @@ gccchoice="4.1.2" } -maemocc () { +maemo_get_version () { + # Determine maemo version + if pkg-config --atleast-version=5 maemo-version; then + maemo_version=5 + elif pkg-config --atleast-version=4 maemo-version; then + maemo_version=4 + else + echo "Unable to determine maemo version. Is the maemo-version-dev package installed?" + exit 1 + fi +} + +maemo4cc () { # Scratchbox sets up "gcc" based on the active target prefixtools "" @@ -518,20 +470,45 @@ SHARED_FLAG="-shared" endian="little" - is_n900=0 - # Determine maemo version - if pkg-config --atleast-version=5 maemo-version; then - extradefines="$extradefines -DMAEMO5" - echo "Found N900 maemo version" - is_n900=1 - elif pkg-config --atleast-version=4 maemo-version; then - extradefines="$extradefines -DMAEMO4" - echo "Found N8xx maemo version" - else - echo "Unable to determine maemo version. Is the maemo-version-dev package installed?" + maemo_get_version + + if [ $maemo_version != 4 ] + then + echo "Maemo 4 required." exit 1 fi + extradefines="$extradefines -DMAEMO4" + + # N8xx specific: Enable armv5te instructions + if sb-conf current |grep ARMEL; then + GCCOPTS="$GCCOPTS -mcpu=arm1136jf-s -mfloat-abi=softfp -mfpu=vfp" + extradefines="$extradefines -DMAEMO_ARM_BUILD" + fi +} + +maemo5cc () { + # Scratchbox sets up "gcc" based on the active target + prefixtools "" + + GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//` + GCCOPTS="$GCCOPTS -fno-builtin -g -I\$(SIMDIR)" + GCCOPTIMIZE='' + LDOPTS="-lm -ldl $LDOPTS" + GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" + SHARED_FLAG="-shared" + endian="little" + + maemo_get_version + + if [ $maemo_version != 5 ] + then + echo "Maemo 5 required." + exit 1 + fi + + extradefines="$extradefines -DMAEMO5" + # SDL GCCOPTS="$GCCOPTS `pkg-config --cflags sdl`" LDOPTS="$LDOPTS `pkg-config --libs sdl`" @@ -545,30 +522,33 @@ LDOPTS="$LDOPTS `pkg-config --libs hal`" GCCOPTS="$GCCOPTS -O2 -fno-strict-aliasing" - if [ $is_n900 -eq 1 ]; then - # gstreamer support: Audio output. - GCCOPTS="$GCCOPTS `pkg-config --cflags gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" - LDOPTS="$LDOPTS `pkg-config --libs gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" - # N900 specific: libplayback support - GCCOPTS="$GCCOPTS `pkg-config --cflags libplayback-1`" - LDOPTS="$LDOPTS `pkg-config --libs libplayback-1`" + # gstreamer support: Audio output. + GCCOPTS="$GCCOPTS `pkg-config --cflags gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" + LDOPTS="$LDOPTS `pkg-config --libs gstreamer-base-0.10 gstreamer-plugins-base-0.10 gstreamer-app-0.10`" - # N900 specific: Enable ARMv7 NEON support - if sb-conf current |grep ARMEL; then - GCCOPTS="$GCCOPTS -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp" - extradefines="$extradefines -DMAEMO_ARM_BUILD" - fi - else - # N8xx specific: Enable armv5te instructions - if sb-conf current |grep ARMEL; then - GCCOPTS="$GCCOPTS -mcpu=arm1136jf-s -mfloat-abi=softfp -mfpu=vfp" - extradefines="$extradefines -DMAEMO_ARM_BUILD" - fi + # N900 specific: libplayback support + GCCOPTS="$GCCOPTS `pkg-config --cflags libplayback-1`" + LDOPTS="$LDOPTS `pkg-config --libs libplayback-1`" + + # N900 specific: Enable ARMv7 NEON support + if sb-conf current |grep ARMEL; then + GCCOPTS="$GCCOPTS -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp" + extradefines="$extradefines -DMAEMO_ARM_BUILD" fi } androidcc () { + if [ -z "$ANDROID_SDK_PATH" ]; then + echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH" + echo "environment variable point to the root directory of the Android SDK." + exit + fi + if [ -z "$ANDROID_NDK_PATH" ]; then + echo "ERROR: You need the Android NDK installed (r5 or higher) and have the ANDROID_NDK_PATH" + echo "environment variable point to the root directory of the Android NDK." + exit + fi buildhost=`uname | tr [:upper:] [:lower:]` gccchoice="4.4.3" gcctarget="arm-linux-androideabi-" @@ -1184,9 +1164,11 @@ 142) YH-925 ==Packard Bell== 143) YP-S3 160) Vibe 500 ==Lyre project== 130) Lyre proto 1 - ==MPIO== == Application == 131) Mini2440 - 170) HD200 200) Application - 171) HD300 +==Application== ==MPIO== 131) Mini2440 + 200) SDL 170) HD200 + 201) Android 171) HD300 + 202) Nokia N8xx + 203) Nokia N900 EOF @@ -2862,28 +2844,109 @@ t_model="hd300" ;; - 200|app*) - target_id=100 + 200|sdlapp) + target_id=73 modelname="application" target="-DAPPLICATION" + need_full_path="yes" + app_set_paths + app_set_lcd_size + memory=8 + uname=`uname` + simcc "sdl-app" + tool="cp " + boottool="cp " + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox" + bootoutput="rockbox" + appextra="recorder:gui:radio" + plugins="" + swcodec="yes" + # architecture, manufacturer and model for the target-tree build + t_cpu="hosted" + t_manufacturer="sdl" + t_model="app" + ;; + 201|android) + target_id=74 + modelname="application" + target="-DAPPLICATION" need_full_path="yes" - app_get_platform + app_set_lcd_size + sharedir="/data/data/org.rockbox/app_rockbox/rockbox" + bindir="/data/data/org.rockbox/lib" + libdir="/data/data/org.rockbox/app_rockbox" + memory=8 + uname=`uname` + androidcc + tool="cp " + boottool="cp " + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="librockbox.so" + bootoutput="librockbox.so" + appextra="recorder:gui:radio" + plugins="" + swcodec="yes" + # architecture, manufacturer and model for the target-tree build + t_cpu="hosted" + t_manufacturer="android" + t_model="app" + ;; + 202|nokian8xx) + target_id=75 + modelname="application" + target="-DAPPLICATION" + need_full_path="yes" + app_set_lcd_size 800 480 + sharedir="/opt/rockbox/share/rockbox" + bindir="/opt/rockbox/bin" + libdir="/opt/rockbox/lib" memory=8 uname=`uname` + maemo4cc + tool="cp " + boottool="cp " + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox" + bootoutput="rockbox" + appextra="recorder:gui:radio" + plugins="" + swcodec="yes" + # architecture, manufacturer and model for the target-tree build + t_cpu="hosted" + t_manufacturer="maemo" + t_model="app" + ;; - appcc "$app_platform" + 203|nokian900) + target_id=76 + modelname="application" + target="-DAPPLICATION" + need_full_path="yes" + app_set_lcd_size 800 480 + sharedir="/opt/rockbox/share/rockbox" + bindir="/opt/rockbox/bin" + libdir="/opt/rockbox/lib" + memory=8 + uname=`uname` + maemo5cc tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox" + bootoutput="rockbox" appextra="recorder:gui:radio" plugins="" swcodec="yes" # architecture, manufacturer and model for the target-tree build t_cpu="hosted" - t_manufacturer="$app_platform" + t_manufacturer="maemo" t_model="app" ;;