移植wpa_supplicant 2.2问题

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 directory
compilation 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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值