From 19c59f39174284c1097e55cd1f0260cb0c2cbf9b Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 1 Jul 2018 05:02:22 +0200 Subject: [PATCH] Look for library paths in a loop --- doc/scripts/platform.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/scripts/platform.sh b/doc/scripts/platform.sh index 37b88e4..62aa8cf 100755 --- a/doc/scripts/platform.sh +++ b/doc/scripts/platform.sh @@ -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) }