external-toolchain: handle libstdc++/libgcc_s for BR toolchains
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 5 Jul 2010 16:59:02 +0000 (18:59 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 6 Jul 2010 06:00:22 +0000 (08:00 +0200)
Most toolchains have their libraries either in /lib or /usr/lib
relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
have basic libraries in /lib, and libstdc++/libgcc_s in
/usr/<target-name>/lib(64).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
toolchain/external-toolchain/ext-tool.mk

index 39961843e90655e37a6a4b825852f278eeac6821..1c84893f9cf7e89df5862791c8e7787945e09405 100644 (file)
 # directory to the target directory. Also optionaly strips the
 # library.
 #
+# Most toolchains have their libraries either in /lib or /usr/lib
+# relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
+# have basic libraries in /lib, and libstdc++/libgcc_s in
+# /usr/<target-name>/lib(64).
+#
 # $1: arch specific sysroot directory
 # $2: library name
 # $3: destination directory
@@ -52,7 +57,11 @@ copy_toolchain_lib_root = \
        LIB="$(strip $2)"; \
        STRIP="$(strip $4)"; \
  \
-       LIBS=`(cd $${ARCH_SYSROOT_DIR}; find . -path "./lib/$${LIB}.*" -o -path "./usr/lib/$${LIB}.*")` ; \
+       LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
+               find -L . -path "./lib/$${LIB}.*"     -o \
+                         -path "./usr/lib/$${LIB}.*" -o \
+                         -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
+               )` ; \
        for FILE in $${LIBS} ; do \
                LIB=`basename $${FILE}`; \
                LIBDIR=`dirname $${FILE}` ; \