[Buildroot] [PATCH 9/9] toolchain: speed up sysroot lib copying

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sun Oct 2 19:20:17 UTC 2011


From: Mike Frysinger <vapier at gentoo.org>

The copy_toolchain_lib_root helper searches the entire sysroot, but is
only interested in files in certain subdirs.  So rather than waste time
in walking the entire tree, walk the few subdirs at the depth level we
are actually going to be poaching files from.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 toolchain/helpers.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 7f3efaa..1a72ae5 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -22,9 +22,9 @@ copy_toolchain_lib_root = \
 	DESTDIR="$(strip $3)" ; \
  \
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
-			  -path "./usr/lib/$${LIB}.*" -o \
-			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
+		find -L \
+			$(for d in lib* usr/lib* usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*; do test -e "$d" && echo $d) \
+			-maxdepth 1 -name "$${LIB}.*" \
 		)` ; \
 	for FILE in $${LIBS} ; do \
 		LIB=`basename $${FILE}`; \
-- 
1.7.4.1



More information about the buildroot mailing list