changeset: 102292:46567fda0b29 user: Xavier de Gaye date: Sat Jul 09 11:05:42 2016 +0200 files: Misc/NEWS configure configure.ac pyconfig.h.in description: Issue #27442: Expose the Android API level in sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'. diff -r d56dc6327de8 -r 46567fda0b29 Misc/NEWS --- a/Misc/NEWS Fri Jul 08 16:44:54 2016 -0700 +++ b/Misc/NEWS Sat Jul 09 11:05:42 2016 +0200 @@ -132,6 +132,9 @@ Build ----- +- Issue #27442: Expose the Android API level that python was built against, in + sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'. + - Issue #27434: The interpreter that runs the cross-build, found in PATH, must now be of the same feature version (e.g. 3.6) as the source being built. diff -r d56dc6327de8 -r 46567fda0b29 configure --- a/configure Fri Jul 08 16:44:54 2016 -0700 +++ b/configure Sat Jul 09 11:05:42 2016 +0200 @@ -5648,6 +5648,32 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5 +$as_echo_n "checking for the Android API level... " >&6; } +cat >> conftest.c < +__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 '^ *$'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 +$as_echo "$ANDROID_API_LEVEL" >&6; } + +cat >>confdefs.h <<_ACEOF +#define ANDROID_API_LEVEL $ANDROID_API_LEVEL +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 +$as_echo "not Android" >&6; } +fi +rm -f conftest.c conftest.out + # Check for unsupported systems case $ac_sys_system/$ac_sys_release in atheos*|Linux*/1*) diff -r d56dc6327de8 -r 46567fda0b29 configure.ac --- a/configure.ac Fri Jul 08 16:44:54 2016 -0700 +++ b/configure.ac Sat Jul 09 11:05:42 2016 +0200 @@ -899,6 +899,25 @@ # checks for UNIX variants that set C preprocessor variables AC_USE_SYSTEM_EXTENSIONS +AC_MSG_CHECKING([for the Android API level]) +cat >> conftest.c < +__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*) diff -r d56dc6327de8 -r 46567fda0b29 pyconfig.h.in --- a/pyconfig.h.in Fri Jul 08 16:44:54 2016 -0700 +++ b/pyconfig.h.in Sat Jul 09 11:05:42 2016 +0200 @@ -12,6 +12,9 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS +/* The Android API level. */ +#undef ANDROID_API_LEVEL + /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754