summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-06-26 20:20:41 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-06-26 20:22:05 +0100
commit377d16bf8b61b5543233f4ffdef7dd1848585040 (patch)
tree9df9e81b70aa6d713728a6b72fa528fe52bac71e /configure.in
parent9b95765526d23e02cf00b475bd79d169be841b5c (diff)
android: add --with-android-arch to make space for an x86 target
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in59
1 files changed, 37 insertions, 22 deletions
diff --git a/configure.in b/configure.in
index e282af34313c..d95d73834bd1 100644
--- a/configure.in
+++ b/configure.in
@@ -109,6 +109,23 @@ fi
dnl ===================================================================
dnl When building for Android the --with-android-ndk is mandatory
dnl ===================================================================
+
+AC_ARG_WITH(android-ndk,
+ AS_HELP_STRING([--with-android-ndk],
+ [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
+,)
+
+AC_ARG_WITH(android-sdk,
+ AS_HELP_STRING([--with-android-sdk],
+ [Specify location of the Android SDK. Mandatory when building for Android.]),
+,)
+
+AC_ARG_WITH(android-arch,
+ AS_HELP_STRING([--with-android-arch],
+ [Specify the Android target architecture - default is arm, or try x86]),,
+ [with_android_arch=arm])
+
+ANDROID_ARCH=
ANDROID_NDK_HOME=
if test -n "$with_android_ndk"; then
ANDROID_NDK_HOME=$with_android_ndk
@@ -116,20 +133,27 @@ if test -n "$with_android_ndk"; then
# What if the NDK at some point starts including several toolchains for different
# gcc versions (like some 3rd-party improved NDK builds already do)?
# Then the use of a wildcard below will break.
- ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-linux*/prebuilt/*/bin`
-
- test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-arm
- test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ar
- test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-nm
- test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-objdump
- test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ranlib
- test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-strip
-
- ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
-
- test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-gcc $ANDROIDCFLAGS"
- test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-g++ $ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include"
+ ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$with_android_arch-linux*/prebuilt/*/bin`
+
+ test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$with_android_arch
+ test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ar
+ test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-nm
+ test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-objdump
+ test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ranlib
+ test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-strip
+
+ if test "$with_android_arch" = "arm"; then
+ ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
+ ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include"
+ else # x86
+ ANDROIDCFLAGS="-march=atom --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-x86 -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/x86"
+ ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/x86/include"
+ fi
+ test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-gcc $ANDROIDCFLAGS"
+ test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-g++ $ANDROIDCXXFLAGS"
+ ANDROID_ARCH=$with_android_arch
fi
+AC_SUBST(ANDROID_ARCH)
AC_SUBST(ANDROID_NDK_HOME)
dnl ===================================================================
@@ -983,15 +1007,6 @@ AC_ARG_ENABLE(coretext,
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
-AC_ARG_WITH(android-ndk,
- AS_HELP_STRING([--with-android-ndk],
- [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
-,)
-
-AC_ARG_WITH(android-sdk,
- AS_HELP_STRING([--with-android-sdk],
- [Specify location of the Android SDK. Mandatory when building for Android.]),
-,)
AC_ARG_WITH(gnu-patch,
AS_HELP_STRING([--with-gnu-patch],