码迷,mamicode.com
首页 > 其他好文 > 详细

Easycwmp移植与配置笔记

时间:2015-12-31 12:26:08      阅读:960      评论:0      收藏:0      [点我收藏+]

标签:

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 &

 

Easycwmp移植与配置笔记

标签:

原文地址:http://www.cnblogs.com/umbrellary/p/5091223.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!