summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/rules9
-rwxr-xr-xtools/configure270
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 @@
1#!/usr/bin/make -f 1#!/usr/bin/make -f
2 2
3CONFIGURE_OPTIONS := --platform=M --lcdwidth=800 --lcdheight=480 --target=application --ram=8 --rbdir=/.rockbox --type=N 3# We deduce the target based on the available version of the Maemo SDK
4ifeq (1,$(shell pkg-config --atleast-version=5 maemo-version && echo 1))
5TARGET=nokian900
6else
7TARGET=nokian8xx
8endif
9
10CONFIGURE_OPTIONS := --target=$(TARGET) --lcdwidth=800 --lcdheight=480 --ram=8 --rbdir=/.rockbox --type=N
4DESKTOP_DIR := `pkg-config --variable=desktopentrydir osso-af-settings` 11DESKTOP_DIR := `pkg-config --variable=desktopentrydir osso-af-settings`
5 12
6export DH_VERBOSE=1 13export 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=
26libdir= 26libdir=
27sharedir= 27sharedir=
28 28
29app_platform= 29app_modelname=
30app_lcd_width= 30app_lcd_width=
31app_lcd_height= 31app_lcd_height=
32# 32#
@@ -50,21 +50,43 @@ prefixtools () {
50 OC=${prefix}objcopy 50 OC=${prefix}objcopy
51} 51}
52 52
53app_get_platform() { 53app_set_paths () {
54 echo "Select your platform: (S)DL, (A)ndroid, (M)aemo (default: Android)" 54 # setup files and paths depending on the platform
55 if [ -z "$ARG_PLATFORM" ]; then 55 if [ -z "$ARG_PREFIX" ]; then
56 choice=`input` 56 sharedir="/usr/local/share/rockbox"
57 bindir="/usr/local/bin"
58 libdir="/usr/local/lib"
57 else 59 else
58 choice="$ARG_PLATFORM" 60 if [ -d "$ARG_PREFIX" ]; then
61 if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then
62 ARG_PREFIX=`realpath $ARG_PREFIX`
63 if [ "0" != "$?" ]; then
64 echo "ERROR: Could not get prefix path (is realpath installed?)."
65 exit
66 fi
67 fi
68 sharedir="$ARG_PREFIX/share/rockbox"
69 bindir="$ARG_PREFIX/bin"
70 libdir="$ARG_PREFIX/lib"
71 else
72 echo "ERROR: PREFIX does not exist"
73 exit
74 fi
59 fi 75 fi
76}
60 77
61 case $choice in 78# Set the application LCD size according to the following priorities:
62 s|S*) app_platform="sdl" ;; 79# 1) If --lcdwidth and --lcdheight are set, use them
63 m|M*) app_platform="maemo" ;; 80# 2) If a size is passed to the app_set_lcd_size() function, use that
64 *|a|A*) app_platform="android" ;; 81# 3) Otherwise ask the user
65 esac 82app_set_lcd_size () {
83 if [ -z "$ARG_LCDWIDTH" ]; then
84 ARG_LCDWIDTH=$1
85 fi
86 if [ -z "$ARG_LCDHEIGHT" ]; then
87 ARG_LCDHEIGHT=$2
88 fi
66 89
67 echo "Selected $app_platform platform"
68 echo "Enter the LCD width (default: 320)" 90 echo "Enter the LCD width (default: 320)"
69 if [ -z "$ARG_LCDWIDTH" ]; then 91 if [ -z "$ARG_LCDWIDTH" ]; then
70 app_lcd_width=`input` 92 app_lcd_width=`input`
@@ -85,76 +107,6 @@ app_get_platform() {
85 107
86 app_lcd_width="#define LCD_WIDTH $app_lcd_width" 108 app_lcd_width="#define LCD_WIDTH $app_lcd_width"
87 app_lcd_height="#define LCD_HEIGHT $app_lcd_height" 109 app_lcd_height="#define LCD_HEIGHT $app_lcd_height"
88 # setup files and paths depending on the platform
89 if [ "$app_platform" = "sdl" ]; then
90 if [ -z "$ARG_PREFIX" ]; then
91 sharedir="/usr/local/share/rockbox"
92 bindir="/usr/local/bin"
93 libdir="/usr/local/lib"
94 else
95 if [ -d "$ARG_PREFIX" ]; then
96 if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then
97 ARG_PREFIX=`realpath $ARG_PREFIX`
98 if [ "0" != "$?" ]; then
99 echo "ERROR: Could not get prefix path (is realpath installed?)."
100 exit
101 fi
102 fi
103 sharedir="$ARG_PREFIX/share/rockbox"
104 bindir="$ARG_PREFIX/bin"
105 libdir="$ARG_PREFIX/lib"
106 else
107 echo "ERROR: PREFIX does not exist"
108 exit
109 fi
110 fi
111 output="rockbox"
112 bootoutput="rockbox"
113 elif [ "$app_platform" = "android" ]; then
114 if [ -n "$PREFIX" ]; then
115 echo "WARNING: PREFIX not supported on Android. You can however use --rbdir"
116 fi
117 if [ -z "$ANDROID_SDK_PATH" ]; then
118 echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH"
119 echo "environment variable point to the root directory of the Android SDK."
120 exit
121 fi
122 if [ -z "$ANDROID_NDK_PATH" ]; then
123 echo "ERROR: You need the Android NDK installed (r5 or higher) and have the ANDROID_NDK_PATH"
124 echo "environment variable point to the root directory of the Android NDK."
125 exit
126 fi
127 sharedir="/data/data/org.rockbox/app_rockbox/rockbox"
128 bindir="/data/data/org.rockbox/lib"
129 libdir="/data/data/org.rockbox/app_rockbox"
130 output="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"
157 fi
158} 110}
159 111
160findarmgcc() { 112findarmgcc() {
@@ -212,18 +164,6 @@ findsdl(){
212 done 164 done
213} 165}
214 166
215appcc () {
216 if [ "$1" = "sdl" ]; then
217 simcc "sdl-app"
218 elif [ "$1" = "maemo" ]; then
219 app_type="sdl-app"
220 maemocc
221 elif [ "$1" = "android" ]; then
222 app_type=$1
223 androidcc
224 fi
225}
226
227simcc () { 167simcc () {
228 168
229 # default tool setup for native building 169 # default tool setup for native building
@@ -521,10 +461,18 @@ maemocc () {
521 is_n900=0 461 is_n900=0
522 # Determine maemo version 462 # Determine maemo version
523 if pkg-config --atleast-version=5 maemo-version; then 463 if pkg-config --atleast-version=5 maemo-version; then
464 if [ "$1" == "4" ]; then
465 echo "ERROR: Maemo 4 SDK required."
466 exit 1
467 fi
524 extradefines="$extradefines -DMAEMO5" 468 extradefines="$extradefines -DMAEMO5"
525 echo "Found N900 maemo version" 469 echo "Found N900 maemo version"
526 is_n900=1 470 is_n900=1
527 elif pkg-config --atleast-version=4 maemo-version; then 471 elif pkg-config --atleast-version=4 maemo-version; then
472 if [ "$1" == "5" ]; then
473 echo "ERROR: Maemo 5 SDK required."
474 exit 1
475 fi
528 extradefines="$extradefines -DMAEMO4" 476 extradefines="$extradefines -DMAEMO4"
529 echo "Found N8xx maemo version" 477 echo "Found N8xx maemo version"
530 else 478 else
@@ -569,6 +517,16 @@ maemocc () {
569} 517}
570 518
571androidcc () { 519androidcc () {
520 if [ -z "$ANDROID_SDK_PATH" ]; then
521 echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH"
522 echo "environment variable point to the root directory of the Android SDK."
523 exit
524 fi
525 if [ -z "$ANDROID_NDK_PATH" ]; then
526 echo "ERROR: You need the Android NDK installed (r5 or higher) and have the ANDROID_NDK_PATH"
527 echo "environment variable point to the root directory of the Android NDK."
528 exit
529 fi
572 buildhost=`uname | tr [:upper:] [:lower:]` 530 buildhost=`uname | tr [:upper:] [:lower:]`
573 gccchoice="4.4.3" 531 gccchoice="4.4.3"
574 gcctarget="arm-linux-androideabi-" 532 gcctarget="arm-linux-androideabi-"
@@ -1062,7 +1020,6 @@ for arg in "$@"; do
1062 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;; 1020 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
1063 --lcdwidth=*) ARG_LCDWIDTH=`echo "$arg" | cut -d = -f 2`;; 1021 --lcdwidth=*) ARG_LCDWIDTH=`echo "$arg" | cut -d = -f 2`;;
1064 --lcdheight=*) ARG_LCDHEIGHT=`echo "$arg" | cut -d = -f 2`;; 1022 --lcdheight=*) ARG_LCDHEIGHT=`echo "$arg" | cut -d = -f 2`;;
1065 --platform=*) ARG_PLATFORM=`echo "$arg" | cut -d = -f 2`;;
1066 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;; 1023 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
1067 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;; 1024 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
1068 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;; 1025 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
@@ -1184,9 +1141,11 @@ cat <<EOF
1184 142) YH-925 ==Packard Bell== 1141 142) YH-925 ==Packard Bell==
1185 143) YP-S3 160) Vibe 500 ==Lyre project== 1142 143) YP-S3 160) Vibe 500 ==Lyre project==
1186 130) Lyre proto 1 1143 130) Lyre proto 1
1187 ==MPIO== == Application == 131) Mini2440 1144==Application== ==MPIO== 131) Mini2440
1188 170) HD200 200) Application 1145 200) SDL 170) HD200
1189 171) HD300 1146 201) Android 171) HD300
1147 202) Nokia N8xx
1148 203) Nokia N900
1190 1149
1191EOF 1150EOF
1192 1151
@@ -2862,28 +2821,116 @@ fi
2862 t_model="hd300" 2821 t_model="hd300"
2863 ;; 2822 ;;
2864 2823
2865 200|app*) 2824 200|sdlapp)
2866 target_id=100 2825 target_id=73
2867 modelname="application" 2826 modelname="application"
2827 app_modelname="sdlapp"
2868 target="-DAPPLICATION" 2828 target="-DAPPLICATION"
2829 need_full_path="yes"
2830 app_set_paths
2831 app_set_lcd_size
2832 memory=8
2833 uname=`uname`
2834 simcc "sdl-app"
2835 tool="cp "
2836 boottool="cp "
2837 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2838 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2839 output="rockbox"
2840 bootoutput="rockbox"
2841 appextra="recorder:gui:radio"
2842 plugins=""
2843 swcodec="yes"
2844 # architecture, manufacturer and model for the target-tree build
2845 t_cpu="hosted"
2846 t_manufacturer="sdl"
2847 t_model="app"
2848 ;;
2869 2849
2850 201|android)
2851 target_id=74
2852 modelname="application"
2853 app_modelname="android"
2854 target="-DAPPLICATION"
2855 app_type="android"
2870 need_full_path="yes" 2856 need_full_path="yes"
2871 app_get_platform 2857 app_set_lcd_size
2858 sharedir="/data/data/org.rockbox/app_rockbox/rockbox"
2859 bindir="/data/data/org.rockbox/lib"
2860 libdir="/data/data/org.rockbox/app_rockbox"
2861 memory=8
2862 uname=`uname`
2863 androidcc
2864 tool="cp "
2865 boottool="cp "
2866 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2867 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2868 output="librockbox.so"
2869 bootoutput="librockbox.so"
2870 appextra="recorder:gui:radio"
2871 plugins=""
2872 swcodec="yes"
2873 # architecture, manufacturer and model for the target-tree build
2874 t_cpu="hosted"
2875 t_manufacturer="android"
2876 t_model="app"
2877 ;;
2872 2878
2879 202|nokian8xx)
2880 target_id=75
2881 modelname="application"
2882 app_modelname="nokian8xx"
2883 app_type="sdl-app"
2884 target="-DAPPLICATION"
2885 need_full_path="yes"
2886 app_set_lcd_size 800 480
2887 sharedir="/opt/rockbox/share/rockbox"
2888 bindir="/opt/rockbox/bin"
2889 libdir="/opt/rockbox/lib"
2873 memory=8 2890 memory=8
2874 uname=`uname` 2891 uname=`uname`
2892 maemocc 4
2893 tool="cp "
2894 boottool="cp "
2895 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2896 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2897 output="rockbox"
2898 bootoutput="rockbox"
2899 appextra="recorder:gui:radio"
2900 plugins=""
2901 swcodec="yes"
2902 # architecture, manufacturer and model for the target-tree build
2903 t_cpu="hosted"
2904 t_manufacturer="maemo"
2905 t_model="app"
2906 ;;
2875 2907
2876 appcc "$app_platform" 2908 203|nokian900)
2909 target_id=76
2910 modelname="application"
2911 app_modelname="nokian900"
2912 app_type="sdl-app"
2913 target="-DAPPLICATION"
2914 need_full_path="yes"
2915 app_set_lcd_size 800 480
2916 sharedir="/opt/rockbox/share/rockbox"
2917 bindir="/opt/rockbox/bin"
2918 libdir="/opt/rockbox/lib"
2919 memory=8
2920 uname=`uname`
2921 maemocc 5
2877 tool="cp " 2922 tool="cp "
2878 boottool="cp " 2923 boottool="cp "
2879 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" 2924 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2880 bmp2rb_native="$rootdir/tools/bmp2rb -f 4" 2925 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2926 output="rockbox"
2927 bootoutput="rockbox"
2881 appextra="recorder:gui:radio" 2928 appextra="recorder:gui:radio"
2882 plugins="" 2929 plugins=""
2883 swcodec="yes" 2930 swcodec="yes"
2884 # architecture, manufacturer and model for the target-tree build 2931 # architecture, manufacturer and model for the target-tree build
2885 t_cpu="hosted" 2932 t_cpu="hosted"
2886 t_manufacturer="$app_platform" 2933 t_manufacturer="maemo"
2887 t_model="app" 2934 t_model="app"
2888 ;; 2935 ;;
2889 2936
@@ -3374,21 +3421,16 @@ fi
3374if [ "$ARG_ARM_EABI" = "1" ]; then 3421if [ "$ARG_ARM_EABI" = "1" ]; then
3375 cmdline="$cmdline--eabi " 3422 cmdline="$cmdline--eabi "
3376fi 3423fi
3377if [ "$app_platform" = "sdl" ]; then
3378 cmdline="$cmdline--platform=S "
3379elif [ "$app_platform" = "android" ]; then
3380 cmdline="$cmdline--platform=A "
3381elif [ "$app_platform" = "maemo" ]; then
3382 cmdline="$cmdline--platform=M "
3383fi
3384if [ "$modelname" = "application" ]; then
3385 cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT "
3386fi
3387if [ -n "$ARG_PREFIX" ]; then 3424if [ -n "$ARG_PREFIX" ]; then
3388 cmdline="$cmdline--prefix=\$(PREFIX) " 3425 cmdline="$cmdline--prefix=\$(PREFIX) "
3389fi 3426fi
3427if [ "$modelname" = "application" ]; then
3428 cmdline="$cmdline--target=$app_modelname --lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT "
3429else
3430 cmdline="$cmdline--target=\$(MODELNAME) "
3431fi
3390 3432
3391cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts" 3433cmdline="$cmdline--ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
3392 3434
3393### end of cmdline 3435### end of cmdline
3394 3436