diff options
Diffstat (limited to 'tools/configure')
-rwxr-xr-x | tools/configure | 49 |
1 files changed, 45 insertions, 4 deletions
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" | |||
19 | 19 | ||
20 | scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` | 20 | scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` |
21 | 21 | ||
22 | rbdir=".rockbox" | 22 | rbdir="/.rockbox" |
23 | need_full_path= | ||
24 | bindir= | ||
25 | libdir= | ||
26 | bindir_full= | ||
27 | libdir_full= | ||
23 | 28 | ||
24 | # | 29 | # |
25 | # Begin Function Definitions | 30 | # Begin Function Definitions |
@@ -2603,7 +2608,27 @@ fi | |||
2603 | target_id=100 | 2608 | target_id=100 |
2604 | modelname="application" | 2609 | modelname="application" |
2605 | target="-DAPPLICATION" | 2610 | target="-DAPPLICATION" |
2606 | memory=32 | 2611 | |
2612 | if [ -z "$PREFIX" ]; then | ||
2613 | rbdir="/usr/local/share/rockbox" | ||
2614 | bindir="/usr/local/bin" | ||
2615 | bindir_full=$bindir | ||
2616 | libdir="/usr/local/lib" | ||
2617 | libdir_full=$libdir | ||
2618 | else | ||
2619 | rbdir=`realpath $PREFIX/share/rockbox` | ||
2620 | bindir="$PREFIX/bin" | ||
2621 | libdir="$PREFIX/lib" | ||
2622 | if [ -d bindir ]; then | ||
2623 | bindir_full=`realpath $bindir` | ||
2624 | fi | ||
2625 | if [ -d libdir ]; then | ||
2626 | libdir_full=`realpath $libdir` | ||
2627 | fi | ||
2628 | fi | ||
2629 | need_full_path="yes" | ||
2630 | |||
2631 | memory=8 | ||
2607 | uname=`uname` | 2632 | uname=`uname` |
2608 | simcc "sdl-app" | 2633 | simcc "sdl-app" |
2609 | tool="cp " | 2634 | tool="cp " |
@@ -2999,7 +3024,15 @@ else | |||
2999 | fi | 3024 | fi |
3000 | 3025 | ||
3001 | if [ "$ARG_RBDIR" ]; then | 3026 | if [ "$ARG_RBDIR" ]; then |
3002 | rbdir=$ARG_RBDIR | 3027 | if [ "$need_full_path" = "yes" ]; then |
3028 | rbdir=`realpath $ARG_RBDIR` | ||
3029 | else # prepend '/' if needed | ||
3030 | if [ -z `echo $ARG_RBDIR | grep -P '/.*'` ]; then | ||
3031 | rbdir="/"$ARG_RBDIR | ||
3032 | else | ||
3033 | rbdir=$ARG_RBDIR | ||
3034 | fi | ||
3035 | fi | ||
3003 | echo "Using alternate rockbox dir: ${rbdir}" | 3036 | echo "Using alternate rockbox dir: ${rbdir}" |
3004 | fi | 3037 | fi |
3005 | 3038 | ||
@@ -3010,6 +3043,8 @@ sed > autoconf.h \ | |||
3010 | -e "s<@config_rtc@<$config_rtc<g" \ | 3043 | -e "s<@config_rtc@<$config_rtc<g" \ |
3011 | -e "s<@have_rtc_alarm@<$have_rtc_alarm<g" \ | 3044 | -e "s<@have_rtc_alarm@<$have_rtc_alarm<g" \ |
3012 | -e "s<@RBDIR@<${rbdir}<g" \ | 3045 | -e "s<@RBDIR@<${rbdir}<g" \ |
3046 | -e "s<@binpath@<${bindir_full}<g" \ | ||
3047 | -e "s<@libpath@<${libdir_full}<g" \ | ||
3013 | -e "s<@have_backlight@<$have_backlight<g" \ | 3048 | -e "s<@have_backlight@<$have_backlight<g" \ |
3014 | -e "s<@have_fmradio_in@<$have_fmradio_in<g" \ | 3049 | -e "s<@have_fmradio_in@<$have_fmradio_in<g" \ |
3015 | -e "s<@have_ata_poweroff@<$have_ata_poweroff<g" \ | 3050 | -e "s<@have_ata_poweroff@<$have_ata_poweroff<g" \ |
@@ -3041,7 +3076,9 @@ sed > autoconf.h \ | |||
3041 | @have_rtc_alarm@ | 3076 | @have_rtc_alarm@ |
3042 | 3077 | ||
3043 | /* root of Rockbox */ | 3078 | /* root of Rockbox */ |
3044 | #define ROCKBOX_DIR "/@RBDIR@" | 3079 | #define ROCKBOX_DIR "@RBDIR@" |
3080 | #define ROCKBOX_BINARY_PATH "@binpath@" | ||
3081 | #define ROCKBOX_LIBRARY_PATH "@libpath@" | ||
3045 | 3082 | ||
3046 | #endif /* __BUILD_AUTOCONF_H */ | 3083 | #endif /* __BUILD_AUTOCONF_H */ |
3047 | EOF | 3084 | EOF |
@@ -3154,6 +3191,8 @@ sed > Makefile \ | |||
3154 | -e "s<@LANGS@<${buildlangs}<g" \ | 3191 | -e "s<@LANGS@<${buildlangs}<g" \ |
3155 | -e "s<@USE_ELF@<${USE_ELF}<g" \ | 3192 | -e "s<@USE_ELF@<${USE_ELF}<g" \ |
3156 | -e "s<@RBDIR@<${rbdir}<g" \ | 3193 | -e "s<@RBDIR@<${rbdir}<g" \ |
3194 | -e "s<@binpath@<${bindir}<g" \ | ||
3195 | -e "s<@libpath@<${libdir}<g" \ | ||
3157 | -e "s<@PREFIX@<$PREFIX<g" \ | 3196 | -e "s<@PREFIX@<$PREFIX<g" \ |
3158 | -e "s<@CMDLINE@<$cmdline<g" \ | 3197 | -e "s<@CMDLINE@<$cmdline<g" \ |
3159 | -e "s<@SDLCONFIG@<$sdl<g" \ | 3198 | -e "s<@SDLCONFIG@<$sdl<g" \ |
@@ -3221,6 +3260,8 @@ export ENC_OPTS=@ENC_OPTS@ | |||
3221 | export ENCODER=@ENCODER@ | 3260 | export ENCODER=@ENCODER@ |
3222 | export USE_ELF=@USE_ELF@ | 3261 | export USE_ELF=@USE_ELF@ |
3223 | export RBDIR=@RBDIR@ | 3262 | export RBDIR=@RBDIR@ |
3263 | export ROCKBOX_BINARY_PATH=@binpath@ | ||
3264 | export ROCKBOX_LIBRARY_PATH=@libpath@ | ||
3224 | export SDLCONFIG=@SDLCONFIG@ | 3265 | export SDLCONFIG=@SDLCONFIG@ |
3225 | 3266 | ||
3226 | CONFIGURE_OPTIONS=@CMDLINE@ | 3267 | CONFIGURE_OPTIONS=@CMDLINE@ |