summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-07 16:47:03 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-07 16:47:03 +0100
commit0d35820cf50d2789752b8776683b26d04642518d (patch)
tree117efcbacc4594dcf6ce0ca22e972f47b730dc8a
parent05d7dcd8be4679e09963d78146625ee4c356a4eb (diff)
Relink different architectures in a nicer and safer way.v2.15.120
-rw-r--r--platform/osx/make_dmg.sh34
1 files changed, 18 insertions, 16 deletions
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh
index 9ba05ac96..d776baa2a 100644
--- a/platform/osx/make_dmg.sh
+++ b/platform/osx/make_dmg.sh
@@ -219,19 +219,19 @@ function relink_relative {
to_relink=`echo $to_relink | sed -e "s/\+//g"`
local linkers=("$@")
- for obj in "${linkers[@]}"; do
- deps=`otool -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"`
- changes=""
- for dep in $deps; do
- base=`basename $dep`
- # $dep will be a path within x86_64; make arm64 path too
- dep_arm64=`echo $dep | sed -e "s/\/x86_64\//\/arm64\//g"`
- changes="$changes -change $dep @executable_path/../Frameworks/$base -change $dep_arm64 @executable_path/../Frameworks/$base"
+ for obj in "${linkers[@]}"; do
+ for arch in x86_64 arm64; do
+ deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"`
+ changes=""
+ for dep in $deps; do
+ base=`basename $dep`
+ changes="$changes -change $dep @executable_path/../Frameworks/$base"
+ done
+ if test "x$changes" != "x"; then
+ install_name_tool $changes -id `basename "$obj"` "$obj"
+ fi
+ done
done
- if test "x$changes" != "x"; then
- install_name_tool $changes -id `basename "$obj"` "$obj"
- fi
- done
}
# param $1 directory things should be relinked into
@@ -243,10 +243,12 @@ function relink_absolute {
local linkers=("$@")
for obj in "${linkers[@]}"; do
- deps=`otool -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"`
- for dep in $deps; do
- base=`basename $dep`
- install_name_tool -change "$dep" "$target"/$base -id `basename "$obj"` "$obj"
+ for arch in x86_64 arm64; do
+ deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"`
+ for dep in $deps; do
+ base=`basename $dep`
+ install_name_tool -change "$dep" "$target"/$base -id `basename "$obj"` "$obj"
+ done
done
done
}