From 9e638c7bc8f1e42769e2df49ea43eff6c5e05db1 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Fri, 11 Feb 2011 19:51:29 +0000 Subject: FS#11924 - Use separate targets for RaaA devices. This changes tools/configure to present the (currently four) possible RaaA targets as separate menu items instead of a single "Application" item with a follow-up question. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29286 a1c6a512-1295-4272-9138-f99709370657 --- debian/rules | 9 +- tools/configure | 270 ++++++++++++++++++++++++++++++++------------------------ 2 files changed, 164 insertions(+), 115 deletions(-) diff --git a/debian/rules b/debian/rules index 380d0d21b8..7df96d22ab 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,13 @@ #!/usr/bin/make -f -CONFIGURE_OPTIONS := --platform=M --lcdwidth=800 --lcdheight=480 --target=application --ram=8 --rbdir=/.rockbox --type=N +# We deduce the target based on the available version of the Maemo SDK +ifeq (1,$(shell pkg-config --atleast-version=5 maemo-version && echo 1)) +TARGET=nokian900 +else +TARGET=nokian8xx +endif + +CONFIGURE_OPTIONS := --target=$(TARGET) --lcdwidth=800 --lcdheight=480 --ram=8 --rbdir=/.rockbox --type=N DESKTOP_DIR := `pkg-config --variable=desktopentrydir osso-af-settings` export DH_VERBOSE=1 diff --git a/tools/configure b/tools/configure index 6be8f61c3a..136b9a59d4 100755 --- a/tools/configure +++ b/tools/configure @@ -26,7 +26,7 @@ bindir= libdir= sharedir= -app_platform= +app_modelname= app_lcd_width= app_lcd_height= # @@ -50,21 +50,43 @@ prefixtools () { 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_get_platform() { 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 @@ findsdl(){ 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 @@ -521,10 +461,18 @@ maemocc () { is_n900=0 # Determine maemo version if pkg-config --atleast-version=5 maemo-version; then + if [ "$1" == "4" ]; then + echo "ERROR: Maemo 4 SDK required." + exit 1 + fi extradefines="$extradefines -DMAEMO5" echo "Found N900 maemo version" is_n900=1 elif pkg-config --atleast-version=4 maemo-version; then + if [ "$1" == "5" ]; then + echo "ERROR: Maemo 5 SDK required." + exit 1 + fi extradefines="$extradefines -DMAEMO4" echo "Found N8xx maemo version" else @@ -569,6 +517,16 @@ maemocc () { } 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-" @@ -1062,7 +1020,6 @@ for arg in "$@"; do --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;; --lcdwidth=*) ARG_LCDWIDTH=`echo "$arg" | cut -d = -f 2`;; --lcdheight=*) ARG_LCDHEIGHT=`echo "$arg" | cut -d = -f 2`;; - --platform=*) ARG_PLATFORM=`echo "$arg" | cut -d = -f 2`;; --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;; --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;; --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;; @@ -1184,9 +1141,11 @@ cat <