bpo-29040: Support building Android with Unified Headers (GH-4492) · python/cpython@c06c22e (original) (raw)
4 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -784,7 +784,9 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler; | ||
784 | 784 | #endif /* Py_BUILD_CORE */ |
785 | 785 | |
786 | 786 | #ifdef __ANDROID__ |
787 | -#include <android/api-level.h> | |
787 | +/* The Android langinfo.h header is not used. */ | |
788 | +#undef HAVE_LANGINFO_H | |
789 | +#undef CODESET | |
788 | 790 | #endif |
789 | 791 | |
790 | 792 | /* Maximum value of the Windows DWORD type */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 | +Support building Android with Unified Headers. The first NDK release to | |
2 | +support Unified Headers is android-ndk-r14. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5611,7 +5611,6 @@ asecho"as_echo "asecho"ac_cv_safe_to_define___extensions__" >&6; } | ||
5611 | 5611 | $as_echo_n "checking for the Android API level... " >&6; } |
5612 | 5612 | cat >> conftest.c <<EOF |
5613 | 5613 | #ifdef __ANDROID__ |
5614 | -#include <android/api-level.h> | |
5615 | 5614 | android_api = __ANDROID_API__ |
5616 | 5615 | arm_arch = __ARM_ARCH |
5617 | 5616 | #else |
@@ -5624,6 +5623,10 @@ if CPPCPP CPPCPPFLAGS conftest.c >conftest.out 2>/dev/null; then | ||
5624 | 5623 | _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out` |
5625 | 5624 | { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 |
5626 | 5625 | asecho"as_echo "asecho"ANDROID_API_LEVEL" >&6; } |
5626 | +if test -z "$ANDROID_API_LEVEL"; then | |
5627 | +echo 'Fatal: you must define __ANDROID_API__' | |
5628 | +exit 1 | |
5629 | +fi | |
5627 | 5630 | |
5628 | 5631 | cat >>confdefs.h <<_ACEOF |
5629 | 5632 | #define ANDROID_API_LEVEL $ANDROID_API_LEVEL |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -885,7 +885,6 @@ AC_USE_SYSTEM_EXTENSIONS | ||
885 | 885 | AC_MSG_CHECKING([for the Android API level]) |
886 | 886 | cat >> conftest.c <<EOF |
887 | 887 | #ifdef __ANDROID__ |
888 | -#include <android/api-level.h> | |
889 | 888 | android_api = __ANDROID_API__ |
890 | 889 | arm_arch = __ARM_ARCH |
891 | 890 | #else |
@@ -897,6 +896,10 @@ if CPPCPP CPPCPPFLAGS conftest.c >conftest.out 2>/dev/null; then | ||
897 | 896 | ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out` |
898 | 897 | _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out` |
899 | 898 | AC_MSG_RESULT([$ANDROID_API_LEVEL]) |
899 | + if test -z "$ANDROID_API_LEVEL"; then | |
900 | + echo 'Fatal: you must define __ANDROID_API__' | |
901 | + exit 1 | |
902 | + fi | |
900 | 903 | AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API level.]) |
901 | 904 | |
902 | 905 | AC_MSG_CHECKING([for the Android arm ABI]) |