summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-09-08 17:48:18 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-09-08 17:48:18 +0000
commite6317d51e95c4ff9dc632085cac0445ca96f4d7a (patch)
treedf4e32c2bef82af683e60403d6cd9467eb56b4d3
parent385af791f1aeee46f4bd4e6480a62c033ff5972f (diff)
downloadrockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.tar.gz
rockbox-e6317d51e95c4ff9dc632085cac0445ca96f4d7a.zip
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
-rwxr-xr-xtools/configure37
1 files changed, 21 insertions, 16 deletions
diff --git a/tools/configure b/tools/configure
index d9324fdb82..755c04c159 100755
--- a/tools/configure
+++ b/tools/configure
@@ -147,26 +147,30 @@ findtool(){
147# scan the $PATH for sdl-config - check whether for a (cross-)win32 147# scan the $PATH for sdl-config - check whether for a (cross-)win32
148# sdl as requested 148# sdl as requested
149findsdl(){ 149findsdl(){
150 file="sdl-config" 150 # sdl-config might (not) be prefixed for cross compiles so try both.
151 files="sdl-config:${CROSS}sdl-config"
151 winbuild="$1" 152 winbuild="$1"
152 153
153 IFS=":" 154 IFS=":"
154 for path in $PATH 155 for file in $files
155 do 156 do
156 #echo "checks for $file in $path" >&2 157 for path in $PATH
157 if test -f "$path/$file"; then 158 do
158 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then 159 #echo "checks for $file in $path" >&2
159 if [ "yes" = "${winbuild}" ]; then 160 if test -f "$path/$file"; then
160 echo "$path/$file" 161 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then
161 return 162 if [ "yes" = "${winbuild}" ]; then
162 fi 163 echo "$path/$file"
163 else 164 return
164 if [ "yes" != "${winbuild}" ]; then 165 fi
165 echo "$path/$file" 166 else
166 return 167 if [ "yes" != "${winbuild}" ]; then
168 echo "$path/$file"
169 return
170 fi
167 fi 171 fi
168 fi 172 fi
169 fi 173 done
170 done 174 done
171} 175}
172 176
@@ -233,6 +237,7 @@ simcc () {
233 LDOPTS="$LDOPTS -mconsole" 237 LDOPTS="$LDOPTS -mconsole"
234 output="$output.exe" 238 output="$output.exe"
235 winbuild="yes" 239 winbuild="yes"
240 CROSS=${CROSS:-"i586-mingw32msvc-"}
236 SHARED_CFLAGS='' 241 SHARED_CFLAGS=''
237 else 242 else
238 case $uname in 243 case $uname in
@@ -360,7 +365,7 @@ EOF
360 else 365 else
361 # We are crosscompiling 366 # We are crosscompiling
362 # add cross-compiler option(s) 367 # add cross-compiler option(s)
363 prefixtools i586-mingw32msvc- 368 prefixtools $CROSS
364 LDOPTS="$LDOPTS -mconsole" 369 LDOPTS="$LDOPTS -mconsole"
365 fibers=`check_fiber` 370 fibers=`check_fiber`
366 output="rockboxui.exe" 371 output="rockboxui.exe"
@@ -3445,7 +3450,7 @@ else
3445 ""|"$CROSS_COMPILE") 3450 ""|"$CROSS_COMPILE")
3446 # simulator 3451 # simulator
3447 ;; 3452 ;;
3448 i586-mingw32msvc-) 3453 ${CROSS})
3449 # cross-compile for win32 3454 # cross-compile for win32
3450 ;; 3455 ;;
3451 *) 3456 *)