coreutils.mk 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ################################################################################
  2. #
  3. # coreutils
  4. #
  5. ################################################################################
  6. COREUTILS_VERSION = 9.0
  7. COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils
  8. COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.xz
  9. COREUTILS_LICENSE = GPL-3.0+
  10. COREUTILS_LICENSE_FILES = COPYING
  11. COREUTILS_CPE_ID_VENDOR = gnu
  12. # Only when including SUSE coreutils-i18n.patch
  13. COREUTILS_IGNORE_CVES = CVE-2013-0221
  14. COREUTILS_IGNORE_CVES += CVE-2013-0222
  15. COREUTILS_IGNORE_CVES += CVE-2013-0223
  16. COREUTILS_CONF_OPTS = --disable-rpath \
  17. $(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex)
  18. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  19. COREUTILS_CONF_OPTS += --disable-single-binary
  20. else
  21. COREUTILS_CONF_OPTS += --enable-single-binary=symlinks
  22. endif
  23. COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
  24. ac_cv_func_chown_works=yes \
  25. ac_cv_func_euidaccess=no \
  26. ac_cv_func_fstatat=yes \
  27. ac_cv_func_getdelim=yes \
  28. ac_cv_func_getgroups=yes \
  29. ac_cv_func_getgroups_works=yes \
  30. ac_cv_func_getloadavg=no \
  31. ac_cv_func_lstat_dereferences_slashed_symlink=yes \
  32. ac_cv_func_lstat_empty_string_bug=no \
  33. ac_cv_func_strerror_r_char_p=no \
  34. ac_cv_func_strnlen_working=yes \
  35. ac_cv_func_strtod=yes \
  36. ac_cv_func_working_mktime=yes \
  37. ac_cv_have_decl_strerror_r=yes \
  38. ac_cv_have_decl_strnlen=yes \
  39. ac_cv_lib_getloadavg_getloadavg=no \
  40. ac_cv_lib_util_getloadavg=no \
  41. ac_fsusage_space=yes \
  42. ac_use_included_regex=no \
  43. am_cv_func_working_getline=yes \
  44. fu_cv_sys_stat_statfs2_bsize=yes \
  45. gl_cv_func_getcwd_null=yes \
  46. gl_cv_func_getcwd_path_max=yes \
  47. gl_cv_func_gettimeofday_clobber=no \
  48. gl_cv_func_fstatat_zero_flag=no \
  49. gl_cv_func_link_follows_symlink=no \
  50. gl_cv_func_re_compile_pattern_working=yes \
  51. gl_cv_func_svid_putenv=yes \
  52. gl_cv_func_tzset_clobber=no \
  53. gl_cv_func_working_mkstemp=yes \
  54. gl_cv_func_working_utimes=yes \
  55. gl_getline_needs_run_time_check=no \
  56. gl_cv_have_proc_uptime=yes \
  57. utils_cv_localtime_cache=no \
  58. PERL=missing \
  59. MAKEINFO=true \
  60. INSTALL_PROGRAM=$(INSTALL)
  61. COREUTILS_BIN_PROGS = base64 cat chgrp chmod chown cp date dd df dir echo false \
  62. kill link ln ls mkdir mknod mktemp mv nice printenv pwd rm rmdir \
  63. vdir sleep stty sync touch true uname join
  64. ifeq ($(BR2_PACKAGE_ACL),y)
  65. COREUTILS_DEPENDENCIES += acl
  66. else
  67. COREUTILS_CONF_OPTS += --disable-acl
  68. endif
  69. ifeq ($(BR2_PACKAGE_ATTR),y)
  70. COREUTILS_DEPENDENCIES += attr
  71. else
  72. COREUTILS_CONF_OPTS += --disable-xattr
  73. endif
  74. COREUTILS_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
  75. # It otherwise fails to link properly, not mandatory though
  76. ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
  77. COREUTILS_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr
  78. endif
  79. ifeq ($(BR2_PACKAGE_GMP),y)
  80. COREUTILS_DEPENDENCIES += gmp
  81. else
  82. COREUTILS_CONF_OPTS += --without-gmp
  83. endif
  84. ifeq ($(BR2_PACKAGE_LIBCAP),y)
  85. COREUTILS_DEPENDENCIES += libcap
  86. else
  87. COREUTILS_CONF_OPTS += --disable-libcap
  88. endif
  89. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  90. COREUTILS_CONF_OPTS += --with-openssl=yes
  91. COREUTILS_DEPENDENCIES += openssl
  92. endif
  93. ifeq ($(BR2_ROOTFS_MERGED_USR),)
  94. # We want to move a few binaries from /usr/bin to /bin. In the case of
  95. # coreutils being built as multi-call binary, we do so by re-creating
  96. # the corresponding symlinks. If coreutils is built with individual
  97. # binaries, we actually move the binaries.
  98. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  99. define COREUTILS_FIX_BIN_LOCATION
  100. $(foreach f,$(COREUTILS_BIN_PROGS), \
  101. mv $(TARGET_DIR)/usr/bin/$(f) $(TARGET_DIR)/bin
  102. )
  103. endef
  104. else
  105. define COREUTILS_FIX_BIN_LOCATION
  106. # some things go in /bin rather than /usr/bin
  107. $(foreach f,$(COREUTILS_BIN_PROGS), \
  108. rm -f $(TARGET_DIR)/usr/bin/$(f) && \
  109. ln -sf ../usr/bin/coreutils $(TARGET_DIR)/bin/$(f)
  110. )
  111. endef
  112. endif
  113. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_BIN_LOCATION
  114. endif
  115. ifeq ($(BR2_STATIC_LIBS),y)
  116. COREUTILS_CONF_OPTS += --enable-no-install-program=stdbuf
  117. endif
  118. # link for archaic shells
  119. define COREUTILS_CREATE_TEST_SYMLINK
  120. ln -fs test $(TARGET_DIR)/usr/bin/[
  121. endef
  122. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CREATE_TEST_SYMLINK
  123. # gnu thinks chroot is in bin, debian thinks it's in sbin
  124. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  125. define COREUTILS_FIX_CHROOT_LOCATION
  126. mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin
  127. endef
  128. else
  129. define COREUTILS_FIX_CHROOT_LOCATION
  130. rm -f $(TARGET_DIR)/usr/bin/chroot
  131. ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot
  132. endef
  133. endif
  134. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_CHROOT_LOCATION
  135. # Explicitly install ln and realpath, which we *are* insterested in.
  136. # A lot of other programs still get installed, however, but disabling
  137. # them does not gain much at build time, and is a loooong list that is
  138. # difficult to maintain... Just avoid overwriting fakedate when creating
  139. # a reproducible build
  140. HOST_COREUTILS_CONF_OPTS = \
  141. --disable-acl \
  142. --disable-libcap \
  143. --disable-rpath \
  144. --disable-single-binary \
  145. --disable-xattr \
  146. --without-gmp \
  147. --enable-install-program=ln,realpath \
  148. --enable-no-install-program=date
  149. $(eval $(autotools-package))
  150. $(eval $(host-autotools-package))