coreutils.mk 5.2 KB

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