1.编译libnl1.1问题
In file included from addr.c:28:0:
../include/netlink-local.h: In function '__str2type':
../include/netlink-local.h:218:11: error: 'ULONG_MAX' undeclared (first use in this function)
../include/netlink-local.h:218:11: note: each undeclared identifier is reported only once for each function it appears in
../include/netlink-local.h: In function '__list_str2type':
../include/netlink-local.h:239:11: error: 'ULONG_MAX' undeclared (first use in this function)
make[2]: *** [addr.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
修改方法:
在 ./include/netlink-local.h 中增加头文件
#include <limits.h>
2.修改wpa_supplicant 2.2 Makefile
修改Makefile之前,需要执行config的拷贝
cp defconfig .config
修改Makefile如下:
CC:=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin/mips-linux-gnu-gcc
#ifndef CC
#CC=gcc
#endif
CFLAGS:= -I /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include
CFLAGS += -I /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/include
CFLAGS += -I /home/xuxuequan/Ingenicwork/lib/libsource/libnl-1.1/include
LIBS := -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lssl
LIBS := -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/libnl-1.1/install/lib -lnl
LIBDIR := ./out/lib/
BINDIR := ./out/sbin/
#ifndef CFLAGS
#CFLAGS = -MMD -O2 -Wall -g
#endif
#export LIBDIR ?= /usr/local/lib/
#export BINDIR ?= /usr/local/sbin/
#LIBS += -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
#LIBS_p += -lcrypto
LIBS_p += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
3.wpa_supplicant 2.2编译问题
问题一:
../src/drivers/driver_nl80211.c:19:31: fatal error: netlink/genl/genl.h: No such file or directorycompilation terminated.
make: *** [../src/drivers/driver_nl80211.o] Error 1
问题分析:
这是由于没有libnl库导致的,在Makefile中设置libnl的相关include即可
问题二:
../src/drivers/driver_nl80211.c: In function 'family_handler':
../src/drivers/driver_nl80211.c:717:10: error: 'CTRL_ATTR_MCAST_GROUPS' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:717:10: note: each undeclared identifier is reported only once for each function it appears in
../src/drivers/driver_nl80211.c:721:22: error: 'CTRL_ATTR_MCAST_GRP_MAX' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:724:12: error: 'CTRL_ATTR_MCAST_GRP_NAME' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:725:12: error: 'CTRL_ATTR_MCAST_GRP_ID' undeclared (first use in this function)
make: *** [../src/drivers/driver_nl80211.o] Error 1
问题分析:
这是由于当前libnl库版本中genetlink.h文件部分定义没有导致的,可以从交叉编译工具链中拷贝一个
cp /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include/linux/genetlink.h ./genetlink.h
问题三:
/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin/../lib/gcc/mips-linux-gnu/4.7.2/../../../../mips-linux-gnu/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make: *** [wpa_passphrase] Error 1
问题分析:
这是由于Makefile中如下部分定义导致的,按照红色部分修改为交叉编译
#LIBS += -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
#LIBS_p += -lcrypto
LIBS_p += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto