summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-07-09 09:05:42 (GMT)
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-07-09 09:05:42 (GMT)
commit95750b1ca535a9883d483ee82b4373fb47d82bc5 (patch)
treee6e83f7702a3e2fb2639404230dc83eeb4a9706c /configure.ac
parent2247e5c48c71e76e44218bfab29129ce0462760c (diff)
downloadcpython-95750b1ca535a9883d483ee82b4373fb47d82bc5.zip
cpython-95750b1ca535a9883d483ee82b4373fb47d82bc5.tar.gz
cpython-95750b1ca535a9883d483ee82b4373fb47d82bc5.tar.bz2
Issue #27442: Expose the Android API level in sysconfig.get_config_vars()
as 'ANDROID_API_LEVEL'.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9b65ec1..7c83ca6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -899,6 +899,25 @@ AC_SUBST(NO_AS_NEEDED)
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
+AC_MSG_CHECKING([for the Android API level])
+cat >> conftest.c <<EOF
+#ifdef __ANDROID__
+#include <android/api-level.h>
+__ANDROID_API__
+#else
+#error not Android
+#endif
+EOF
+
+if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
+ ANDROID_API_LEVEL=`grep -v '^#' conftest.out | grep -v '^ *$'`
+ AC_MSG_RESULT([$ANDROID_API_LEVEL])
+ AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API level.])
+else
+ AC_MSG_RESULT([not Android])
+fi
+rm -f conftest.c conftest.out
+
# Check for unsupported systems
case $ac_sys_system/$ac_sys_release in
atheos*|Linux*/1*)