The install names don't contain the path to the libraries. An application linking to the libraries cannot be started without tricks like DYLD_LIBRARY_PATH. Fixup the boost libraries after installation with a script like this:
set -e
for filename in *.dylib; do
# Change id name of shared each library. It must be the absolute
# pathname of the library.
# The id name of a shared library is also called its install name.
install_name_tool -id $(realpath $filename) $filename
# Change install names of all local libraries that are *referenced*
# by each library.
install_names=`
otool -L $filename | # List install names.
sed '1,2d' | # Skip the name of ourselves.
sed 's/^\s//' | # Get rid of leading whitespace.
sed 's/\s.*$//' # Get rid of trailing whitespace.
`
library_directory=$(dirname $(realpath $filename))
for install_name in $install_names; do
# If this is one of the neighboring shared libraries, then replace
# its install name by the absolute pathname.
install_name_directory=$(dirname $(realpath $install_name))
if [[ $install_name_directory == $library_directory ]]; then
install_name_tool -change $install_name $(realpath $install_name) $filename
fi
done
done
The install names don't contain the path to the libraries. An application linking to the libraries cannot be started without tricks like DYLD_LIBRARY_PATH. Fixup the boost libraries after installation with a script like this: