apm821xx: MBL: HDD regulators overhaul for MBL DUO
[openwrt/staging/chunkeey.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:=10.1
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=@GNU/gdb
15 PKG_HASH:=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
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 --disable-werror \
34 --without-uiout \
35 --enable-tui --disable-gdbtk --without-x \
36 --without-included-gettext \
37 --enable-threads \
38 --with-expat \
39 --disable-unit-tests \
40 --disable-ubsan \
41 --disable-binutils \
42 --disable-ld \
43 --disable-gas \
44 --disable-sim
45
46 ifneq ($(CONFIG_GDB_PYTHON),)
47 HOST_CONFIGURE_ARGS+= --with-python
48 else
49 HOST_CONFIGURE_ARGS+= --without-python
50 endif
51
52 define Host/Install
53 mkdir -p $(TOOLCHAIN_DIR)/bin
54 $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
55 ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
56 strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
57 mkdir -p $(TOOLCHAIN_DIR)/share/gdb
58 -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/
59 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/
60 cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/
61 endef
62
63 define Host/Clean
64 rm -rf \
65 $(HOST_BUILD_DIR) \
66 $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \
67 $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
68 endef
69
70 $(eval $(call HostBuild))