+# param $1 directory containg things
+# $2 list of things that link to other things
+function relink_absolute {
+ to_relink=`echo $to_relink | sed -e "s/\+//g"`
+ target=$1
+ shift
+ local linkers=("$@")
+
+ for obj in "${linkers[@]}"; do
+ deps=`otool -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu)"`
+ changes=""
+ for dep in $deps; do
+ base=`basename $dep`
+ changes="$changes -change "$dep" \"$target/$base\""
+ done
+ if test "x$changes" != "x"; then
+ install_name_tool $changes -id "`basename "$obj"`" "$obj"
+ fi
+ done
+}
+
+function sign {
+ codesign --deep --force --verify --verbose --options runtime --sign "Developer ID Application: Carl Hetherington (R82DXSR997)" "$1"
+ if [ "$?" != "0" ]; then
+ echo "Failed to sign $1"
+ exit 1
+ fi
+}
+
+