@@ -3247,6 +3247,9 @@ then
32473247 # a lot of different things including 'define_xopen_source'
32483248 # in the case statement below.
32493249 case " $host " in
3250+ * -* -linux-android* )
3251+ ac_sys_system=Linux-android
3252+ ;;
32503253 * -* -linux* )
32513254 ac_sys_system=Linux
32523255 ;;
@@ -5640,21 +5643,32 @@ $as_echo_n "checking for the Android API level... " >&6; }
56405643cat >> conftest.c << EOF
56415644#ifdef __ANDROID__
56425645#include <android/api-level.h>
5643- __ANDROID_API__
5646+ android_api = __ANDROID_API__
5647+ arm_arch = __ARM_ARCH
56445648#else
56455649#error not Android
56465650#endif
56475651EOF
56485652
56495653if $CPP $CPPFLAGS conftest.c > conftest.out 2> /dev/null; then
5650- ANDROID_API_LEVEL=` grep -v ' ^#' conftest.out | grep -v ' ^ *$' `
5654+ ANDROID_API_LEVEL=` sed -n -e ' /__ANDROID_API__/d' -e ' s/^android_api = //p' conftest.out`
5655+ _arm_arch=` sed -n -e ' /__ARM_ARCH/d' -e ' s/^arm_arch = //p' conftest.out`
56515656 { $as_echo " $as_me :${as_lineno-$LINENO } : result: $ANDROID_API_LEVEL " >&5
56525657$as_echo " $ANDROID_API_LEVEL " >&6 ; }
56535658
56545659cat >> confdefs.h << _ACEOF
56555660#define ANDROID_API_LEVEL $ANDROID_API_LEVEL
56565661_ACEOF
56575662
5663+
5664+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for the Android arm ABI" >&5
5665+ $as_echo_n " checking for the Android arm ABI... " >&6 ; }
5666+ { $as_echo " $as_me :${as_lineno-$LINENO } : result: $_arm_arch " >&5
5667+ $as_echo " $_arm_arch " >&6 ; }
5668+ if test " $_arm_arch " = 7; then
5669+ BASECFLAGS=" ${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
5670+ LDFLAGS=" ${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
5671+ fi
56585672else
56595673 { $as_echo " $as_me :${as_lineno-$LINENO } : result: not Android" >&5
56605674$as_echo " not Android" >&6 ; }
@@ -9281,6 +9295,7 @@ then
92819295 then CCSHARED=" -fPIC" ;
92829296 else CCSHARED=" +z" ;
92839297 fi ;;
9298+ Linux-android* ) ;;
92849299 Linux* |GNU* ) CCSHARED=" -fPIC" ;;
92859300 BSD/OS* /4* ) CCSHARED=" -fpic" ;;
92869301 FreeBSD* |NetBSD* |OpenBSD* |DragonFly* ) CCSHARED=" -fPIC" ;;
@@ -9314,6 +9329,7 @@ then
93149329 LINKFORSHARED=" -Wl,-E -Wl,+s" ;;
93159330# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
93169331 BSD/OS/4* ) LINKFORSHARED=" -Xlinker -export-dynamic" ;;
9332+ Linux-android* ) LINKFORSHARED=" -pie -Xlinker -export-dynamic" ;;
93179333 Linux* |GNU* ) LINKFORSHARED=" -Xlinker -export-dynamic" ;;
93189334 # -u libsys_s pulls in all symbols in libsys
93199335 Darwin/* )
0 commit comments