blob: 8fe06ffa5bd1f1b5400e0258a75dc2580d2d42b9 [file] [log] [blame]
Yann E. MORIN11c10762014-07-27 21:28:32 +02001# 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
4# have been built.
5
6# Install the gconv modules
7ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y)
8GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST))
9define COPY_GCONV_LIBS
10 $(Q)if [ -z "$(GCONV_LIBS)" ]; then \
11 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/gconv-modules \
12 $(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
13 $(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/gconv/*.so \
14 $(TARGET_DIR)/usr/lib/gconv \
15 || exit 1; \
16 else \
17 for l in $(GCONV_LIBS); do \
18 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/$${l}.so \
19 $(TARGET_DIR)/usr/lib/gconv/$${l}.so \
20 || exit 1; \
21 $(TARGET_READELF) -d $(STAGING_DIR)/usr/lib/gconv/$${l}.so |\
22 sort -u |\
23 sed -e '/.*(NEEDED).*\[\(.*\.so\)\]$$/!d; s//\1/;' |\
24 while read lib; do \
25 $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/$${lib} \
26 $(TARGET_DIR)/usr/lib/gconv/$${lib} \
27 || exit 1; \
28 done; \
29 done; \
30 ./support/scripts/expunge-gconv-modules "$(GCONV_LIBS)" \
31 <$(STAGING_DIR)/usr/lib/gconv/gconv-modules \
32 >$(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
33 fi
34endef
35TARGET_FINALIZE_HOOKS += COPY_GCONV_LIBS
36endif