mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
macOS: make openconnect relocatable; drive installation through make install (#668)
Co-authored-by: Kevin Yue <[email protected]>
This commit is contained in:
1 parent
f7649898fd
commit
f9965f8a35
12 files changed
+427
-162
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Resolve the library used by this build, rather than choosing a stale Cargo output.
|
||||
set -eu
|
||||
binary=$1
|
||||
library=$(otool -L "$binary" | awk '/^[[:space:]]+@rpath\/libopenconnect\..*\.dylib / { sub("@rpath/", "", $1); print $1 }')
|
||||
test -n "$library" || { echo "No OpenConnect dependency in $binary" >&2; exit 1; }
|
||||
rpaths=$(otool -l "$binary" | awk '/cmd LC_RPATH/ { rpath=1; next } rpath && $1 == "path" { sub(/^[[:space:]]*path /, ""); sub(/ \(offset [0-9]+\)$/, ""); print; rpath=0 }')
|
||||
while IFS= read -r directory; do
|
||||
case "$directory" in /*) ;; *) continue ;; esac
|
||||
if [ -f "$directory/$library" ]; then
|
||||
printf '%s\n' "$directory/$library"
|
||||
exit 0
|
||||
fi
|
||||
done <<EOF
|
||||
$rpaths
|
||||
EOF
|
||||
echo "Cannot resolve the OpenConnect build library for $binary" >&2
|
||||
exit 1
|
||||
Reference in new issue
Block a user