toolchain: speed up sysroot lib copying

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.

Some simplification suggested by Yann E. MORIN
<yann.morin.1998@anciens.enib.fr> and Arnout Vandecappelle
<arnout@mind.be>, added by Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Mike Frysinger 2011-10-09 19:44:32 +02:00 committed by Peter Korsgaard
parent 2e57043b4d
commit da6353c9e7

View file

@ -22,9 +22,8 @@ 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 lib* usr/lib* usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib* \
-maxdepth 1 -name "$${LIB}.*" 2>/dev/null \
)` ; \
for FILE in $${LIBS} ; do \
LIB=`basename $${FILE}`; \