coreutils.mk 5.1 KB

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