diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildzip.pl | 26 | ||||
-rwxr-xr-x | tools/configure | 54 |
2 files changed, 45 insertions, 35 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 22a706224f..62413acd30 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -18,8 +18,8 @@ use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DT | |||
18 | 18 | ||
19 | my $ROOT=".."; | 19 | my $ROOT=".."; |
20 | 20 | ||
21 | my $ziptool="zip -r9"; | 21 | my $ziptool; |
22 | my $output="rockbox.zip"; | 22 | my $output; |
23 | my $verbose; | 23 | my $verbose; |
24 | my $install; | 24 | my $install; |
25 | my $exe; | 25 | my $exe; |
@@ -27,7 +27,7 @@ my $target; | |||
27 | my $modelname; | 27 | my $modelname; |
28 | my $incfonts; | 28 | my $incfonts; |
29 | my $target_id; # passed in, not currently used | 29 | my $target_id; # passed in, not currently used |
30 | my $rbdir=".rockbox"; # can be changed for special builds | 30 | my $rbdir; # can be non-.rockbox for special builds |
31 | my $app; | 31 | my $app; |
32 | 32 | ||
33 | sub glob_mkdir { | 33 | sub glob_mkdir { |
@@ -197,16 +197,30 @@ sub make_install { | |||
197 | 197 | ||
198 | # Get options | 198 | # Get options |
199 | GetOptions ( 'r|root=s' => \$ROOT, | 199 | GetOptions ( 'r|root=s' => \$ROOT, |
200 | 'z|ziptool=s' => \$ziptool, | 200 | 'z|ziptool:s' => \$ziptool, |
201 | 'm|modelname=s' => \$modelname, # The model name as used in ARCHOS in the root makefile | 201 | 'm|modelname=s' => \$modelname, # The model name as used in ARCHOS in the root makefile |
202 | 'i|id=s' => \$target_id, # The target id name as used in TARGET_ID in the root makefile | 202 | 'i|id=s' => \$target_id, # The target id name as used in TARGET_ID in the root makefile |
203 | 'o|output=s' => \$output, | 203 | 'o|output:s' => \$output, |
204 | 'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package | 204 | 'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package |
205 | 'v|verbose' => \$verbose, | 205 | 'v|verbose' => \$verbose, |
206 | 'install=s' => \$install, # install destination | 206 | 'install=s' => \$install, # install destination |
207 | 'rbdir=s' => \$rbdir, # If we want to put in a different directory | 207 | 'rbdir:s' => \$rbdir, # If we want to put in a different directory |
208 | ); | 208 | ); |
209 | 209 | ||
210 | # GetOptions() doesn't remove the params from @ARGV if their value was "" | ||
211 | # Thus we use the ":" for those for which we use a default value in case of "" | ||
212 | # and assign the default value afterwards | ||
213 | if ($ziptool eq '') { | ||
214 | $ziptool = "zip -r9"; | ||
215 | } | ||
216 | if ($output eq '') { | ||
217 | $output = "rockbox.zip" | ||
218 | } | ||
219 | if ($rbdir eq '') { | ||
220 | $rbdir = ".rockbox"; | ||
221 | } | ||
222 | |||
223 | # Now @ARGV shuold be free of any left-overs GetOptions left | ||
210 | ($target, $exe) = @ARGV; | 224 | ($target, $exe) = @ARGV; |
211 | 225 | ||
212 | my $firmdir="$ROOT/firmware"; | 226 | my $firmdir="$ROOT/firmware"; |
diff --git a/tools/configure b/tools/configure index ed3d63c61e..efeaa92a92 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -24,8 +24,6 @@ rbdir="/.rockbox" | |||
24 | need_full_path= | 24 | need_full_path= |
25 | bindir= | 25 | bindir= |
26 | libdir= | 26 | libdir= |
27 | bindir_full= | ||
28 | libdir_full= | ||
29 | 27 | ||
30 | app_platform= | 28 | app_platform= |
31 | app_lcd_width= | 29 | app_lcd_width= |
@@ -87,21 +85,25 @@ app_get_platform() { | |||
87 | app_lcd_height="#define LCD_HEIGHT $app_lcd_height" | 85 | app_lcd_height="#define LCD_HEIGHT $app_lcd_height" |
88 | # setup files and paths depending on the platform | 86 | # setup files and paths depending on the platform |
89 | if [ "$app_platform" = "sdl" ]; then | 87 | if [ "$app_platform" = "sdl" ]; then |
90 | if [ -z "$PREFIX" ]; then | 88 | if [ -z "$ARG_PREFIX" ]; then |
91 | rbdir="/usr/local/share/rockbox" | 89 | rbdir="/usr/local/share/rockbox" |
92 | bindir="/usr/local/bin" | 90 | bindir="/usr/local/bin" |
93 | bindir_full=$bindir | ||
94 | libdir="/usr/local/lib" | 91 | libdir="/usr/local/lib" |
95 | libdir_full=$libdir | ||
96 | else | 92 | else |
97 | rbdir=`realpath $PREFIX/share/rockbox` | 93 | if [ -d "$ARG_PREFIX" ]; then |
98 | bindir="$PREFIX/bin" | 94 | if [ -z `echo $ARG_PREFIX | grep "^/"` ]; then |
99 | libdir="$PREFIX/lib" | 95 | ARG_PREFIX=`realpath $ARG_PREFIX` |
100 | if [ -d bindir ]; then | 96 | if [ "0" != "$?" ]; then |
101 | bindir_full=`realpath $bindir` | 97 | echo "ERROR: Could not get prefix path (is realpath installed?)." |
102 | fi | 98 | exit |
103 | if [ -d libdir ]; then | 99 | fi |
104 | libdir_full=`realpath $libdir` | 100 | fi |
101 | rbdir="$ARG_PREFIX/share/rockbox" | ||
102 | bindir="$ARG_PREFIX/bin" | ||
103 | libdir="$ARG_PREFIX/lib" | ||
104 | else | ||
105 | echo "ERROR: PREFIX does not does not exist" | ||
106 | exit | ||
105 | fi | 107 | fi |
106 | fi | 108 | fi |
107 | output="rockbox" | 109 | output="rockbox" |
@@ -122,9 +124,7 @@ app_get_platform() { | |||
122 | fi | 124 | fi |
123 | rbdir="/data/data/org.rockbox/app_rockbox/rockbox" | 125 | rbdir="/data/data/org.rockbox/app_rockbox/rockbox" |
124 | bindir="/data/data/org.rockbox/lib" | 126 | bindir="/data/data/org.rockbox/lib" |
125 | bindir_full=$bindir | ||
126 | libdir="/data/data/org.rockbox/app_rockbox" | 127 | libdir="/data/data/org.rockbox/app_rockbox" |
127 | libdir_full=$libdir | ||
128 | output="librockbox.so" | 128 | output="librockbox.so" |
129 | bootoutput="librockbox.so" | 129 | bootoutput="librockbox.so" |
130 | fi | 130 | fi |
@@ -953,6 +953,7 @@ ARG_TYPE= | |||
953 | ARG_VOICE= | 953 | ARG_VOICE= |
954 | ARG_ARM_EABI= | 954 | ARG_ARM_EABI= |
955 | ARG_ARM_THUMB= | 955 | ARG_ARM_THUMB= |
956 | ARG_PREFIX="$PREFIX" | ||
956 | err= | 957 | err= |
957 | for arg in "$@"; do | 958 | for arg in "$@"; do |
958 | case "$arg" in | 959 | case "$arg" in |
@@ -974,7 +975,7 @@ for arg in "$@"; do | |||
974 | --no-eabi) ARG_ARM_EABI=0;; | 975 | --no-eabi) ARG_ARM_EABI=0;; |
975 | --thumb) ARG_ARM_THUMB=1;; | 976 | --thumb) ARG_ARM_THUMB=1;; |
976 | --no-thumb) ARG_ARM_THUMB=0;; | 977 | --no-thumb) ARG_ARM_THUMB=0;; |
977 | --prefix=*) PREFIX=`echo "$arg" | cut -d = -f 2`;; | 978 | --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; |
978 | --help) help;; | 979 | --help) help;; |
979 | *) err=1; echo "[ERROR] Option '$arg' unsupported";; | 980 | *) err=1; echo "[ERROR] Option '$arg' unsupported";; |
980 | esac | 981 | esac |
@@ -3119,15 +3120,6 @@ else | |||
3119 | fi | 3120 | fi |
3120 | 3121 | ||
3121 | if [ "$ARG_RBDIR" ]; then | 3122 | if [ "$ARG_RBDIR" ]; then |
3122 | if [ "$need_full_path" = "yes" ]; then | ||
3123 | rbdir=`realpath $ARG_RBDIR` | ||
3124 | else # prepend '/' if needed | ||
3125 | if [ -z `echo $ARG_RBDIR | grep '^/'` ]; then | ||
3126 | rbdir="/"$ARG_RBDIR | ||
3127 | else | ||
3128 | rbdir=$ARG_RBDIR | ||
3129 | fi | ||
3130 | fi | ||
3131 | echo "Using alternate rockbox dir: ${rbdir}" | 3123 | echo "Using alternate rockbox dir: ${rbdir}" |
3132 | fi | 3124 | fi |
3133 | 3125 | ||
@@ -3138,8 +3130,8 @@ sed > autoconf.h \ | |||
3138 | -e "s<@config_rtc@<$config_rtc<g" \ | 3130 | -e "s<@config_rtc@<$config_rtc<g" \ |
3139 | -e "s<@have_rtc_alarm@<$have_rtc_alarm<g" \ | 3131 | -e "s<@have_rtc_alarm@<$have_rtc_alarm<g" \ |
3140 | -e "s<@RBDIR@<${rbdir}<g" \ | 3132 | -e "s<@RBDIR@<${rbdir}<g" \ |
3141 | -e "s<@binpath@<${bindir_full}<g" \ | 3133 | -e "s<@binpath@<${bindir}<g" \ |
3142 | -e "s<@libpath@<${libdir_full}<g" \ | 3134 | -e "s<@libpath@<${libdir}<g" \ |
3143 | -e "s<@have_backlight@<$have_backlight<g" \ | 3135 | -e "s<@have_backlight@<$have_backlight<g" \ |
3144 | -e "s<@have_fmradio_in@<$have_fmradio_in<g" \ | 3136 | -e "s<@have_fmradio_in@<$have_fmradio_in<g" \ |
3145 | -e "s<@have_ata_poweroff@<$have_ata_poweroff<g" \ | 3137 | -e "s<@have_ata_poweroff@<$have_ata_poweroff<g" \ |
@@ -3237,8 +3229,12 @@ fi | |||
3237 | if [ "$modelname" = "application" ]; then | 3229 | if [ "$modelname" = "application" ]; then |
3238 | cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT " | 3230 | cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT " |
3239 | fi | 3231 | fi |
3232 | if [ -n "$ARG_PREFIX" ]; then | ||
3233 | cmdline="$cmdline--prefix=\$(PREFIX) " | ||
3234 | fi | ||
3235 | |||
3236 | cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts" | ||
3240 | 3237 | ||
3241 | cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts --prefix=\$(PREFIX)" | ||
3242 | ### end of cmdline | 3238 | ### end of cmdline |
3243 | 3239 | ||
3244 | sed > Makefile \ | 3240 | sed > Makefile \ |
@@ -3306,7 +3302,7 @@ sed > Makefile \ | |||
3306 | -e "s<@RBDIR@<${rbdir}<g" \ | 3302 | -e "s<@RBDIR@<${rbdir}<g" \ |
3307 | -e "s<@binpath@<${bindir}<g" \ | 3303 | -e "s<@binpath@<${bindir}<g" \ |
3308 | -e "s<@libpath@<${libdir}<g" \ | 3304 | -e "s<@libpath@<${libdir}<g" \ |
3309 | -e "s<@PREFIX@<$PREFIX<g" \ | 3305 | -e "s<@PREFIX@<$ARG_PREFIX<g" \ |
3310 | -e "s<@CMDLINE@<$cmdline<g" \ | 3306 | -e "s<@CMDLINE@<$cmdline<g" \ |
3311 | -e "s<@SDLCONFIG@<$sdl<g" \ | 3307 | -e "s<@SDLCONFIG@<$sdl<g" \ |
3312 | <<EOF | 3308 | <<EOF |