#!/bin/sh
set -e
[ -n "$DSTROOT" ] || exit 1
[ -n "$DEVELOPER_DIR" ] || exit 1
[ -n "$RPATHVERS" ] || exit 1
for dylib in "$DSTROOT""$RPATHVERS"/*.dylib; do
if [ ! -L "$dylib" ]; then
old_name=`otool -D "$dylib" | sed "1d"`
new_name=`echo "$old_name" | sed "s|$DEVELOPER_DIR|@rpath|"`
install_name_tool -id "$new_name" "$dylib"
for file in "$DSTROOT""$RPATHVERS"/../auto/SVN/*/*.bundle; do
install_name_tool -change "$old_name" "$new_name" "$file"
done
fi
done
for bundle in "$DSTROOT""$RPATHVERS"/../auto/SVN/*/*.bundle; do
install_name_tool -add_rpath @loader_path/../../../../../../.. "$bundle"
install_name_tool -add_rpath @loader_path/../../../../../../../usr "$bundle"
done