bash.mk 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #############################################################
  2. #
  3. # bash
  4. #
  5. #############################################################
  6. BASH_VERSION:=3.2
  7. BASH_SOURCE:=bash-$(BASH_VERSION).tar.gz
  8. BASH_SITE:=$(BR2_GNU_MIRROR)/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. $(call DOWNLOAD,$(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. ac_cv_have_decl_sys_siglist=yes \
  35. bash_cv_job_control_missing=present \
  36. bash_cv_sys_named_pipes=present \
  37. bash_cv_unusable_rtsigs=no \
  38. bash_cv_func_ctype_nonascii=yes \
  39. bash_cv_decl_under_sys_siglist=yes \
  40. bash_cv_ulimit_maxfds=yes \
  41. bash_cv_getcwd_malloc=yes \
  42. bash_cv_func_sigsetjmp=present \
  43. bash_cv_printf_a_format=yes \
  44. ./configure $(QUIET) \
  45. --target=$(GNU_TARGET_NAME) \
  46. --host=$(GNU_TARGET_NAME) \
  47. --build=$(GNU_HOST_NAME) \
  48. --prefix=/usr \
  49. --exec-prefix=/usr \
  50. --bindir=/usr/bin \
  51. --sbindir=/usr/sbin \
  52. --libdir=/lib \
  53. --libexecdir=/usr/lib \
  54. --sysconfdir=/etc \
  55. --datadir=/usr/share \
  56. --localstatedir=/var \
  57. --mandir=/usr/share/man \
  58. --infodir=/usr/share/info \
  59. --includedir=/usr/include \
  60. $(DISABLE_NLS) \
  61. $(DISABLE_LARGEFILE) \
  62. --with-curses \
  63. --enable-alias \
  64. --without-bash-malloc \
  65. $(ENABLE_DEBUG) \
  66. )
  67. touch $@
  68. $(BASH_DIR)/$(BASH_BINARY): $(BASH_DIR)/.configured
  69. $(MAKE1) CC=$(TARGET_CC) CC_FOR_BUILD="$(HOSTCC)" -C $(BASH_DIR)
  70. $(TARGET_DIR)/$(BASH_TARGET_BINARY): $(BASH_DIR)/$(BASH_BINARY)
  71. mkdir -p $(TARGET_DIR)/bin
  72. $(MAKE1) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) install
  73. rm -f $(TARGET_DIR)/bin/bash*
  74. mv $(TARGET_DIR)/usr/bin/bash* $(TARGET_DIR)/bin/
  75. (cd $(TARGET_DIR)/bin; /bin/ln -fs bash sh)
  76. ifneq ($(BR2_HAVE_INFOPAGES),y)
  77. rm -rf $(TARGET_DIR)/usr/share/info
  78. endif
  79. ifneq ($(BR2_HAVE_MANPAGES),y)
  80. rm -rf $(TARGET_DIR)/usr/share/man
  81. endif
  82. rm -rf $(TARGET_DIR)/share/locale
  83. rm -rf $(TARGET_DIR)/usr/share/doc
  84. # If both bash and busybox are selected, make certain bash wins
  85. # the fight over who gets to own the /bin/sh symlink.
  86. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  87. bash: ncurses busybox $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  88. else
  89. bash: ncurses $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  90. endif
  91. # If both bash and busybox are selected, the /bin/sh symlink
  92. # may need to be reinstated by the clean targets.
  93. bash-clean:
  94. -$(MAKE1) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) uninstall
  95. rm -f $(TARGET_DIR)/$(BASH_TARGET_BINARY)
  96. -$(MAKE1) -C $(BASH_DIR) clean
  97. bash-dirclean:
  98. rm -rf $(BASH_DIR)
  99. #############################################################
  100. #
  101. # Toplevel Makefile options
  102. #
  103. #############################################################
  104. ifeq ($(BR2_PACKAGE_BASH),y)
  105. TARGETS+=bash
  106. endif