您的位置:首页 > 运维架构 > Linux

交叉编译hostapd的方法

2017-01-03 17:51 316 查看
在调试wifi的过程中,需要使用到其Ap模式。折腾许久,在这里将方法记录下来,供以后查阅。

1. 进入hostapd目录,打开 .config 文件,选择合适的驱动。此处我选择 nl80211 的模式。此时直接编译会出现错误的信息。

通过查阅资料发现需要 添加一个 libnl 的库。其2.0以上版本,API 接口有改变。这里下载了 libnl1.*.*  的库文件进行编译。

编译方法如下:

./configure --prefix=/home/anyone/wifi/libnl --host=arm-linux其中 --prefix指定编译好后make install的路径。
2 、make3、
make install

此时在libnl的文件夹下就可以看见include的头文件以及lib目录下的库文件。libnl编译完成。

接下来编译hostapd工具

进入hostapd的.config文件进行配置

CONFIG_DRIVER_NL80211=y
# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be
# shipped with your distribution yet. If that is the case, you need to build
# newer libnl version and point the hostapd build to use it.
LIBNL=/your libnl path
CFLAGS += -I$(LIBNL)/include
LIBS += -L$(LIBNL)/lib
其中LIBNL变量表示你的libnl的文件地址。

make之后即可得到 hostapd的应用程序。hostapd程序编译成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux hostapd wi-fi