1 ######################################################################
5 ######################################################################
6 ifeq ($(BR2_TOOLCHAIN_SOURCE
),y
)
7 GDB_VERSION
:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
10 GDB_VERSION
:=$(strip $(subst ",, $(BR2_EXT_GDB_VERSION)))
14 ifeq ($(GDB_VERSION
),snapshot
)
15 # Be aware that this changes daily....
16 GDB_SITE
:=ftp
://sources.redhat.com
/pub
/gdb
/snapshots
/current
17 GDB_SOURCE
:=gdb.
tar.bz2
19 GDB_DIR
:=$(TOOL_BUILD_DIR
)/gdb-
$(GDB_VERSION
)
20 GDB_PATCH_DIR
:=toolchain
/gdb
/$(GDB_VERSION
)
24 ifeq ($(BR2_TOOLCHAIN_BUILDROOT
),y
)
25 GDB_SITE
:=$(BR2_GNU_MIRROR
)/gdb
27 GDB_SITE
:=$(VENDOR_SITE
)
30 GDB_OFFICIAL_VERSION
:=$(GDB_VERSION
)$(VENDOR_SUFFIX
)$(VENDOR_GDB_RELEASE
)
32 GDB_SOURCE
:=gdb-
$(GDB_OFFICIAL_VERSION
).
tar.bz2
35 ifeq ($(BR2_TOOLCHAIN_BUILDROOT
),y
)
36 GDB_PATCH_DIR
:=toolchain
/gdb
/$(GDB_OFFICIAL_VERSION
)
38 GDB_PATCH_DIR
:=$(VENDOR_PATCH_DIR
)/gdb-
$(GDB_OFFICIAL_VERSION
)
41 GDB_DIR
:=$(TOOL_BUILD_DIR
)/gdb-
$(GDB_OFFICIAL_VERSION
)
43 # NOTE: This option should not be used with gdb versions 6.4 and above.
44 ifeq ($(GDB_VERSION
),6.2.1)
45 DISABLE_GDBMI
:=--disable-gdbmi
48 ifeq ($(GDB_VERSION
),6.3)
49 DISABLE_GDBMI
:=--disable-gdbmi
53 $(DL_DIR
)/$(GDB_SOURCE
):
54 $(WGET
) -P
$(DL_DIR
) $(GDB_SITE
)/$(GDB_SOURCE
)
56 gdb-unpacked
: $(GDB_DIR
)/.unpacked
57 $(GDB_DIR
)/.unpacked
: $(DL_DIR
)/$(GDB_SOURCE
)
58 mkdir
-p
$(TOOL_BUILD_DIR
)
59 $(GDB_CAT
) $(DL_DIR
)/$(GDB_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
60 ifeq ($(GDB_VERSION
),snapshot
)
61 GDB_REAL_DIR
=$(shell \
62 tar jtf
$(DL_DIR
)/$(GDB_SOURCE
) | head
-1 | cut
-d
"/" -f1
)
63 ln
-sf
$(TOOL_BUILD_DIR
)/$(shell tar jtf
$(DL_DIR
)/$(GDB_SOURCE
) | head
-1 | cut
-d
"/" -f1
) $(GDB_DIR
)
65 toolchain
/patch-kernel.sh
$(GDB_DIR
) $(GDB_PATCH_DIR
) \
*.patch
66 $(SED
) '/^ac_subdirs_all/s/ testsuite//g' \
67 -e
'/^subdirs/s/ testsuite//g' $(@D
)/gdb
/configure
68 $(CONFIG_UPDATE
) $(@D
)
69 $(CONFIG_UPDATE
) $(@D
)/readline
/support
75 ######################################################################
79 ######################################################################
81 GDB_TARGET_DIR
:=$(BUILD_DIR
)/gdb-
$(GDB_VERSION
)-target
83 GDB_TARGET_CONFIGURE_VARS
:= \
84 ac_cv_type_uintptr_t
=yes \
85 gt_cv_func_gettext_libintl
=yes \
86 ac_cv_func_dcgettext
=yes \
87 gdb_cv_func_sigsetjmp
=yes \
88 bash_cv_func_strcoll_broken
=no \
89 bash_cv_must_reinstall_sighandlers
=no \
90 bash_cv_func_sigsetjmp
=present \
91 bash_cv_have_mbstate_t
=yes
93 $(GDB_TARGET_DIR
)/.configured
: THIS_SRCDIR
= $(GDB_DIR
)
94 $(GDB_TARGET_DIR
)/.configured
: $(GDB_DIR
)/.unpacked
95 mkdir
-p
$(GDB_TARGET_DIR
)
96 (cd
$(GDB_TARGET_DIR
); rm -rf config.cache
; \
97 gdb_cv_func_sigsetjmp
=yes \
98 $(AUTO_CONFIGURE_TARGET
) \
101 --without-uiout
$(DISABLE_GDBMI
) \
102 --disable-tui
--disable-gdbtk
--without-x \
103 --disable-sim
--enable-gdbserver \
104 --without-included-gettext \
107 ifeq ($(BR2_ENABLE_LOCALE
),y
)
108 -$(SED
) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR
)/gdb
/Makefile
112 $(GDB_TARGET_DIR
)/gdb
/gdb
: $(GDB_TARGET_DIR
)/.configured
113 $(MAKE
) -C
$(GDB_TARGET_DIR
)
116 $(TARGET_DIR
)/usr
/bin
/gdb
: $(GDB_TARGET_DIR
)/gdb
/gdb
117 $(INSTALL
) -D
-m
0755 $(GDB_TARGET_DIR
)/gdb
/gdb
$@
118 $(STRIPCMD
) $(STRIP_STRIP_ALL
) $@
120 gdb_target
: ncurses
$(TARGET_DIR
)/usr
/bin
/gdb
122 gdb_target-source
: $(DL_DIR
)/$(GDB_SOURCE
)
125 -$(MAKE
) -C
$(GDB_TARGET_DIR
) clean
126 rm -f
$(TARGET_DIR
)/usr
/bin
/gdb
129 rm -rf
$(GDB_TARGET_DIR
)
131 ######################################################################
135 ######################################################################
137 GDB_SERVER_DIR
:=$(BUILD_DIR
)/gdbserver-
$(GDB_VERSION
)
139 $(GDB_SERVER_DIR
)/.configured
: THIS_SRCDIR
= $(GDB_DIR
)/gdb
/gdbserver
140 $(GDB_SERVER_DIR
)/.configured
: $(GDB_DIR
)/.unpacked
141 mkdir
-p
$(GDB_SERVER_DIR
)
142 (cd
$(GDB_SERVER_DIR
); rm -rf config.cache
; \
143 gdb_cv_func_sigsetjmp
=yes \
144 bash_cv_have_mbstate_t
=yes \
145 $(AUTO_CONFIGURE_TARGET
) \
149 --sbindir
=/usr
/sbin \
150 --libexecdir
=/usr
/lib \
152 --datadir=/usr
/share \
153 --localstatedir
=/var \
154 --mandir=/usr
/share
/man \
155 --infodir=/usr
/share
/info \
156 --includedir=$(STAGING_DIR
)/usr
/include \
158 --without-uiout
$(DISABLE_GDBMI
) \
159 --disable-tui
--disable-gdbtk
--without-x \
160 --without-included-gettext \
164 $(GDB_SERVER_DIR
)/gdbserver
: $(GDB_SERVER_DIR
)/.configured
165 $(MAKE
) -C
$(GDB_SERVER_DIR
)
167 $(TARGET_DIR
)/usr
/bin
/gdbserver
: $(GDB_SERVER_DIR
)/gdbserver
168 ifeq ($(BR2_CROSS_TOOLCHAIN_TARGET_UTILS
),y
)
169 $(INSTALL
) -d
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/target_utils
170 $(INSTALL
) -D
-m
0755 $(GDB_SERVER_DIR
)/gdbserver \
171 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/target_utils
/gdbserver
173 $(INSTALL
) -D
-m
0755 $(GDB_SERVER_DIR
)/gdbserver
$@
174 $(STRIPCMD
) $(STRIP_STRIP_ALL
) $@
176 gdbserver
: $(TARGET_DIR
)/usr
/bin
/gdbserver
179 -$(MAKE
) -C
$(GDB_SERVER_DIR
) clean
180 rm -f
$(TARGET_DIR
)/usr
/bin
/gdbserver
183 rm -rf
$(GDB_SERVER_DIR
)
185 ######################################################################
189 ######################################################################
191 GDB_HOST_DIR
:=$(TOOL_BUILD_DIR
)/gdbhost-
$(GDB_VERSION
)
193 $(GDB_HOST_DIR
)/.configured
: $(GDB_DIR
)/.unpacked
194 mkdir
-p
$(GDB_HOST_DIR
)
195 (cd
$(GDB_HOST_DIR
); rm -rf config.cache
; \
196 gdb_cv_func_sigsetjmp
=yes \
197 bash_cv_have_mbstate_t
=yes \
198 $(GDB_DIR
)/configure \
199 --prefix=$(STAGING_DIR
) \
200 --build
=$(GNU_HOST_NAME
) \
201 --host
=$(GNU_HOST_NAME
) \
202 --target
=$(REAL_GNU_TARGET_NAME
) \
204 --without-uiout
$(DISABLE_GDBMI
) \
205 --disable-tui
--disable-gdbtk
--without-x \
206 --without-included-gettext \
211 $(GDB_HOST_DIR
)/gdb
/gdb
: $(GDB_HOST_DIR
)/.configured
212 $(MAKE
) -C
$(GDB_HOST_DIR
)
213 strip $(GDB_HOST_DIR
)/gdb
/gdb
215 $(TARGET_CROSS
)gdb
: $(GDB_HOST_DIR
)/gdb
/gdb
216 $(INSTALL
) -D
$(GDB_HOST_DIR
)/gdb
/gdb
$(TARGET_CROSS
)gdb
217 ln
-snf ..
/..
/bin
/$(REAL_GNU_TARGET_NAME
)-gdb \
218 $(STAGING_DIR
)/usr
/$(REAL_GNU_TARGET_NAME
)/bin
/gdb
219 ln
-snf
$(REAL_GNU_TARGET_NAME
)-gdb \
220 $(STAGING_DIR
)/usr
/bin
/$(GNU_TARGET_NAME
)-gdb
222 gdbhost
: $(TARGET_CROSS
)gdb
225 -$(MAKE
) -C
$(GDB_HOST_DIR
) clean
226 rm -f
$(TARGET_CROSS
)gdb
229 rm -rf
$(GDB_HOST_DIR
)
231 #############################################################
233 # Toplevel Makefile options
235 #############################################################
236 ifeq ($(BR2_PACKAGE_GDB
),y
)
240 ifeq ($(BR2_PACKAGE_GDB_SERVER
),y
)
244 ifeq ($(BR2_PACKAGE_GDB_HOST
),y
)
247 ifeq ($(findstring y
,$(BR2_PACKAGE_GDB_SERVER
)$(BR2_PACKAGE_GDB_HOST
)),y
)
248 HOST_SOURCE
+=gdb-source