mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
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:
parent
893666a734
commit
013cc9dedf
1 changed files with 52 additions and 58 deletions
46
tools/configure
vendored
46
tools/configure
vendored
|
@ -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,14 +326,9 @@ 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>
|
||||||
|
@ -333,9 +342,7 @@ int main(int argc, char **argv)
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue