summaryrefslogtreecommitdiffstats
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.tar.bz2
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
my $ROOT="..";
-my $ziptool="zip -r9";
-my $output="rockbox.zip";
+my $ziptool;
+my $output;
my $verbose;
my $install;
my $exe;
@@ -27,7 +27,7 @@ my $target;
my $modelname;
my $incfonts;
my $target_id; # passed in, not currently used
-my $rbdir=".rockbox"; # can be changed for special builds
+my $rbdir; # can be non-.rockbox for special builds
my $app;
sub glob_mkdir {
@@ -197,16 +197,30 @@ sub make_install {
# Get options
GetOptions ( 'r|root=s' => \$ROOT,
- 'z|ziptool=s' => \$ziptool,
+ 'z|ziptool:s' => \$ziptool,
'm|modelname=s' => \$modelname, # The model name as used in ARCHOS in the root makefile
'i|id=s' => \$target_id, # The target id name as used in TARGET_ID in the root makefile
- 'o|output=s' => \$output,
+ 'o|output:s' => \$output,
'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package
'v|verbose' => \$verbose,
'install=s' => \$install, # install destination
- 'rbdir=s' => \$rbdir, # If we want to put in a different directory
+ 'rbdir:s' => \$rbdir, # If we want to put in a different directory
);
+# GetOptions() doesn't remove the params from @ARGV if their value was ""
+# Thus we use the ":" for those for which we use a default value in case of ""
+# and assign the default value afterwards
+if ($ziptool eq '') {
+ $ziptool = "zip -r9";
+}
+if ($output eq '') {
+ $output = "rockbox.zip"
+}
+if ($rbdir eq '') {
+ $rbdir = ".rockbox";
+}
+
+# Now @ARGV shuold be free of any left-overs GetOptions left
($target, $exe) = @ARGV;
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"
need_full_path=
bindir=
libdir=
-bindir_full=
-libdir_full=
app_platform=
app_lcd_width=
@@ -87,21 +85,25 @@ app_get_platform() {
app_lcd_height="#define LCD_HEIGHT $app_lcd_height"
# setup files and paths depending on the platform
if [ "$app_platform" = "sdl" ]; then
- if [ -z "$PREFIX" ]; then
+ if [ -z "$ARG_PREFIX" ]; then
rbdir="/usr/local/share/rockbox"
bindir="/usr/local/bin"
- bindir_full=$bindir
libdir="/usr/local/lib"
- libdir_full=$libdir
else
- rbdir=`realpath $PREFIX/share/rockbox`
- bindir="$PREFIX/bin"
- libdir="$PREFIX/lib"
- if [ -d bindir ]; then
- bindir_full=`realpath $bindir`
- fi
- if [ -d libdir ]; then
- libdir_full=`realpath $libdir`
+ 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
+ rbdir="$ARG_PREFIX/share/rockbox"
+ bindir="$ARG_PREFIX/bin"
+ libdir="$ARG_PREFIX/lib"
+ else
+ echo "ERROR: PREFIX does not does not exist"
+ exit
fi
fi
output="rockbox"
@@ -122,9 +124,7 @@ app_get_platform() {
fi
rbdir="/data/data/org.rockbox/app_rockbox/rockbox"
bindir="/data/data/org.rockbox/lib"
- bindir_full=$bindir
libdir="/data/data/org.rockbox/app_rockbox"
- libdir_full=$libdir
output="librockbox.so"
bootoutput="librockbox.so"
fi
@@ -953,6 +953,7 @@ ARG_TYPE=
ARG_VOICE=
ARG_ARM_EABI=
ARG_ARM_THUMB=
+ARG_PREFIX="$PREFIX"
err=
for arg in "$@"; do
case "$arg" in
@@ -974,7 +975,7 @@ for arg in "$@"; do
--no-eabi) ARG_ARM_EABI=0;;
--thumb) ARG_ARM_THUMB=1;;
--no-thumb) ARG_ARM_THUMB=0;;
- --prefix=*) PREFIX=`echo "$arg" | cut -d = -f 2`;;
+ --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;;
--help) help;;
*) err=1; echo "[ERROR] Option '$arg' unsupported";;
esac
@@ -3119,15 +3120,6 @@ else
fi
if [ "$ARG_RBDIR" ]; then
- if [ "$need_full_path" = "yes" ]; then
- rbdir=`realpath $ARG_RBDIR`
- else # prepend '/' if needed
- if [ -z `echo $ARG_RBDIR | grep '^/'` ]; then
- rbdir="/"$ARG_RBDIR
- else
- rbdir=$ARG_RBDIR
- fi
- fi
echo "Using alternate rockbox dir: ${rbdir}"
fi
@@ -3138,8 +3130,8 @@ sed > autoconf.h \
-e "s<@config_rtc@<$config_rtc<g" \
-e "s<@have_rtc_alarm@<$have_rtc_alarm<g" \
-e "s<@RBDIR@<${rbdir}<g" \
- -e "s<@binpath@<${bindir_full}<g" \
- -e "s<@libpath@<${libdir_full}<g" \
+ -e "s<@binpath@<${bindir}<g" \
+ -e "s<@libpath@<${libdir}<g" \
-e "s<@have_backlight@<$have_backlight<g" \
-e "s<@have_fmradio_in@<$have_fmradio_in<g" \
-e "s<@have_ata_poweroff@<$have_ata_poweroff<g" \
@@ -3237,8 +3229,12 @@ fi
if [ "$modelname" = "application" ]; then
cmdline="$cmdline--lcdwidth=$ARG_LCDWIDTH --lcdheight=$ARG_LCDHEIGHT "
fi
+if [ -n "$ARG_PREFIX" ]; then
+ cmdline="$cmdline--prefix=\$(PREFIX) "
+fi
+
+cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
-cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts --prefix=\$(PREFIX)"
### end of cmdline
sed > Makefile \
@@ -3306,7 +3302,7 @@ sed > Makefile \
-e "s<@RBDIR@<${rbdir}<g" \
-e "s<@binpath@<${bindir}<g" \
-e "s<@libpath@<${libdir}<g" \
- -e "s<@PREFIX@<$PREFIX<g" \
+ -e "s<@PREFIX@<$ARG_PREFIX<g" \
-e "s<@CMDLINE@<$cmdline<g" \
-e "s<@SDLCONFIG@<$sdl<g" \
<<EOF