星期五, 11月 25, 2022

CPython

 Cross-compile Python for use on armv7l


Cross compiling python for aarch64


#!/bin/bashset -x -eexport HOST_ARCH=aarch64-linux-gnuexport TOOL_PREFIX=/home/username/aarch64-linux-toolchain/bin/$HOST_ARCH
export CXX=$TOOL_PREFIX-g++
export CPP="$TOOL_PREFIX-g++ -E"export AR=$TOOL_PREFIX-arexport RANLIB=$TOOL_PREFIX-ranlibexport CC=$TOOL_PREFIX-gccexport LD=$TOOL_PREFIX-ldexport READELF=$TOOL_PREFIX-readelfexport LDLAST="-lgcov"./configure --host=$HOST_ARCH --target=$HOST_ARCH --build=x86_64-pc-linux-gnu --prefix=$HOME/temp --disable-ipv6 ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-shared --with-zlib-dir=/usr/lib64 --with-ensurepip=yes --enable-optimizationmake BLDSHARED="$TOOL_PREFIX-gcc -shared" CROSS-COMPILE=$TOOL_PREFIX- CROSS_COMPILE_TARGET=yessudo make install BLDSHARED="$TOOL_PREFIX-gcc -shared" CROSS-COMPILE=$TOOL_PREFIX- CROSS_COMPILE_TARGET=yes prefix=$HOME/Python-$HOST_ARCH/_install

沒有留言: