aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nikita Sobolev <Nikita.Sobolev@synopsys.com>2019-11-21 15:31:20 +0300
committerGravatar Yann E. MORIN <yann.morin.1998@free.fr>2019-11-23 11:53:14 +0100
commitc6cd512fe2e954b2ccc0412717c1c3380bc5f69b (patch)
tree33a1cf2cb25326d1f92a20bb40ce32db34e8c988
parent1ca16b1feb6c52c98e8b3082c2a36503017b3c10 (diff)
downloadbuildroot-c6cd512fe2e954b2ccc0412717c1c3380bc5f69b.tar.gz
buildroot-c6cd512fe2e954b2ccc0412717c1c3380bc5f69b.tar.bz2
glibc: install glibc utils to target
With this patch we introduce an option for glibc, which installs getconf, ldconfig and ldd utilities on target, that may be useful in debugging. By default these utilities are built, but not installed to the target. ldd is a bash script, so it has bash dependency. Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
-rw-r--r--package/glibc/Config.in10
-rw-r--r--package/glibc/glibc.mk7
2 files changed, 17 insertions, 0 deletions
diff --git a/package/glibc/Config.in b/package/glibc/Config.in
index 7821251087..323767fc8a 100644
--- a/package/glibc/Config.in
+++ b/package/glibc/Config.in
@@ -8,3 +8,13 @@ config BR2_PACKAGE_GLIBC
help
https://www.gnu.org/software/libc/
endif
+
+config BR2_PACKAGE_GLIBC_UTILS
+ bool "Install glibc utilities"
+ depends on BR2_PACKAGE_BASH
+ help
+ Enabling this option will compile and install the getconf,
+ ldconfig and ldd glibc utilities for the target.
+
+comment "glibc utilities need bash"
+ depends on !BR2_PACKAGE_BASH
diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index c6acc43ff5..5cb19aabb9 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -143,10 +143,17 @@ ifeq ($(BR2_PACKAGE_GDB),y)
GLIBC_LIBS_LIB += libthread_db.so.*
endif
+ifeq ($(BR2_PACKAGE_GLIBC_UTILS),y)
+GLIBC_TARGET_UTILS_BIN = posix/getconf elf/ldconfig elf/ldd
+endif
+
define GLIBC_INSTALL_TARGET_CMDS
for libpattern in $(GLIBC_LIBS_LIB); do \
$(call copy_toolchain_lib_root,$$libpattern) ; \
done
+ $(foreach util,$(GLIBC_TARGET_UTILS_BIN), \
+ $(INSTALL) -D -m 0755 $(@D)/build/$(util) $(TARGET_DIR)/bin/$(notdir $(util))
+ )
endef
$(eval $(autotools-package))