Due to the needs of the project, the need to openwrt on the Libubox library to arm, Libubox is OpenWrt base library, is an event-driven library, specific to the OPENWRT official online to understand.
Host for Ubuntu 10.04 cross-compiler toolchain version ARM-LINUX-GCC 4.5.1, Target machine for s3c6410/s5pv210
The source code is libubox-2014-08-04-dffbc09baf71b294185a36048166d00066d433b5.tar.gz, this library relies on the JSON-C library, so first porting the Json-c library ( json-c-0.11.tar.gz).
Json-c transplant is relatively simple, do not elaborate, the following steps:
1. Extracting Source code
2. Modify the Config.h.in file to remove the following lines
/* Define to Rpl_malloc if the replacement function should is used. */
#undef malloc
/* Define to Rpl_realloc if the replacement function should is used. */
#undef realloc
3../configure--host=arm-linux--prefix=/root/softwares/openwrt-a8/json-c
4. Make
5. Make install
Follow these steps to generate a library file
Libubox transplant, because Libubox does not have configure and the like, need to use cmake generation Makefile,cmake if not, please install it yourself. The specific steps are as follows:
1. Decompression Libubox Source code
2. Revise the CMakeList.txt file and add the following sentence at the beginning of the document:
#告知当前使用的是交叉编译方式, you must configure
SET (Cmake_system_name Linux)
#指定C交叉编译器, you must configure
#或交叉编译器使用绝对地址
SET (Cmake_c_compiler "ARM-LINUX-GCC")
#指定C + + Cross Compiler
SET (Cmake_cxx_compiler "arm-linux-g++")
#json the path to the-C header file
Include_directories ("/root/softwares/openwrt-a8/json-c/include/json-c")
#json-C Library file path
Link_directories ("/root/softwares/openwrt-a8/json-c/lib")
3.make
Create a library file in the root directory of the source code