iw命令移植(arm)

http://blog.csdn.net/lqrensn/article/details/9110897
http://www.aichengxu.com/view/35939
http://blog.chinaunix.net/uid-22028680-id-3574122.html
http://www.xuebuyuan.com/2044392.html
http://blog.csdn.net/robertsong2004/article/details/40044947
http://www.infradead.org/~tgr/libnl/
获得 iw

iw发布压缩包可以从这里获取: http://kernel.org/pub/software/network/iw/.

另外,你也可以从 git 下载 iw: http://git.kernel.org/?p=linux/kernel/git/jberg/iw.git.
iw编译
需要libnl
编译libnl
./configure –host=arm-linux –prefix=/home/jieen/workspace/third/wirelesscmd/build_libnl_arm CC=arm-linux-gcc
make
出现:
addr.c:1027: error: ‘AF_RDS’ undeclared here (not in a function)
addr.c:1033: error: ‘AF_CAN’ undeclared here (not in a function)
addr.c:1034: error: ‘AF_TIPC’ undeclared here (not in a function)
addr.c:1038: error: ‘AF_ISDN’ undeclared here (not in a function)
addr.c:1039: error: ‘AF_PHONET’ undeclared here (not in a function)
屏蔽掉代码中的上述几行,再
make
make install
编译iw
export PKG_CONFIG_PATH=/home/jieen/workspace/third/wirelesscmd/build_libnl_arm/lib/pkgconfig
make CC=arm-linux-gcc
编译出现
error: implicit declaration of function ‘htole16’
发现glibc太老了的缘故,后期版本有此函数,不过直接添加
在info.c的代码前面添加
//add by jieen used little endian

if 0

define htole16(X) (X)

else

define htole16(X) (((((uint16_t)(X)) << 8) | ((uint16_t)(X) >> 8)) & 0xffff)

endif

编译成功,生成iw。
在开发板./iw not found,才发现/lib目录下没有动态库
重新编译busybox使用动态库(节省点空间)
在生成ramfs时加入动态库文件,可以从交叉编译工具链目录下复制过来。
在ramfs/etc/profile加入相关环境变量配置
export PATH=.:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root
export LD_LIBRARY_PATH=./lib:/usr/lib:/usr/local/lib:/root

你可能感兴趣的:(iw命令移植(arm))