Index: tools/rockboxdev.sh =================================================================== --- tools/rockboxdev.sh (revision 20888) +++ tools/rockboxdev.sh (working copy) @@ -10,11 +10,18 @@ # downloaded files dlwhere="${RBDEV_DOWNLOAD:-/tmp/rbdev-dl}" -# will append the target string to the prefix dir mentioned here +# This is the prefix for cross compilers used to build rockbox. +# We will append the target string to the prefix dir mentioned here. +# The default prefix is used if the custom prefix is not set or is empty. # Note that the user running this script must be able to do make install in # this given prefix directory. Also make sure that this given root dir # exists. -prefix="${RBDEV_PREFIX:-/usr/local}" +if [ -f ~/.config/rockbox.org/RockboxCompilerPrefix ]; then + read prefix < ~/.config/rockbox.org/RockboxCompilerPrefix +fi +if [ -z "$prefix" ]; then + prefix="${RBDEV_PREFIX:-/usr/local}" +fi # This directory is used to extract all files and to build everything in. It # must not exist before this script is invoked (as a security measure). Index: tools/configure =================================================================== --- tools/configure (revision 20888) +++ tools/configure (working copy) @@ -38,11 +38,24 @@ OC=${prefix}objcopy } +setpath () { + # This is the prefix for cross compilers used to build rockbox. + # It won't be set if the custom prefix is not set or is empty. + if [ -f ~/.config/rockbox.org/RockboxCompilerPrefix ]; then + read path_prefix < ~/.config/rockbox.org/RockboxCompilerPrefix + fi + if [ -n "$path_prefix" ]; then + path_prepend="$path_prefix/$1/bin:" + PATH="$path_prepend$PATH" + fi +} + crosswincc () { # naive approach to selecting a mingw cross-compiler on linux/*nix echo "Enabling win32 crosscompiling" prefixtools i586-mingw32msvc- + setpath i586-mingw32msvc # add cross-compiler option(s) GCCOPTS="$GCCOPTS `sdl-config --cflags`" @@ -224,6 +237,7 @@ # shcc () { prefixtools sh-elf- + setpath sh-elf GCCOPTS="$CCOPTS -m1" GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns" endian="big" @@ -232,6 +246,7 @@ calmrisccc () { prefixtools calmrisc16-unknown-elf- + setpath calmrisc16-unknown-elf GCCOPTS="-Wl\,--no-check-sections $CCOPTS" GCCOPTIMIZE="-fomit-frame-pointer" endian="big" @@ -239,6 +254,7 @@ coldfirecc () { prefixtools m68k-elf- + setpath m68k-elf GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align" GCCOPTIMIZE="-fomit-frame-pointer" endian="big" @@ -247,6 +263,7 @@ arm7tdmicc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm7tdmi" if test "X$1" != "Xshort"; then GCCOPTS="$GCCOPTS -mlong-calls" @@ -258,6 +275,7 @@ arm9tdmicc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm9tdmi" if test "$modelname" != "gigabeatf"; then GCCOPTS="$GCCOPTS -mlong-calls" @@ -269,6 +287,7 @@ arm940tbecc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="big" @@ -277,6 +296,7 @@ arm946cc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -285,6 +305,7 @@ arm926ejscc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -293,6 +314,7 @@ arm1136jfscc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm1136jf-s" if test "$modelname" != "gigabeats"; then GCCOPTS="$GCCOPTS -mlong-calls" @@ -304,6 +326,7 @@ mipselcc () { prefixtools mipsel-elf- + setpath mipsel-elf GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-abicalls -mno-long-calls -Wno-parentheses" GCCOPTIMIZE="-fomit-frame-pointer" GCCOPTS="$GCCOPTS -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -msoft-float -G 0" @@ -2467,6 +2490,7 @@ ### end of cmdline sed > Makefile \ + -e "s,@PATH_PREPEND@,${path_prepend},g" \ -e "s,@ROOTDIR@,${rootdir},g" \ -e "s,@DEBUG@,${debug},g" \ -e "s,@MEMORY@,${memory},g" \ @@ -2533,6 +2557,7 @@ <