1 #############################################################
5 #############################################################
8 ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT
),y
)
9 # Be aware that this changes daily....
10 BUSYBOX_DIR
:=$(PROJECT_BUILD_DIR
)/busybox
11 BUSYBOX_SOURCE
:=busybox-snapshot.
tar.bz2
12 BUSYBOX_SITE
:=http
://www.busybox.net
/downloads
/snapshots
14 BUSYBOX_VERSION
=$(strip $(subst ",, $(BR2_BUSYBOX_VERSION)))
16 BUSYBOX_DIR
:=$(PROJECT_BUILD_DIR
)/busybox-
$(BUSYBOX_VERSION
)
17 BUSYBOX_SOURCE
:=busybox-
$(BUSYBOX_VERSION
).
tar.bz2
18 BUSYBOX_SITE
:=http
://www.busybox.net
/downloads
21 BUSYBOX_UNZIP
=$(BZCAT
)
23 ifndef BUSYBOX_CONFIG_FILE
24 BUSYBOX_CONFIG_FILE
=$(subst ",, $(strip $(BR2_PACKAGE_BUSYBOX_CONFIG)))
28 $(DL_DIR
)/$(BUSYBOX_SOURCE
):
29 $(WGET
) -P
$(DL_DIR
) $(BUSYBOX_SITE
)/$(BUSYBOX_SOURCE
)
31 $(BUSYBOX_DIR
)/.unpacked
: $(DL_DIR
)/$(BUSYBOX_SOURCE
)
32 $(BUSYBOX_UNZIP
) $(DL_DIR
)/$(BUSYBOX_SOURCE
) |
tar -C
$(PROJECT_BUILD_DIR
) $(TAR_OPTIONS
) -
33 ifeq ($(BR2_PACKAGE_SYSKLOGD
),y
)
34 # if we have external syslogd, force busybox to use it
35 $(SED
) "/#include.*busybox\.h/a#define CONFIG_SYSLOGD" $(BUSYBOX_DIR
)/init
/init.c
37 # Allow busybox patches.
38 ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT
),y
)
39 toolchain
/patch-kernel.sh
$(BUSYBOX_DIR
) package
/busybox busybox.\
*.patch
41 toolchain
/patch-kernel.sh
$(BUSYBOX_DIR
) package
/busybox busybox-
$(BUSYBOX_VERSION
)-\
*.patch
45 $(BUSYBOX_DIR
)/.configured
: $(BUSYBOX_DIR
)/.unpacked
$(BUSYBOX_CONFIG_FILE
)
46 ifeq ($(BR2_USE_UPDATES
),y
)
47 (cd
$(@D
) && $(SVN_UP
))
49 cp
-f
$(BUSYBOX_CONFIG_FILE
) $(BUSYBOX_DIR
)/.config
50 $(SED
) s
,^CONFIG_PREFIX
=.
*,CONFIG_PREFIX
=\"$(TARGET_DIR
)\", \
51 $(BUSYBOX_DIR
)/.config
52 ifeq ($(BR2_BUSYBOX_VERSION_1_0_1
),y
)
53 $(SED
) "s,^CROSS.*,CROSS=$(TARGET_CROSS)\n\PREFIX=$(TARGET_DIR),;" \
54 $(BUSYBOX_DIR
)/Rules.mak
56 ifeq ($(BR2_BUSYBOX_VERSION_1_1_3
),y
)
57 $(SED
) s
,^PREFIX
=.
*,CONFIG_PREFIX
=\"$(TARGET_DIR
)\", \
58 $(BUSYBOX_DIR
)/.config
60 ifeq ($(BR2_BUSYBOX_VERSION_1_2_2_1
),y
)
61 $(SED
) s
,^CROSS_COMPILER_PREFIX
=.
*,CROSS_COMPILER_PREFIX
=\"$(TARGET_CROSS
)\", \
62 $(BUSYBOX_DIR
)/.config
63 $(SED
) s
,^PREFIX
=.
*,CROSS_COMPILER_PREFIX
=\"$(TARGET_CROSS
)\", \
64 $(BUSYBOX_DIR
)/.config
66 ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT
),y
)
67 $(SED
) s
,^CROSS_COMPILER_PREFIX
=.
*,CROSS_COMPILER_PREFIX
=\"$(TARGET_CROSS
)\", \
68 $(BUSYBOX_DIR
)/.config
69 $(SED
) s
,^PREFIX
=.
*,CROSS_COMPILER_PREFIX
=\"$(TARGET_CROSS
)\", \
70 $(BUSYBOX_DIR
)/.config
72 ifeq ($(BR2_LARGEFILE
),y
)
73 $(SED
) "s/^.*CONFIG_LFS.*/CONFIG_LFS=y/;" $(BUSYBOX_DIR
)/.config
74 $(SED
) "s/^.*CONFIG_FDISK_SUPPORT_LARGE_DISKS.*/CONFIG_FDISK_SUPPORT_LARGE_DISKS=y/;" $(BUSYBOX_DIR
)/.config
76 $(SED
) "s/^.*CONFIG_LFS.*/CONFIG_LFS=n/;" $(BUSYBOX_DIR
)/.config
77 $(SED
) "s/^.*FDISK_SUPPORT_LARGE_DISKS.*/CONFIG_FDISK_SUPPORT_LARGE_DISKS=n/;" $(BUSYBOX_DIR
)/.config
79 ifeq ($(BR2_INET_IPV6
),y
)
80 $(SED
) "s/^.*CONFIG_FEATURE_IPV6.*/CONFIG_FEATURE_IPV6=y/;" $(BUSYBOX_DIR
)/.config
82 $(SED
) "s/^.*CONFIG_FEATURE_IPV6.*/CONFIG_FEATURE_IPV6=n/;" $(BUSYBOX_DIR
)/.config
84 ifeq ($(BR2_PACKAGE_BUSYBOX_SKELETON
),y
)
86 $(SED
) "s/^.*CONFIG_MDEV.*/CONFIG_MDEV=y/" $(BUSYBOX_DIR
)/.config
88 ifeq ($(BR2_PACKAGE_NETKITBASE
),y
)
89 # disable usage of inetd if netkit-base package is selected
90 $(SED
) "s/^.*CONFIG_INETD.*/CONFIG_INETD=n/;" $(BUSYBOX_DIR
)/.config
91 @echo
"WARNING!! CONFIG_INETD option disabled!"
93 ifeq ($(BR2_PACKAGE_NETKITTELNET
),y
)
94 # disable usage of telnetd if netkit-telnetd package is selected
95 $(SED
) "s/^.*CONFIG_TELNETD.*/CONFIG_TELNETD=n/;" $(BUSYBOX_DIR
)/.config
96 @echo
"WARNING!! CONFIG_TELNETD option disabled!"
98 yes
"" |
$(MAKE
) CC
=$(TARGET_CC
) CROSS_COMPILE
="$(TARGET_CROSS)" \
99 HOSTCC
="$(HOSTCC) $(HOST_CFLAGS)" \
100 CROSS
="$(TARGET_CROSS)" -C
$(BUSYBOX_DIR
) oldconfig
104 $(BUSYBOX_DIR
)/busybox
: $(BUSYBOX_DIR
)/.configured
105 $(MAKE
) HOSTCC
="$(HOSTCC) $(HOST_CFLAGS)" \
106 CC
=$(TARGET_CC
) CROSS_COMPILE
="$(TARGET_CROSS)" \
107 CROSS
="$(TARGET_CROSS)" PREFIX
="$(TARGET_DIR)" \
108 ARCH
=$(KERNEL_ARCH
) \
109 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" -C
$(BUSYBOX_DIR
)
110 ifeq ($(BR2_PREFER_IMA
)$(BR2_PACKAGE_BUSYBOX_SNAPSHOT
),yy
)
112 $(MAKE
) HOSTCC
="$(HOSTCC) $(HOST_CFLAGS)" \
113 CC
=$(TARGET_CC
) CROSS_COMPILE
="$(TARGET_CROSS)" \
114 CROSS
="$(TARGET_CROSS)" PREFIX
="$(TARGET_DIR)" \
115 ARCH
=$(KERNEL_ARCH
) STRIP
="$(STRIPCMD)" \
116 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" -C
$(BUSYBOX_DIR
) \
117 -f scripts
/Makefile.IMA
120 $(TARGET_DIR
)/bin
/busybox
: $(BUSYBOX_DIR
)/busybox
121 ifeq ($(BR2_PACKAGE_BUSYBOX_INSTALL_SYMLINKS
),y
)
122 $(MAKE
) HOSTCC
="$(HOSTCC) $(HOST_CFLAGS)" \
123 CC
=$(TARGET_CC
) CROSS_COMPILE
="$(TARGET_CROSS)" \
124 CROSS
="$(TARGET_CROSS)" PREFIX
="$(TARGET_DIR)" \
125 ARCH
=$(KERNEL_ARCH
) \
126 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" -C
$(BUSYBOX_DIR
) install
128 install -D
-m
0755 $(BUSYBOX_DIR
)/busybox
$(TARGET_DIR
)/bin
/busybox
131 $(Q
)if
test -r
$(TARGET_DIR
)/usr
/share
/udhcpc
/default.script
; then \
132 chmod a
+x
$(TARGET_DIR
)/usr
/share
/udhcpc
/default.script
; \
135 busybox
: uclibc
$(TARGET_DIR
)/bin
/busybox
137 busybox-source
: $(DL_DIR
)/$(BUSYBOX_SOURCE
) $(BUSYBOX_CONFIG_FILE
)
139 busybox-unpacked
: $(BUSYBOX_DIR
)/.unpacked
141 busybox-config
: $(BUSYBOX_DIR
)/.configured
143 busybox-menuconfig
: host-sed
$(PROJECT_BUILD_DIR
) busybox-source
$(BUSYBOX_DIR
)/.configured
144 $(MAKE
) __TARGET_ARCH
=$(ARCH
) HOSTCC
="$(HOSTCC) $(HOST_CFLAGS)" \
145 -C
$(BUSYBOX_DIR
) menuconfig
148 cp
-f
$(BUSYBOX_DIR
)/.config
$(BUSYBOX_CONFIG_FILE
)
151 -$(MAKE
) -C
$(BUSYBOX_DIR
) clean
152 rm -f
$(TARGET_DIR
)/bin
/busybox
155 rm -rf
$(BUSYBOX_DIR
)
156 #############################################################
158 # Toplevel Makefile options
160 #############################################################
161 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)