Support the "include" directive in ld.so.conf

This commit is contained in:
Pierre Pronchery 2018-07-08 11:51:20 +02:00
parent 89b2c1f565
commit 0e114f8885

View File

@ -43,10 +43,11 @@ _platform_library()
path="/lib:/usr/lib:$libdir"
if [ -f "$DESTDIR$LDSOCONF" ]; then
while read line; do
paths=$(_library_ldsoconf "$DESTDIR$LDSOCONF")
#XXX breaks on whitespace
[ -n "${line%#*}" ] && path="$path:$line"
done < "$DESTDIR$LDSOCONF"
for p in $paths; do
path="$path:$p"
done
fi
(IFS=:; for p in $path; do
if [ -f "$DESTDIR$p/lib$library$SOEXT" ]; then
@ -56,6 +57,26 @@ _platform_library()
done)
}
_library_ldsoconf()
{
ldsoconf="$1"
while read line; do
case "$line" in
"#"*)
;;
"include "*)
filename="${ldsoconf%/*}/${line#include }"
[ -f "$filename" ] &&
_library_ldsoconf "$filename"
;;
*)
echo "$line"
;;
esac
done < "$ldsoconf"
}
#platform_variable
_platform_variable()