diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-06-02 18:25:51 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-06-02 18:25:51 +0200 |
commit | 71fff4edf79e819f703d95c55cb44c5fe4fb13df (patch) | |
tree | 3674f1f7710e37a350a49b919fcbf25553aa2003 | |
parent | c7f4a038457f80ea6d3a10de7512a14054b72bd8 (diff) | |
download | embtoolkit-71fff4edf79e819f703d95c55cb44c5fe4fb13df.tar.gz embtoolkit-71fff4edf79e819f703d95c55cb44c5fe4fb13df.tar.bz2 embtoolkit-71fff4edf79e819f703d95c55cb44c5fe4fb13df.tar.xz |
Toolchain: GDB: rework deeply the build infrastructure and add gdb-7.2 and associated patches
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r-- | Kconfig | 2 | ||||
-rw-r--r-- | mk/gdb.mk | 99 | ||||
-rw-r--r-- | mk/packages.mk | 18 | ||||
-rw-r--r-- | packages/development/development.kconfig | 2 | ||||
-rw-r--r-- | packages/development/development.mk | 6 | ||||
-rw-r--r-- | packages/development/gdb/gdb.kconfig (renamed from kconfig/gdb.kconfig) | 83 | ||||
-rw-r--r-- | packages/development/gdb/gdb.mk | 123 |
7 files changed, 183 insertions, 150 deletions
@@ -48,7 +48,7 @@ source kconfig/targetbuildopts.kconfig endmenu menu "Debugging system" -source "kconfig/gdb.kconfig" +source "packages/development/gdb/gdb.kconfig" source "kconfig/strace.kconfig" endmenu diff --git a/mk/gdb.mk b/mk/gdb.mk deleted file mode 100644 index 5883d5f..0000000 --- a/mk/gdb.mk +++ /dev/null @@ -1,99 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -################################################################################ -# -# \file gdb.mk -# \brief gdb.mk of Embtoolkit. -# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org> -# \date July 2009 -################################################################################ - -GDB_VERSION := $(subst ",,$(strip $(CONFIG_EMBTK_GDB_VERSION_STRING))) -GDB_SITE := http://ftp.gnu.org/gnu/gdb -GDB_PACKAGE := gdb-$(GDB_VERSION).tar.bz2 -GDB_HOST_BUILD_DIR :=$(TOOLS_BUILD)/gdb -GDB_TARGET_BUILD_DIR :=$(PACKAGES_BUILD)/gdb -GDBSERVER_TARGET_BUILD_DIR :=$(PACKAGES_BUILD)/gdbserver - -gdb_host_install: $(GDB_HOST_BUILD_DIR)/.installed -gdb_target_install: $(GDB_TARGET_BUILD_DIR)/.installed -gdbserver_target_install: $(GDBSERVER_TARGET_BUILD_DIR)/.installed - -#gdb for target -$(GDB_TARGET_BUILD_DIR)/.installed: ncurses_install download_gdb \ - decompress_gdb $(GDB_TARGET_BUILD_DIR)/.configured - $(Q)$(MAKE) -C $(GDB_TARGET_BUILD_DIR) $(J) - $(Q)$(MAKE) -C $(GDB_TARGET_BUILD_DIR) install - -$(GDBSERVER_TARGET_BUILD_DIR)/.installed: ncurses_install download_gdb \ - decompress_gdb $(GDB_TARGET_BUILD_DIR)/.configured - cd $(GDB_TARGET_BUILD_DIR); make; cd gdb/gdbserver; make install - @touch $@ - -$(GDB_TARGET_BUILD_DIR)/.configured: - $(call EMBTK_GENERIC_MESSAGE,"Configuring gdb-$(GDB_VERSION) for \ - $(STRICT_GNU_TARGET) ...") - @cd $(GDB_TARGET_BUILD_DIR); \ - CC=$(TARGETCC_CACHED) CXX=$(TARGETCXX_CACHED) \ - AR=$(TARGETAR) LD=$(TARGETLD) RANLIB=$(TARGETRANLIB) \ - NM=$(TARGETNM) STRIP=$(TARGETSTRIP) \ - $(TOOLS_BUILD)/gdb-$(GDB_VERSION)/configure \ - --host=$(STRICT_GNU_TARGET) \ - --target=$(STRICT_GNU_TARGET) --prefix=$(SYSROOT)/usr --disable-werror - @touch $@ - -gdb_target_clean: - $(call EMBTK_GENERIC_MESSAGE,"Cleanup gdb for target...") -gdbserver_target_clean: - $(call EMBTK_GENERIC_MESSAGE,"Cleanup gdbserver for target...") - -#gdb for host -$(GDB_HOST_BUILD_DIR)/.installed: download_gdb decompress_gdb \ -$(GDB_HOST_BUILD_DIR)/.configured - @cd $(GDB_HOST_BUILD_DIR); make $(J); make install - @touch $@ - -$(GDB_HOST_BUILD_DIR)/.configured: - $(call EMBTK_GENERIC_MESSAGE,"Configuring gdb-$(GDB_VERSION) for \ - your host development machine ...") - @cd $(GDB_HOST_BUILD_DIR); \ - CC=$(HOSTCC_CACHED) CXX=$(HOSTCXX_CACHED) \ - CC_FOR_TARGET=$(TARGETCC_CACHED) CXX_FOR_TARGET=$(TARGETCXX_CACHED) \ - AR_FOR_TARGET=$(TARGETAR) LD_FOR_TARGET=$(TARGETLD) \ - NM_FOR_TARGET=$(TARGETNM) RANLIB_FOR_TARGET=$(TARGETRANLIB) \ - STRIP_FOR_TARGET=$(TARGETSTRIP) OBJDUMP_FOR_TARGET=$(TARGETOBJDUMP) \ - $(TOOLS_BUILD)/gdb-$(GDB_VERSION)/configure \ - --host=$(HOST_ARCH) --build=$(HOST_ARCH) --target=$(STRICT_GNU_TARGET) \ - --prefix=$(TOOLS) --disable-werror - @touch $@ - -download_gdb: - $(call EMBTK_GENERIC_MESSAGE,"Downloading $(GDB_PACKAGE) \ - if necessary ...") - @test -e $(DOWNLOAD_DIR)/$(GDB_PACKAGE) || \ - wget -O $(DOWNLOAD_DIR)/$(GDB_PACKAGE) \ - $(GDB_SITE)/$(GDB_PACKAGE) - -decompress_gdb: - $(call EMBTK_GENERIC_MESSAGE,"Decompressing $(GDB_PACKAGE) ...") - @cd $(TOOLS_BUILD); test -e gdb-$(GDB_VERSION) || \ - tar xjf $(DOWNLOAD_DIR)/$(GDB_PACKAGE) - @mkdir -p $(GDB_TARGET_BUILD_DIR) - @mkdir -p $(GDBSERVER_TARGET_BUILD_DIR) - @mkdir -p $(GDB_HOST_BUILD_DIR) - diff --git a/mk/packages.mk b/mk/packages.mk index 236e198..2b62a0b 100644 --- a/mk/packages.mk +++ b/mk/packages.mk @@ -31,19 +31,10 @@ HOSTTOOLS_COMPONENTS-y := mkimage_install include $(EMBTK_ROOT)/mk/mkimage.mk include $(EMBTK_ROOT)/mk/mtd-utils.mk -#gdb -include $(EMBTK_ROOT)/mk/gdb.mk - ################################################################################ -############################# Packages for TARGET ############################## +######################### Packages for TARGET and HOST ######################### ################################################################################ -#gdb -ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDB_ON_TARGET) += gdb_target_install - -#gdbserver -ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDBSERVER_ON_TARGET) += gdbserver_target_install - #strace ROOTFS_COMPONENTS-$(CONFIG_EMBTK_ROOTFS_HAVE_STRACE) += strace_install include $(EMBTK_ROOT)/mk/strace.mk @@ -88,13 +79,6 @@ include $(EMBTK_ROOT)/packages/busybox/busybox.mk ROOTFS_COMPONENTS_CLEAN := $(subst install,clean,$(ROOTFS_COMPONENTS-)) ################################################################################ -########################## Packages for HOST MACHINE ########################### -################################################################################ - -#gdb -HOSTTOOLS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDB_ON_HOST) += gdb_host_install - -################################################################################ ########################### Targets for HOST MACHINE ########################### ################################################################################ host_packages_build: diff --git a/packages/development/development.kconfig b/packages/development/development.kconfig index f12e035..cab2c9d 100644 --- a/packages/development/development.kconfig +++ b/packages/development/development.kconfig @@ -23,6 +23,8 @@ # \date October 2010 ################################################################################ +# GDB: already included from main kconfig + #libevent source packages/development/libevent/libevent.kconfig diff --git a/packages/development/development.mk b/packages/development/development.mk index 97025fa..2bd71af 100644 --- a/packages/development/development.mk +++ b/packages/development/development.mk @@ -24,6 +24,12 @@ ################################################################################ #libevent +include $(EMBTK_ROOT)/packages/development/gdb/gdb.mk +ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDB) += gdbfull_install +ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDBSERVER) += gdbserver_install +HOSTTOOLS_COMPONENTS-$(CONFIG_EMBTK_HOST_HAVE_GDB) += gdb_host_install + +#libevent include $(EMBTK_ROOT)/packages/development/libevent/libevent.mk ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_LIBEVENT) += libevent_install diff --git a/kconfig/gdb.kconfig b/packages/development/gdb/gdb.kconfig index e4826b8..73cdf8c 100644 --- a/kconfig/gdb.kconfig +++ b/packages/development/gdb/gdb.kconfig @@ -23,61 +23,78 @@ # \date July 2009 ################################################################################ -config EMBTK_HAVE_GDB +config EMBTK_HAVE_GDB_SYSTEM bool "Have GDB: Gnu debugging system" - select EMBTK_HAVE_NCURSES + select EMBTK_GDB_PKG_IS_TARBZ2 help - Have GNU debugger components on your embedded target and/or on your - development machine. + Have GNU debugger components on your embedded target and/or on + your development machine. choice prompt "GDB version to use" - depends on EMBTK_HAVE_GDB + depends on EMBTK_HAVE_GDB_SYSTEM help Choose which version of gdb to use. - config EMBTK_GDB_VERSION_7_1 - bool "gdb-7.1" - config EMBTK_GDB_VERSION_7_0_1 - depends on !EMBTK_CLIB_UCLIBC - depends on EMBTK_OLDPACKAGES - bool "gdb-7.0.1" - config EMBTK_GDB_VERSION_7_0 - depends on !EMBTK_CLIB_UCLIBC - depends on EMBTK_OLDPACKAGES - bool "gdb-7.0" + config EMBTK_GDB_VERSION_7_2 + bool "gdb-7.2" + select EMBTK_GDB_NEED_PATCH config EMBTK_GDB_VERSION_6_8 bool "gdb-6.8" endchoice -config EMBTK_GDB_VERSION_STRING - string - default "7.1" if EMBTK_GDB_VERSION_7_1 - default "7.0.1" if EMBTK_GDB_VERSION_7_0_1 - default "7.0" if EMBTK_GDB_VERSION_7_0 - default "6.8" if EMBTK_GDB_VERSION_6_8 - choice prompt "GDB on your target embedded system" - depends on EMBTK_HAVE_GDB depends on EMBTK_HAVE_ROOTFS - config EMBTK_HAVE_GDBSERVER_ON_TARGET + depends on EMBTK_HAVE_GDB_SYSTEM + config EMBTK_HAVE_GDBSERVER bool "Have gdbserver on target" + select EMBTK_HAVE_NCURSES + select KEMBTK_UCLIBC_PTHREADS_DEBUG_SUPPORT if EMBTK_CLIB_UCLIBC help - Say yes if you want to have only gdbserver on your embedded - system target. + Say yes if you want to have only gdbserver on your + embedded system target. - config EMBTK_HAVE_GDB_ON_TARGET + config EMBTK_HAVE_GDB bool "Have gdb on target" + select EMBTK_HAVE_NCURSES + select KEMBTK_UCLIBC_PTHREADS_DEBUG_SUPPORT if EMBTK_CLIB_UCLIBC help - Say yes if you want to have full gdb on your embedded system - target. + Say yes if you want to have full gdb on your embedded + system target. endchoice -config EMBTK_HAVE_GDB_ON_HOST - bool "Have gdb on host" - depends on EMBTK_HAVE_GDB +config EMBTK_HOST_HAVE_GDB + bool "Have gdb on host your development machine" + depends on EMBTK_HAVE_GDB_SYSTEM help - Say yes if you want to have gdb on your host development machine. + Say yes if you want to have gdb on your host development + machine. + + +config EMBTK_GDB_VERSION_STRING + string + default "7.2" if EMBTK_GDB_VERSION_7_2 + default "6.8" if EMBTK_GDB_VERSION_6_8 +config EMBTK_GDB_NEED_PATCH + bool + select EMBTK_GDB_HOST_NEED_PATCH +config EMBTK_GDB_NEED_AUTORECONF + bool + select EMBTK_GDB_HOST_NEED_AUTORECONF +config EMBTK_GDB_PKG_IS_TARGZ + bool + select EMBTK_GDB_HOST_PKG_IS_TARGZ +config EMBTK_GDB_PKG_IS_TARBZ2 + bool + select EMBTK_GDB_HOST_PKG_IS_TARBZ2 +config EMBTK_GDB_HOST_NEED_PATCH + bool +config EMBTK_GDB_HOST_NEED_AUTORECONF + bool +config EMBTK_GDB_HOST_PKG_IS_TARGZ + bool +config EMBTK_GDB_HOST_PKG_IS_TARBZ2 + bool diff --git a/packages/development/gdb/gdb.mk b/packages/development/gdb/gdb.mk new file mode 100644 index 0000000..1fae170 --- /dev/null +++ b/packages/development/gdb/gdb.mk @@ -0,0 +1,123 @@ +################################################################################ +# Embtoolkit +# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +################################################################################ +# +# \file gdb.mk +# \brief gdb.mk of Embtoolkit +# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org> +# \date July 2009 +################################################################################ + +GDB_NAME := gdb +GDB_VERSION := $(call EMBTK_GET_PKG_VERSION,GDB) +GDB_SITE := http://ftp.gnu.org/gnu/gdb +GDB_SITE_MIRROR3 := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror +GDB_PATCH_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/gdb/$(GDB_VERSION) +GDB_PACKAGE := gdb-$(GDB_VERSION).tar.bz2 +GDB_SRC_DIR := $(PACKAGES_BUILD)/gdb-$(GDB_VERSION) +GDB_BUILD_DIR := $(PACKAGES_BUILD)/gdb-$(GDB_VERSION) + +# GDB installed files +GDBSERVER_BIN := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER),,gdbserver) +GDB_BINS := gdb $(GDBSERVER_BIN) gdbtui run +GDB_SBINS := +GDB_INCLUDES := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER), \ + ,,ansidecl.h bfd.h bfdlink.h dis-asm.h symcat.h) +GDB_LIBS := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER), \ + ,,lib*-sim.a libbfd.* libiberty.* libopcodes.*) +GDB_LIBEXECS := +GDB_PKGCONFIGS := + +GDB_CONFIGURE_ENV := +GDB_CONFIGURE_OPTS := --disable-werror --disable-sim \ + --with-bugurl="$(EMBTK_BUGURL)" \ + --with-pkgversion="embtk-$(EMBTK_VERSION)" + +GDB_DEPS := ncurses_install + +# +# GDB for target +# +gdbfull_install: + $(call EMBTK_INSTALL_PKG,GDB) + +gdbserver_install: + @test -e $(GDB_BUILD_DIR)/.gdbserver_installed || \ + $(MAKE) $(GDB_BUILD_DIR)/.gdbserver_installed + +$(GDB_BUILD_DIR)/.gdbserver_installed: $(GDB_DEPS) \ + download_gdb \ + $(GDB_BUILD_DIR)/.gdbserver_decompressed \ + $(GDB_BUILD_DIR)/.gdbserver_configured + $(Q)$(MAKE) -C $(GDB_BUILD_DIR) $(J) + $(Q)$(MAKE) -C $(GDB_BUILD_DIR)/gdb/gdbserver \ + DESTDIR=$(SYSROOT)/$(GDB_SYSROOT_SUFFIX) install + $(Q)$(MAKE) libtool_files_adapt + @touch $@ + +$(GDB_BUILD_DIR)/.gdbserver_configured: + $(call EMBTK_CONFIGURE_PKG,GDB) + @touch $@ + +$(GDB_BUILD_DIR)/.gdbserver_decompressed: + $(call EMBTK_DECOMPRESS_PKG,GDB) + @touch $@ + +gdbserver_clean gdbfull_clean: + $(call EMBTK_CLEANUP_PKG,GDB) + +# +# GDB for host development machine +# +GDB_HOST_NAME := gdb +GDB_HOST_VERSION := $(GDB_VERSION) +GDB_HOST_SITE := $(GDB_SITE) +GDB_HOST_SITE_MIRROR3 := $(GDB_SITE_MIRROR3) +GDB_HOST_PATCH_SITE := $(GDB_PATCH_SITE) +GDB_HOST_PACKAGE := $(GDB_PACKAGE) +GDB_HOST_SRC_DIR := $(TOOLS_BUILD)/gdb-$(GDB_VERSION) +GDB_HOST_BUILD_DIR := $(TOOLS_BUILD)/gdb-$(GDB_VERSION) + +GDB_HOST_CONFIGURE_ENV := CC=$(HOSTCC_CACHED) +GDB_HOST_CONFIGURE_ENV += CXX=$(HOSTCXX_CACHED) +GDB_HOST_CONFIGURE_ENV += CC_FOR_TARGET=$(TARGETCC_CACHED) +GDB_HOST_CONFIGURE_ENV += CXX_FOR_TARGET=$(TARGETCXX_CACHED) +GDB_HOST_CONFIGURE_ENV += AR_FOR_TARGET=$(TARGETAR) +GDB_HOST_CONFIGURE_ENV += LD_FOR_TARGET=$(TARGETLD) +GDB_HOST_CONFIGURE_ENV += NM_FOR_TARGET=$(TARGETNM) +GDB_HOST_CONFIGURE_ENV += RANLIB_FOR_TARGET=$(TARGETRANLIB) +GDB_HOST_CONFIGURE_ENV += STRIP_FOR_TARGET=$(TARGETSTRIP) +GDB_HOST_CONFIGURE_ENV += OBJDUMP_FOR_TARGET=$(TARGETOBJDUMP) + +GDB_HOST_CONFIGURE_OPTS := --disable-werror --disable-sim \ + --with-bugurl="$(EMBTK_BUGURL)" \ + --with-pkgversion="embtk-$(EMBTK_VERSION)" \ + --target=$(STRICT_GNU_TARGET) +GDB_HOST_PREFIX := $(TOOLS) + +gdb_host_install: + $(call EMBTK_INSTALL_HOSTPKG,GDB_HOST) + +gdb_host_clean: + $(call EMBTK_GENERIC_MSG,"Clean up gdb host") + +# +# Common for target and host development machine +# +download_gdb: + $(call EMBTK_DOWNLOAD_PKG,GDB) |