2 # Copyright (C) 2006-2020 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
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
)
19 HOST_BUILD_DIR
:=$(BUILD_DIR_TOOLCHAIN
)/$(GDB_DIR
)
21 HOST_BUILD_PARALLEL
:=1
23 include $(INCLUDE_DIR
)/toolchain-build.mk
25 export ZSTD_CFLAGS
=-I
$(STAGING_DIR_HOST
)/include -pthread
26 export ZSTD_LIBS
=-L
$(STAGING_DIR_HOST
)/lib
-lzstd
-lpthread
28 HOST_CONFIGURE_VARS
+= \
29 acx_cv_cc_gcc_supports_ada
=false \
30 gdb_cv_func_sigsetjmp
=yes
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
) \
43 --enable-tui
--disable-gdbtk
--without-x \
44 --without-included-gettext \
46 --disable-unit-tests \
53 ifneq ($(CONFIG_GDB_PYTHON
),)
54 HOST_CONFIGURE_ARGS
+= --with-python
56 HOST_CONFIGURE_ARGS
+= --without-python
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
/
73 $(TOOLCHAIN_DIR
)/bin
/$(TARGET_CROSS
)gdb \
74 $(TOOLCHAIN_DIR
)/bin
/$(GNU_TARGET_NAME
)-gdb
77 $(eval
$(call HostBuild
))