This commit is contained in:
nitowa
2023-08-15 22:28:03 +02:00
commit 1dae68b1c7
5529 changed files with 1659171 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env sh
# from https://github.com/cryptocoinjs/secp256k1-node/blob/25a4b6cb567b49a40f47f50c5ca9a756f5343e4d/utils/has_lib.sh
check () {
regex="lib$1.+(so|dylib)"
# Add /sbin to path as ldconfig is located there on some systems - e.g. Debian
# (and it still can be used by unprivileged users):
PATH="$PATH:/sbin"
export PATH
# Try just checking common library locations
for dir in /lib /usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu; do
if test -d $dir; then
# shellcheck disable=SC2010
ls $dir | grep -E "$regex" && return 0
fi
done
return 1
}
check "$1" > /dev/null
if test "$?" -eq 0; then
echo true
else
echo false
fi