How do i make library dependencies local?
Up to Table of ContentsThis FAQ applies to: Any version.
I want to ship dependencies side-by-side with my external and not have to install in the "correct" path (e.g. /sw/lib/)
OSX
on OSX you can change the path where a library is searched for with the install_name_tool
using the special path @loader_path, the path where the external lives will be searched
here's a small script to make all /sw/lib/ dependencies "local":
for f in *.pd_darwin
do
otool -L ${f} | grep sw | awk '{print $1}' | while read i
do j=@loader_path/${i##*/}
echo $f $i $j
install_name_tool -change ${i} ${j} ${f}
done
done
Here is the script that is used in the readanysf~ library for including lots of libraries using the above technique: embed-MacOSX-dependencies.sh
see also:
-
How do i find out the dylib dependencies of a binary?
- How do i find out, against which dynamic libraries a certain binary (e.g. the Gem-binary) is linked?