bash.mk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ################################################################################
  2. #
  3. # bash
  4. #
  5. ################################################################################
  6. BASH_VERSION = 4.2
  7. BASH_SITE = $(BR2_GNU_MIRROR)/bash
  8. BASH_DEPENDENCIES = ncurses host-bison
  9. BASH_LICENSE = GPLv3+
  10. BASH_LICENSE_FILES = COPYING
  11. BASH_CONF_ENV += \
  12. bash_cv_job_control_missing=present \
  13. bash_cv_sys_named_pipes=present \
  14. bash_cv_func_sigsetjmp=present \
  15. bash_cv_printf_a_format=yes
  16. # Parallel build sometimes fails because some of the generator tools
  17. # are built twice (i.e. while executing).
  18. BASH_MAKE = $(MAKE1)
  19. # The static build needs some trickery
  20. ifeq ($(BR2_PREFER_STATIC_LIB),y)
  21. BASH_CONF_OPT += --enable-static-link --without-bash-malloc
  22. endif
  23. # Make sure we build after busybox so that /bin/sh links to bash
  24. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  25. BASH_DEPENDENCIES += busybox
  26. endif
  27. # Save the old sh file/link if there is one and symlink bash->sh
  28. define BASH_INSTALL_TARGET_CMDS
  29. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
  30. DESTDIR=$(TARGET_DIR) exec_prefix=/ install
  31. rm -f $(TARGET_DIR)/bin/bashbug
  32. if [ -e $(TARGET_DIR)/bin/sh ]; then \
  33. mv -f $(TARGET_DIR)/bin/sh $(TARGET_DIR)/bin/sh.prebash; \
  34. fi
  35. ln -sf bash $(TARGET_DIR)/bin/sh
  36. endef
  37. # Restore the old shell file/link if there was one
  38. define BASH_UNINSTALL_TARGET_CMDS
  39. $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) \
  40. -C $(BASH_DIR) exec_prefix=/ uninstall
  41. rm -f $(TARGET_DIR)/bin/sh
  42. if [ -e $(TARGET_DIR)/bin/sh.prebash ]; then \
  43. mv -f $(TARGET_DIR)/bin/sh.prebash $(TARGET_DIR)/bin/sh; \
  44. fi
  45. endef
  46. $(eval $(autotools-package))