summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-11-14 15:29:11 +0000
committerThomas Martitz <kugel@rockbox.org>2010-11-14 15:29:11 +0000
commit9321ce3febacfc6ef495a9d834edb3e74cf3ab5b (patch)
tree6fa65e5141f3118b7fc39e85388156f7621a4ce7 /tools
parenta5ad3f8a7223c7f8dd17ddc57c1a018ba4d62835 (diff)
downloadrockbox-9321ce3febacfc6ef495a9d834edb3e74cf3ab5b.tar.gz
rockbox-9321ce3febacfc6ef495a9d834edb3e74cf3ab5b.zip
Fix path detection for app builds in configure and buildzip.pl.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28592 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl26
-rwxr-xr-xtools/configure54
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
19my $ROOT=".."; 19my $ROOT="..";
20 20
21my $ziptool="zip -r9"; 21my $ziptool;
22my $output="rockbox.zip"; 22my $output;
23my $verbose; 23my $verbose;
24my $install; 24my $install;
25my $exe; 25my $exe;
@@ -27,7 +27,7 @@ my $target;
27my $modelname; 27my $modelname;
28my $incfonts; 28my $incfonts;
29my $target_id; # passed in, not currently used 29my $target_id; # passed in, not currently used
30my $rbdir=".rockbox"; # can be changed for special builds 30my $rbdir; # can be non-.rockbox for special builds
31my $app; 31my $app;
32 32
33sub glob_mkdir { 33sub glob_mkdir {
@@ -197,16 +197,30 @@ sub make_install {
197 197
198# Get options 198# Get options
199GetOptions ( 'r|root=s' => \$ROOT, 199GetOptions ( '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
213if ($ziptool eq '') {
214 $ziptool = "zip -r9";
215}
216if ($output eq '') {
217 $output = "rockbox.zip"
218}
219if ($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
212my $firmdir="$ROOT/firmware"; 226my $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"
24need_full_path= 24need_full_path=
25bindir= 25bindir=
26libdir= 26libdir=
27bindir_full=
28libdir_full=
29 27
30app_platform= 28app_platform=
31app_lcd_width= 29app_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=
953ARG_VOICE= 953ARG_VOICE=
954ARG_ARM_EABI= 954ARG_ARM_EABI=
955ARG_ARM_THUMB= 955ARG_ARM_THUMB=
956ARG_PREFIX="$PREFIX"
956err= 957err=
957for arg in "$@"; do 958for 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
3119fi 3120fi
3120 3121
3121if [ "$ARG_RBDIR" ]; then 3122if [ "$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}"
3132fi 3124fi
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
3237if [ "$modelname" = "application" ]; then 3229if [ "$modelname" = "application" ]; then
3238 cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT " 3230 cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT "
3239fi 3231fi
3232if [ -n "$ARG_PREFIX" ]; then
3233 cmdline="$cmdline--prefix=\$(PREFIX) "
3234fi
3235
3236cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
3240 3237
3241cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts --prefix=\$(PREFIX)"
3242### end of cmdline 3238### end of cmdline
3243 3239
3244sed > Makefile \ 3240sed > 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