buildroot: 2018.1
uwsgi: 2.0.17.1
- 下载uwsgi源码包
https://uwsgi-docs.readthedocs.io/en/latest/Download.html
https://projects.unbit.it/downloads/uwsgi-2.0.17.1.tar.gz
- 复制python中pyconfig.h到uwsgi/plugins/python,并在uwsgi_python.h引用
#include <uwsgi.h>
#include <pyconfig.h>
#include <Python.h>
- 编译
CC=$BUILDROOT_HOST/bin/arm-xilinx-linux-gnueabi-gcc
CPP=$BUILDROOT_HOST/bin/arm-xilinx-linux-gnueabi-cpp
LDFLAGS='-L$BUILDROOT_HOST/arm-buildroot-linux-gnueabi/sysroot/usr/lib'
CPUCOUNT=2
$BUILD_ROOT_HOST/bin/python3
uwsgiconfig.py --build
- 相关错误
plugins/python/uwsgi_python.h:3:10: fatal error: Python.h: 没有那个文件或目录
error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
Exception: you need a C compiler to build uWSGI
lib/libz.so: file not recognized: File format not recognized
- 参考
http://matelakat.blogspot.com/2013/08/cross-compiling-uwsgi-with-buildroot.html