2 # Copyright (C) 2006-2013 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:=9c0cae5a0379228e7b55e5b29528df8e
20 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
23 PKG_LICENSE:=GPLv2 BSD-4c
24 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
26 include $(INCLUDE_DIR)/package.mk
29 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
32 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
33 BB_MAKE_VERBOSE := V=1
39 init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
40 init-$(CONFIG_BUSYBOX_CONFIG_NTPD) += ntp
41 init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
43 define Package/busybox
46 MAINTAINER:=Nicolas Thill <nico@openwrt.org>
47 TITLE:=Core utilities for embedded Linux
48 URL:=http://busybox.net/
49 DEPENDS:=+BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
53 define Package/busybox/description
54 The Swiss Army Knife of embedded Linux.
55 It slices, it dices, it makes Julian Fries.
58 define Package/busybox/config
59 source "$(SOURCE)/Config.in"
62 define Build/Configure
63 rm -f $(PKG_BUILD_DIR)/.configured*
64 grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
65 yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \
67 CROSS_COMPILE="$(TARGET_CROSS)" \
74 ifdef CONFIG_GCC_VERSION_LLVM
75 TARGET_CFLAGS += -fnested-functions
79 ifdef CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC
80 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
81 export LDFLAGS=$(TARGET_LDFLAGS)
86 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
88 CROSS_COMPILE="$(TARGET_CROSS)" \
90 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
96 rm -rf $(PKG_INSTALL_DIR)
97 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
98 $(MAKE) -C $(PKG_BUILD_DIR) \
100 CROSS_COMPILE="$(TARGET_CROSS)" \
101 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
103 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
109 define Package/busybox/install
110 $(INSTALL_DIR) $(1)/etc/init.d
111 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
112 for tmp in $(init-y); do \
113 $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
118 $(eval $(call BuildPackage,busybox))