1、操作系统:Ubuntu16.04
2、交叉编译工具链:arm-linux-gcc4.4.3
3、busybox版本:busybox-1.7.0
解压源码包 tar -jxvf busybox-1.7.0
1.make menuconfig
出现错误:
Makefile:405: *** mixed implicit and normalrules: deprecated syntax
Makefile:1242: *** mixed implicit andnormal rules: deprecated syntax
原因Make工具太新
修改Makefile
修改前:405行 config %config: scripts_basic outputmakefile FORCE
修改后:405 行 %config: scripts_basic outputmakefile FORCE
修改前:1242 行 / %/: prepare scripts FORCE
修改后:1242 行 %/: prepare scripts FORCE
继续make menuconfig
出现错误
scripts/kconfig/lxdialog/dialog.h:31:20:fatal error: curses.h: 没有那个文件或目录
compilation terminated.
make[2]: ***[scripts/kconfig/lxdialog/checklist.o] 错误 1
make[1]: *** [menuconfig] 错误 2
make: *** [menuconfig] 错误 2
因为ubuntu系统中缺少一个套件 ncurses devel ,把此套件安装即可
apt-get install libncurses5-dev
保存之后make menuconfig进行相关设置
2.修改makefile
175 ARCH ?= $(SUBARCH)
176 CROSS_COMPLE ?=
修改为
175 ARCH ?= arm
176 CROSS_COMPLE ?= arm-linux-
3.执行make
错误:make[1]: *** [ipsvd/tcpudp.o] Error 1
Makefile:701: recipe for target 'ipsvd'failed
make: *** [ipsvd] Error 2
/usr/local/arm/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/sys-root/usr/include/linux
netfilter.h 头文件的开头
添加缺少的头文件:
#include
错误:
iptunnel.c:(.text.print_tunnel+0x1ec):undefined reference to `__cpu_to_be16'
iptunnel.c:(.text.print_tunnel+0x200):undefined reference to `__cpu_to_be16'
iptunnel.c:(.text.print_tunnel+0x238):undefined reference to `__cpu_to_be16'
iptunnel.c:(.text.print_tunnel+0x24c):undefined reference to `__cpu_to_be16'
iptunnel.c:(.text.print_tunnel+0x26c):undefined reference to `__cpu_to_be16'
networking/libiproute/lib.a(iptunnel.o):iptunnel.c:(.text.print_tunnel+0x290):more undefined references to `__cpu_to_be16' follow
collect2: ld returned 1 exit status
Makefile:678: recipe for target'busybox_unstripped' failed
make: *** [busybox_unstripped] Error 1
修改 networking/libiproute/iptunnel.c文件
在#include
后面加上
#include
之后即可重新make通过