Kaydet (Commit) 377d16bf authored tarafından Michael Meeks's avatar Michael Meeks

android: add --with-android-arch to make space for an x86 target

üst 9b957655
...@@ -109,6 +109,23 @@ fi ...@@ -109,6 +109,23 @@ fi
dnl =================================================================== dnl ===================================================================
dnl When building for Android the --with-android-ndk is mandatory dnl When building for Android the --with-android-ndk is mandatory
dnl =================================================================== 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= ANDROID_NDK_HOME=
if test -n "$with_android_ndk"; then if test -n "$with_android_ndk"; then
ANDROID_NDK_HOME=$with_android_ndk ANDROID_NDK_HOME=$with_android_ndk
...@@ -116,20 +133,27 @@ if test -n "$with_android_ndk"; then ...@@ -116,20 +133,27 @@ if test -n "$with_android_ndk"; then
# What if the NDK at some point starts including several toolchains for different # What if the NDK at some point starts including several toolchains for different
# gcc versions (like some 3rd-party improved NDK builds already do)? # gcc versions (like some 3rd-party improved NDK builds already do)?
# Then the use of a wildcard below will break. # Then the use of a wildcard below will break.
ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-linux*/prebuilt/*/bin` 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-arm test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$with_android_arch
test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ar test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ar
test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-nm test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-nm
test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-objdump test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-objdump
test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ranlib test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ranlib
test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-strip test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-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" 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"
test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-gcc $ANDROIDCFLAGS" 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"
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" 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 fi
AC_SUBST(ANDROID_ARCH)
AC_SUBST(ANDROID_NDK_HOME) AC_SUBST(ANDROID_NDK_HOME)
dnl =================================================================== dnl ===================================================================
...@@ -983,15 +1007,6 @@ AC_ARG_ENABLE(coretext, ...@@ -983,15 +1007,6 @@ AC_ARG_ENABLE(coretext,
dnl =================================================================== dnl ===================================================================
dnl Optional Packages (--with/without-) dnl Optional Packages (--with/without-)
dnl =================================================================== 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, AC_ARG_WITH(gnu-patch,
AS_HELP_STRING([--with-gnu-patch], AS_HELP_STRING([--with-gnu-patch],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment