Include Python static libraries to build Python-C extensions with static linking
Currently Python 2.7/3.5 in CrystaX NDK include only shared Python libs libpythonX.X.so. I'd like to be able to build Python-C statically-linked extensions with no external dependencies. Please include static libs libpythonX.X.a as well.
#3 Updated by Vitaly Murashev about 3 years ago
In order to have full control over static python libraries and more over to be able to play with python byte-code in any games,
first of all we need to have host pythons of the same major versions as we already have for target - python2.7 and python3.5
This task is almost done - remaining part https://tracker.crystax.net/issues/1354
Build target python core as static library.
This static is expected to self-consistent but with one external symbol - struct _frozen PyImport_FrozenModules
Now we can play with content of PyImport_FrozenModules and provide different levels of frozen modules:
- level-0) Absolute minimal content for PyImport_FrozenModules - means you need nothing except static python core
- level-1) Full content for PyImport_FrozenModules - means you have full access to python stdlib prebuilt as bytecode
- level-2) Custom content for PyImport_FrozenModules - nearly the same what different freezing toools do (like cx_Freeze or others)
#4 Updated by Vitaly Murashev about 3 years ago
Custom content for PyImport_FrozenModules
To make sure that everything works well here I decided to compile a completely static python interpreter without depends on any dynamic libraries. In this interpreter PyImport_FrozenModules list is filled full python-stdlib being frozen as byte-code.
Actual python-freezing tool adapted for CrystaX can be implemented lately when it is really needed - not as a part of this task.
#5 Updated by Vitaly Murashev about 3 years ago
pull request: https://github.com/crystax/android-platform-ndk/pull/3