[issue30386] Add a build infrastructure for Android

Xavier de Gaye report at bugs.python.org
Fri May 19 09:21:01 EDT 2017


Xavier de Gaye added the comment:

Commited 'bpo-30386: Support the new NDK Unified Headers'.

This does fix the missing declarations in the NDK headers and android-api-24.patch is not needed now.
It also fixes the missing declaration of sethostname() at API 24 that caused the import of the _socket module to fail.
More surprisingly it also fixes the compilation failure with 32 bits architectures (the size of off_t is now 8 instead of 4 previously) and issue29619.patch is not needed now.
Only one version of the NDK is supported, currently it is android-ndk-r14 the latest stable release.
The '-Wno-nullability-completeness' compilation flag is needed to avoid a flow of warnings in the processing of some NDK headers.

Unified Headers comes with a new annoying problem: langinfo.h exists now but nl_langinfo() is intentionaly not declared except for the __ANDROID_API_FUTURE__ API level
which is reserved for the development of the NDK itself. The solution chosen here is:
* Undefine HAVE_LANGINFO_H and CODESET in Include/pyport.h to maintain the status quo in the Python code.
* The Makefile generated by makesetup runs a script at configure time that checks that nl_langinfo() is not declared and aborts the build otherwise.  This allows to detect when langinfo.h starts being not broken anymore when swicthing to a new version of the NDK. In that case the following steps should be taken upon swicthing to this new version:
  + Remove this script from the build system (obviously).
  + Remove the changes in Include/pyport.h.
  + Revert the changes made in issue 28596.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30386>
_______________________________________


More information about the Python-bugs-list mailing list