Python Forum

Full Version: cross-compiling python with zlib support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi There
Has anybody ever tried to cross-compile python with zlib support for another architecture?
I'm trying to cross-compile Python for my embedded ARM system.

here are the triplets:

HOST = arm-linux-musleabi
BUILD = x86_64-linux-gnu



I've already cross-compiled python without zlib support and it sort of works. I'm running it on my Android
Phone.

Here's a Screenshot:
https://drive.google.com/file/d/1vTVqtRl...PVFCi/view

The configure command i give to produce Python is this

../Python-2.7.14/configure --host=arm-linux-musleabi --build=x86_64-linux-gnu --prefix=/home/michele/PythonAndroid/prefix/python2 --disable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no | tee ../python2-configure.log

how do I add zlib support?

I have installed zlib inside my cross-compiler and I have uncommented a line inside the file (build_dir)/Modules/Setup to force the building of the zlib module but it doesn't work.
you may want to take a look at MicroPython: https://micropython.org/
@Larz60+
Thanks a lot for the reply, but I still would like to cross-compile the whole Python distribution using my arm-linux-musleabi cross-compiler. I'm doing it for the sake of learning. It might be cool if I succeed in doing this.

Python's make program says that I should take a look at the setup.py inside the source tree to look for what's missing to build the module.. but I don't know how to adapt that file so it can find the zlib.h and libz.so library
The module of zlib that i'm trying to cross-compile is inside the main python distribution. the setup.py file is not one of an ordinary program but the one of the python package
Hi and sorry for bringing up that thread again!

I have exactly the the same problem as michelebucca. Did you ever succeed in building Python with zlib support?

Cheers,
Marcus