2
1

gdb.mk 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. ######################################################################
  2. #
  3. # gdb
  4. #
  5. ######################################################################
  6. GDB_VERSION:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
  7. #"
  8. GDB_SITE:=http://ftp.gnu.org/gnu/gdb
  9. GDB_SOURCE:=gdb-$(GDB_VERSION).tar.bz2
  10. GDB_CAT:=bzcat
  11. GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
  12. $(DL_DIR)/$(GDB_SOURCE):
  13. $(WGET) -P $(DL_DIR) $(GDB_SITE)/$(GDB_SOURCE)
  14. $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
  15. $(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
  16. toolchain/patch-kernel.sh $(GDB_DIR) toolchain/gdb/$(GDB_VERSION) \*.patch
  17. # Copy a config.sub from gcc. This is only necessary until
  18. # gdb's config.sub supports <arch>-linux-uclibc tuples.
  19. # Should probably integrate this into the patch.
  20. touch $(GDB_DIR)/.unpacked
  21. ######################################################################
  22. #
  23. # gdb target
  24. #
  25. ######################################################################
  26. GDB_TARGET_DIR:=$(BUILD_DIR)/gdb-$(GDB_VERSION)-target
  27. GDB_TARGET_CONFIGURE_VARS:= \
  28. ac_cv_type_uintptr_t=yes \
  29. gt_cv_func_gettext_libintl=yes \
  30. ac_cv_func_dcgettext=yes \
  31. gdb_cv_func_sigsetjmp=yes \
  32. bash_cv_func_strcoll_broken=no \
  33. bash_cv_must_reinstall_sighandlers=no \
  34. bash_cv_func_sigsetjmp=present \
  35. bash_cv_have_mbstate_t=yes
  36. $(GDB_TARGET_DIR)/.configured: $(GDB_DIR)/.unpacked
  37. mkdir -p $(GDB_TARGET_DIR)
  38. (cd $(GDB_TARGET_DIR); \
  39. gdb_cv_func_sigsetjmp=yes \
  40. $(TARGET_CONFIGURE_OPTS) \
  41. CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
  42. $(GDB_TARGET_CONFIGURE_VARS) \
  43. $(GDB_DIR)/configure \
  44. --build=$(GNU_HOST_NAME) \
  45. --host=$(REAL_GNU_TARGET_NAME) \
  46. --target=$(REAL_GNU_TARGET_NAME) \
  47. --prefix=/usr \
  48. $(DISABLE_NLS) \
  49. --without-uiout --disable-gdbmi \
  50. --disable-tui --disable-gdbtk --without-x \
  51. --disable-sim --enable-gdbserver \
  52. --without-included-gettext \
  53. );
  54. ifeq ($(ENABLE_LOCALE),true)
  55. -$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
  56. endif
  57. touch $(GDB_TARGET_DIR)/.configured
  58. $(GDB_TARGET_DIR)/gdb/gdb: $(GDB_TARGET_DIR)/.configured
  59. $(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
  60. -C $(GDB_TARGET_DIR)
  61. $(STRIP) $(GDB_TARGET_DIR)/gdb/gdb
  62. $(TARGET_DIR)/usr/bin/gdb: $(GDB_TARGET_DIR)/gdb/gdb
  63. install -c $(GDB_TARGET_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
  64. gdb_target: ncurses $(TARGET_DIR)/usr/bin/gdb
  65. gdb_target-source: $(DL_DIR)/$(GDB_SOURCE)
  66. gdb_target-clean:
  67. $(MAKE) -C $(GDB_DIR) clean
  68. gdb_target-dirclean:
  69. rm -rf $(GDB_DIR)
  70. ######################################################################
  71. #
  72. # gdbserver
  73. #
  74. ######################################################################
  75. GDB_SERVER_DIR:=$(BUILD_DIR)/gdbserver-$(GDB_VERSION)
  76. $(GDB_SERVER_DIR)/.configured: $(GDB_DIR)/.unpacked
  77. mkdir -p $(GDB_SERVER_DIR)
  78. (cd $(GDB_SERVER_DIR); \
  79. $(TARGET_CONFIGURE_OPTS) \
  80. gdb_cv_func_sigsetjmp=yes \
  81. $(GDB_DIR)/gdb/gdbserver/configure \
  82. --build=$(GNU_HOST_NAME) \
  83. --host=$(REAL_GNU_TARGET_NAME) \
  84. --target=$(REAL_GNU_TARGET_NAME) \
  85. --prefix=/usr \
  86. --exec-prefix=/usr \
  87. --bindir=/usr/bin \
  88. --sbindir=/usr/sbin \
  89. --libexecdir=/usr/lib \
  90. --sysconfdir=/etc \
  91. --datadir=/usr/share \
  92. --localstatedir=/var \
  93. --mandir=/usr/man \
  94. --infodir=/usr/info \
  95. --includedir=$(STAGING_DIR)/include \
  96. $(DISABLE_NLS) \
  97. --without-uiout --disable-gdbmi \
  98. --disable-tui --disable-gdbtk --without-x \
  99. --without-included-gettext \
  100. );
  101. touch $(GDB_SERVER_DIR)/.configured
  102. $(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured
  103. $(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
  104. -C $(GDB_SERVER_DIR)
  105. $(STRIP) $(GDB_SERVER_DIR)/gdbserver
  106. $(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver
  107. install -c $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
  108. gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
  109. gdbserver-clean:
  110. $(MAKE) -C $(GDB_SERVER_DIR) clean
  111. gdbserver-dirclean:
  112. rm -rf $(GDB_SERVER_DIR)
  113. ######################################################################
  114. #
  115. # gdb client
  116. #
  117. ######################################################################
  118. GDB_CLIENT_DIR:=$(TOOL_BUILD_DIR)/gdbclient-$(GDB_VERSION)
  119. $(GDB_CLIENT_DIR)/.configured: $(GDB_DIR)/.unpacked
  120. mkdir -p $(GDB_CLIENT_DIR)
  121. (cd $(GDB_CLIENT_DIR); \
  122. gdb_cv_func_sigsetjmp=yes \
  123. $(GDB_DIR)/configure \
  124. --prefix=$(STAGING_DIR) \
  125. --build=$(GNU_HOST_NAME) \
  126. --host=$(GNU_HOST_NAME) \
  127. --target=$(REAL_GNU_TARGET_NAME) \
  128. $(DISABLE_NLS) \
  129. --without-uiout --disable-gdbmi \
  130. --disable-tui --disable-gdbtk --without-x \
  131. --without-included-gettext \
  132. --enable-threads \
  133. );
  134. touch $(GDB_CLIENT_DIR)/.configured
  135. $(GDB_CLIENT_DIR)/gdb/gdb: $(GDB_CLIENT_DIR)/.configured
  136. $(MAKE) -C $(GDB_CLIENT_DIR)
  137. strip $(GDB_CLIENT_DIR)/gdb/gdb
  138. $(TARGET_CROSS)gdb: $(GDB_CLIENT_DIR)/gdb/gdb
  139. install -c $(GDB_CLIENT_DIR)/gdb/gdb $(TARGET_CROSS)gdb
  140. ln -fs ../../bin/$(REAL_GNU_TARGET_NAME)-gdb \
  141. $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/gdb
  142. gdbclient: $(TARGET_CROSS)gdb
  143. gdbclient-clean:
  144. $(MAKE) -C $(GDB_CLIENT_DIR) clean
  145. gdbclient-dirclean:
  146. rm -rf $(GDB_CLIENT_DIR)
  147. #############################################################
  148. #
  149. # Toplevel Makefile options
  150. #
  151. #############################################################
  152. ifeq ($(strip $(BR2_PACKAGE_GDB)),y)
  153. TARGETS+=gdb_target
  154. endif
  155. ifeq ($(strip $(BR2_PACKAGE_GDB_SERVER)),y)
  156. TARGETS+=gdbserver
  157. endif
  158. ifeq ($(strip $(BR2_PACKAGE_GDB_CLIENT)),y)
  159. TARGETS+=gdbclient
  160. endif