Look for library paths in a loop

This commit is contained in:
Pierre Pronchery 2018-07-01 05:02:22 +02:00
parent d0f989bafe
commit 19c59f3917

View File

@ -39,12 +39,14 @@ _platform_library()
{
library="$1"
libdir=$(_platform_variable "LIBDIR")
path="/lib:/usr/lib:$libdir"
if [ -f "$DESTDIR/lib/lib$library$SOEXT" \
-o -f "$DESTDIR/usr/lib/lib$library$SOEXT" \
-o -f "$DESTDIR$libdir/lib$library$SOEXT" ]; then
echo "-l$library"
fi
(IFS=:; for p in $path; do
if [ -f "$DESTDIR$p/lib$library$SOEXT" ]; then
echo "-l$library"
return
fi
done)
}