coreutils.mk 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #############################################################
  2. #
  3. # coreutils
  4. #
  5. #############################################################
  6. COREUTILS_VERSION:=6.9
  7. COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.bz2
  8. #COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/
  9. COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils
  10. COREUTILS_CAT:=$(BZCAT)
  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. ac_cv_func_memcmp_working=yes \
  59. ac_cv_have_decl_malloc=yes \
  60. gl_cv_func_malloc_0_nonnull=yes \
  61. ac_cv_func_malloc_0_nonnull=yes \
  62. ac_cv_func_calloc_0_nonnull=yes \
  63. ac_cv_func_realloc_0_nonnull=yes \
  64. jm_cv_func_gettimeofday_clobber=no \
  65. am_cv_func_working_getline=yes \
  66. gl_cv_func_working_readdir=yes \
  67. jm_ac_cv_func_link_follows_symlink=no \
  68. utils_cv_localtime_cache=no \
  69. ac_cv_struct_st_mtim_nsec=no \
  70. gl_cv_func_tzset_clobber=no \
  71. gl_cv_func_getcwd_null=yes \
  72. gl_cv_func_getcwd_path_max=yes \
  73. ac_cv_func_fnmatch_gnu=yes \
  74. am_getline_needs_run_time_check=no \
  75. am_cv_func_working_getline=yes \
  76. gl_cv_func_mkdir_trailing_slash_bug=no \
  77. gl_cv_func_mkstemp_limitations=no \
  78. ac_cv_func_working_mktime=yes \
  79. jm_cv_func_working_re_compile_pattern=yes \
  80. ac_use_included_regex=no \
  81. gl_cv_c_restrict=no \
  82. ./configure \
  83. --target=$(GNU_TARGET_NAME) \
  84. --host=$(GNU_TARGET_NAME) \
  85. --build=$(GNU_HOST_NAME) \
  86. --prefix=/usr \
  87. --exec-prefix=/usr \
  88. --bindir=/usr/bin \
  89. --sbindir=/usr/sbin \
  90. --libdir=/lib \
  91. --libexecdir=/usr/lib \
  92. --sysconfdir=/etc \
  93. --datadir=/usr/share \
  94. --localstatedir=/var \
  95. --mandir=/usr/share/man \
  96. --infodir=/usr/share/info \
  97. $(DISABLE_NLS) \
  98. $(DISABLE_LARGEFILE) \
  99. --disable-rpath \
  100. --disable-dependency-tracking \
  101. )
  102. touch $@
  103. $(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured
  104. $(MAKE) -C $(COREUTILS_DIR)
  105. rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  106. $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY)
  107. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install
  108. # some things go in root rather than usr
  109. for f in $(BIN_PROGS); do \
  110. mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
  111. done
  112. # link for archaic shells
  113. ln -fs test $(TARGET_DIR)/usr/bin/[
  114. # gnu thinks chroot is in bin, debian thinks it's in sbin
  115. mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
  116. $(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
  117. ifneq ($(BR2_HAVE_INFOPAGES),y)
  118. rm -rf $(TARGET_DIR)/usr/share/info
  119. endif
  120. ifneq ($(BR2_HAVE_MANPAGES),y)
  121. rm -rf $(TARGET_DIR)/usr/share/man
  122. endif
  123. rm -rf $(TARGET_DIR)/share/locale
  124. rm -rf $(TARGET_DIR)/usr/share/doc
  125. # If both coreutils and busybox are selected, make certain coreutils
  126. # wins the fight over who gets to have their utils actually installed.
  127. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  128. coreutils: uclibc busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  129. else
  130. coreutils: uclibc $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
  131. endif
  132. # If both coreutils and busybox are selected, the corresponding applets
  133. # may need to be reinstated by the clean targets.
  134. coreutils-clean:
  135. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall
  136. -$(MAKE) -C $(COREUTILS_DIR) clean
  137. coreutils-dirclean:
  138. rm -rf $(COREUTILS_DIR)
  139. #############################################################
  140. #
  141. # Toplevel Makefile options
  142. #
  143. #############################################################
  144. ifeq ($(BR2_PACKAGE_COREUTILS),y)
  145. TARGETS+=coreutils
  146. endif