mips平台交叉编译wpa工具

所需文件:openssl、libnl、wpa_supplicant,从网上下载这3个的源码,解压。

1.编译openssl:

<1>配置config:

./config no-asm shared --prefix=/home/tony/mtk/others/wpa/openssl-1.0.1s/build

<2>打开Makefile,找到CC等编译器选项,替换为自己的交叉编译链:

CC= /opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-gcc
AR= /opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-ar $(ARFLAGS) r
RANLIB= /opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-ranlib
NM= /opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-nm

<3> make & make install 编译好的库会复制到build目录下。

2.编译libnl:

<1> 配置:

./configure --prefix=/home/tony/mtk/others/wpa/libnl-1.1.4/build CC=/opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-gcc --host=mips

<2> make & make install

3.编译wpa_supplicant:

<1>配置:

进入wpa目录,

cp -rf defconfig .config
<2>在Makefile中添加头文件及库目录:

CC=/opt/buildroot-gcc463/usr/bin/mipsel-buildroot-linux-uclibc-gcc
CFLAGS+= -Os -I../../libnl-1.1.4/build/include -I../../openssl-1.0.1s/build/include
LDFLAGS += -ldl -L../../libnl-1.1.4/build/lib -L../../openssl-1.0.1s/build/lib
LIBS += -L../../libnl-1.1.4/build/lib -L../../openssl-1.0.1s/build/lib
LIBS_p += -L../../libnl-1.1.4/build/lib -L../../openssl-1.0.1s/build/lib
<3>make


你可能感兴趣的:(mips平台交叉编译wpa工具)