blob: 7bdc6c83cbe8999c0553fdd63d5a684f1fcb1fd8 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2006-2016 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=gdb
11PKG_VERSION:=15.2
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15PKG_SOURCE_URL:=@GNU/gdb
16PKG_HASH:=83350ccd35b5b5a0cba6b334c41294ea968158c573940904f00b92f76345314d
17
18PKG_BUILD_PARALLEL:=1
19PKG_INSTALL:=1
20PKG_LICENSE:=GPL-3.0+
21PKG_CPE_ID:=cpe:/a:gnu:gdb
22
23include $(INCLUDE_DIR)/package.mk
24include $(INCLUDE_DIR)/nls.mk
25
26define Package/gdb/Default
27 SECTION:=devel
28 CATEGORY:=Development
29 DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS)
30 URL:=https://www.gnu.org/software/gdb/
31endef
32
33define Package/gdb
34$(call Package/gdb/Default)
35 TITLE:=GNU Debugger
36 DEPENDS+=+libreadline +libncurses +zlib +libgmp +libmpfr
37endef
38
39define Package/gdb/description
40GDB, the GNU Project debugger, allows you to see what is going on 'inside'
41another program while it executes -- or what another program was doing at the
42moment it crashed.
43endef
44
45define Package/gdbserver
46$(call Package/gdb/Default)
47 TITLE:=Remote server for GNU Debugger
48endef
49
50define Package/gdbserver/description
51GDBSERVER is a program that allows you to run GDB on a different machine than the
52one which is running the program being debugged.
53endef
54
55# XXX: add --disable-werror to prevent build failure with arm
56CONFIGURE_ARGS+= \
57 --with-system-readline \
58 --with-system-zlib \
59 --without-expat \
60 --without-lzma \
61 --without-zstd \
62 --disable-unit-tests \
63 --disable-ubsan \
64 --disable-sim \
65 --disable-werror \
66 --disable-source-highlight \
67 --without-isl \
68 --without-xxhash \
69 --with-libgmp-prefix=$(STAGING_DIR)/usr
70
71CONFIGURE_VARS+= \
72 ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
73
74TARGET_LDFLAGS+= \
75 $(INTL_LDFLAGS) $(if $(INTL_FULL),-lintl) \
76 -static-libstdc++ \
77 -Wl,--gc-sections
78
79define Build/Install
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 DESTDIR="$(PKG_INSTALL_DIR)" \
82 CPPFLAGS="$(TARGET_CPPFLAGS)" \
83 install-gdb install-gdbserver
84endef
85
86define Package/gdb/install
87 $(INSTALL_DIR) $(1)/usr/bin
88 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
89endef
90
91define Package/gdbserver/install
92 $(INSTALL_DIR) $(1)/usr/bin
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
94endef
95
96$(eval $(call BuildPackage,gdb))
97$(eval $(call BuildPackage,gdbserver))