aboutsummaryrefslogtreecommitdiffstats
path: root/android-configure.sh
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-12-22 14:44:19 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-01-02 12:28:45 +0100
commite3650680f44fed0262d33eb4f486e5c1e58ddc32 (patch)
tree2ab5a1feabf263d2ac5bb56c06111c2c43e6db1a /android-configure.sh
parent79709b32a7ab759b0beb139a1e12bcc652dee4c4 (diff)
downloadexternal_qemu-e3650680f44fed0262d33eb4f486e5c1e58ddc32.zip
external_qemu-e3650680f44fed0262d33eb4f486e5c1e58ddc32.tar.gz
external_qemu-e3650680f44fed0262d33eb4f486e5c1e58ddc32.tar.bz2
android-configure.sh: Use 32-bit toolchain if present.
This makes android-configure.sh probe for our custom 32-bit toolchain. If found, it will be used unless you have defined CC in your environment, use --try-64 or --cc=<compiler> Change-Id: I40855378eaadf52daf004dab074e53b9df0262b5
Diffstat (limited to 'android-configure.sh')
-rwxr-xr-xandroid-configure.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/android-configure.sh b/android-configure.sh
index 24dbf99..8b5ea7e 100755
--- a/android-configure.sh
+++ b/android-configure.sh
@@ -26,9 +26,8 @@ OPTION_DEBUG=no
OPTION_STATIC=no
OPTION_MINGW=no
-if [ -z "$CC" ] ; then
- CC=gcc
-fi
+HOST_CC=${CC:-gcc}
+OPTION_CC=
for opt do
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
@@ -50,7 +49,7 @@ for opt do
;;
--mingw) OPTION_MINGW=yes
;;
- --cc=*) CC="$optarg" ; HOSTCC=$CC
+ --cc=*) OPTION_CC="$optarg"
;;
--no-strip) OPTION_NO_STRIP=yes
;;
@@ -81,7 +80,7 @@ EOF
echo "Standard options:"
echo " --help print this message"
echo " --install=FILEPATH copy emulator executable to FILEPATH [$TARGETS]"
- echo " --cc=PATH specify C compiler [$CC]"
+ echo " --cc=PATH specify C compiler [$HOST_CC]"
echo " --sdl-config=FILE use specific sdl-config script [$SDL_CONFIG]"
echo " --no-strip do not strip emulator executable"
echo " --debug enable debug (-O0 -g) build"
@@ -96,6 +95,16 @@ EOF
exit 1
fi
+# On Linux, try to use our 32-bit prebuilt toolchain to generate binaries
+# that are compatible with Ubuntu 8.04
+if [ -z "$CC" -a -z "$OPTION_CC" -a "$HOST_OS" = linux -a "$OPTION_TRY_64" != "yes" ] ; then
+ HOST_CC=`dirname $0`/../../prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/bin/i686-linux-gcc
+ if [ -f "$HOST_CC" ] ; then
+ echo "Using prebuilt 32-bit toolchain: $HOST_CC"
+ CC="$HOST_CC"
+ fi
+fi
+
# we only support generating 32-bit binaris on 64-bit systems.
# And we may need to add a -Wa,--32 to CFLAGS to let the assembler
# generate 32-bit binaries on Linux x86_64.