cython 交叉编译arm .so

 

先贴个 setup.py 的脚本,前提是先安装好 arm-linux-gnueabihf-gcc 安装命令:sudo apt-get install gcc-arm-linux-gnueabihf  教程:https://blog.526net.com/?p=3121

 from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import os

os.environ[‘CC’] = ‘arm-linux-gnueabihf-gcc’
os.environ[‘LDSHARED’] = ‘arm-linux-gnueabihf-gcc -shared’
sysroot_args=[‘–sysroot’, ‘/path/to/xenial-armhf’]

setup(cmdclass = {‘build_ext’: build_ext},
ext_modules= [ Extension("core", ["core.py"]) ])

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注