下载地址
https://github.com/pocoproject/poco/releases
以上链接下,有各个版本的源码下载。
编译环境
Ubuntu 18.04.3 LTS
编译配置
假设:
- 交叉编译工具:arm-linux-
使用的交叉编译工具版本信息如下:Target: arm-linux-gnueabi Configured with: --target=arm-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --disable-nls --enable-clocale=gnu --enable-libgomp --disable-libitm --enable-poison-system-directories Thread model: posix gcc version 6.3.0
- 交叉编译结果安装目录:/home/user/cross-compile/
编译配置如下:
./configure --prefix=/home/user/cross-compile/poco --config=ARM-Linux --minimal --static --shared --no-tests --no-samples
- –prefix:指定安装目录
- –config=ARM-Linux:指定编译使用的配置文件
- –shared:编译生成.so动态库
- –static:编译生成.a静态库
以上配置为最小化编译,仅编译如下库: - PocoEncodings
- PocoFoundation
- PocoJSON
- PocoNet
- PocoRedisd
- PocoUtil
- PocoXML
如果需要编译其他工具,另外需要提前编译对应的开源软件,例如openssl,或者sqilte等。
然后修改build/config/ARM-Linux文件,将TOOL修改为目标芯片的交叉编译工具:
#
# General Settings
#
LINKMODE ?= SHARED
TOOL ?= arm-linux
POCO_TARGET_OSNAME = Linux
POCO_TARGET_OSARCH ?= armv7l
修为完保存后,编译即可。
make
make install