Skip to content
This repository
tree: e21bd2a32e
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 15 lines (15 sloc) 0.732 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
for lib in "$1"/*.dylib; do
echo "Processing $lib"
install_path="$(otool -D "$lib"|tail -n1)"
new_install_path="${install_path/executable_path/loader_path}"
if [[ "${install_path}" == "${new_install_path}" ]]; then
echo "- Install path already uses @loader_path"
else
echo "- Changing install path from $install_path to ${new_install_path}"
fi
install_name_tool -id "${new_install_path}" "$lib"
otool -L "$lib"|egrep --only-matching '^ @executable_path.+\.dylib'|while read dependancy_path; do
echo "- Switching dependancy path ${dependancy_path} to @loader_path${dependancy_path#@executable_path}"
install_name_tool -change "${dependancy_path}" "@loader_path${dependancy_path#@executable_path}" "$lib"
done
done
Something went wrong with that request. Please try again.