tools/patchelf: update to 0.18.0
[openwrt/staging/dedeckeh.git] / toolchain / gdb / Makefile
1 #
2 # Copyright (C) 2006-2020 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=gdb
10 PKG_VERSION:=12.1
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=@GNU/gdb
15 PKG_HASH:=0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed
16 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
17
18 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
19
20 HOST_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/toolchain-build.mk
23
24 HOST_CONFIGURE_VARS += \
25 acx_cv_cc_gcc_supports_ada=false \
26 gdb_cv_func_sigsetjmp=yes
27
28 HOST_CONFIGURE_ARGS = \
29 --prefix=$(TOOLCHAIN_DIR) \
30 --build=$(GNU_HOST_NAME) \
31 --host=$(GNU_HOST_NAME) \
32 --target=$(REAL_GNU_TARGET_NAME) \
33 --with-gmp=$(STAGING_DIR_HOST) \
34 --with-mpfr=$(STAGING_DIR_HOST) \
35 --with-mpc=$(STAGING_DIR_HOST) \
36 --with-expat=$(STAGING_DIR_HOST) \
37 --disable-werror \
38 --without-uiout \
39 --enable-tui --disable-gdbtk --without-x \
40 --without-included-gettext \
41 --enable-threads \
42 --disable-unit-tests \
43 --disable-ubsan \
44 --disable-binutils \
45 --disable-ld \
46 --disable-gas \
47 --disable-sim
48
49 ifneq ($(CONFIG_GDB_PYTHON),)
50 HOST_CONFIGURE_ARGS+= --with-python
51 else
52 HOST_CONFIGURE_ARGS+= --without-python
53 endif
54
55 define Host/Install
56 mkdir -p $(TOOLCHAIN_DIR)/bin
57 $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
58 ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
59 strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
60 mkdir -p $(TOOLCHAIN_DIR)/share/gdb
61 -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/
62 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/
63 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/
64 endef
65
66 define Host/Clean
67 rm -rf \
68 $(HOST_BUILD_DIR) \
69 $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \
70 $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
71 endef
72
73 $(eval $(call HostBuild))