1 # This file contains toolchain-related customisation of the content
2 # of the target/ directory. Those customisations are added to the
3 # TARGET_FINALIZE_HOOKS, to be applied just after all packages
6 # Install default nsswitch.conf file if the skeleton doesn't provide it
7 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC
),y
)
8 define GLIBC_COPY_NSSWITCH_FILE
9 $(Q
)if
[ ! -f
"$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
10 $(INSTALL
) -D
-m
0644 package
/glibc
/nsswitch.conf
$(TARGET_DIR
)/etc
/nsswitch.conf
; \
13 TARGET_FINALIZE_HOOKS
+= GLIBC_COPY_NSSWITCH_FILE
16 # Install the gconv modules
17 ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
),y
)
18 GCONV_LIBS
= $(call qstrip
,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST
))
19 define COPY_GCONV_LIBS
21 for d in
$(TOOLCHAIN_EXTERNAL_PREFIX
) ''; do \
22 [ -d
"$(STAGING_DIR)/usr/lib/$${d}/gconv" ] || continue
; \
26 if
[ "$${found_gconv}" = "no" ]; then \
27 printf
"Unable to find gconv modules\n" >&2; \
30 if
[ -z
"$(GCONV_LIBS)" ]; then \
31 $(INSTALL
) -m
0644 -D
$(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/gconv-modules \
32 $(TARGET_DIR
)/usr
/lib
/gconv
/gconv-modules
&& \
33 $(INSTALL
) -m
0644 $(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/*.so \
34 $(TARGET_DIR
)/usr
/lib
/gconv \
37 for l in
$(GCONV_LIBS
); do \
38 $(INSTALL
) -m
0644 -D
$(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/$${l}.so \
39 $(TARGET_DIR
)/usr
/lib
/gconv
/$${l}.so \
41 $(TARGET_READELF
) -d
$(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/$${l}.so |\
43 sed
-e
'/.*(NEEDED).*\[\(.*\.so\)\]$$/!d; s//\1/;' |\
45 $(INSTALL
) -m
0644 -D
$(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/$${lib} \
46 $(TARGET_DIR
)/usr
/lib
/gconv
/$${lib} \
50 .
/support
/scripts
/expunge-gconv-modules
"$(GCONV_LIBS)" \
51 <$(STAGING_DIR
)/usr
/lib
/$${d}/gconv
/gconv-modules \
52 >$(TARGET_DIR
)/usr
/lib
/gconv
/gconv-modules
; \
55 TARGET_FINALIZE_HOOKS
+= COPY_GCONV_LIBS