################################################################################
################################################################################
GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
GDB_SITE = $(BR2_GNU_MIRROR)/gdb
GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
ifeq ($(BR2_microblaze),y)
GDB_SITE = $(call github,Xilinx,gdb,$(GDB_VERSION))
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
GDB_LICENSE = GPLv2+, LGPLv2+, GPLv3+, LGPLv3+
GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
# We only want gdbserver and not the entire debugger.
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),)
GDB_SUBDIR = gdb/gdbserver
GDB_DEPENDENCIES = ncurses \
$(if $(BR2_PACKAGE_LIBICONV),libiconv)
# For the host variant, we really want to build with XML support,
# which is needed to read XML descriptions of target architectures. We
HOST_GDB_DEPENDENCIES = host-expat host-ncurses
# Apply the Xtensa specific patches
XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
ifneq ($(XTENSA_CORE_NAME),)
define GDB_XTENSA_PRE_PATCH
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
-C $(@D) --strip-components=1 gdb
GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
HOST_GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
# Prevent gdb to build the documentation
$(SED) '/^SUBDIRS =/ s/doc//' $(@D)/gdb/Makefile.in
if test -e $(@D)/bfd/doc/Makefile.in ; then \
$(SED) 's/^INFO_DEPS =.*$$/INFO_DEPS =/' $(@D)/bfd/doc/Makefile.in ; \
if test -e $(@D)/gprof/Makefile.in ; then \
$(SED) 's/^INFO_DEPS =.*$$/INFO_DEPS =/' $(@D)/gprof/Makefile.in ; \
GDB_PRE_CONFIGURE_HOOKS += GDB_DISABLE_DOC
HOST_GDB_PRE_CONFIGURE_HOOKS += GDB_DISABLE_DOC
# When gdb sources are fetched from the binutils-gdb repository, they
# also contain the binutils sources, but binutils shouldn't be built,
GDB_DISABLE_BINUTILS_CONF_OPTS = \
ac_cv_type_uintptr_t=yes \
gt_cv_func_gettext_libintl=yes \
ac_cv_func_dcgettext=yes \
gdb_cv_func_sigsetjmp=yes \
bash_cv_func_strcoll_broken=no \
bash_cv_must_reinstall_sighandlers=no \
bash_cv_func_sigsetjmp=present \
bash_cv_have_mbstate_t=yes \
gdb_cv_func_sigsetjmp=yes
# The shared only build is not supported by gdb, so enable static build for
# build-in libraries with --enable-static.
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
$(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver) \
--without-included-gettext \