x86: fix reboot on apu2 boards
[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
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/gdb/Default
25   SECTION:=devel
26   CATEGORY:=Development
27   DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib @!arc
28   URL:=http://www.gnu.org/software/gdb/
29 endef
30
31 define Package/gdb
32 $(call Package/gdb/Default)
33   TITLE:=GNU Debugger
34   DEPENDS+=+libreadline +libncurses +zlib
35 endef
36
37 define Package/gdb/description
38 GDB, the GNU Project debugger, allows you to see what is going on `inside'
39 another program while it executes -- or what another program was doing at the
40 moment it crashed.
41 endef
42
43 define Package/gdbserver
44 $(call Package/gdb/Default)
45   TITLE:=Remote server for GNU Debugger
46 endef
47
48 define Package/gdbserver/description
49 GDBSERVER is a program that allows you to run GDB on a different machine than the
50 one which is running the program being debugged.
51 endef
52
53 # XXX: add --disable-werror to prevent build failure with arm
54 CONFIGURE_ARGS+= \
55         --with-system-readline \
56         --without-expat \
57         --without-lzma \
58         --disable-sim \
59         --disable-werror
60
61 CONFIGURE_VARS+= \
62         ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
63
64 TARGET_LDFLAGS+= \
65         -static-libstdc++ \
66         -Wl,--gc-sections
67
68 define Build/Install
69         $(MAKE) -C $(PKG_BUILD_DIR) \
70                 DESTDIR="$(PKG_INSTALL_DIR)" \
71                 CPPFLAGS="$(TARGET_CPPFLAGS)" \
72                 install-gdb
73 endef
74
75 define Package/gdb/install
76         $(INSTALL_DIR) $(1)/usr/bin
77         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
78 endef
79
80 define Package/gdbserver/install
81         $(INSTALL_DIR) $(1)/usr/bin
82         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
83 endef
84
85 $(eval $(call BuildPackage,gdb))
86 $(eval $(call BuildPackage,gdbserver))