0. 环境准备
下载 :https://www.linuxfromscratch.org/blfs/view/svn/basicnet/wireless_tools.html
1. 交叉编译wireless_tools
tar xzf wireless_tools.29.tar.gz
cd wireless_tools.29/
打开Makefile,修改配置:
## Compiler to use (modify this for cross compile).
CC = arm-anykav500-linux-uclibcgnueabi-gcc
## Other tools you need to modify for cross compile (static lib only).
AR = arm-anykav500-linux-uclibcgnueabi-ar
RANLIB = arm-anykav500-linux-uclibcgnueabi-ranlib## Uncomment this to build tools using static version of the library.
## Mostly useful for embedded platforms without ldd, or to create
## a local version (non-root).
BUILD_STATIC = y## Uncomment this to strip binary from symbols. This reduce binary size.
## by a few percent but make debug worse...
BUILD_STRIPPING = y
编译
make
make PREFIX=/home/linux/tmp/wireless_tools/install install
2. 工具运行
编译完成后,可以看到工具:
linux@linux-MS-7D22:~/tmp/wireless_tools/install$ ls
include lib man sbin
linux@linux-MS-7D22:~/tmp/wireless_tools/install$ ls sbin/
ifrename iwconfig iwevent iwgetid iwlist iwpriv iwspy
设备端执行工具:
/mnt/install/sbin # ./ifrename -v
ifrename Wireless-Tools version 29