2002-04-26 13:45:55 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# busybox
|
|
|
|
#
|
|
|
|
#############################################################
|
2002-10-23 09:56:48 +02:00
|
|
|
|
2007-09-30 14:48:25 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_VERSION = snapshot
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads/snapshots
|
2007-02-06 17:34:54 +01:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_VERSION = $(call qstrip,$(BR2_BUSYBOX_VERSION))
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads
|
2002-10-23 09:56:48 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
|
|
|
|
BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
|
2010-07-22 15:50:08 +02:00
|
|
|
# Allows the build system to tweak CFLAGS
|
|
|
|
BUSYBOX_MAKE_ENV = $(TARGET_MAKE_ENV) CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_HEADERS_DIR)/include"
|
2005-04-12 22:32:45 +02:00
|
|
|
|
2007-01-19 15:17:34 +01:00
|
|
|
ifndef BUSYBOX_CONFIG_FILE
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
|
2007-01-19 15:17:34 +01:00
|
|
|
endif
|
2002-04-26 13:45:55 +02:00
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
# If we have external syslogd, force busybox to use it
|
2005-09-13 23:04:12 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_SYSKLOGD),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_SYSKLOGD
|
|
|
|
@$(SED) "/#include.*busybox\.h/a#define CONFIG_SYSLOGD" \
|
|
|
|
$(BUSYBOX_DIR)/init/init.c
|
|
|
|
endef
|
2005-09-13 23:04:12 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
2009-04-15 15:42:03 +02:00
|
|
|
# id applet breaks on >=1.13.0 with old uclibc unless the bb pwd routines are used
|
|
|
|
ifeq ($(BR2_BUSYBOX_VERSION_1_13_X)$(BR2_BUSYBOX_VERSION_1_14_X)$(BR2_UCLIBC_VERSION_0_9_28_3)$(BR2_UCLIBC_VERSION_0_9_29),yy)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_BB_PWD
|
|
|
|
if grep -q 'CONFIG_ID=y' $(BUSYBOX_BUILD_CONFIG); \
|
2008-11-21 15:36:48 +01:00
|
|
|
then \
|
|
|
|
echo 'warning: CONFIG_ID needs BB_PWD_GRP with old uclibc, enabling' >&2;\
|
2010-07-08 19:20:06 +02:00
|
|
|
$(SED) "s/^.*CONFIG_USE_BB_PWD_GRP.*/CONFIG_USE_BB_PWD_GRP=y/;" $(BUSYBOX_BUILD_CONFIG); \
|
2008-11-21 15:36:48 +01:00
|
|
|
fi
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2008-11-21 15:36:48 +01:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
2004-10-09 03:06:03 +02:00
|
|
|
ifeq ($(BR2_LARGEFILE),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_LARGEFILE
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_LFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FDISK_SUPPORT_LARGE_DISKS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2003-11-17 02:31:38 +01:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_LARGEFILE
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_LFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FDISK_SUPPORT_LARGE_DISKS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-02-16 15:32:22 +01:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# If IPv6 is enabled then enable basic ifupdown support for it
|
2007-06-27 23:07:09 +02:00
|
|
|
ifeq ($(BR2_INET_IPV6),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_IPV6
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_IFUPDOWN_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-06-27 23:07:09 +02:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_IPV6
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_IFUPDOWN_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-06-27 23:07:09 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# If RPC is enabled then enable nfs mounts
|
2009-06-22 15:25:33 +02:00
|
|
|
ifeq ($(BR2_INET_RPC),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_RPC
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MOUNT_NFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2009-06-22 15:25:33 +02:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_RPC
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_MOUNT_NFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2009-06-22 15:25:33 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# If we're using static libs do the same for busybox
|
2010-04-05 13:29:01 +02:00
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2010-04-05 13:29:01 +02:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_STATIC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2010-04-05 13:29:01 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# Disable usage of inetd if netkit-base package is selected
|
2007-05-07 06:04:34 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITBASE),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_NETKITBASE
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_INETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-05-07 06:04:34 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# Disable usage of telnetd if netkit-telnetd package is selected
|
2007-05-07 06:04:34 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITTELNET),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_NETKITTELNET
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_TELNETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2003-01-10 07:00:39 +01:00
|
|
|
endif
|
2002-10-23 09:56:48 +02:00
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_COPY_CONFIG
|
|
|
|
cp -f $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# We do this here to avoid busting a modified .config in configure
|
|
|
|
BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG
|
|
|
|
|
|
|
|
define BUSYBOX_CONFIGURE_CMDS
|
|
|
|
$(BUSYBOX_SET_SYSKLOGD)
|
|
|
|
$(BUSYBOX_SET_BB_PWD)
|
|
|
|
$(BUSYBOX_SET_LARGEFILE)
|
|
|
|
$(BUSYBOX_SET_IPV6)
|
|
|
|
$(BUSYBOX_SET_RPC)
|
|
|
|
$(BUSYBOX_PREFER_STATIC)
|
|
|
|
$(BUSYBOX_NETKITBASE)
|
|
|
|
$(BUSYBOX_NETKITTELNET)
|
|
|
|
@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
-C $(@D) oldconfig
|
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_BUILD_CMDS
|
2010-07-22 15:50:08 +02:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ARCH=$(KERNEL_ARCH) \
|
2010-07-08 19:20:06 +02:00
|
|
|
PREFIX="$(TARGET_DIR)" EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
2010-07-22 15:50:08 +02:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2006-12-13 10:14:10 +01:00
|
|
|
|
2008-03-21 18:56:00 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_FULLINSTALL),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_INSTALL_BINARY
|
2010-07-22 15:50:08 +02:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ARCH=$(KERNEL_ARCH) \
|
2010-07-08 19:20:06 +02:00
|
|
|
PREFIX="$(TARGET_DIR)" EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
2010-07-22 15:50:08 +02:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" CONFIG_PREFIX="$(TARGET_DIR)" \
|
|
|
|
-C $(@D) install
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2005-11-10 03:59:20 +01:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_INSTALL_BINARY
|
2005-11-10 03:59:20 +01:00
|
|
|
install -D -m 0755 $(BUSYBOX_DIR)/busybox $(TARGET_DIR)/bin/busybox
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2005-11-10 03:59:20 +01:00
|
|
|
endif
|
2007-09-27 00:12:51 +02:00
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_INSTALL_TARGET_CMDS
|
|
|
|
$(BUSYBOX_INSTALL_BINARY)
|
|
|
|
-chmod a+rx $(TARGET_DIR)/usr/share/udhcpc/default.script
|
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_UNINSTALL_TARGET_CMDS
|
2010-07-22 15:50:08 +02:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ARCH=$(KERNEL_ARCH) \
|
2010-07-08 19:20:06 +02:00
|
|
|
PREFIX="$(TARGET_DIR)" EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
2010-07-22 15:50:08 +02:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" CONFIG_PREFIX="$(TARGET_DIR)" \
|
|
|
|
-C $(@D) uninstall
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_CLEAN_CMDS
|
2010-07-22 15:50:08 +02:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" ARCH=$(KERNEL_ARCH) \
|
2010-07-08 19:20:06 +02:00
|
|
|
PREFIX="$(TARGET_DIR)" EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
2010-07-22 15:50:08 +02:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" CONFIG_PREFIX="$(TARGET_DIR)" \
|
|
|
|
-C $(@D) clean
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call GENTARGETS,package,busybox))
|
|
|
|
|
|
|
|
busybox-menuconfig: $(BUSYBOX_DIR)/.stamp_extracted
|
2010-07-22 15:50:08 +02:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) ARCH=$(KERNEL_ARCH) \
|
2010-07-08 19:20:06 +02:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" -C $(BUSYBOX_DIR) menuconfig
|
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_built
|
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_target_installed
|
2007-09-27 00:12:51 +02:00
|
|
|
|
|
|
|
busybox-update:
|
2010-07-08 19:20:06 +02:00
|
|
|
cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
|