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=