From 42c9321a15c2a98dd72cc09c7ef5900b5097c6eb Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Thu, 4 Aug 2005 03:49:25 +0000 Subject: [PATCH] Add BR2_CROSS_TOOLCHAIN_TARGET_UTILS to allow bundling of some useful debug apps with a deployed cross toolchain. Should probably do ltrace as well... Also, add another compat symlink for cross gdb. --- package/strace/strace.mk | 5 +++++ toolchain/Config.in | 11 +++++++++++ toolchain/gdb/gdb.mk | 9 ++++++++- toolchain/uClibc/uclibc.mk | 5 +++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package/strace/strace.mk b/package/strace/strace.mk index 2f28fe498e..c930aa2a8c 100644 --- a/package/strace/strace.mk +++ b/package/strace/strace.mk @@ -49,6 +49,11 @@ $(STRACE_DIR)/strace: $(STRACE_DIR)/.configured $(TARGET_DIR)/usr/bin/strace: $(STRACE_DIR)/strace install -c $(STRACE_DIR)/strace $(TARGET_DIR)/usr/bin/strace $(STRIP) $(TARGET_DIR)/usr/bin/strace > /dev/null 2>&1 +ifeq ($(strip $(BR2_CROSS_TOOLCHAIN_TARGET_UTILS)),y) + mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils + install -c $(TARGET_DIR)/usr/bin/strace \ + $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils/strace +endif strace: uclibc $(TARGET_DIR)/usr/bin/strace diff --git a/toolchain/Config.in b/toolchain/Config.in index 0369bd4aab..8597ac3991 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -45,6 +45,17 @@ config BR2_TARGET_OPTIMIZATION help Optimizations to use when building for the target host. +config BR2_CROSS_TOOLCHAIN_TARGET_UTILS + string "Include target utils in cross toolchain." + default y + help + When using buildroot to build a deployable cross toolchain, it is handy + to include certain target apps with that toolchain as a convenience. + Examples include ldd, gdbserver, and strace. + + Answer Y if you want these apps (if built) copied into the cross toolchain + dir under -linux-uclibc/target_utils/. + # Might be worth experimenting with for gcc 3.4.x. #GCC_WITH_CPU:= #GCC_WITH_ARCH:= diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index ed37a75a07..95d6d3dae5 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -123,6 +123,11 @@ $(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured $(STRIP) $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver +ifeq ($(strip $(BR2_CROSS_TOOLCHAIN_TARGET_UTILS)),y) + mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils + install -c $(GDB_SERVER_DIR)/gdbserver \ + $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils/gdbserver +endif install -c $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver gdbserver: $(TARGET_DIR)/usr/bin/gdbserver @@ -164,8 +169,10 @@ $(GDB_CLIENT_DIR)/gdb/gdb: $(GDB_CLIENT_DIR)/.configured $(TARGET_CROSS)gdb: $(GDB_CLIENT_DIR)/gdb/gdb install -c $(GDB_CLIENT_DIR)/gdb/gdb $(TARGET_CROSS)gdb - ln -fs ../../bin/$(REAL_GNU_TARGET_NAME)-gdb \ + ln -snf ../../bin/$(REAL_GNU_TARGET_NAME)-gdb \ $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/gdb + ln -snf $(REAL_GNU_TARGET_NAME)-gdb \ + $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gdb gdbclient: $(TARGET_CROSS)gdb diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index 569a9e8b02..a51c5364ba 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -126,6 +126,11 @@ $(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/lib/libc.a $(TARGET_DIR)/usr/bin/ldd: $(MAKE1) -C $(UCLIBC_DIR) $(TARGET_CONFIGURE_OPTS) \ PREFIX=$(TARGET_DIR) utils install_utils +ifeq ($(strip $(BR2_CROSS_TOOLCHAIN_TARGET_UTILS)),y) + mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils + install -c $(TARGET_DIR)/usr/bin/ldd \ + $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils/ldd +endif touch -c $(TARGET_DIR)/usr/bin/ldd UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0 -- 2.30.2