ext-tool.mk 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # copy_toolchain_lib_root
  3. #
  4. # $1: source
  5. # $2: destination
  6. # $3: strip (y|n) default is to strip
  7. #
  8. copy_toolchain_lib_root = \
  9. LIB="$(strip $1)"; \
  10. DST="$(strip $2)"; \
  11. STRIP="$(strip $3)"; \
  12. \
  13. LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \
  14. \
  15. if test -z "$${LIB_DIR}"; then \
  16. echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \
  17. exit -1; \
  18. fi; \
  19. \
  20. LIB="$(strip $1)"; \
  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}; \
  31. case "$${STRIP}" in \
  32. (0 | n | no) \
  33. ;; \
  34. (*) \
  35. $(TARGET_CROSS)strip "$(TARGET_DIR)$${DST}/$${LIB}"; \
  36. ;; \
  37. esac; \
  38. else \
  39. exit -1; \
  40. fi; \
  41. LIB="`readlink $${LIB_DIR}/$${LIB}`"; \
  42. done; \
  43. done; \
  44. \
  45. echo -n
  46. copy_toolchain_sysroot = \
  47. SYSROOT_DIR=`$(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=`; \
  48. if [ -n "$${SYSROOT_DIR}" ]; then cp -a $${SYSROOT_DIR}/* $(STAGING_DIR)/ ; \
  49. find $(STAGING_DIR) -type d | xargs chmod 755; fi
  50. uclibc: dependencies $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C)))
  51. $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))):
  52. #"))
  53. mkdir -p $(TARGET_DIR)/lib
  54. @$(call copy_toolchain_lib_root, $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP))
  55. #")))
  56. for libs in $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIBS))); do \
  57. $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
  58. done
  59. $(call copy_toolchain_sysroot)