libnl-1.1 移植到ARM Linux

1 下载地址:http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz

     或者:http://packages.ubuntu.com/oneiric/libnl1


2 最好不要用最新的libnl。


libnl简介:

libnl is a library for applications dealing with netlink sockets. The library provides an interface for raw netlink messaging and various netlink family specific interfaces.

libnl是为了方便应用程序使用netlink接口而开发的一个库。这个库为原始netlink消息传递以及不同的netlink family专用接口提供了一个统一的接口。

   

The API of libnl-2.0 is not compatible with libnl-1.0. Your application may break without adjustment of API usage.

libnl2.0的API与libnl1.0的API并不兼容。如果您的应用程序不做相应调整,将可能导致不可用。

注:

移植libnl1.1是hostapd的移植的一部分。hostapd使用的libnl库为1.x版本,2.0版本的API与1.0的并不兼容,故这里移植1.1版本,但2.0移植方式相同。

移植:

开发环境:

ubuntu 10.04

arm-linux-gcc version 4.4.1

目标环境

友善之臂mini6410

linux-2.6.36

步骤

1.至官网下载libnl1.1,解压缩,cd进入libnl目录
2.执行./configure -prefix=/usr/local/libnl,配置libnl安装路径
3.执行make CC=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc,完成编译,得到libnl库
4.执行su,输入密码,以root身份登录,执行make install,将libnl库安装至/usr/local/libnl路径下


5.将/usr/local/arm/libnl1.1/lib下所有文件拷贝至开发板的/lib目录下,确保hostapd在开发板上运行,能够正确找到libnl库的位置

/usr/local/libnl/lib/下所有文件拷贝至开发板的/lib目录下,确保hostapd在开发板上运行,能够正确找到libnl库的位置

推荐网址:

http://www.infradead.org/~tgr/libnl/



QA: 1 在make的时候出现错误:


In file included from addr.c:28:
../include/netlink-local.h: In function '__str2type':
../include/netlink-local.h:218: error: 'ULONG_MAX' undeclared (first use in this function)
../include/netlink-local.h:218: error: (Each undeclared identifier is reported only once
../include/netlink-local.h:218: error: for each function it appears in.)
../include/netlink-local.h: In function '__list_str2type':
../include/netlink-local.h:239: error: 'ULONG_MAX' undeclared (first use in this function)
../include/netlink-local.h: In function '__dp_dump':
../include/netlink-local.h:277: warning: ignoring return value of 'vasprintf', declared with attribute warn_unused_result
make[2]: *** [addr.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2




解决方法是:在vi include/netlink-local.h 里面增加头文件#include <limits.h>然后继续编译.

你可能感兴趣的:(libnl-1.1 移植到ARM Linux)