2004-09-03 02:49:43 +02:00
|
|
|
######################################################################
|
2002-05-29 16:24:11 +02:00
|
|
|
#
|
|
|
|
# gdb
|
|
|
|
#
|
2004-09-03 02:49:43 +02:00
|
|
|
######################################################################
|
2009-07-30 17:35:26 +02:00
|
|
|
GDB_VERSION:=$(call qstrip,$(BR2_GDB_VERSION))
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2010-02-08 16:56:08 +01:00
|
|
|
GDB_SOURCE:=gdb-$(GDB_VERSION).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
GDB_CAT:=$(BZCAT)
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2010-02-09 11:48:17 +01:00
|
|
|
ifeq ($(findstring avr32,$(GDB_VERSION)),avr32)
|
2009-12-14 11:38:58 +01:00
|
|
|
GDB_SITE:=ftp://www.at91.com/pub/buildroot/
|
2010-02-08 16:56:08 +01:00
|
|
|
GDB_PATCH_DIR:=toolchain/gdb/$(GDB_VERSION)
|
2008-06-16 17:52:41 +02:00
|
|
|
else
|
2009-12-14 11:38:58 +01:00
|
|
|
GDB_SITE:=$(BR2_GNU_MIRROR)/gdb
|
2010-02-08 16:56:08 +01:00
|
|
|
GDB_PATCH_DIR:=toolchain/gdb/$(GDB_VERSION)
|
2007-07-31 16:59:58 +02:00
|
|
|
endif
|
|
|
|
|
2010-02-08 16:56:08 +01:00
|
|
|
GDB_DIR:=$(TOOLCHAIN_DIR)/gdb-$(GDB_VERSION)
|
2002-05-29 16:24:11 +02:00
|
|
|
|
|
|
|
$(DL_DIR)/$(GDB_SOURCE):
|
2012-03-16 14:42:53 +01:00
|
|
|
$(call DOWNLOAD,$(GDB_SITE)/$(GDB_SOURCE))
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2005-12-02 23:31:12 +01:00
|
|
|
gdb-unpacked: $(GDB_DIR)/.unpacked
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
|
2011-09-13 23:57:29 +02:00
|
|
|
mkdir -p $(GDB_DIR)
|
|
|
|
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(GDB_DIR) $(TAR_STRIP_COMPONENTS)=1 $(TAR_OPTIONS) -
|
2012-11-20 09:31:36 +01:00
|
|
|
ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
|
|
|
|
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip, \
|
|
|
|
$(BR2_XTENSA_CORE_NAME)).tar -C $(@D) --strip-components=1 gdb
|
2012-11-15 04:53:52 +01:00
|
|
|
endif
|
2009-12-14 11:38:58 +01:00
|
|
|
ifneq ($(wildcard $(GDB_PATCH_DIR)),)
|
2012-09-04 06:04:06 +02:00
|
|
|
support/scripts/apply-patches.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch
|
2009-12-14 11:38:58 +01:00
|
|
|
endif
|
2011-08-31 23:35:06 +02:00
|
|
|
$(call CONFIG_UPDATE,$(@D))
|
2007-06-22 12:42:07 +02:00
|
|
|
touch $@
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2008-07-04 10:39:35 +02:00
|
|
|
gdb-patched: $(GDB_DIR)/.unpacked
|
|
|
|
|
2008-12-07 22:22:45 +01:00
|
|
|
gdb-source: $(DL_DIR)/$(GDB_SOURCE)
|
2005-12-02 23:31:12 +01:00
|
|
|
gdb-dirclean:
|
|
|
|
rm -rf $(GDB_DIR)
|
|
|
|
|
2004-09-03 02:49:43 +02:00
|
|
|
######################################################################
|
|
|
|
#
|
|
|
|
# gdb target
|
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
GDB_TARGET_DIR:=$(BUILD_DIR)/gdb-$(GDB_VERSION)-target
|
|
|
|
|
|
|
|
GDB_TARGET_CONFIGURE_VARS:= \
|
|
|
|
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
|
|
|
|
|
2008-08-24 09:48:22 +02:00
|
|
|
$(GDB_TARGET_DIR)/.configured: $(GDB_DIR)/.unpacked
|
2004-09-03 02:49:43 +02:00
|
|
|
mkdir -p $(GDB_TARGET_DIR)
|
2008-07-01 23:38:03 +02:00
|
|
|
(cd $(GDB_TARGET_DIR); \
|
2004-09-30 02:51:53 +02:00
|
|
|
gdb_cv_func_sigsetjmp=yes \
|
2003-03-04 20:16:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-26 16:32:10 +02:00
|
|
|
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_LDFLAGS) -Wno-error" \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS) -Wno-error" \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_TARGET_CONFIGURE_VARS) \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GDB_DIR)/configure $(QUIET) \
|
2008-07-01 23:38:03 +02:00
|
|
|
--cache-file=/dev/null \
|
2004-09-03 02:49:43 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2004-09-03 02:49:43 +02:00
|
|
|
--prefix=/usr \
|
|
|
|
$(DISABLE_NLS) \
|
2005-08-30 05:37:12 +02:00
|
|
|
--without-uiout $(DISABLE_GDBMI) \
|
2004-09-03 02:49:43 +02:00
|
|
|
--disable-tui --disable-gdbtk --without-x \
|
|
|
|
--disable-sim --enable-gdbserver \
|
|
|
|
--without-included-gettext \
|
2007-06-26 16:32:10 +02:00
|
|
|
--disable-werror \
|
2008-10-26 10:14:02 +01:00
|
|
|
$(QUIET) \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2006-10-17 18:57:02 +02:00
|
|
|
ifeq ($(BR2_ENABLE_LOCALE),y)
|
2004-09-03 02:49:43 +02:00
|
|
|
-$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
|
|
|
|
endif
|
2007-06-22 12:42:07 +02:00
|
|
|
touch $@
|
2004-09-03 02:49:43 +02:00
|
|
|
|
|
|
|
$(GDB_TARGET_DIR)/gdb/gdb: $(GDB_TARGET_DIR)/.configured
|
2010-04-29 21:19:20 +02:00
|
|
|
# force ELF support since it fails due to BFD linking problems
|
|
|
|
gdb_cv_var_elf=yes \
|
2012-05-07 05:28:28 +02:00
|
|
|
$(TARGET_MAKE_ENV) \
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" MT_CFLAGS="$(TARGET_CFLAGS)" \
|
2004-09-03 02:49:43 +02:00
|
|
|
-C $(GDB_TARGET_DIR)
|
|
|
|
|
|
|
|
$(TARGET_DIR)/usr/bin/gdb: $(GDB_TARGET_DIR)/gdb/gdb
|
2007-02-06 19:17:31 +01:00
|
|
|
install -c -D $(GDB_TARGET_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2005-02-24 23:26:06 +01:00
|
|
|
gdb_target: ncurses $(TARGET_DIR)/usr/bin/gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
|
|
|
gdb_target-source: $(DL_DIR)/$(GDB_SOURCE)
|
|
|
|
|
2004-10-10 03:16:29 +02:00
|
|
|
gdb_target-clean:
|
2007-06-22 12:42:07 +02:00
|
|
|
-$(MAKE) -C $(GDB_DIR) clean
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2004-10-10 03:16:29 +02:00
|
|
|
gdb_target-dirclean:
|
2004-09-03 02:49:43 +02:00
|
|
|
rm -rf $(GDB_DIR)
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
#
|
|
|
|
# gdbserver
|
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
GDB_SERVER_DIR:=$(BUILD_DIR)/gdbserver-$(GDB_VERSION)
|
|
|
|
|
|
|
|
$(GDB_SERVER_DIR)/.configured: $(GDB_DIR)/.unpacked
|
|
|
|
mkdir -p $(GDB_SERVER_DIR)
|
2008-07-01 23:38:03 +02:00
|
|
|
(cd $(GDB_SERVER_DIR); \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2004-09-30 02:51:53 +02:00
|
|
|
gdb_cv_func_sigsetjmp=yes \
|
2007-05-15 13:33:08 +02:00
|
|
|
bash_cv_have_mbstate_t=yes \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GDB_DIR)/gdb/gdbserver/configure $(QUIET) \
|
2008-07-01 23:38:03 +02:00
|
|
|
--cache-file=/dev/null \
|
2004-09-03 02:49:43 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2003-01-17 09:03:59 +01:00
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
2007-08-12 00:26:56 +02:00
|
|
|
--includedir=$(STAGING_DIR)/usr/include \
|
2003-09-03 09:18:18 +02:00
|
|
|
$(DISABLE_NLS) \
|
2005-08-30 05:37:12 +02:00
|
|
|
--without-uiout $(DISABLE_GDBMI) \
|
2003-01-17 09:03:59 +01:00
|
|
|
--disable-tui --disable-gdbtk --without-x \
|
|
|
|
--without-included-gettext \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-06-22 12:42:07 +02:00
|
|
|
touch $@
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" MT_CFLAGS="$(TARGET_CFLAGS)" \
|
2004-09-03 02:49:43 +02:00
|
|
|
-C $(GDB_SERVER_DIR)
|
2008-07-01 23:38:03 +02:00
|
|
|
|
2004-09-03 02:49:43 +02:00
|
|
|
$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver
|
2008-12-08 09:15:42 +01:00
|
|
|
ifeq ($(BR2_CROSS_TOOLCHAIN_TARGET_UTILS),y)
|
2012-06-08 03:52:16 +02:00
|
|
|
mkdir -p $(STAGING_DIR)/usr/$(GNU_TARGET_NAME)/target_utils
|
2005-08-04 05:49:25 +02:00
|
|
|
install -c $(GDB_SERVER_DIR)/gdbserver \
|
2012-06-08 03:52:16 +02:00
|
|
|
$(STAGING_DIR)/usr/$(GNU_TARGET_NAME)/target_utils/gdbserver
|
2005-08-04 05:49:25 +02:00
|
|
|
endif
|
2007-02-06 19:17:31 +01:00
|
|
|
install -c -D $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2005-01-23 12:09:40 +01:00
|
|
|
gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2010-11-19 13:37:59 +01:00
|
|
|
gdbserver-source: $(DL_DIR)/$(GDB_SOURCE)
|
|
|
|
|
2004-10-10 03:16:29 +02:00
|
|
|
gdbserver-clean:
|
2007-06-22 12:42:07 +02:00
|
|
|
-$(MAKE) -C $(GDB_SERVER_DIR) clean
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2004-10-10 03:16:29 +02:00
|
|
|
gdbserver-dirclean:
|
2004-09-03 02:49:43 +02:00
|
|
|
rm -rf $(GDB_SERVER_DIR)
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
#
|
2006-04-06 20:08:44 +02:00
|
|
|
# gdb on host
|
2004-09-03 02:49:43 +02:00
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
2009-09-23 01:30:00 +02:00
|
|
|
GDB_HOST_DIR:=$(TOOLCHAIN_DIR)/gdbhost-$(GDB_VERSION)
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
$(GDB_HOST_DIR)/.configured: $(GDB_DIR)/.unpacked
|
|
|
|
mkdir -p $(GDB_HOST_DIR)
|
2008-07-01 23:38:03 +02:00
|
|
|
(cd $(GDB_HOST_DIR); \
|
2004-09-30 02:51:53 +02:00
|
|
|
gdb_cv_func_sigsetjmp=yes \
|
2007-05-15 13:33:08 +02:00
|
|
|
bash_cv_have_mbstate_t=yes \
|
2011-02-24 21:37:48 +01:00
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GDB_DIR)/configure $(QUIET) \
|
2008-07-01 23:38:03 +02:00
|
|
|
--cache-file=/dev/null \
|
2004-09-03 02:49:43 +02:00
|
|
|
--prefix=$(STAGING_DIR) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(DISABLE_NLS) \
|
2005-08-30 05:37:12 +02:00
|
|
|
--without-uiout $(DISABLE_GDBMI) \
|
2004-09-03 02:49:43 +02:00
|
|
|
--disable-tui --disable-gdbtk --without-x \
|
|
|
|
--without-included-gettext \
|
2004-09-30 02:51:53 +02:00
|
|
|
--enable-threads \
|
2008-07-01 23:46:50 +02:00
|
|
|
--disable-werror \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-06-22 12:42:07 +02:00
|
|
|
touch $@
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
$(GDB_HOST_DIR)/gdb/gdb: $(GDB_HOST_DIR)/.configured
|
2012-01-24 12:46:37 +01:00
|
|
|
# force ELF support since it fails due to BFD linking problems
|
gdb: properly pass the PATH when building gdb for the host
When building gdb for the host, we properly pass the PATH (through
HOST_CONFIGURE_OPTS) during the configure step, but we forget to do so
for the compilation step.
The result of this is that when the Crosstool-NG backend is used, gawk
is built and installed in $(HOST_DIR), as a dependency of the
crosstool-ng package.
Then, the host gdb configure script detects this gawk binary
($(HOST_DIR) is in the PATH), and assumes gawk is
available. Unfortunately, during the compilation step, it fails to
find the expected gawk binary, because $(HOST_DIR) is no longer in the
PATH. This causes the following build failure:
http://autobuild.buildroot.org/results/067d0c2ea01673ba98ec11de2426f1ab92dac800/build-end.log
In order to fix this, we simply call the compilation step of gdb for
the host with $(HOST_MAKE_ENV), as it should have been done from the
beginning.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-11-28 07:34:52 +01:00
|
|
|
$(HOST_MAKE_ENV) \
|
2012-01-24 12:46:37 +01:00
|
|
|
gdb_cv_var_elf=yes \
|
2006-04-06 20:08:44 +02:00
|
|
|
$(MAKE) -C $(GDB_HOST_DIR)
|
|
|
|
strip $(GDB_HOST_DIR)/gdb/gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
$(TARGET_CROSS)gdb: $(GDB_HOST_DIR)/gdb/gdb
|
|
|
|
install -c $(GDB_HOST_DIR)/gdb/gdb $(TARGET_CROSS)gdb
|
2012-06-23 21:26:16 +02:00
|
|
|
ln -snf $(@F) $(HOST_DIR)/usr/bin/$(ARCH)-linux-gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2011-02-24 21:37:48 +01:00
|
|
|
gdbhost: host-expat $(TARGET_CROSS)gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2010-11-19 13:37:59 +01:00
|
|
|
gdbhost-source: $(DL_DIR)/$(GDB_SOURCE)
|
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
gdbhost-clean:
|
2007-06-22 12:42:07 +02:00
|
|
|
-$(MAKE) -C $(GDB_HOST_DIR) clean
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
gdbhost-dirclean:
|
|
|
|
rm -rf $(GDB_HOST_DIR)
|
2003-11-12 10:31:12 +01:00
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:42 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_GDB),y)
|
2005-02-10 04:06:39 +01:00
|
|
|
TARGETS+=gdb_target
|
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:42 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
|
2005-02-10 04:06:39 +01:00
|
|
|
TARGETS+=gdbserver
|
|
|
|
endif
|
|
|
|
|
2008-12-08 09:15:42 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_GDB_HOST),y)
|
2006-04-06 20:08:44 +02:00
|
|
|
TARGETS+=gdbhost
|
2005-02-10 04:06:39 +01:00
|
|
|
endif
|