coreutils.mk 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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_GMP),y)
  69. COREUTILS_DEPENDENCIES += gmp
  70. else
  71. COREUTILS_CONF_OPTS += --without-gmp
  72. endif
  73. ifeq ($(BR2_PACKAGE_LIBCAP),y)
  74. COREUTILS_DEPENDENCIES += libcap
  75. else
  76. COREUTILS_CONF_OPTS += --disable-libcap
  77. endif
  78. ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
  79. COREUTILS_DEPENDENCIES += libselinux
  80. COREUTILS_CONF_OPTS += --with-selinux
  81. else
  82. COREUTILS_CONF_OPTS += --without-selinux
  83. endif
  84. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  85. COREUTILS_CONF_OPTS += --with-openssl=yes
  86. COREUTILS_DEPENDENCIES += openssl
  87. endif
  88. ifeq ($(BR2_ROOTFS_MERGED_USR),)
  89. # We want to move a few binaries from /usr/bin to /bin. In the case of
  90. # coreutils being built as multi-call binary, we do so by re-creating
  91. # the corresponding symlinks. If coreutils is built with individual
  92. # binaries, we actually move the binaries.
  93. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  94. define COREUTILS_FIX_BIN_LOCATION
  95. $(foreach f,$(COREUTILS_BIN_PROGS), \
  96. mv $(TARGET_DIR)/usr/bin/$(f) $(TARGET_DIR)/bin
  97. )
  98. endef
  99. else
  100. define COREUTILS_FIX_BIN_LOCATION
  101. # some things go in /bin rather than /usr/bin
  102. $(foreach f,$(COREUTILS_BIN_PROGS), \
  103. rm -f $(TARGET_DIR)/usr/bin/$(f) && \
  104. ln -sf ../usr/bin/coreutils $(TARGET_DIR)/bin/$(f)
  105. )
  106. endef
  107. endif
  108. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_BIN_LOCATION
  109. endif
  110. ifeq ($(BR2_STATIC_LIBS),y)
  111. COREUTILS_CONF_OPTS += --enable-no-install-program=stdbuf
  112. endif
  113. # link for archaic shells
  114. define COREUTILS_CREATE_TEST_SYMLINK
  115. ln -fs test $(TARGET_DIR)/usr/bin/[
  116. endef
  117. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CREATE_TEST_SYMLINK
  118. # gnu thinks chroot is in bin, debian thinks it's in sbin
  119. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  120. define COREUTILS_FIX_CHROOT_LOCATION
  121. mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin
  122. endef
  123. else
  124. define COREUTILS_FIX_CHROOT_LOCATION
  125. rm -f $(TARGET_DIR)/usr/bin/chroot
  126. ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot
  127. endef
  128. endif
  129. COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_CHROOT_LOCATION
  130. # Explicitly install ln and realpath, which we *are* insterested in.
  131. # A lot of other programs still get installed, however, but disabling
  132. # them does not gain much at build time, and is a loooong list that is
  133. # difficult to maintain... Just avoid overwriting fakedate when creating
  134. # a reproducible build
  135. HOST_COREUTILS_CONF_OPTS = \
  136. --disable-acl \
  137. --disable-libcap \
  138. --disable-rpath \
  139. --disable-single-binary \
  140. --disable-xattr \
  141. --without-gmp \
  142. --enable-install-program=ln,realpath \
  143. --enable-no-install-program=date
  144. $(eval $(autotools-package))
  145. $(eval $(host-autotools-package))