4cf2aaa87fc964ff50ba82fa20462853b776f4df
[openwrt/openwrt.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.0.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/gdb
16 PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3
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 @!arc
29 URL:=http://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 endef
48
49 define Package/gdbserver/description
50 GDBSERVER is a program that allows you to run GDB on a different machine than the
51 one which is running the program being debugged.
52 endef
53
54 # XXX: add --disable-werror to prevent build failure with arm
55 CONFIGURE_ARGS+= \
56 --with-system-readline \
57 --without-expat \
58 --without-lzma \
59 --disable-sim \
60 --disable-werror
61
62 CONFIGURE_VARS+= \
63 ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
64
65 TARGET_LDFLAGS+= \
66 -static-libstdc++ \
67 -Wl,--gc-sections
68
69 define Build/Install
70 $(MAKE) -C $(PKG_BUILD_DIR) \
71 DESTDIR="$(PKG_INSTALL_DIR)" \
72 CPPFLAGS="$(TARGET_CPPFLAGS)" \
73 install-gdb
74 endef
75
76 define Package/gdb/install
77 $(INSTALL_DIR) $(1)/usr/bin
78 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
79 endef
80
81 define Package/gdbserver/install
82 $(INSTALL_DIR) $(1)/usr/bin
83 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
84 endef
85
86 $(eval $(call BuildPackage,gdb))
87 $(eval $(call BuildPackage,gdbserver))