a2abf29f86eb206ae8f93938ae2e178158434ade
[openwrt/staging/wigyori.git] / package / devel / gdb / Makefile
1 #
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gdb
11 PKG_VERSION:=8.3.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/gdb
16 PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_INSTALL:=1
20 PKG_LICENSE:=GPL-3.0+
21 PKG_CPE_ID:=cpe:/a:gnu:gdb
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/gdb/Default
26 SECTION:=devel
27 CATEGORY:=Development
28 DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib
29 URL:=https://www.gnu.org/software/gdb/
30 endef
31
32 define Package/gdb
33 $(call Package/gdb/Default)
34 TITLE:=GNU Debugger
35 DEPENDS+=+libreadline +libncurses +zlib
36 endef
37
38 define Package/gdb/description
39 GDB, the GNU Project debugger, allows you to see what is going on `inside'
40 another program while it executes -- or what another program was doing at the
41 moment it crashed.
42 endef
43
44 define Package/gdbserver
45 $(call Package/gdb/Default)
46 TITLE:=Remote server for GNU Debugger
47 DEPENDS=@!arc
48 endef
49
50 define Package/gdbserver/description
51 GDBSERVER is a program that allows you to run GDB on a different machine than the
52 one which is running the program being debugged.
53 endef
54
55 # XXX: add --disable-werror to prevent build failure with arm
56 CONFIGURE_ARGS+= \
57 --with-system-readline \
58 --without-expat \
59 --without-lzma \
60 --disable-sim \
61 --disable-werror \
62 --disable-source-highlight
63
64 CONFIGURE_VARS+= \
65 ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
66
67 TARGET_LDFLAGS+= \
68 -static-libstdc++ \
69 -Wl,--gc-sections
70
71 define Build/Install
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 CPPFLAGS="$(TARGET_CPPFLAGS)" \
75 install-gdb
76 endef
77
78 define Package/gdb/install
79 $(INSTALL_DIR) $(1)/usr/bin
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
81 endef
82
83 define Package/gdbserver/install
84 $(INSTALL_DIR) $(1)/usr/bin
85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
86 endef
87
88 $(eval $(call BuildPackage,gdb))
89 $(eval $(call BuildPackage,gdbserver))