Cross-compiling GNU libmicrohttpd for OpenWRT

As a small introductory task to get GNUnet to run on small devices I started to cross- compile libmicrohttpd on my desktop computer for a router running OpenWRT.

This is not intended as a from scratch documentation, I used my notebook which already had all the development tools required for GNUnet installed, so when you start from scratch there are perhaps some more requirements.

The OpenWRT documentation is quite good but here a summary what I finally did to get libmicrohttpd to compile.

The first steps is to install the OpenWRT cross-compiling toolchain on your system. Here you can stick to the OpenWRT documentation, that worked fine for me.

OpenWrt Buildroot – Installation
http://wiki.openwrt.org/doc/howto/buildroot.exigence

OpenWrt Buildroot – Usage
http://wiki.openwrt.org/doc/howto/build

Now you have the tool chain installed.

You can find information about the cross-compiling process here:
http://wiki.openwrt.org/doc/devel/crosscompile

Here some basic information about my installation:

Target plattform: Atheros AR71xx/AR7240/AR913x/AR934x
Target plattform toolchain: toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32
OpenWRT buildroot path: /opt/dev/openwrt/trunk

So you shoud set the following environmental variables (in a script):

export STAGING_DIR=/opt/dev/openwrt/trunk/staging_dir
export TOOLCHAIN_DIR=$STAGING_DIR/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32
export PATH=$STAGING_DIR/bin:$PATH

export LDCFLAGS=$TOOLCHAIN_DIR/usr/lib/
export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/usr/lib/

Checkout libmicrohttpd

svn co https://gnunet.org/svn/libmicrohttpd ./mhd-openwrt

Configure and make:

cd mhd-openwrt
./bootstrap
./configure --prefix=$TOOLCHAIN_DIR --host=mips-openwrt-linux-uclibc --disable https

For GNU make, override the CC and LD environment variables and compile with:

make CC=mips-openwrt-linux-uclibc-gcc LD=mips-openwrt-linux-uclibc-ld
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值