2 # Copyright (C) 2006-2012 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_TELNETD) += telnet
42 define Package/busybox
45 MAINTAINER:=Nicolas Thill <nico@openwrt.org>
46 TITLE:=Core utilities for embedded Linux
47 URL:=http://busybox.net/
48 DEPENDS:=+BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
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 define Build/Configure
62 rm -f $(PKG_BUILD_DIR)/.configured*
63 grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
64 yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
66 CROSS_COMPILE="$(TARGET_CROSS)" \
73 ifdef CONFIG_GCC_VERSION_LLVM
74 TARGET_CFLAGS += -fnested-functions
78 ifdef CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC
79 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
80 export LDFLAGS=$(TARGET_LDFLAGS)
85 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
87 CROSS_COMPILE="$(TARGET_CROSS)" \
89 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
95 rm -rf $(PKG_INSTALL_DIR)
96 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
97 $(MAKE) -C $(PKG_BUILD_DIR) \
99 CROSS_COMPILE="$(TARGET_CROSS)" \
100 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
102 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
108 define Package/busybox/install
109 $(INSTALL_DIR) $(1)/etc/init.d
110 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
111 for tmp in $(init-y); do \
112 $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
117 $(eval $(call BuildPackage,busybox))