Resolve CROSS/CROSS_COMPILE dualism in configure to use only CROSS_COMPILE (only used for SDL builds so far), which should be the de facto environment variable for this.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31408 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2011-12-23 09:03:31 +00:00
parent 893666a734
commit 013cc9dedf

56
tools/configure vendored
View file

@ -148,7 +148,7 @@ findtool(){
# sdl as requested # sdl as requested
findsdl(){ findsdl(){
# sdl-config might (not) be prefixed for cross compiles so try both. # sdl-config might (not) be prefixed for cross compiles so try both.
files="sdl-config:${CROSS}sdl-config" files="${CROSS_COMPILE}sdl-config:sdl-config"
winbuild="$1" winbuild="$1"
IFS=":" IFS=":"
@ -234,11 +234,18 @@ simcc () {
SHARED_CFLAGS="-fPIC -fvisibility=hidden" SHARED_CFLAGS="-fPIC -fvisibility=hidden"
if [ "$win32crosscompile" = "yes" ]; then if [ "$win32crosscompile" = "yes" ]; then
# We are crosscompiling
# add cross-compiler option(s)
LDOPTS="$LDOPTS -mconsole" LDOPTS="$LDOPTS -mconsole"
output="$output.exe" output="$output.exe"
winbuild="yes" winbuild="yes"
CROSS=${CROSS:-"i586-mingw32msvc-"} CROSS_COMPILE=${CROSS_COMPILE:-"i586-mingw32msvc-"}
SHARED_CFLAGS='' SHARED_CFLAGS=''
prefixtools "$CROSS_COMPILE"
fibers=`check_fiber`
endian="little" # windows is little endian
echo "Enabling MMX support"
GCCOPTS="$GCCOPTS -mmmx"
else else
case $uname in case $uname in
CYGWIN*) CYGWIN*)
@ -294,7 +301,14 @@ simcc () {
esac esac
fi fi
[ "$winbuild" != "yes" ] && GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" if [ "$winbuild" != "yes" ]; then
GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
if [ "`uname -m`" = "i686" ]; then
echo "Enabling MMX support"
GCCOPTS="$GCCOPTS -mmmx"
fi
fi
sdl=`findsdl $winbuild` sdl=`findsdl $winbuild`
if [ -n `echo $app_type | grep "sdl"` ]; then if [ -n `echo $app_type | grep "sdl"` ]; then
@ -312,30 +326,23 @@ simcc () {
GCCOPTS="$GCCOPTS -I\$(SIMDIR)" GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
if test "X$win32crosscompile" != "Xyes"; then
if test "`uname -m`" = "i686"; then
echo "Enabling MMX support"
GCCOPTS="$GCCOPTS -mmmx"
fi
# x86_64 supports MMX by default # x86_64 supports MMX by default
if [ "$endian" = "" ]; then
id=$$ id=$$
cat >$tmpdir/conftest-$id.c <<EOF cat >$tmpdir/conftest-$id.c <<EOF
#include <stdio.h> #include <stdio.h>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int var=0; int var=0;
char *varp = (char *)&var; char *varp = (char *)&var;
*varp=1; *varp=1;
printf("%d\n", var); printf("%d\n", var);
return 0; return 0;
} }
EOF EOF
$CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
# when cross compiling, the endianess cannot be detected because the above program doesn't run # when cross compiling, the endianess cannot be detected because the above program doesn't run
# on the local machine. assume little endian but print a warning # on the local machine. assume little endian but print a warning
endian=`$tmpdir/conftest-$id 2> /dev/null` endian=`$tmpdir/conftest-$id 2> /dev/null`
@ -346,9 +353,10 @@ EOF
# little endian # little endian
endian="little" endian="little"
fi fi
fi
if [ "$CROSS_COMPILE" != "" ]; then if [ "$CROSS_COMPILE" != "" ]; then
echo "WARNING: Cross Compiling, cannot detect endianess. Assuming little endian!" echo "WARNING: Cross Compiling, cannot detect endianess. Assuming $endian endian!"
fi fi
if [ "$app_type" = "sdl-sim" ]; then if [ "$app_type" = "sdl-sim" ]; then
@ -362,17 +370,6 @@ EOF
# use wildcard here to make it work even if it was named *.exe like # use wildcard here to make it work even if it was named *.exe like
# on cygwin # on cygwin
rm -f $tmpdir/conftest-$id* rm -f $tmpdir/conftest-$id*
else
# We are crosscompiling
# add cross-compiler option(s)
prefixtools $CROSS
LDOPTS="$LDOPTS -mconsole"
fibers=`check_fiber`
output="rockboxui.exe"
endian="little" # windows is little endian
echo "Enabling MMX support"
GCCOPTS="$GCCOPTS -mmmx"
fi
thread_support= thread_support=
if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then
@ -3515,9 +3512,6 @@ else
""|"$CROSS_COMPILE") ""|"$CROSS_COMPILE")
# simulator # simulator
;; ;;
${CROSS})
# cross-compile for win32
;;
*) *)
# Verify that the cross-compiler is of a recommended version! # Verify that the cross-compiler is of a recommended version!
if test "$gccver" != "$gccchoice"; then if test "$gccver" != "$gccchoice"; then