diff options
-rw-r--r-- | package/gdb/gdb.mk | 2 | ||||
-rw-r--r-- | toolchain/helpers.mk | 7 | ||||
-rw-r--r-- | toolchain/toolchain-external/toolchain-external.mk | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 69fb3bae21..678c17cfd9 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -126,5 +126,7 @@ endef HOST_GDB_POST_INSTALL_HOOKS += HOST_GDB_ADD_SYMLINK +HOST_GDB_POST_INSTALL_HOOKS += gen_gdbinit_file + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 9595196e9b..ef60120713 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -355,3 +355,10 @@ check_unusable_toolchain = \ echo "such as Buildroot." ; \ exit 1 ; \ fi + +# +# Generate gdbinit file for use with Buildroot +# +gen_gdbinit_file = \ + mkdir -p $(STAGING_DIR)/usr/share/buildroot/ ; \ + echo "set sysroot $(STAGING_DIR)" > $(STAGING_DIR)/usr/share/buildroot/gdbinit diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index b40f54dd7e..05d8867a81 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -651,6 +651,12 @@ define TOOLCHAIN_EXTERNAL_SANITIZE_KERNEL_HEADERS -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' endef +define TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT + if test -f $(TARGET_CROSS)gdb ; then \ + $(call gen_gdbinit_file) ; \ + fi +endef + # Even though we're installing things in both the staging, the host # and the target directory, we do everything within the # install-staging step, arbitrarily. @@ -659,6 +665,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS $(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC) $(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT) $(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER) + $(TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT) endef $(eval $(generic-package)) |