bash.mk 1.7 KB

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