bash.mk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #############################################################
  2. #
  3. # bash
  4. #
  5. #############################################################
  6. BASH_VERSION = 4.1
  7. BASH_SITE = $(BR2_GNU_MIRROR)/bash
  8. BASH_DEPENDENCIES = ncurses
  9. # Make sure we build after busybox so that /bin/sh links to bash
  10. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  11. BASH_DEPENDENCIES += busybox
  12. endif
  13. # Save the old sh file/link if there is one and symlink bash->sh
  14. define BASH_INSTALL_TARGET_CMDS
  15. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
  16. DESTDIR=$(TARGET_DIR) exec_prefix=/ install
  17. rm -f $(TARGET_DIR)/bin/bashbug
  18. if [ -e $(TARGET_DIR)/bin/sh ]; then \
  19. mv -f $(TARGET_DIR)/bin/sh $(TARGET_DIR)/bin/sh.prebash; \
  20. fi
  21. ln -sf bash $(TARGET_DIR)/bin/sh
  22. endef
  23. # Restore the old shell file/link if there was one
  24. define BASH_UNINSTALL_TARGET_CMDS
  25. $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) \
  26. -C $(BASH_DIR) exec_prefix=/ uninstall
  27. rm -f $(TARGET_DIR)/bin/sh
  28. if [ -e $(TARGET_DIR)/bin/sh.prebash ]; then \
  29. mv -f $(TARGET_DIR)/bin/sh.prebash $(TARGET_DIR)/bin/sh; \
  30. fi
  31. endef
  32. $(eval $(call AUTOTARGETS,package,bash))