bash.mk 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #############################################################
  2. #
  3. # bash
  4. #
  5. #############################################################
  6. BASH_VERSION:=3.2
  7. BASH_SOURCE:=bash-$(BASH_VERSION).tar.gz
  8. BASH_SITE:=http://ftp.gnu.org/pub/gnu/bash
  9. BASH_CAT:=$(ZCAT)
  10. BASH_DIR:=$(BUILD_DIR)/bash-$(BASH_VERSION)
  11. BASH_BINARY:=bash
  12. BASH_TARGET_BINARY:=bin/bash
  13. $(DL_DIR)/$(BASH_SOURCE):
  14. $(WGET) -P $(DL_DIR) $(BASH_SITE)/$(BASH_SOURCE)
  15. bash-source: $(DL_DIR)/$(BASH_SOURCE)
  16. bash-unpacked: $(BASH_DIR)/.unpacked
  17. $(BASH_DIR)/.unpacked: $(DL_DIR)/$(BASH_SOURCE)
  18. $(BASH_CAT) $(DL_DIR)/$(BASH_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  19. toolchain/patch-kernel.sh $(BASH_DIR) package/bash/ bash??-\*
  20. # This is broken when -lintl is added to LIBS
  21. $(SED) 's,LIBS_FOR_BUILD =.*,LIBS_FOR_BUILD =,g' \
  22. $(BASH_DIR)/builtins/Makefile.in
  23. # using target's LDFLAGS as LDFLAGS_FOR_BUILD is b0rked
  24. -$(SED) '/^LDFLAGS_FOR_BUILD/d' $(BASH_DIR)/{,*/{,*/}}Makefile.in
  25. $(CONFIG_UPDATE) $(BASH_DIR)/support
  26. touch $@
  27. $(BASH_DIR)/.configured: $(BASH_DIR)/.unpacked
  28. # bash_cv_have_mbstate_t=yes
  29. (cd $(BASH_DIR); rm -rf config.cache; \
  30. $(TARGET_CONFIGURE_OPTS) \
  31. $(TARGET_CONFIGURE_ARGS) \
  32. CCFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
  33. ac_cv_func_setvbuf_reversed=no \
  34. ./configure \
  35. --target=$(GNU_TARGET_NAME) \
  36. --host=$(GNU_TARGET_NAME) \
  37. --build=$(GNU_HOST_NAME) \
  38. --prefix=/usr \
  39. --exec-prefix=/usr \
  40. --bindir=/usr/bin \
  41. --sbindir=/usr/sbin \
  42. --libdir=/lib \
  43. --libexecdir=/usr/lib \
  44. --sysconfdir=/etc \
  45. --datadir=/usr/share \
  46. --localstatedir=/var \
  47. --mandir=/usr/share/man \
  48. --infodir=/usr/share/info \
  49. --includedir=/usr/include \
  50. $(DISABLE_NLS) \
  51. $(DISABLE_LARGEFILE) \
  52. --with-curses \
  53. --enable-alias \
  54. --without-bash-malloc \
  55. )
  56. touch $@
  57. $(BASH_DIR)/$(BASH_BINARY): $(BASH_DIR)/.configured
  58. $(MAKE1) CC=$(TARGET_CC) CC_FOR_BUILD="$(HOSTCC)" -C $(BASH_DIR)
  59. $(TARGET_DIR)/$(BASH_TARGET_BINARY): $(BASH_DIR)/$(BASH_BINARY)
  60. mkdir -p $(TARGET_DIR)/bin
  61. $(MAKE1) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) install
  62. rm -f $(TARGET_DIR)/bin/bash*
  63. mv $(TARGET_DIR)/usr/bin/bash* $(TARGET_DIR)/bin/
  64. (cd $(TARGET_DIR)/bin; /bin/ln -fs bash sh)
  65. ifneq ($(BR2_HAVE_INFOPAGES),y)
  66. rm -rf $(TARGET_DIR)/usr/share/info
  67. endif
  68. ifneq ($(BR2_HAVE_MANPAGES),y)
  69. rm -rf $(TARGET_DIR)/usr/share/man
  70. endif
  71. rm -rf $(TARGET_DIR)/share/locale
  72. rm -rf $(TARGET_DIR)/usr/share/doc
  73. # If both bash and busybox are selected, make certain bash wins
  74. # the fight over who gets to own the /bin/sh symlink.
  75. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  76. bash: ncurses uclibc busybox $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  77. else
  78. bash: ncurses uclibc $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  79. endif
  80. # If both bash and busybox are selected, the /bin/sh symlink
  81. # may need to be reinstated by the clean targets.
  82. bash-clean:
  83. -$(MAKE1) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) uninstall
  84. rm -f $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  85. -$(MAKE1) -C $(BASH_DIR) clean
  86. bash-dirclean:
  87. rm -rf $(BASH_DIR)
  88. #############################################################
  89. #
  90. # Toplevel Makefile options
  91. #
  92. #############################################################
  93. ifeq ($(strip $(BR2_PACKAGE_BASH)),y)
  94. TARGETS+=bash
  95. endif