bash.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ################################################################################
  2. #
  3. # bash
  4. #
  5. ################################################################################
  6. BASH_VERSION = 5.0
  7. BASH_SITE = $(BR2_GNU_MIRROR)/bash
  8. BASH_DEPENDENCIES = ncurses readline host-bison
  9. BASH_CONF_OPTS = --with-installed-readline --without-bash-malloc
  10. BASH_LICENSE = GPL-3.0+
  11. BASH_LICENSE_FILES = COPYING
  12. BASH_CPE_ID_VENDOR = gnu
  13. BASH_CONF_ENV += \
  14. ac_cv_rl_prefix="$(STAGING_DIR)" \
  15. ac_cv_rl_version="$(READLINE_VERSION)" \
  16. bash_cv_getcwd_malloc=yes \
  17. bash_cv_job_control_missing=present \
  18. bash_cv_sys_named_pipes=present \
  19. bash_cv_func_sigsetjmp=present \
  20. bash_cv_printf_a_format=yes
  21. # The static build needs some trickery
  22. ifeq ($(BR2_STATIC_LIBS),y)
  23. BASH_CONF_OPTS += --enable-static-link
  24. BASH_CONF_ENV += SHOBJ_STATUS=unsupported
  25. # bash wants to redefine the getenv() function. To check whether this is
  26. # possible, AC_TRY_RUN is used which is not possible in
  27. # cross-compilation.
  28. # On uClibc, redefining getenv is not possible; on glibc and musl it is.
  29. # Related:
  30. # http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00052.html
  31. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  32. BASH_CONF_ENV += bash_cv_getenv_redef=no
  33. else
  34. BASH_CONF_ENV += bash_cv_getenv_redef=yes
  35. endif
  36. endif
  37. define BASH_INSTALL_TARGET_CMDS
  38. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
  39. DESTDIR=$(TARGET_DIR) exec_prefix=/ install
  40. rm -f $(TARGET_DIR)/bin/bashbug
  41. endef
  42. # Add /bin/bash to /etc/shells otherwise some login tools like dropbear
  43. # can reject the user connection. See man shells.
  44. define BASH_ADD_MKSH_TO_SHELLS
  45. grep -qsE '^/bin/bash$$' $(TARGET_DIR)/etc/shells \
  46. || echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
  47. endef
  48. BASH_TARGET_FINALIZE_HOOKS += BASH_ADD_MKSH_TO_SHELLS
  49. $(eval $(autotools-package))