From 9321ce3febacfc6ef495a9d834edb3e74cf3ab5b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 14 Nov 2010 15:29:11 +0000 Subject: 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 --- tools/configure | 54 +++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'tools/configure') 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 Makefile \ @@ -3306,7 +3302,7 @@ sed > Makefile \ -e "s<@RBDIR@<${rbdir}