blob: d2a3586e4ce12f12c7c05497ec3ee168434ac6ec [file] [log] [blame]
Eric Andersen77bf6fb2002-10-23 12:54:42 +00001#############################################################
2#
3# coreutils
4#
5#############################################################
Thomas Petazzoni0ef93af2009-07-31 13:54:23 +02006COREUTILS_VERSION:=7.4
7COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz
Bernhard Reutner-Fischer1281c7b2006-03-08 08:34:32 +00008#COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/
Hamish Moffattaf510f42008-03-26 03:28:09 +00009COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils
Thomas Petazzoni0ef93af2009-07-31 13:54:23 +020010COREUTILS_CAT:=$(ZCAT)
Ulf Samuelssone1621a42007-07-11 14:06:06 +000011COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION)
Eric Andersen55de6e52003-03-06 17:44:29 +000012COREUTILS_BINARY:=src/vdir
13COREUTILS_TARGET_BINARY:=bin/vdir
Eric Andersen0811c2d2003-03-10 17:45:39 +000014BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false hostname \
15 ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true uname
Eric Andersen77bf6fb2002-10-23 12:54:42 +000016
17$(DL_DIR)/$(COREUTILS_SOURCE):
Peter Korsgaard4a7bfd22009-01-16 11:42:52 +000018 $(call DOWNLOAD,$(COREUTILS_SITE),$(COREUTILS_SOURCE))
Eric Andersen77bf6fb2002-10-23 12:54:42 +000019
20coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE)
21
22$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE)
Eric Andersenbb05a9a2004-10-09 21:19:47 +000023 $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
Ulf Samuelsson5d19a1f2007-07-28 16:39:06 +000024 toolchain/patch-kernel.sh $(COREUTILS_DIR) package/coreutils/ coreutils\*.patch
Hamish Moffatt03d65312008-02-12 00:35:03 +000025 $(CONFIG_UPDATE) $(COREUTILS_DIR)/build-aux
Bernhard Reutner-Fischer701d2ae2007-06-20 13:25:44 +000026 touch $@
Eric Andersen77bf6fb2002-10-23 12:54:42 +000027
28$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
Eric Andersenef7784a2003-01-17 08:03:59 +000029 (cd $(COREUTILS_DIR); rm -rf config.cache; \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000030 $(TARGET_CONFIGURE_OPTS) \
Bernhard Reutner-Fischer74d518d2007-06-27 12:01:27 +000031 $(TARGET_CONFIGURE_ARGS) \
Manuel Novoa III 68579662004-05-28 17:50:07 +000032 ac_cv_func_strtod=yes \
Eric Andersen94b43832005-08-15 12:52:38 +000033 ac_fsusage_space=yes \
34 fu_cv_sys_stat_statfs2_bsize=yes \
35 ac_cv_func_closedir_void=no \
36 ac_cv_func_getloadavg=no \
37 ac_cv_lib_util_getloadavg=no \
38 ac_cv_lib_getloadavg_getloadavg=no \
39 ac_cv_func_getgroups=yes \
40 ac_cv_func_getgroups_works=yes \
41 ac_cv_func_chown_works=yes \
42 ac_cv_have_decl_euidaccess=no \
43 ac_cv_func_euidaccess=no \
44 ac_cv_have_decl_strnlen=yes \
45 ac_cv_func_strnlen_working=yes \
46 ac_cv_func_lstat_dereferences_slashed_symlink=yes \
47 ac_cv_func_lstat_empty_string_bug=no \
48 ac_cv_func_stat_empty_string_bug=no \
Peter Korsgaarddfca1b22009-09-10 09:21:48 +020049 gl_cv_func_rename_trailing_slash_bug=no \
Eric Andersen94b43832005-08-15 12:52:38 +000050 ac_cv_have_decl_nanosleep=yes \
51 jm_cv_func_nanosleep_works=yes \
52 gl_cv_func_working_utimes=yes \
53 ac_cv_func_utime_null=yes \
54 ac_cv_have_decl_strerror_r=yes \
Eric Andersen74b9bf92005-12-08 06:39:19 +000055 ac_cv_func_strerror_r_char_p=no \
Eric Andersen94b43832005-08-15 12:52:38 +000056 jm_cv_func_svid_putenv=yes \
57 ac_cv_func_getcwd_null=yes \
58 ac_cv_func_getdelim=yes \
59 ac_cv_func_mkstemp=yes \
60 utils_cv_func_mkstemp_limitations=no \
61 utils_cv_func_mkdir_trailing_slash_bug=no \
Thomas Petazzoni0ef93af2009-07-31 13:54:23 +020062 gl_cv_func_rename_dest_exists_bug=no \
Eric Andersen94b43832005-08-15 12:52:38 +000063 ac_cv_func_memcmp_working=yes \
Eric Andersen74b9bf92005-12-08 06:39:19 +000064 ac_cv_have_decl_malloc=yes \
65 gl_cv_func_malloc_0_nonnull=yes \
66 ac_cv_func_malloc_0_nonnull=yes \
67 ac_cv_func_calloc_0_nonnull=yes \
68 ac_cv_func_realloc_0_nonnull=yes \
69 jm_cv_func_gettimeofday_clobber=no \
70 am_cv_func_working_getline=yes \
71 gl_cv_func_working_readdir=yes \
72 jm_ac_cv_func_link_follows_symlink=no \
73 utils_cv_localtime_cache=no \
74 ac_cv_struct_st_mtim_nsec=no \
75 gl_cv_func_tzset_clobber=no \
76 gl_cv_func_getcwd_null=yes \
77 gl_cv_func_getcwd_path_max=yes \
78 ac_cv_func_fnmatch_gnu=yes \
79 am_getline_needs_run_time_check=no \
80 am_cv_func_working_getline=yes \
81 gl_cv_func_mkdir_trailing_slash_bug=no \
82 gl_cv_func_mkstemp_limitations=no \
83 ac_cv_func_working_mktime=yes \
84 jm_cv_func_working_re_compile_pattern=yes \
85 ac_use_included_regex=no \
Eric Andersenafc5e902006-04-19 21:17:49 +000086 gl_cv_c_restrict=no \
Peter Korsgaard3fdf0bf2009-10-01 21:24:42 +020087 ./configure $(QUIET) \
Eric Andersenef7784a2003-01-17 08:03:59 +000088 --target=$(GNU_TARGET_NAME) \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000089 --host=$(GNU_TARGET_NAME) \
90 --build=$(GNU_HOST_NAME) \
Eric Andersenef7784a2003-01-17 08:03:59 +000091 --prefix=/usr \
92 --exec-prefix=/usr \
93 --bindir=/usr/bin \
94 --sbindir=/usr/sbin \
Eric Andersen732d94d2007-01-14 03:52:21 +000095 --libdir=/lib \
Eric Andersenef7784a2003-01-17 08:03:59 +000096 --libexecdir=/usr/lib \
97 --sysconfdir=/etc \
98 --datadir=/usr/share \
99 --localstatedir=/var \
Bernhard Reutner-Fischere4c63402007-09-17 12:30:31 +0000100 --mandir=/usr/share/man \
101 --infodir=/usr/share/info \
Manuel Novoa III 0e956fc2003-09-03 07:18:18 +0000102 $(DISABLE_NLS) \
Manuel Novoa III 50e1da82003-11-17 01:31:38 +0000103 $(DISABLE_LARGEFILE) \
Eric Andersenec59e372003-03-31 20:01:12 +0000104 --disable-rpath \
105 --disable-dependency-tracking \
Bernhard Reutner-Fischer6c6cb062007-08-21 19:20:18 +0000106 )
Bernhard Reutner-Fischer701d2ae2007-06-20 13:25:44 +0000107 touch $@
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000108
109$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured
Mike Frysinger70b5dc82006-04-20 00:58:20 +0000110 $(MAKE) -C $(COREUTILS_DIR)
Eric Andersen55de6e52003-03-06 17:44:29 +0000111 rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000112
113$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY)
Eric Andersena9bfe852003-01-19 06:07:22 +0000114 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000115 # some things go in root rather than usr
116 for f in $(BIN_PROGS); do \
117 mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
118 done
119 # link for archaic shells
120 ln -fs test $(TARGET_DIR)/usr/bin/[
121 # gnu thinks chroot is in bin, debian thinks it's in sbin
122 mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
Bernhard Reutner-Fischer14a71562007-10-01 16:15:31 +0000123 $(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
Bernhard Reutner-Fischere4c63402007-09-17 12:30:31 +0000124ifneq ($(BR2_HAVE_INFOPAGES),y)
125 rm -rf $(TARGET_DIR)/usr/share/info
126endif
127ifneq ($(BR2_HAVE_MANPAGES),y)
128 rm -rf $(TARGET_DIR)/usr/share/man
129endif
130 rm -rf $(TARGET_DIR)/share/locale
131 rm -rf $(TARGET_DIR)/usr/share/doc
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000132
Bernhard Reutner-Fischere4c63402007-09-17 12:30:31 +0000133# If both coreutils and busybox are selected, make certain coreutils
134# wins the fight over who gets to have their utils actually installed.
Eric Andersenb5a211c2004-12-27 21:49:53 +0000135ifeq ($(BR2_PACKAGE_BUSYBOX),y)
Will Newton422ce652009-09-02 16:02:02 +0100136coreutils: busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
Eric Andersenb5a211c2004-12-27 21:49:53 +0000137else
Will Newton422ce652009-09-02 16:02:02 +0100138coreutils: $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
Eric Andersenb5a211c2004-12-27 21:49:53 +0000139endif
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000140
Bernhard Reutner-Fischere4c63402007-09-17 12:30:31 +0000141# If both coreutils and busybox are selected, the corresponding applets
142# may need to be reinstated by the clean targets.
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000143coreutils-clean:
Eric Andersena9bfe852003-01-19 06:07:22 +0000144 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall
Eric Andersenef7784a2003-01-17 08:03:59 +0000145 -$(MAKE) -C $(COREUTILS_DIR) clean
Eric Andersen77bf6fb2002-10-23 12:54:42 +0000146
147coreutils-dirclean:
148 rm -rf $(COREUTILS_DIR)
149
Eric Andersend06645d2005-02-10 03:06:39 +0000150#############################################################
151#
152# Toplevel Makefile options
153#
154#############################################################
Peter Korsgaardac1d92c2008-12-08 08:15:27 +0000155ifeq ($(BR2_PACKAGE_COREUTILS),y)
Eric Andersend06645d2005-02-10 03:06:39 +0000156TARGETS+=coreutils
157endif