]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - toolchain/toolchain.mk
woff2: fix build on m68k
[coffee/buildroot.git] / toolchain / toolchain.mk
1 ################################################################################
2 #
3 # toolchain-related customisation of the content of the target/ directory
4 #
5 ################################################################################
6
7 # Those customisations are added to the TARGET_FINALIZE_HOOKS, to be applied
8 # just after all packages have been built.
9
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 ; \
15         fi
16 endef
17 TOOLCHAIN_TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
18 endif
19
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
24         $(Q)found_gconv=no; \
25         for d in $(TOOLCHAIN_EXTERNAL_PREFIX) ''; do \
26                 [ -d "$(STAGING_DIR)/usr/lib/$${d}/gconv" ] || continue; \
27                 found_gconv=yes; \
28                 break; \
29         done; \
30         if [ "$${found_gconv}" = "no" ]; then \
31                 printf "Unable to find gconv modules\n" >&2; \
32                 exit 1; \
33         fi; \
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 \
39                 || exit 1; \
40         else \
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 \
44                         || exit 1; \
45                         $(TARGET_READELF) -d $(STAGING_DIR)/usr/lib/$${d}/gconv/$${l}.so |\
46                         sort -u |\
47                         sed -e '/.*(NEEDED).*\[\(.*\.so\)\]$$/!d; s//\1/;' |\
48                         while read lib; do \
49                                  $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/$${lib} \
50                                                        $(TARGET_DIR)/usr/lib/gconv/$${lib} \
51                                  || exit 1; \
52                         done; \
53                 done; \
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; \
57         fi
58 endef
59 TOOLCHAIN_TARGET_FINALIZE_HOOKS += TOOLCHAIN_GLIBC_COPY_GCONV_LIBS
60 endif