aboutsummaryrefslogtreecommitdiff
path: root/toolchain/toolchain.mk
diff options
context:
space:
mode:
authorGravatar Gustavo Zacarias <gustavo@zacarias.com.ar>2014-10-20 09:28:05 -0300
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-25 12:48:17 +0200
commite1eba3d97c5d435ed1b88fdb6b6989871aa2c9eb (patch)
tree247ebe63543bc8ae29dca992209a10ce41e797e7 /toolchain/toolchain.mk
parent9623ff651f83a350819719f10705552da9793205 (diff)
downloadbuildroot-e1eba3d97c5d435ed1b88fdb6b6989871aa2c9eb.tar.gz
buildroot-e1eba3d97c5d435ed1b88fdb6b6989871aa2c9eb.tar.bz2
system/skeleton: make nsswitch install conditional
Don't blindly install the /etc/nsswitch.conf file, it's useless for toolchains that aren't (e)glibc-based and misleading. Make the installation conditional on a (e)glibc toolchain. [Thomas: use $(INSTALL) instead of cp.] Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain/toolchain.mk')
-rw-r--r--toolchain/toolchain.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/toolchain/toolchain.mk b/toolchain/toolchain.mk
index 8fe06ffa5b..3f9900ba18 100644
--- a/toolchain/toolchain.mk
+++ b/toolchain/toolchain.mk
@@ -3,6 +3,16 @@
# TARGET_FINALIZE_HOOKS, to be applied just after all packages
# have been built.
+# Install default nsswitch.conf file if the skeleton doesn't provide it
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+define GLIBC_COPY_NSSWITCH_FILE
+ $(Q)if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
+ $(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
+ fi
+endef
+TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
+endif
+
# Install the gconv modules
ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y)
GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST))