coreutils.mk 4.7 KB

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