mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -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
56
tools/configure
vendored
56
tools/configure
vendored
|
@ -148,7 +148,7 @@ findtool(){
|
|||
# sdl as requested
|
||||
findsdl(){
|
||||
# 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"
|
||||
|
||||
IFS=":"
|
||||
|
@ -234,11 +234,18 @@ simcc () {
|
|||
SHARED_CFLAGS="-fPIC -fvisibility=hidden"
|
||||
|
||||
if [ "$win32crosscompile" = "yes" ]; then
|
||||
# We are crosscompiling
|
||||
# add cross-compiler option(s)
|
||||
LDOPTS="$LDOPTS -mconsole"
|
||||
output="$output.exe"
|
||||
winbuild="yes"
|
||||
CROSS=${CROSS:-"i586-mingw32msvc-"}
|
||||
CROSS_COMPILE=${CROSS_COMPILE:-"i586-mingw32msvc-"}
|
||||
SHARED_CFLAGS=''
|
||||
prefixtools "$CROSS_COMPILE"
|
||||
fibers=`check_fiber`
|
||||
endian="little" # windows is little endian
|
||||
echo "Enabling MMX support"
|
||||
GCCOPTS="$GCCOPTS -mmmx"
|
||||
else
|
||||
case $uname in
|
||||
CYGWIN*)
|
||||
|
@ -294,7 +301,14 @@ simcc () {
|
|||
esac
|
||||
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`
|
||||
|
||||
if [ -n `echo $app_type | grep "sdl"` ]; then
|
||||
|
@ -312,30 +326,23 @@ simcc () {
|
|||
|
||||
|
||||
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
|
||||
|
||||
if [ "$endian" = "" ]; then
|
||||
id=$$
|
||||
cat >$tmpdir/conftest-$id.c <<EOF
|
||||
#include <stdio.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int var=0;
|
||||
char *varp = (char *)&var;
|
||||
*varp=1;
|
||||
int var=0;
|
||||
char *varp = (char *)&var;
|
||||
*varp=1;
|
||||
|
||||
printf("%d\n", var);
|
||||
return 0;
|
||||
printf("%d\n", var);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
$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
|
||||
# on the local machine. assume little endian but print a warning
|
||||
endian=`$tmpdir/conftest-$id 2> /dev/null`
|
||||
|
@ -346,9 +353,10 @@ EOF
|
|||
# little endian
|
||||
endian="little"
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
# on cygwin
|
||||
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=
|
||||
if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then
|
||||
|
@ -3515,9 +3512,6 @@ else
|
|||
""|"$CROSS_COMPILE")
|
||||
# simulator
|
||||
;;
|
||||
${CROSS})
|
||||
# cross-compile for win32
|
||||
;;
|
||||
*)
|
||||
# Verify that the cross-compiler is of a recommended version!
|
||||
if test "$gccver" != "$gccchoice"; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue