ubuntu busybox-1.7.0编译

来源:互联网 发布:多益网络 校园招聘 编辑:程序博客网 时间:2024/05/17 05:02

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 syntaxMakefile: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] 错误 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-.执行make

错误:

make[1]: *** [ipsvd/tcpudp.o] Error 1Makefile:701: recipe for target 'ipsvd'failedmake: *** [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 <asm/byteorder.h>

之后即可重新make通过

原创粉丝点击