bash.mk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ################################################################################
  2. #
  3. # bash
  4. #
  5. ################################################################################
  6. BASH_VERSION = 5.1.16
  7. BASH_SITE = $(BR2_GNU_MIRROR)/bash
  8. BASH_DEPENDENCIES = ncurses readline host-bison
  9. BASH_LICENSE = GPL-3.0+
  10. BASH_LICENSE_FILES = COPYING
  11. BASH_CPE_ID_VENDOR = gnu
  12. # We want the bash binary in /bin
  13. BASH_CONF_OPTS = \
  14. --bindir=/bin \
  15. --with-installed-readline \
  16. --without-bash-malloc
  17. BASH_CONF_ENV += \
  18. ac_cv_rl_prefix="$(STAGING_DIR)" \
  19. ac_cv_rl_version="$(READLINE_VERSION)" \
  20. bash_cv_getcwd_malloc=yes \
  21. bash_cv_job_control_missing=present \
  22. bash_cv_sys_named_pipes=present \
  23. bash_cv_func_sigsetjmp=present \
  24. bash_cv_printf_a_format=yes
  25. # The static build needs some trickery
  26. ifeq ($(BR2_STATIC_LIBS),y)
  27. BASH_CONF_OPTS += --enable-static-link
  28. # bash wants to redefine the getenv() function. To check whether this is
  29. # possible, AC_TRY_RUN is used which is not possible in
  30. # cross-compilation.
  31. # On uClibc, redefining getenv is not possible; on glibc and musl it is.
  32. # Related:
  33. # http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00052.html
  34. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  35. BASH_CONF_ENV += bash_cv_getenv_redef=no
  36. else
  37. BASH_CONF_ENV += bash_cv_getenv_redef=yes
  38. endif
  39. endif
  40. define BASH_REMOVE_UNUSED_FILES
  41. rm -f $(TARGET_DIR)/bin/bashbug
  42. endef
  43. BASH_POST_INSTALL_TARGET_HOOKS += BASH_REMOVE_UNUSED_FILES
  44. ifeq ($(BR2_PACKAGE_BASH_LOADABLE_EXAMPLES),y)
  45. define BASH_REMOVE_LOADABLE_UNUSED_FILES
  46. rm -f $(TARGET_DIR)/usr/lib/bash/Makefile.inc
  47. rm -f $(TARGET_DIR)/usr/lib/bash/loadables.h
  48. endef
  49. BASH_POST_INSTALL_TARGET_HOOKS += BASH_REMOVE_LOADABLE_UNUSED_FILES
  50. else
  51. define BASH_REMOVE_LOADABLE_EXAMPLES
  52. rm -rf $(TARGET_DIR)/usr/lib/bash
  53. endef
  54. BASH_POST_INSTALL_TARGET_HOOKS += BASH_REMOVE_LOADABLE_EXAMPLES
  55. endif
  56. # Add /bin/bash to /etc/shells otherwise some login tools like dropbear
  57. # can reject the user connection. See man shells.
  58. define BASH_ADD_BASH_TO_SHELLS
  59. grep -qsE '^/bin/bash$$' $(TARGET_DIR)/etc/shells \
  60. || echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
  61. endef
  62. BASH_TARGET_FINALIZE_HOOKS += BASH_ADD_BASH_TO_SHELLS
  63. $(eval $(autotools-package))