Netopeer2 ARM交叉编译

Netopeer2 ARM交叉编译

工具链

$ arm-broadcom-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-broadcom-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/opt/arm/usr/libexec/gcc/arm-broadcom-linux-gnueabi/4.7.3/lto-wrapper
Target: arm-broadcom-linux-gnueabi
Configured with: ./configure --prefix=/opt/arm/usr --sysconfdir=/opt/arm/etc --enable-shared --disable-static --disable-gtk-doc --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no --target=arm-broadcom-linux-gnueabi --with-sysroot=/opt/arm/usr/arm-broadcom-linux-gnueabi/sysroot --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --with-gmp=/opt/arm/usr --with-mpfr=/opt/arm/usr --enable-target-optspace --disable-libquadmath --enable-tls --disable-libmudflap --enable-threads --with-mpc=/opt/arm/usr --with-float=soft --disable-decimal-float --with-arch=armv7-a --with-tune=cortex-a9 --with-abi=aapcs-linux --with-float=soft --with-mode=thumb --with-pkgversion='Buildroot 2013.11' --with-bugurl=http://bugs.buildroot.net/ --enable-languages=c,c++ --with-build-time-tools=/opt/arm/usr/arm-broadcom-linux-gnueabi/bin --disable-libgomp --with-pkgversion='Broadcom Linux 3.6' --with-bug-url=http://www.broadcom.com
Thread model: posix
gcc version 4.7.3 (Broadcom Linux 3.6) 

依赖关系

sysrepo依赖:

libyang

protobuf(Google Protocol Buffers)

protobuf-c

libev

libredblack

netopeer2依赖:

libyang

libnetconf2

sysrepo

openssl

libssh

libyang依赖:

libpcre

cmake交叉编译配置

将下述内容include进源码的CMakeLists.txt中即可。

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm) 
SET(TOOLCHAIN_DIR "/opt/arm/usr")
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-broadcom-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-broadcom-linux-gnueabi-g++)

编译

编译器可执行文件路径(/opt/arm/usr/bin)需添加至PATH环境变量。

使用configure配置编译的情况,configure时使用--prefix=

  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值