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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值