Yann E. MORIN | 11c1076 | 2014-07-27 21:28:32 +0200 | [diff] [blame] | 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 |
| 4 | # have been built. |
| 5 | |
| 6 | # Install the gconv modules |
| 7 | ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y) |
| 8 | GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST)) |
| 9 | define 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 |
| 34 | endef |
| 35 | TARGET_FINALIZE_HOOKS += COPY_GCONV_LIBS |
| 36 | endif |