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
This commit is contained in:
Dominik Riebeling 2011-09-08 17:48:18 +00:00
parent 385af791f1
commit e6317d51e9

37
tools/configure vendored
View file

@ -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
;;
*)