Yes, it is possible, but if you have a hand on the python interpreter. What I will tell was done for python on the IOS platform. You need to check again how to tell python about your module if you don't want to touch the original python interpreter (replace TEST everywhere with your own / libname tag).
One possible way to do this is:
Compile your own python with the dynload patch , which prefers not to dlopen () your module, but use dlsym () directly to check if the module is in memory.
Create libTEST.a, including all .o created during the build process (not .so). You can usually find it in build/temp.* And do something like this:
ar rc libTEST.a build/temp.*/*.o ranlib libTEST.a
When compiling the main executable, you need to add a dependency to this new libTEST.a by adding to the compilation command line:
-lTEST -L.
The result will provide you with an executable with all the character from your cython modules, and python will be able to look for them in memory.
(As an example, I use an extended shell that redirects ld at compile time so as not to create .so and create .a at the end. On kivy-ios , you can grab the liblink that is used to create the .o and biglink that is used to capture all .o in directories and create .a. You can see how it is used in build_kivy.sh )
tito Dec 06 '11 at 11:16 2011-12-06 11:16
source share