coreutils.mk 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #############################################################
  2. #
  3. # coreutils
  4. #
  5. #############################################################
  6. COREUTILS_VERSION:=7.4
  7. COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz
  8. #COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/
  9. COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils
  10. COREUTILS_CAT:=$(ZCAT)
  11. COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION)
  12. COREUTILS_BINARY:=src/vdir
  13. COREUTILS_TARGET_BINARY:=bin/vdir
  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
  16. $(DL_DIR)/$(COREUTILS_SOURCE):
  17. $(call DOWNLOAD,$(COREUTILS_SITE),$(COREUTILS_SOURCE))
  18. coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE)
  19. $(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE)
  20. $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  21. toolchain/patch-kernel.sh $(COREUTILS_DIR) package/coreutils/ coreutils\*.patch
  22. $(CONFIG_UPDATE) $(COREUTILS_DIR)/build-aux
  23. # ensure rename.m4 file is older than configure / aclocal.m4 so
  24. # auto* isn't rerun
  25. touch -d '1979-01-01' $(@D)/m4/rename.m4
  26. touch $@
  27. $(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
  28. (cd $(COREUTILS_DIR); rm -rf config.cache; \
  29. $(TARGET_CONFIGURE_OPTS) \
  30. $(TARGET_CONFIGURE_ARGS) \
  31. ac_cv_func_strtod=yes \
  32. ac_fsusage_space=yes \
  33. fu_cv_sys_stat_statfs2_bsize=yes \
  34. ac_cv_func_closedir_void=no \
  35. ac_cv_func_getloadavg=no \
  36. ac_cv_lib_util_getloadavg=no \
  37. ac_cv_lib_getloadavg_getloadavg=no \
  38. ac_cv_func_getgroups=yes \
  39. ac_cv_func_getgroups_works=yes \
  40. ac_cv_func_chown_works=yes \
  41. ac_cv_have_decl_euidaccess=no \
  42. ac_cv_func_euidaccess=no \
  43. ac_cv_have_decl_strnlen=yes \
  44. ac_cv_func_strnlen_working=yes \
  45. ac_cv_func_lstat_dereferences_slashed_symlink=yes \
  46. ac_cv_func_lstat_empty_string_bug=no \
  47. ac_cv_func_stat_empty_string_bug=no \
  48. gl_cv_func_rename_trailing_slash_bug=no \
  49. ac_cv_have_decl_nanosleep=yes \
  50. jm_cv_func_nanosleep_works=yes \
  51. gl_cv_func_working_utimes=yes \
  52. ac_cv_func_utime_null=yes \
  53. ac_cv_have_decl_strerror_r=yes \
  54. ac_cv_func_strerror_r_char_p=no \
  55. jm_cv_func_svid_putenv=yes \
  56. ac_cv_func_getcwd_null=yes \
  57. ac_cv_func_getdelim=yes \
  58. ac_cv_func_mkstemp=yes \
  59. utils_cv_func_mkstemp_limitations=no \
  60. utils_cv_func_mkdir_trailing_slash_bug=no \
  61. gl_cv_func_rename_dest_exists_bug=no \
  62. jm_cv_func_gettimeofday_clobber=no \
  63. am_cv_func_working_getline=yes \
  64. gl_cv_func_working_readdir=yes \
  65. jm_ac_cv_func_link_follows_symlink=no \
  66. utils_cv_localtime_cache=no \
  67. ac_cv_struct_st_mtim_nsec=no \
  68. gl_cv_func_tzset_clobber=no \
  69. gl_cv_func_getcwd_null=yes \
  70. gl_cv_func_getcwd_path_max=yes \
  71. ac_cv_func_fnmatch_gnu=yes \
  72. am_getline_needs_run_time_check=no \
  73. am_cv_func_working_getline=yes \
  74. gl_cv_func_mkdir_trailing_slash_bug=no \
  75. gl_cv_func_mkstemp_limitations=no \
  76. ac_cv_func_working_mktime=yes \
  77. jm_cv_func_working_re_compile_pattern=yes \
  78. ac_use_included_regex=no \
  79. gl_cv_c_restrict=no \
  80. ./configure $(QUIET) \
  81. --target=$(GNU_TARGET_NAME) \
  82. --host=$(GNU_TARGET_NAME) \
  83. --build=$(GNU_HOST_NAME) \
  84. --prefix=/usr \
  85. --exec-prefix=/usr \
  86. --bindir=/usr/bin \
  87. --sbindir=/usr/sbin \
  88. --libdir=/lib \
  89. --libexecdir=/usr/lib \
  90. --sysconfdir=/etc \
  91. --datadir=/usr/share \
  92. --localstatedir=/var \
  93. --mandir=/usr/share/man \
  94. --infodir=/usr/share/info \
  95. $(DISABLE_NLS) \
  96. $(DISABLE_LARGEFILE) \
  97. --disable-rpath \
  98. --disable-dependency-tracking \
  99. )
  100. touch $@
  101. $(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured
  102. $(MAKE) -C $(COREUTILS_DIR)
  103. rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  104. $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY)
  105. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install
  106. # some things go in root rather than usr
  107. for f in $(BIN_PROGS); do \
  108. mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
  109. done
  110. # link for archaic shells
  111. ln -fs test $(TARGET_DIR)/usr/bin/[
  112. # gnu thinks chroot is in bin, debian thinks it's in sbin
  113. mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
  114. $(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
  115. ifneq ($(BR2_HAVE_INFOPAGES),y)
  116. rm -rf $(TARGET_DIR)/usr/share/info
  117. endif
  118. ifneq ($(BR2_HAVE_MANPAGES),y)
  119. rm -rf $(TARGET_DIR)/usr/share/man
  120. endif
  121. rm -rf $(TARGET_DIR)/share/locale
  122. rm -rf $(TARGET_DIR)/usr/share/doc
  123. # If both coreutils and busybox are selected, make certain coreutils
  124. # wins the fight over who gets to have their utils actually installed.
  125. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  126. coreutils: busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  127. else
  128. coreutils: $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  129. endif
  130. # If both coreutils and busybox are selected, the corresponding applets
  131. # may need to be reinstated by the clean targets.
  132. coreutils-clean:
  133. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall
  134. -$(MAKE) -C $(COREUTILS_DIR) clean
  135. coreutils-dirclean:
  136. rm -rf $(COREUTILS_DIR)
  137. #############################################################
  138. #
  139. # Toplevel Makefile options
  140. #
  141. #############################################################
  142. ifeq ($(BR2_PACKAGE_COREUTILS),y)
  143. TARGETS+=coreutils
  144. endif