scripts: normalize.sh: Rework out-dated dep replacement

No functional changes.

Change-Id: I58f7113cfd199d2e884d3d5c78b9842e2f4202cf
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen 2023-02-14 10:38:20 +08:00
parent 309268f7a3
commit fd04d272df

View file

@ -7,9 +7,9 @@ for lib in $LIBS; do
DEPS=$(readelf -d $lib)
# Hack out-dated deps
for dep in libffi.so.6 libcrypto.so.1.0.0; do
echo $DEPS | grep -wq $dep &&
patchelf $lib --replace-needed $dep ${dep%.so*}.so
for dep in libffi.so libcrypto.so; do
DEP=$(echo $DEPS | grep -oE "$dep.[0-9]*")
[ -z "$DEP" ] || patchelf $lib --replace-needed $DEP $dep
done
# Set a common soname