coreutils: convert to autotarget

Signed-off-by: Martin Banky <Martin.Banky@gmail.com>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Martin Banky 2010-09-30 12:03:31 -07:00 committed by Peter Korsgaard
parent 877044a738
commit 386183f852

View File

@ -3,37 +3,21 @@
# coreutils # coreutils
# #
############################################################# #############################################################
COREUTILS_VERSION:=7.4 COREUTILS_VERSION = 7.4
COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.gz
#COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/ COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils
COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils
COREUTILS_CAT:=$(ZCAT) # If both coreutils and busybox are selected, make certain coreutils
COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION) # wins the fight over who gets to have their utils actually installed.
COREUTILS_BINARY:=src/vdir ifeq ($(BR2_PACKAGE_BUSYBOX),y)
COREUTILS_TARGET_BINARY:=bin/vdir COREUTILS_DEPENDENCIES = busybox
BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false hostname \ endif
COREUTILS_BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false hostname \
ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \ ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \
uname join uname join
$(DL_DIR)/$(COREUTILS_SOURCE): COREUTILS_CONF_ENV = ac_cv_func_strtod=yes \
$(call DOWNLOAD,$(COREUTILS_SITE),$(COREUTILS_SOURCE))
coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE)
$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE)
$(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(COREUTILS_DIR) package/coreutils/ coreutils\*.patch
$(CONFIG_UPDATE) $(COREUTILS_DIR)/build-aux
# ensure rename.m4 file is older than configure / aclocal.m4 so
# auto* isn't rerun
touch -d '1979-01-01' $(@D)/m4/rename.m4
touch $@
$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
(cd $(COREUTILS_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
ac_cv_func_strtod=yes \
ac_fsusage_space=yes \ ac_fsusage_space=yes \
fu_cv_sys_stat_statfs2_bsize=yes \ fu_cv_sys_stat_statfs2_bsize=yes \
ac_cv_func_closedir_void=no \ ac_cv_func_closedir_void=no \
@ -81,68 +65,33 @@ $(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
ac_cv_func_working_mktime=yes \ ac_cv_func_working_mktime=yes \
jm_cv_func_working_re_compile_pattern=yes \ jm_cv_func_working_re_compile_pattern=yes \
ac_use_included_regex=no \ ac_use_included_regex=no \
gl_cv_c_restrict=no \ gl_cv_c_restrict=no
./configure $(QUIET) \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libdir=/lib \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
--disable-rpath \
--disable-dependency-tracking \
)
touch $@
$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured COREUTILS_CONF_OPT = --disable-rpath \
$(MAKE) -C $(COREUTILS_DIR) --disable-dependency-tracking
rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY) define COREUTILS_TOUCH_RENAME_M4
$(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(COREUTILS_DIR) install # ensure rename.m4 file is older than configure / aclocal.m4 so
# auto* isn't rerun
touch -d '1979-01-01' $(@D)/m4/rename.m4
endef
COREUTILS_POST_PATCH_HOOKS += COREUTILS_TOUCH_RENAME_M4
define COREUTILS_POST_INSTALL
# some things go in root rather than usr # some things go in root rather than usr
for f in $(BIN_PROGS); do \ for f in $(COREUTILS_BIN_PROGS); do \
mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \ mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
done done
# link for archaic shells # link for archaic shells
ln -fs test $(TARGET_DIR)/usr/bin/[ ln -fs test $(TARGET_DIR)/usr/bin/[
# gnu thinks chroot is in bin, debian thinks it's in sbin # gnu thinks chroot is in bin, debian thinks it's in sbin
mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
$(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1 endef
rm -rf $(TARGET_DIR)/share/locale
# If both coreutils and busybox are selected, make certain coreutils COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_POST_INSTALL
# wins the fight over who gets to have their utils actually installed.
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
coreutils: busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
else
coreutils: $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
endif
# If both coreutils and busybox are selected, the corresponding applets # If both coreutils and busybox are selected, the corresponding applets
# may need to be reinstated by the clean targets. # may need to be reinstated by the clean targets.
coreutils-clean:
$(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(COREUTILS_DIR) uninstall
-$(MAKE) -C $(COREUTILS_DIR) clean
coreutils-dirclean: $(eval $(call AUTOTARGETS,package,coreutils))
rm -rf $(COREUTILS_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_COREUTILS),y)
TARGETS+=coreutils
endif