下载zlib
wget https://zlib.net/current/zlib.tar.gz
./configure
make
sudo make install
下载python3.9.5
wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz
tar zxvf Python-3.9.5.tgz
cd Python-3.9.5/
./configure --prefix=$PWD/…/install_x86 --enable-shared
make
make install
make distclean
交叉编译
zlib
./configure --prefix=$PWD/…/install CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ --host=arm-none-linux-gnueabi
make
make install
export PATH=/home/ye/install_x86/bin: P A T H e x p o r t L D L I B R A R Y P A T H = / h o m e / y e / i n s t a l l x 86 / l i b : PATH export LD_LIBRARY_PATH=/home/ye/install_x86/lib: PATHexportLDLIBRARYPATH=/home/ye/installx86/lib:LD_LIBRARY_PATH
python3.9.5
./configure --prefix=$PWD/…/install --enable-shared
make
make install
make distclean