From 9c0b2479f7025a84444adf08e3be8ced60dad013 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 1 Aug 2010 16:15:27 +0000 Subject: Rockbox as an application: add get_user_file_path(). For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox). This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local. On the DAPs it's a no-op, returing /.rockbox directly. Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657 --- tools/configure | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure b/tools/configure index 0896e5b699..ce23c2a965 100755 --- a/tools/configure +++ b/tools/configure @@ -19,7 +19,12 @@ use_bootchart="#undef DO_BOOTCHART" scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` -rbdir=".rockbox" +rbdir="/.rockbox" +need_full_path= +bindir= +libdir= +bindir_full= +libdir_full= # # Begin Function Definitions @@ -2603,7 +2608,27 @@ fi target_id=100 modelname="application" target="-DAPPLICATION" - memory=32 + + if [ -z "$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` + fi + fi + need_full_path="yes" + + memory=8 uname=`uname` simcc "sdl-app" tool="cp " @@ -2999,7 +3024,15 @@ else fi if [ "$ARG_RBDIR" ]; then - rbdir=$ARG_RBDIR + if [ "$need_full_path" = "yes" ]; then + rbdir=`realpath $ARG_RBDIR` + else # prepend '/' if needed + if [ -z `echo $ARG_RBDIR | grep -P '/.*'` ]; then + rbdir="/"$ARG_RBDIR + else + rbdir=$ARG_RBDIR + fi + fi echo "Using alternate rockbox dir: ${rbdir}" fi @@ -3010,6 +3043,8 @@ sed > autoconf.h \ -e "s<@config_rtc@<$config_rtc autoconf.h \ @have_rtc_alarm@ /* root of Rockbox */ -#define ROCKBOX_DIR "/@RBDIR@" +#define ROCKBOX_DIR "@RBDIR@" +#define ROCKBOX_BINARY_PATH "@binpath@" +#define ROCKBOX_LIBRARY_PATH "@libpath@" #endif /* __BUILD_AUTOCONF_H */ EOF @@ -3154,6 +3191,8 @@ sed > Makefile \ -e "s<@LANGS@<${buildlangs}