1 ################################################################################
3 # toolchain-related customisation of the content of the target/ directory
5 ################################################################################
7 # Those customisations are added to the TARGET_FINALIZE_HOOKS, to be applied
8 # just after all packages have been built.
10 # Install default nsswitch.conf file if the skeleton doesn't provide it
11 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
12 define GLIBC_COPY_NSSWITCH_FILE
13 $(Q)if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
14 $(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
17 TOOLCHAIN_TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
20 # Install the gconv modules
21 ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y)
22 TOOLCHAIN_GLIBC_GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST))
23 define TOOLCHAIN_GLIBC_COPY_GCONV_LIBS
25 for d in $(TOOLCHAIN_EXTERNAL_PREFIX) ''; do \
26 [ -d "$(STAGING_DIR)/usr/lib/$${d}/gconv" ] || continue; \
30 if [ "$${found_gconv}" = "no" ]; then \
31 printf "Unable to find gconv modules\n" >&2; \
34 if [ -z "$(TOOLCHAIN_GLIBC_GCONV_LIBS)" ]; then \
35 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules \
36 $(TARGET_DIR)/usr/lib/gconv/gconv-modules && \
37 $(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/$${d}/gconv/*.so \
38 $(TARGET_DIR)/usr/lib/gconv \
41 for l in $(TOOLCHAIN_GLIBC_GCONV_LIBS); do \
42 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/$${l}.so \
43 $(TARGET_DIR)/usr/lib/gconv/$${l}.so \
45 $(TARGET_READELF) -d $(STAGING_DIR)/usr/lib/$${d}/gconv/$${l}.so |\
47 sed -e '/.*(NEEDED).*\[\(.*\.so\)\]$$/!d; s//\1/;' |\
49 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/$${lib} \
50 $(TARGET_DIR)/usr/lib/gconv/$${lib} \
54 ./support/scripts/expunge-gconv-modules "$(TOOLCHAIN_GLIBC_GCONV_LIBS)" \
55 <$(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules \
56 >$(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
59 TOOLCHAIN_TARGET_FINALIZE_HOOKS += TOOLCHAIN_GLIBC_COPY_GCONV_LIBS