Index: tools/rockboxdev.sh =================================================================== --- tools/rockboxdev.sh (revision 17767) +++ tools/rockboxdev.sh (working copy) @@ -4,11 +4,18 @@ # downloaded files dlwhere="/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="/usr/local" +if [ -f ~/.config/rockbox.org/RockboxCompilerPrefix ]; then + read prefix < ~/.config/rockbox.org/RockboxCompilerPrefix +fi +if [ -z "$prefix" ]; then + 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 17767) +++ tools/configure (working copy) @@ -36,11 +36,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_append=":$path_prefix/$1/bin" + PATH="$PATH$path_append" + 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`" @@ -208,6 +221,7 @@ # shcc () { prefixtools sh-elf- + setpath sh-elf GCCOPTS="$CCOPTS -m1" GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns" endian="big" @@ -216,6 +230,7 @@ calmrisccc () { prefixtools calmrisc16-unknown-elf- + setpath calmrisc16-unknown-elf GCCOPTS="-Wl\,--no-check-sections $CCOPTS" GCCOPTIMIZE="-fomit-frame-pointer" endian="big" @@ -223,6 +238,7 @@ coldfirecc () { prefixtools m68k-elf- + setpath m68k-elf GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align" GCCOPTIMIZE="-fomit-frame-pointer" endian="big" @@ -231,6 +247,7 @@ arm7tdmicc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm7tdmi" if test "X$1" != "Xshort"; then GCCOPTS="$GCCOPTS -mlong-calls" @@ -242,6 +259,7 @@ arm9tdmicc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -250,6 +268,7 @@ arm946cc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -258,6 +277,7 @@ arm926ejscc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -266,6 +286,7 @@ arm1136jfscc () { prefixtools arm-elf- + setpath arm-elf GCCOPTS="$CCOPTS -mcpu=arm1136jf-s -mlong-calls" GCCOPTIMIZE="-fomit-frame-pointer" endian="little" @@ -2063,6 +2084,7 @@ fi sed > Makefile \ + -e "s,@PATH_APPEND@,${path_append},g" \ -e "s,@ROOTDIR@,${rootdir},g" \ -e "s,@DEBUG@,${debug},g" \ -e "s,@MEMORY@,${memory},g" \ @@ -2124,6 +2146,9 @@ <