diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 05de3c14d1..9bde2beea1 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -77,14 +77,6 @@ ifeq ($(BR2_GDB_VERSION_11),y) HOST_GDB_DEPENDENCIES += host-gmp endif -# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and -# we're building the full gdb for the target, we need gmp as a -# dependency. For now the default gdb version in Buildroot doesn't -# require gmp. -ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy) -GDB_DEPENDENCIES += gmp -endif - # When gdb sources are fetched from the binutils-gdb repository, they # also contain the binutils sources, but binutils shouldn't be built, # so we disable it (additionally the option --disable-install-libbfd @@ -169,6 +161,16 @@ GDB_CONF_OPTS += \ --without-curses endif +# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and +# we're building the full gdb for the target, we need gmp as a +# dependency. For now the default gdb version in Buildroot doesn't +# require gmp. +ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy) +GDB_CONF_OPTS += \ + --with-libgmp-prefix=$(STAGING_DIR)/usr +GDB_DEPENDENCIES += gmp +endif + ifeq ($(BR2_PACKAGE_GDB_SERVER),y) GDB_CONF_OPTS += --enable-gdbserver GDB_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)