On Tue, Apr 01, 2014 at 10:01:16AM -0400, Jeffrey Walton wrote: > > However, alternative flags that achieve the same effect are available: > > > > To build a library whose SONAME involves an rpath: > > > > $ cc -shared -Wl,-flat_namespace -Wl,-undefined,dynamic_lookup \ > > -Wl,-install_name,@rpath/libfoo.dylib.1 -o libfoo.dylib.1 > > # cp libfoo.dylib.1 /usr/local/lib > > # ln -s libfoo.dylib.1 /usr/local/lib/libfoo > > > > To build an executable that uses this library: > > > > cc -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lfoo > > I have not had success with the above (-Wl,-rpath,/usr/local/lib) with > shared objects. But I'm pretty sure they all have had the extension > *.so. Does the Apple linker honor it if the extension is *.dylib?
The extension is not the point, to use rpaths the SONAME (install_name when building the shared object) of the target library has to start with @rpath/. The extension of the filename after @rpath/ is not important: @rpath/libfoo.so.1 will work just as well as: @rpath/libfoo.dylib.1 provided the object is installed with the name in question. However, to link with "-lfoo", there should be a symlink: libfoo.dylib -> libfoo.dylib.1 | libfoo.so.1 pointing to whichever form is used for the SONAME. The compiler flags are somewhat release dependent. My tests are with MacOSX 10.9 (Mavericks). Sufficiently older releases will require different flags. -- Viktor. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org