2 # Copyright (C) 2006-2014 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:=http://www.busybox.net/downloads \
17 http://distfiles.gentoo.org/distfiles/
18 PKG_MD5SUM:=337d1a15ab1cb1d4ed423168b1eb7d7e
20 PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam
22 PKG_CHECK_FORMAT_SECURITY:=0
24 PKG_LICENSE:=GPL-2.0 BSD-4-Clause
25 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
27 include $(INCLUDE_DIR)/package.mk
30 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
33 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
34 BB_MAKE_VERBOSE := V=1
39 define Package/busybox
42 MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
43 TITLE:=Core utilities for embedded Linux
44 URL:=http://busybox.net/
45 DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam
49 define Package/busybox/description
50 The Swiss Army Knife of embedded Linux.
51 It slices, it dices, it makes Julian Fries.
54 define Package/busybox/config
55 source "$(SOURCE)/Config.in"
58 BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
60 define Build/Configure
61 rm -f $(PKG_BUILD_DIR)/.configured*
62 grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config
63 yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \
65 CROSS_COMPILE="$(TARGET_CROSS)" \
72 ifdef CONFIG_GCC_VERSION_LLVM
73 TARGET_CFLAGS += -fnested-functions
77 ifdef CONFIG_BUSYBOX_USE_LIBRPC
78 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
79 export LDFLAGS=$(TARGET_LDFLAGS)
83 ifdef CONFIG_BUSYBOX_CONFIG_PAM
84 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
85 export LDFLAGS=$(TARGET_LDFLAGS)
86 LDLIBS += pam pam_misc pthread
90 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
92 CROSS_COMPILE="$(TARGET_CROSS)" \
94 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
100 rm -rf $(PKG_INSTALL_DIR)
101 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
102 $(MAKE) -C $(PKG_BUILD_DIR) \
104 CROSS_COMPILE="$(TARGET_CROSS)" \
105 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
107 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
113 define Package/busybox/install
114 $(INSTALL_DIR) $(1)/etc/init.d
115 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
116 $(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
117 $(INSTALL_BIN) ./files/telnet $(1)/etc/init.d/telnet
118 $(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
122 $(eval $(call BuildPackage,busybox))