Search
lxdream.org :: lxdream/m4/android.m4 :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename m4/android.m4
changeset 1255:d63f73cc586f
prev1245:01e0020adf88
author nkeynes
date Sun Mar 04 20:56:40 2012 +1000 (7 years ago)
permissions -rw-r--r--
last change Add support for armv7-a abi and make it the default - it's a good bit faster
file annotate diff log raw
1.1 --- a/m4/android.m4 Fri Mar 02 23:49:10 2012 +1000
1.2 +++ b/m4/android.m4 Sun Mar 04 20:56:40 2012 +1000
1.3 @@ -8,6 +8,7 @@
1.4 AC_ARG_WITH( android-ndk, AS_HELP_STRING( [--with-android-ndk=NDK], [Specify the location of the Android NDK] ) )
1.5 AC_ARG_WITH( android-version, AS_HELP_STRING( [--with-android-version], [Specify target Android SDK version]), [], [with_android_version="android-11"] )
1.6 AC_ARG_WITH( android-ndk-version, AS_HELP_STRING( [--with-android-version], [Specify target Android NDK version]), [], [with_ndk_version="android-9"] )
1.7 + AC_ARG_WITH( android-abi, AS_HELP_STRING( [--with-android-abi], [Specify target Android ABI]), [], [ANDROID_ABI="armeabi-v7a"] )
1.8
1.9 if test "x$with_android" != "x"; then
1.10 if test "$with_android" = "yes"; then
1.11 @@ -26,8 +27,11 @@
1.12 AC_CHECK_FILE( [$ANDROID_SDK_HOME/platforms/$ANDROID_SDK_VERSION/sdk.properties], [], [ AC_MSG_ERROR([Android platform version $ANDROID_SDK_VERSION not found in $ANDROID_SDK_HOME]) ])
1.13 AC_CHECK_FILE( [$ANDROID_NDK_HOME/toolchains], [], [ AC_MSG_ERROR([Android NDK not found in $ANDROID_NDK_HOME]) ])
1.14
1.15 - case $host_alias in
1.16 - arm-* | "")
1.17 + dnl common flags
1.18 + TARGETFLAGS="-ffunction-sections -funwind-tables -fomit-frame-pointer -DANDROID -Wa,--noexecstack"
1.19 +
1.20 + case $ANDROID_ABI in
1.21 + armeabi | armeabi-v7a)
1.22 host_alias="arm-linux-androideabi"
1.23 host_cpu="arm"
1.24 host_vendor="unknown";
1.25 @@ -35,10 +39,15 @@
1.26 ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/*/bin`
1.27 ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/gdbserver`
1.28 ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_NDK_VERSION/arch-arm"
1.29 - TARGETFLAGS="-ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wno-psabi -Wa,--noexecstack"
1.30 - TARGETFLAGS="$TARGETFLAGS -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -mthumb -Os"
1.31 + dnl Common ARM flags
1.32 + TARGETFLAGS="$TARGETFLAGS -fstack-protector -finline-limit=64 -fno-strict-aliasing -Wno-psabi -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__"
1.33 + if test "x$with_abi" = "armeabi"; then
1.34 + TARGETFLAGS="$TARGETFLAGS -march=armv5te -mtune=xscale -msoft-float"
1.35 + else
1.36 + TARGETFLAGS="$TARGETFLAGS -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfp"
1.37 + fi
1.38 ;;
1.39 - i686-*)
1.40 + x86)
1.41 host_alias="i686-android-linux"
1.42 host_cpu="i686"
1.43 host_vendor="android"
1.44 @@ -46,10 +55,10 @@
1.45 ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/*/bin`
1.46 ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/gdbserver`
1.47 ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_NDK_VERSION/arch-x86"
1.48 - TARGETFLAGS=""
1.49 + TARGETFLAGS="$TARGETFLAGS -finline-limit=300 -fno-rtti -funswitch-loops -fstrict-aliasing"
1.50 ;;
1.51 *)
1.52 - AC_MSG_ERROR([Unsupported android host $host_alias])
1.53 + AC_MSG_ERROR([Unsupported android ABI $ANDROID_ABI])
1.54 ;;
1.55 esac
1.56
1.57 @@ -67,6 +76,7 @@
1.58 LDFLAGS="-nostdlib -Wl,--no-undefined -L${ANDROID_SYSROOT}/usr/lib -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib -Wl,-allow-shlib-undefined -Wl,-z,noexecstack $LDFLAGS"
1.59 LIBS="$LIBS -liconv -landroid -llog -lgcc -lc -lm"
1.60
1.61 + AC_SUBST(ANDROID_ABI)
1.62 AC_SUBST(ANDROID_SDK_HOME)
1.63 AC_SUBST(ANDROID_NDK_HOME)
1.64 AC_SUBST(ANDROID_SDK_VERSION)
.