diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-09-08 17:48:18 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-09-08 17:48:18 +0000 |
| commit | e6317d51e95c4ff9dc632085cac0445ca96f4d7a (patch) | |
| tree | df4e32c2bef82af683e60403d6cd9467eb56b4d3 /tools | |
| parent | 385af791f1aeee46f4bd4e6480a62c033ff5972f (diff) | |
| download | rockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.zip rockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.tar.gz rockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.tar.bz2 rockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.tar.xz | |
Improve sim win32 cross compiling.
- Extend configure to allow setting the cross compiler prefix using the
environment variable CROSS. This allows using a compiler that is prefixed
differently than the prefix configure does assume.
- When searching for sdl-config also check for a prefixed version. Some
toolchains prefix sdl-config (like mingw-cross-env).
This enables cross compiling the sim with at least the MinGW packages provided
by Fedora (different prefix) and mingw-cross-env (different prefix and prefixes
sdl-config. There's a non-prefixed version as well, but that folder also
includes the non-prefixed compiler, so using the prefixed version is
preferable.)
starting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30484 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/configure | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/tools/configure b/tools/configure index d9324fd..755c04c 100755 --- a/tools/configure +++ b/tools/configure @@ -147,26 +147,30 @@ findtool(){ # scan the $PATH for sdl-config - check whether for a (cross-)win32 # sdl as requested findsdl(){ - file="sdl-config" + # sdl-config might (not) be prefixed for cross compiles so try both. + files="sdl-config:${CROSS}sdl-config" winbuild="$1" IFS=":" - for path in $PATH + for file in $files do - #echo "checks for $file in $path" >&2 - if test -f "$path/$file"; then - if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then - if [ "yes" = "${winbuild}" ]; then - echo "$path/$file" - return - fi - else - if [ "yes" != "${winbuild}" ]; then - echo "$path/$file" - return + for path in $PATH + do + #echo "checks for $file in $path" >&2 + if test -f "$path/$file"; then + if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then + if [ "yes" = "${winbuild}" ]; then + echo "$path/$file" + return + fi + else + if [ "yes" != "${winbuild}" ]; then + echo "$path/$file" + return + fi fi fi - fi + done done } @@ -233,6 +237,7 @@ simcc () { LDOPTS="$LDOPTS -mconsole" output="$output.exe" winbuild="yes" + CROSS=${CROSS:-"i586-mingw32msvc-"} SHARED_CFLAGS='' else case $uname in @@ -360,7 +365,7 @@ EOF else # We are crosscompiling # add cross-compiler option(s) - prefixtools i586-mingw32msvc- + prefixtools $CROSS LDOPTS="$LDOPTS -mconsole" fibers=`check_fiber` output="rockboxui.exe" @@ -3445,7 +3450,7 @@ else ""|"$CROSS_COMPILE") # simulator ;; - i586-mingw32msvc-) + ${CROSS}) # cross-compile for win32 ;; *) |