2 # Copyright (C) 2006-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=https
://www.busybox.net
/downloads \
17 http
://sources.buildroot.net
18 PKG_HASH
:=0e4925392fd9f3743cc517e031b68b012b24a63b0cf6c1ff03cce7bb3846cc99
20 PKG_BUILD_DEPENDS
:=BUSYBOX_CONFIG_PAM
:libpam
22 PKG_CHECK_FORMAT_SECURITY
:=0
24 #Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc.
28 PKG_LICENSE_FILES
:=LICENSE archival
/libarchive
/bz
/LICENSE
29 PKG_CPE_ID
:=cpe
:/a
:busybox
:busybox
31 include $(INCLUDE_DIR
)/package.mk
34 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell grep
'^CONFIG_BUSYBOX_' $(TOPDIR
)/.config | mkhash md5
)
37 BUSYBOX_SYM
=$(if
$(CONFIG_BUSYBOX_CUSTOM
),CONFIG
,DEFAULT
)
38 BUSYBOX_IF_ENABLED
=$(if
$(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_
$(1)),$(2))
40 # All files provided by busybox will serve as fallback alternatives by opkg.
41 # There should be no need to enumerate ALTERNATIVES entries here
42 define Package
/busybox
45 MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
46 TITLE
:=Core utilities for embedded Linux
47 URL
:=http
://busybox.net
/
48 DEPENDS
:=+BUSYBOX_CONFIG_PAM
:libpam
+BUSYBOX_CONFIG_NTPD
:jsonfilter
52 define Package
/busybox
/description
53 The Swiss Army Knife of embedded Linux.
54 It slices
, it dices
, it makes Julian Fries.
57 define Package
/busybox
/config
58 source
"$(SOURCE)/Config.in"
61 ifdef CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG
62 define Package
/busybox
/conffiles
67 # don't create a version string containing the actual timestamp
68 export KCONFIG_NOTIMESTAMP
=1
71 ifndef CONFIG_USE_MUSL
75 LDLIBS
+= $(call BUSYBOX_IF_ENABLED
,PAM
,pam pam_misc pthread
)
76 ifeq ($(CONFIG_USE_GLIBC
),y
)
77 LDLIBS
+= $(call BUSYBOX_IF_ENABLED
,NSLOOKUP_OPENWRT
,resolv
)
80 TARGET_CFLAGS
+= -flto
81 TARGET_LDFLAGS
+= -flto
=jobserver
-fuse-linker-plugin
85 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
86 EXTRA_LDFLAGS
="$(TARGET_LDFLAGS)" \
90 ifneq ($(findstring c
,$(OPENWRT_VERBOSE
)),)
94 define Build
/Configure
95 grep
'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR
)/.config | sed
-e
"s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR
)/.config
96 yes
'n' |
$(MAKE
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
) oldconfig
100 $(call Build
/Compile
/Default
, \
101 CONFIG_PREFIX
="$(PKG_INSTALL_DIR)" \
106 define Package
/busybox
/install
107 $(INSTALL_DIR
) $(1)/etc
/init.d
108 $(INSTALL_DIR
) $(1)/usr
/sbin
109 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)/
110 ifneq ($(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_CROND
),)
111 $(INSTALL_BIN
) .
/files
/cron
$(1)/etc
/init.d
/cron
113 ifneq ($(CONFIG_BUSYBOX_
$(BUSYBOX_SYM
)_NTPD
),)
114 $(INSTALL_BIN
) .
/files
/sysntpd
$(1)/etc
/init.d
/sysntpd
115 $(INSTALL_BIN
) .
/files
/ntpd-hotplug
$(1)/usr
/sbin
/ntpd-hotplug
120 $(eval
$(call BuildPackage
,busybox
))