1、下载源码
# ethtool依赖libmul
git clone git://git.netfilter.org/libmnl
# ethtool源码
git clone git://git.kernel.org/pub/scm/network/ethtool/ethtool.git
2、配置编译器环境变量
export PATH=/home/rkdev/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/:$PATH
3、编译libmul
autoreconf -vif #生成configure,必须加后边的vif不然要报错
./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc LDFLAGS=-static --prefix=/home/rkdev/install/libmul
make
make install
4、编译ethtool
#创建编译所需配置文件
./autogen.sh
自动配置编译环境,生成makefile等文件,将$LIBMNL_PWD替换为libmnl项目根目录,如:/opt/libmnl
./configure --prefix=/home/rkdev/install/ethtool
--host=arm-linux CC=arm-linux-gnueabihf-gcc
MNL_CFLAGS="-I/home/rkdev/install/libmul
/include" MNL_LIBS="-L/home/rkdev/install/libmul
/lib -lmnl" LDFLAGS=-static make make install
- 本文固定链接: http://www.letg.top/?p=90
- 转载请注明: ubosm 于 点滴分享 发表