参考文章:https://blog.csdn.net/lyndon_li/article/details/120354679
一、hostapd编译
1、libnl
tar -xvf libnl-3.2.25.tar.gz
cd libnl-3.2.25/
mkdir _install
sudo chmod 777 -R ../libnl-3.2.25
./configure CC=arm-linux-gnueabihf-gcc --prefix=$(pwd)/_install --host=arm-linux-gnueabihf
make
make install
2、openssl
tar -xvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a/
mkdir _install
sudo chmod 777 -R ../openssl-1.1.1a
./Configure no-asm shared --prefix=$(pwd)/__install --cross-compile-prefix=arm-linux-gnueabihf- linux-armv4
make
make install
3、hostapd
tar -xvf hostapd-2.9.tar.gz
cd hostapd-2.9/hostapd
sudo chmod 777 -R ../../hostapd-2.9
cp defconfig .config
vim .config
CONFIG_LIBNL32=y
+CFLAGS += -I /home/johan/share/268/wifi/libnl-3.2.25/_install/include/libnl3
+LIBS += -L /home/johan/share/268/wifi/libnl-3.2.25/_install/lib
+CFLAGS += -I /home/johan/share/268/wifi/openssl-1.1.1a/_install/include
+LIBS += -L /home/johan/share/268/wifi/openssl-1.1.1a/_install/lib
vim Makefile
+CC=arm-linux-gnueabihf-gcc
ifndef CC
CC=gcc
endif
make
二、wpa_supplicant编译
tar -xvf wpa_supplicant-2.9.tar.gz
cd wpa_supplicant-2.9/wpa_supplicant/
sudo chmod 777 -R ../wpa_supplicant/
cp defconfig .config
vim .config
CONFIG_LIBNL32=y
+CFLAGS += -I /home/johan/share/268/wifi/libnl-3.2.25/_install/include/libnl3
+LIBS += -L /home/johan/share/268/wifi/libnl-3.2.25/_install/lib
+CFLAGS += -I /home/johan/share/268/wifi/openssl-1.1.1a/_install/include
+LIBS += -L /home/johan/share/268/wifi/openssl-1.1.1a/_install/lib
vim Makefile
+CC=arm-linux-gnueabihf-gcc
ifndef CC
CC=gcc
endif
make
报错:cannot find -ldbus-1
解决办法,我们不需要 dbus 功能,所以直接关闭该功能
vi .config
再次make