summaryrefslogtreecommitdiffhomepage
path: root/install-fail-tool
blob: 910d9cc4cfe9051141b56c9fc8d7348bb4583c3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

test -n "$1" || exit 1

dir="$1"

for i in "$dir"/*.dylib; do
	echo ---- $i ----

	install_name_tool -id "@executable_path/$(basename -- "$i")" "$i"

	otool -L "$i" | awk '$1 ~ /\.dylib$/ { print $1 }' |
	while read l; do
		j="$(basename -- "$l")"
		if test -e "$dir/$j"; then
			install_name_tool -change "$l" "@executable_path/$j" "$i"
		fi
	done
done