toolchain.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # Install default nsswitch.conf file if the skeleton doesn't provide it
  6. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
  7. define GLIBC_COPY_NSSWITCH_FILE
  8. $(Q)if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
  9. $(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
  10. fi
  11. endef
  12. TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
  13. endif
  14. # Install the gconv modules
  15. ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y)
  16. GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST))
  17. define COPY_GCONV_LIBS
  18. $(Q)if [ -z "$(GCONV_LIBS)" ]; then \
  19. $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/gconv-modules \
  20. $(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
  21. $(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/gconv/*.so \
  22. $(TARGET_DIR)/usr/lib/gconv \
  23. || exit 1; \
  24. else \
  25. for l in $(GCONV_LIBS); do \
  26. $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/$${l}.so \
  27. $(TARGET_DIR)/usr/lib/gconv/$${l}.so \
  28. || exit 1; \
  29. $(TARGET_READELF) -d $(STAGING_DIR)/usr/lib/gconv/$${l}.so |\
  30. sort -u |\
  31. sed -e '/.*(NEEDED).*\[\(.*\.so\)\]$$/!d; s//\1/;' |\
  32. while read lib; do \
  33. $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/$${lib} \
  34. $(TARGET_DIR)/usr/lib/gconv/$${lib} \
  35. || exit 1; \
  36. done; \
  37. done; \
  38. ./support/scripts/expunge-gconv-modules "$(GCONV_LIBS)" \
  39. <$(STAGING_DIR)/usr/lib/gconv/gconv-modules \
  40. >$(TARGET_DIR)/usr/lib/gconv/gconv-modules; \
  41. fi
  42. endef
  43. TARGET_FINALIZE_HOOKS += COPY_GCONV_LIBS
  44. endif