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
|
|
|
######################################################################
|
2005-02-11 22:32:35 +01:00
|
|
|
GDB_VERSION:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
|
|
|
|
#"
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2005-08-30 05:37:12 +02:00
|
|
|
ifeq ($(GDB_VERSION),snapshot)
|
|
|
|
# Be aware that this changes daily....
|
|
|
|
GDB_SITE:=ftp://sources.redhat.com/pub/gdb/snapshots/current
|
|
|
|
GDB_SOURCE:=gdb.tar.bz2
|
|
|
|
GDB_CAT:=bzcat
|
|
|
|
GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
|
|
|
|
else
|
2004-09-03 02:49:43 +02:00
|
|
|
GDB_SITE:=http://ftp.gnu.org/gnu/gdb
|
|
|
|
GDB_SOURCE:=gdb-$(GDB_VERSION).tar.bz2
|
|
|
|
GDB_CAT:=bzcat
|
|
|
|
|
|
|
|
GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2006-07-05 07:12:51 +02:00
|
|
|
# NOTE: This option should not be used with gdb versions 6.4 and above.
|
|
|
|
ifeq ($(GDB_VERSION),6.2.1)
|
2005-08-30 05:37:12 +02:00
|
|
|
DISABLE_GDBMI:=--disable-gdbmi
|
|
|
|
endif
|
|
|
|
|
2006-07-05 07:12:51 +02:00
|
|
|
ifeq ($(GDB_VERSION),6.3)
|
|
|
|
DISABLE_GDBMI:=--disable-gdbmi
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2002-05-29 16:24:11 +02:00
|
|
|
$(DL_DIR)/$(GDB_SOURCE):
|
2002-11-21 00:16:10 +01:00
|
|
|
$(WGET) -P $(DL_DIR) $(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)
|
2004-10-11 16:01:07 +02:00
|
|
|
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
2005-08-30 05:37:12 +02:00
|
|
|
ifeq ($(GDB_VERSION),snapshot)
|
|
|
|
GDB_REAL_DIR=$(shell \
|
|
|
|
tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1)
|
|
|
|
ln -sf $(TOOL_BUILD_DIR)/$(shell tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) $(GDB_DIR)
|
|
|
|
endif
|
2004-10-09 05:23:27 +02:00
|
|
|
toolchain/patch-kernel.sh $(GDB_DIR) toolchain/gdb/$(GDB_VERSION) \*.patch
|
2006-06-21 10:18:10 +02:00
|
|
|
$(CONFIG_UPDATE) $(GDB_DIR)
|
|
|
|
touch $(GDB_DIR)/.unpacked
|
2004-09-03 02:49:43 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
|
$(GDB_TARGET_DIR)/.configured: $(GDB_DIR)/.unpacked
|
|
|
|
mkdir -p $(GDB_TARGET_DIR)
|
|
|
|
(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) \
|
2004-09-03 02:49:43 +02:00
|
|
|
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
|
|
|
|
$(GDB_TARGET_CONFIGURE_VARS) \
|
|
|
|
$(GDB_DIR)/configure \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
2004-01-14 13:12:17 +01:00
|
|
|
--target=$(REAL_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 \
|
|
|
|
);
|
|
|
|
ifeq ($(ENABLE_LOCALE),true)
|
|
|
|
-$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
|
|
|
|
endif
|
|
|
|
touch $(GDB_TARGET_DIR)/.configured
|
|
|
|
|
|
|
|
$(GDB_TARGET_DIR)/gdb/gdb: $(GDB_TARGET_DIR)/.configured
|
|
|
|
$(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
-C $(GDB_TARGET_DIR)
|
|
|
|
$(STRIP) $(GDB_TARGET_DIR)/gdb/gdb
|
|
|
|
|
|
|
|
$(TARGET_DIR)/usr/bin/gdb: $(GDB_TARGET_DIR)/gdb/gdb
|
|
|
|
install -c $(GDB_TARGET_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
|
|
|
|
|
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:
|
2006-05-30 10:20:54 +02:00
|
|
|
@if [ -d $(GDB_DIR)/Makefile ] ; then \
|
|
|
|
$(MAKE) -C $(GDB_DIR) clean ; \
|
|
|
|
fi;
|
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)
|
|
|
|
(cd $(GDB_SERVER_DIR); \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2004-09-30 02:51:53 +02:00
|
|
|
gdb_cv_func_sigsetjmp=yes \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_DIR)/gdb/gdbserver/configure \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2004-01-14 13:12:17 +01:00
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
2004-09-03 02:49:43 +02:00
|
|
|
--target=$(REAL_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 \
|
2003-01-17 10:30:37 +01:00
|
|
|
--includedir=$(STAGING_DIR)/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 \
|
|
|
|
);
|
2004-09-03 02:49:43 +02:00
|
|
|
touch $(GDB_SERVER_DIR)/.configured
|
2002-05-29 16:24:11 +02:00
|
|
|
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured
|
|
|
|
$(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
-C $(GDB_SERVER_DIR)
|
|
|
|
$(STRIP) $(GDB_SERVER_DIR)/gdbserver
|
|
|
|
$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver
|
2005-08-04 05:49:25 +02:00
|
|
|
ifeq ($(strip $(BR2_CROSS_TOOLCHAIN_TARGET_UTILS)),y)
|
|
|
|
mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils
|
|
|
|
install -c $(GDB_SERVER_DIR)/gdbserver \
|
|
|
|
$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils/gdbserver
|
|
|
|
endif
|
2004-09-03 02:49:43 +02:00
|
|
|
install -c $(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
|
|
|
|
2004-10-10 03:16:29 +02:00
|
|
|
gdbserver-clean:
|
2006-05-30 10:20:54 +02:00
|
|
|
@if [ -d $(GDB_SERVER_DIR)/Makefile ] ; then \
|
|
|
|
$(MAKE) -C $(GDB_SERVER_DIR) clean ; \
|
|
|
|
fi;
|
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
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
GDB_HOST_DIR:=$(TOOL_BUILD_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)
|
|
|
|
(cd $(GDB_HOST_DIR); \
|
2004-09-30 02:51:53 +02:00
|
|
|
gdb_cv_func_sigsetjmp=yes \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(GDB_DIR)/configure \
|
|
|
|
--prefix=$(STAGING_DIR) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
$(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 \
|
2004-09-03 02:49:43 +02:00
|
|
|
);
|
2006-04-06 20:08:44 +02:00
|
|
|
touch $(GDB_HOST_DIR)/.configured
|
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
|
|
|
|
$(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
|
2005-08-04 05:49:25 +02:00
|
|
|
ln -snf ../../bin/$(REAL_GNU_TARGET_NAME)-gdb \
|
2004-09-03 02:49:43 +02:00
|
|
|
$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/gdb
|
2005-08-04 05:49:25 +02:00
|
|
|
ln -snf $(REAL_GNU_TARGET_NAME)-gdb \
|
|
|
|
$(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
gdbhost: $(TARGET_CROSS)gdb
|
2004-09-03 02:49:43 +02:00
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
gdbhost-clean:
|
2006-05-30 10:20:54 +02:00
|
|
|
@if [ -d $(GDB_HOST_DIR)/Makefile ] ; then \
|
|
|
|
$(MAKE) -C $(GDB_HOST_DIR) clean ; \
|
|
|
|
fi;
|
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
|
|
|
|
2002-05-29 16:24:11 +02:00
|
|
|
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_GDB)),y)
|
|
|
|
TARGETS+=gdb_target
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_GDB_SERVER)),y)
|
|
|
|
TARGETS+=gdbserver
|
|
|
|
endif
|
|
|
|
|
2006-04-06 20:08:44 +02:00
|
|
|
ifeq ($(strip $(BR2_PACKAGE_GDB_HOST)),y)
|
|
|
|
TARGETS+=gdbhost
|
2005-02-10 04:06:39 +01:00
|
|
|
endif
|