tools/elfutils: refresh portability patch for macOS
[openwrt/openwrt.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:=14.1
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=@GNU/gdb
15 PKG_HASH:=d66df51276143451fcbff464cc8723d68f1e9df45a6a2d5635a54e71643edb80
16 PKG_CPE_ID:=cpe:/a:gnu:gdb
17 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
18
19 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
20
21 HOST_BUILD_PARALLEL:=1
22
23 include $(INCLUDE_DIR)/toolchain-build.mk
24
25 export ZSTD_CFLAGS=-I$(STAGING_DIR_HOST)/include -pthread
26 export ZSTD_LIBS=-L$(STAGING_DIR_HOST)/lib -lzstd -lpthread
27
28 HOST_CONFIGURE_VARS += \
29 acx_cv_cc_gcc_supports_ada=false \
30 gdb_cv_func_sigsetjmp=yes
31
32 HOST_CONFIGURE_ARGS = \
33 --prefix=$(TOOLCHAIN_DIR) \
34 --build=$(GNU_HOST_NAME) \
35 --host=$(GNU_HOST_NAME) \
36 --target=$(REAL_GNU_TARGET_NAME) \
37 --with-gmp=$(STAGING_DIR_HOST) \
38 --with-mpfr=$(STAGING_DIR_HOST) \
39 --with-mpc=$(STAGING_DIR_HOST) \
40 --with-expat=$(STAGING_DIR_HOST) \
41 --disable-werror \
42 --without-uiout \
43 --enable-tui --disable-gdbtk --without-x \
44 --without-included-gettext \
45 --enable-threads \
46 --disable-unit-tests \
47 --disable-ubsan \
48 --disable-binutils \
49 --disable-ld \
50 --disable-gas \
51 --disable-sim
52
53 ifneq ($(CONFIG_GDB_PYTHON),)
54 HOST_CONFIGURE_ARGS+= --with-python
55 else
56 HOST_CONFIGURE_ARGS+= --without-python
57 endif
58
59 define Host/Install
60 mkdir -p $(TOOLCHAIN_DIR)/bin
61 $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
62 ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
63 strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
64 mkdir -p $(TOOLCHAIN_DIR)/share/gdb
65 -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/
66 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/
67 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/
68 endef
69
70 define Host/Clean
71 rm -rf \
72 $(HOST_BUILD_DIR) \
73 $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \
74 $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
75 endef
76
77 $(eval $(call HostBuild))