Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 1 | ############################################################# |
| 2 | # |
| 3 | # coreutils |
| 4 | # |
| 5 | ############################################################# |
Thomas Petazzoni | 0ef93af | 2009-07-31 13:54:23 +0200 | [diff] [blame] | 6 | COREUTILS_VERSION:=7.4 |
| 7 | COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz |
Bernhard Reutner-Fischer | 1281c7b | 2006-03-08 08:34:32 +0000 | [diff] [blame] | 8 | #COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/ |
Hamish Moffatt | af510f4 | 2008-03-26 03:28:09 +0000 | [diff] [blame] | 9 | COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils |
Thomas Petazzoni | 0ef93af | 2009-07-31 13:54:23 +0200 | [diff] [blame] | 10 | COREUTILS_CAT:=$(ZCAT) |
Ulf Samuelsson | e1621a4 | 2007-07-11 14:06:06 +0000 | [diff] [blame] | 11 | COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION) |
Eric Andersen | 55de6e5 | 2003-03-06 17:44:29 +0000 | [diff] [blame] | 12 | COREUTILS_BINARY:=src/vdir |
| 13 | COREUTILS_TARGET_BINARY:=bin/vdir |
Eric Andersen | 0811c2d | 2003-03-10 17:45:39 +0000 | [diff] [blame] | 14 | BIN_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 Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 16 | |
| 17 | $(DL_DIR)/$(COREUTILS_SOURCE): |
Peter Korsgaard | 4a7bfd2 | 2009-01-16 11:42:52 +0000 | [diff] [blame] | 18 | $(call DOWNLOAD,$(COREUTILS_SITE),$(COREUTILS_SOURCE)) |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 19 | |
| 20 | coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE) |
| 21 | |
| 22 | $(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE) |
Eric Andersen | bb05a9a | 2004-10-09 21:19:47 +0000 | [diff] [blame] | 23 | $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - |
Ulf Samuelsson | 5d19a1f | 2007-07-28 16:39:06 +0000 | [diff] [blame] | 24 | toolchain/patch-kernel.sh $(COREUTILS_DIR) package/coreutils/ coreutils\*.patch |
Hamish Moffatt | 03d6531 | 2008-02-12 00:35:03 +0000 | [diff] [blame] | 25 | $(CONFIG_UPDATE) $(COREUTILS_DIR)/build-aux |
Bernhard Reutner-Fischer | 701d2ae | 2007-06-20 13:25:44 +0000 | [diff] [blame] | 26 | touch $@ |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 27 | |
| 28 | $(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 29 | (cd $(COREUTILS_DIR); rm -rf config.cache; \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 30 | $(TARGET_CONFIGURE_OPTS) \ |
Bernhard Reutner-Fischer | 74d518d | 2007-06-27 12:01:27 +0000 | [diff] [blame] | 31 | $(TARGET_CONFIGURE_ARGS) \ |
Manuel Novoa III | 6857966 | 2004-05-28 17:50:07 +0000 | [diff] [blame] | 32 | ac_cv_func_strtod=yes \ |
Eric Andersen | 94b4383 | 2005-08-15 12:52:38 +0000 | [diff] [blame] | 33 | 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 Korsgaard | dfca1b2 | 2009-09-10 09:21:48 +0200 | [diff] [blame] | 49 | gl_cv_func_rename_trailing_slash_bug=no \ |
Eric Andersen | 94b4383 | 2005-08-15 12:52:38 +0000 | [diff] [blame] | 50 | 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 Andersen | 74b9bf9 | 2005-12-08 06:39:19 +0000 | [diff] [blame] | 55 | ac_cv_func_strerror_r_char_p=no \ |
Eric Andersen | 94b4383 | 2005-08-15 12:52:38 +0000 | [diff] [blame] | 56 | 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 Petazzoni | 0ef93af | 2009-07-31 13:54:23 +0200 | [diff] [blame] | 62 | gl_cv_func_rename_dest_exists_bug=no \ |
Eric Andersen | 94b4383 | 2005-08-15 12:52:38 +0000 | [diff] [blame] | 63 | ac_cv_func_memcmp_working=yes \ |
Eric Andersen | 74b9bf9 | 2005-12-08 06:39:19 +0000 | [diff] [blame] | 64 | 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 Andersen | afc5e90 | 2006-04-19 21:17:49 +0000 | [diff] [blame] | 86 | gl_cv_c_restrict=no \ |
Peter Korsgaard | 3fdf0bf | 2009-10-01 21:24:42 +0200 | [diff] [blame^] | 87 | ./configure $(QUIET) \ |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 88 | --target=$(GNU_TARGET_NAME) \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 89 | --host=$(GNU_TARGET_NAME) \ |
| 90 | --build=$(GNU_HOST_NAME) \ |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 91 | --prefix=/usr \ |
| 92 | --exec-prefix=/usr \ |
| 93 | --bindir=/usr/bin \ |
| 94 | --sbindir=/usr/sbin \ |
Eric Andersen | 732d94d | 2007-01-14 03:52:21 +0000 | [diff] [blame] | 95 | --libdir=/lib \ |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 96 | --libexecdir=/usr/lib \ |
| 97 | --sysconfdir=/etc \ |
| 98 | --datadir=/usr/share \ |
| 99 | --localstatedir=/var \ |
Bernhard Reutner-Fischer | e4c6340 | 2007-09-17 12:30:31 +0000 | [diff] [blame] | 100 | --mandir=/usr/share/man \ |
| 101 | --infodir=/usr/share/info \ |
Manuel Novoa III | 0e956fc | 2003-09-03 07:18:18 +0000 | [diff] [blame] | 102 | $(DISABLE_NLS) \ |
Manuel Novoa III | 50e1da8 | 2003-11-17 01:31:38 +0000 | [diff] [blame] | 103 | $(DISABLE_LARGEFILE) \ |
Eric Andersen | ec59e37 | 2003-03-31 20:01:12 +0000 | [diff] [blame] | 104 | --disable-rpath \ |
| 105 | --disable-dependency-tracking \ |
Bernhard Reutner-Fischer | 6c6cb06 | 2007-08-21 19:20:18 +0000 | [diff] [blame] | 106 | ) |
Bernhard Reutner-Fischer | 701d2ae | 2007-06-20 13:25:44 +0000 | [diff] [blame] | 107 | touch $@ |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 108 | |
| 109 | $(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured |
Mike Frysinger | 70b5dc8 | 2006-04-20 00:58:20 +0000 | [diff] [blame] | 110 | $(MAKE) -C $(COREUTILS_DIR) |
Eric Andersen | 55de6e5 | 2003-03-06 17:44:29 +0000 | [diff] [blame] | 111 | rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 112 | |
| 113 | $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY) |
Eric Andersen | a9bfe85 | 2003-01-19 06:07:22 +0000 | [diff] [blame] | 114 | $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 115 | # 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-Fischer | 14a7156 | 2007-10-01 16:15:31 +0000 | [diff] [blame] | 123 | $(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1 |
Bernhard Reutner-Fischer | e4c6340 | 2007-09-17 12:30:31 +0000 | [diff] [blame] | 124 | ifneq ($(BR2_HAVE_INFOPAGES),y) |
| 125 | rm -rf $(TARGET_DIR)/usr/share/info |
| 126 | endif |
| 127 | ifneq ($(BR2_HAVE_MANPAGES),y) |
| 128 | rm -rf $(TARGET_DIR)/usr/share/man |
| 129 | endif |
| 130 | rm -rf $(TARGET_DIR)/share/locale |
| 131 | rm -rf $(TARGET_DIR)/usr/share/doc |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 132 | |
Bernhard Reutner-Fischer | e4c6340 | 2007-09-17 12:30:31 +0000 | [diff] [blame] | 133 | # If both coreutils and busybox are selected, make certain coreutils |
| 134 | # wins the fight over who gets to have their utils actually installed. |
Eric Andersen | b5a211c | 2004-12-27 21:49:53 +0000 | [diff] [blame] | 135 | ifeq ($(BR2_PACKAGE_BUSYBOX),y) |
Will Newton | 422ce65 | 2009-09-02 16:02:02 +0100 | [diff] [blame] | 136 | coreutils: busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) |
Eric Andersen | b5a211c | 2004-12-27 21:49:53 +0000 | [diff] [blame] | 137 | else |
Will Newton | 422ce65 | 2009-09-02 16:02:02 +0100 | [diff] [blame] | 138 | coreutils: $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) |
Eric Andersen | b5a211c | 2004-12-27 21:49:53 +0000 | [diff] [blame] | 139 | endif |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 140 | |
Bernhard Reutner-Fischer | e4c6340 | 2007-09-17 12:30:31 +0000 | [diff] [blame] | 141 | # If both coreutils and busybox are selected, the corresponding applets |
| 142 | # may need to be reinstated by the clean targets. |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 143 | coreutils-clean: |
Eric Andersen | a9bfe85 | 2003-01-19 06:07:22 +0000 | [diff] [blame] | 144 | $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 145 | -$(MAKE) -C $(COREUTILS_DIR) clean |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 146 | |
| 147 | coreutils-dirclean: |
| 148 | rm -rf $(COREUTILS_DIR) |
| 149 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 150 | ############################################################# |
| 151 | # |
| 152 | # Toplevel Makefile options |
| 153 | # |
| 154 | ############################################################# |
Peter Korsgaard | ac1d92c | 2008-12-08 08:15:27 +0000 | [diff] [blame] | 155 | ifeq ($(BR2_PACKAGE_COREUTILS),y) |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 156 | TARGETS+=coreutils |
| 157 | endif |