default "9.2" if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv)
default "10.2" if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv)
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
+
+# recent gdb versions (>= 10) have gdbserver moved at the top-level,
+# which requires a different build logic.
+config BR2_PACKAGE_GDB_TOPLEVEL
+ bool
+ default y if BR2_arc
+ default y if BR2_GDB_VERSION_10
+ default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv
+ depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
GDB_SITE = $(BR2_GNU_MIRROR)/gdb
GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
-# recent gdb versions (>= 10) have gdbserver moved at the top-level,
-# which requires a different build logic.
-ifeq ($(BR2_GDB_VERSION_10),y)
-GDB_GDBSERVER_TOPLEVEL = y
-endif
-
ifeq ($(BR2_arc),y)
GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
GDB_FROM_GIT = y
-# recent gdb versions (>= 10) have gdbserver moved at the top-level,
-# which requires a different build logic.
-GDB_GDBSERVER_TOPLEVEL = y
endif
ifeq ($(BR2_csky),y)
# On gdb < 10, if you want to build only gdbserver, you need to
# configure only gdb/gdbserver.
-ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(GDB_GDBSERVER_TOPLEVEL),)
+ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(BR2_PACKAGE_GDB_TOPLEVEL),)
GDB_SUBDIR = gdb/gdbserver
# When we want to build the full gdb, or for very recent versions of