标签:
Easycwmp是一个和snmp差不多的协议。
1.首先看下需要依赖的软件:
curl-7.29.0
easycwmp-1.2.3
json-c-0.11
libmicroxml-2012-06-11
libubox-2013-10-19
lua-5.1.4
ubus-2013-08-08
uci-2013-06-11.1
2.开始以此移植
curl-7.29.0
#!/bin/sh ./configure --target=mips-linux --host=mips-linux --prefix=$PWD/../install
json-c-0.11
#!/bin/bash PRJ_PATH=`pwd` CROSS=/opt/toolchain-mips-gcc433/usr/bin/mips-linux- make distclean autoreconf -i export CC=${CROSS}gcc export CPP=${CROSS}cpp export AS=${CROSS}as export LD=${CROSS}ld export AR=${CROSS}ar export RANLIB=${CROSS}ranlib export STRIP=${CROSS}strip export ac_cv_func_malloc_0_nonnull=yes export ac_cv_func_realloc_0_nonnull=yes export ac_cv_have_decl_isinf=yes export ac_cv_have_decl_isnan=yes #export LDFLAGS += -lm ./configure --disable-dependency-tracking --with-gnu-ld --target=mips-linux --host=mips-linux --prefix=${PRJ_PATH}/../install
libmicroxml-2012-06-11
#!/bin/sh ./configure --target=mips-linux --host=mips-linux --prefix=$PWD/../install
libubox-2013-10-19
SET(CMAKE_SYSTEM_NAME Linux) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/include) LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/lib) #SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) #SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) #SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_C_COMPILER /opt/toolchain/bin/mips-linux-gcc) SET(CMAKE_CXX_COMPILER /opt/toolchain/bin/mips-linux-g++)
#!/bin/sh cmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=$PWD/../install
uci-2013-06-11.1
SET(CMAKE_SYSTEM_NAME Linux)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/include)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/lib)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_C_COMPILER /opt/toolchain/bin/mips-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/toolchain/bin/mips-linux-g++)
#!/bin/sh
cmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=$PWD/../install
ubus-2013-08-08
SET(CMAKE_SYSTEM_NAME Linux) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/include) LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../install/lib) #SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) #SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) #SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_C_COMPILER /opt/toolchain/bin/mips-linux-gcc) SET(CMAKE_CXX_COMPILER /opt/toolchain/bin/mips-linux-g++)
#!/bin/sh ccmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=$PWD/../install
easycwmp-1.2.3
#!/bin/sh ./configure --target=mips-linux --host=mips-linux --prefix=$PWD/../install LIBCURL_CFLAGS="-I$PWD/../install/include" LIBCURL_LIBS="-L$PWD/../install/lib -lcurl" MICROXML_CFLAGS="-I$PWD/../install/include" MICROXML_LIBS="-L$PWD/../install/lib -lmicroxml -lpthread" CFLAGS="-I$PWD/../install/include" LDFLAGS="-L$PWD/../install/lib" LIBS="-ljson-c "
配置文件只需要修改服务器的地址和端口即可
最后程序运行
ubusd &
easycwmpd -b -f &
标签:
原文地址:http://www.cnblogs.com/umbrellary/p/5091223.html