summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-12-23 09:03:31 +0000
committerThomas Martitz <kugel@rockbox.org>2011-12-23 09:03:31 +0000
commit013cc9dedfa940588ae6a69e08d5be51f72c6b8e (patch)
treec0f6203a149a588262fe296831ab9df1c43948e3
parent893666a734a79885ffb7f701225daf805e437bf5 (diff)
downloadrockbox-013cc9dedfa940588ae6a69e08d5be51f72c6b8e.zip
rockbox-013cc9dedfa940588ae6a69e08d5be51f72c6b8e.tar.gz
rockbox-013cc9dedfa940588ae6a69e08d5be51f72c6b8e.tar.bz2
rockbox-013cc9dedfa940588ae6a69e08d5be51f72c6b8e.tar.xz
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
-rwxr-xr-xtools/configure108
1 files changed, 51 insertions, 57 deletions
diff --git a/tools/configure b/tools/configure
index 1b7eaa0..d1ed70a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -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,68 +326,51 @@ simcc () {
GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
+ # x86_64 supports MMX by default
- 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
-
- id=$$
- cat >$tmpdir/conftest-$id.c <<EOF
+ 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`
+ if [ "$endian" != "" ] && [ $endian -gt "1" ]; then
+ # big endian
+ endian="big"
+ else
+ # little endian
+ endian="little"
+ fi
+ fi
- $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`
- if [ "$endian" != "" ] && [ $endian -gt "1" ]; then
- # big endian
- endian="big"
- else
- # little endian
- endian="little"
- fi
-
- if [ "$CROSS_COMPILE" != "" ]; then
- echo "WARNING: Cross Compiling, cannot detect endianess. Assuming little endian!"
- fi
-
- if [ "$app_type" = "sdl-sim" ]; then
- echo "Simulator environment deemed $endian endian"
- elif [ "$app_type" = "sdl-app" ]; then
- echo "Application environment deemed $endian endian"
- elif [ "$app_type" = "checkwps" ]; then
- echo "CheckWPS environment deemed $endian endian"
- fi
+ if [ "$CROSS_COMPILE" != "" ]; then
+ echo "WARNING: Cross Compiling, cannot detect endianess. Assuming $endian endian!"
+ fi
- # 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"
+ if [ "$app_type" = "sdl-sim" ]; then
+ echo "Simulator environment deemed $endian endian"
+ elif [ "$app_type" = "sdl-app" ]; then
+ echo "Application environment deemed $endian endian"
+ elif [ "$app_type" = "checkwps" ]; then
+ echo "CheckWPS environment deemed $endian endian"
fi
+ # use wildcard here to make it work even if it was named *.exe like
+ # on cygwin
+ rm -f $tmpdir/conftest-$id*
+
thread_support=
if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then
if [ "$sigaltstack" = "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