OpenWrt Libubox transplanted to arm

Source: Internet
Author: User
Tags json

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





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.