2 # copy_toolchain_lib_root
6 # $3: strip (y|n) default is to strip
8 copy_toolchain_lib_root
= \
11 STRIP
="$(strip $3)"; \
13 LIB_DIR
=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \
15 if
test -z
"$${LIB_DIR}"; then \
16 echo
"copy_toolchain_lib_root: lib=$${LIB} not found"; \
21 for FILE in
`find $${LIB_DIR} -maxdepth 1 -type l -name "$${LIB}*"`; do \
22 LIB
=`basename $${FILE}`; \
23 while
test \
! -z
"$${LIB}"; do \
24 echo
"copy_toolchain_lib_root lib=$${LIB} dst=$${DST}"; \
25 rm -fr
$(TARGET_DIR
)$${DST}/$${LIB}; \
26 mkdir
-p
$(TARGET_DIR
)$${DST}; \
27 if
test -h
$${LIB_DIR}/$${LIB}; then \
28 cp
-d
$${LIB_DIR}/$${LIB} $(TARGET_DIR
)$${DST}/; \
29 elif
test -f
$${LIB_DIR}/$${LIB}; then \
30 $(INSTALL
) -D
-m0755
$${LIB_DIR}/$${LIB} $(TARGET_DIR
)$${DST}/$${LIB}; \
35 $(TARGET_CROSS
)strip "$(TARGET_DIR)$${DST}/$${LIB}"; \
41 LIB
="`readlink $${LIB_DIR}/$${LIB}`"; \
47 copy_toolchain_sysroot
= \
48 SYSROOT_DIR
=`$(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=`; \
49 if
[ -n
"$${SYSROOT_DIR}" ]; then cp
-a
$${SYSROOT_DIR}/* $(STAGING_DIR
)/ ; \
50 find
$(STAGING_DIR
) -type d | xargs chmod
755; fi
52 uclibc
: dependencies
$(TARGET_DIR
)/lib
/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C)))
54 $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C
))):
56 mkdir
-p
$(TARGET_DIR
)/lib
57 @
$(call copy_toolchain_lib_root
, $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP))
59 for libs in
$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIBS))); do \
60 $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
62 $(call copy_toolchain_sysroot)