iw命令移植(arm)

来源:互联网 发布:好源码分享 编辑:程序博客网 时间:2024/04/30 22:42
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

原创粉丝点击