Re: Another problem with library paths

Florian Höch <[email protected]> Wed, 30 Sep 2015 20:02:52 +0200
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <[email protected]>
Hi,

Am 30.09.2015 um 18:16 schrieb Ilja Honkonen:
> I stumbled upon more path errors when trying to install PCRE following 
> http://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html. 
> Attached pcre.xml gives this when I try to run pcregrep:
> 
> dyld: Library not loaded: 
> /private/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-wSab_U/pcre-any-any/lib/libpcre.1.dylib
>    Referenced from: 
> /Users/iljah/.local/share/0install.net/site-packages/file/Users__iljah__0inst-test__lfs__pcre__pcre.xml/8.37-x86_64/bin/pcregrep
>    Reason: image not found

not sure, but this sounds like a job for install_name_tool to adjust the
loader_path of the dylib. Off the top of my head (this most certainly
isn't completely correct, but should give a rough idea):

install_name_tool -id @loader_path/lib/libpcre.1.dylib
/path/to/pcre-any-any/lib/libpcre.1.dylib

The equivalent needs to be done for each binary actually loading the dylib:

install_name_tool -change libpcre.1.dylib
@loader_path/lib/libpcre.1.dylib /path/to/binary_or_so


Maybe something like the above can also be accomplished by otool during
the build, but I haven't looked into it.

-- 
Florian Höch
GPG: 770C 1FC4 9A8C 33E7 5794  A9DF 8EA3 1827 1BFD 1EBE


------------------------------------------------------------------------------