coreutils.mk 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ################################################################################
  2. #
  3. # coreutils
  4. #
  5. ################################################################################
  6. COREUTILS_VERSION = 8.32
  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_CONF_OPTS = --disable-rpath \
  12. $(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex)
  13. ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
  14. COREUTILS_CONF_OPTS += --disable-single-binary
  15. else
  16. COREUTILS_CONF_OPTS += --enable-single-binary=symlinks
  17. endif
  18. COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
  19. ac_cv_func_chown_works=yes \
  20. ac_cv_func_euidaccess=no \
  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_lstat_dereferences_slashed_symlink=yes \
  27. ac_cv_func_lstat_empty_string_bug=no \
  28. ac_cv_func_strerror_r_char_p=no \
  29. ac_cv_func_strnlen_working=yes \
  30. ac_cv_func_strtod=yes \
  31. ac_cv_func_working_mktime=yes \
  32. ac_cv_have_decl_strerror_r=yes \
  33. ac_cv_have_decl_strnlen=yes \
  34. ac_cv_lib_getloadavg_getloadavg=no \
  35. ac_cv_lib_util_getloadavg=no \
  36. ac_fsusage_space=yes \
  37. ac_use_included_regex=no \
  38. am_cv_func_working_getline=yes \
  39. fu_cv_sys_stat_statfs2_bsize=yes \
  40. gl_cv_func_getcwd_null=yes \
  41. gl_cv_func_getcwd_path_max=yes \
  42. gl_cv_func_gettimeofday_clobber=no \
  43. gl_cv_func_fstatat_zero_flag=no \
  44. gl_cv_func_link_follows_symlink=no \
  45. gl_cv_func_re_compile_pattern_working=yes \
  46. gl_cv_func_svid_putenv=yes \
  47. gl_cv_func_tzset_clobber=no \
  48. gl_cv_func_working_mkstemp=yes \
  49. gl_cv_func_working_utimes=yes \
  50. gl_getline_needs_run_time_check=no \
  51. gl_cv_have_proc_uptime=yes \
  52. utils_cv_localtime_cache=no \
  53. PERL=missing \
  54. MAKEINFO=true \
  55. INSTALL_PROGRAM=$(INSTALL)
  56. COREUTILS_BIN_PROGS = base64 cat chgrp chmod chown cp date dd df dir echo false \
  57. kill link ln ls mkdir mknod mktemp mv nice printenv pwd rm rmdir \
  58. vdir sleep stty sync touch true uname join
  59. ifeq ($(BR2_PACKAGE_ACL),y)
  60. COREUTILS_DEPENDENCIES += acl
  61. else
  62. COREUTILS_CONF_OPTS += --disable-acl
  63. endif
  64. ifeq ($(BR2_PACKAGE_ATTR),y)
  65. COREUTILS_DEPENDENCIES += attr
  66. else
  67. COREUTILS_CONF_OPTS += --disable-xattr
  68. endif
  69. COREUTILS_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
  70. # It otherwise fails to link properly, not mandatory though
  71. ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
  72. COREUTILS_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr
  73. endif
  74. ifeq ($(BR2_PACKAGE_GMP),y)
  75. COREUTILS_DEPENDENCIES += gmp
  76. else
  77. COREUTILS_CONF_OPTS += --without-gmp
  78. endif
  79. ifeq ($(BR2_PACKAGE_LIBCAP),y)
  80. COREUTILS_DEPENDENCIES += libcap
  81. else
  82. COREUTILS_CONF_OPTS += --disable-libcap
  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...
  134. HOST_COREUTILS_CONF_OPTS = \
  135. --disable-acl \
  136. --disable-libcap \
  137. --disable-rpath \
  138. --disable-single-binary \
  139. --disable-xattr \
  140. --without-gmp \
  141. --enable-install-program=ln,realpath
  142. $(eval $(autotools-package))
  143. $(eval $(host-autotools-package))