Trouble distributing application that links to MacPort libraries

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Mar 30 01:34:49 PDT 2012


On Fri, Mar 30, 2012 at 00:17, Peter Schmitt wrote:
> Hi macports-users!
>
> I installed some ports on a build machine. I then build my application
> and `otool -L myApp.binary` shows dependencies on some MacPorts
> libraries installed at /opt/local/lib. myApp.binary runs fine on this
> build machine.  In order to deploy my application to other machines, I
> copy the corresponding libraries to "myApplication/darwin-libs" and
> write a wrapper script at "myApplication/launchMyApp.sh" which looks
> something like this:
>
>>
>>  #!/bin/env sh
>>  # this is "launchMyApp.sh".
>>  export DYLD_LIBRARY_PATH=/path/to/myApplication/darwin-libs
>>  /path/to/myApplication/myApp.binary.

I think that you should use install_name_tool instead. You can then
copy libraries inside the app and change from absolute paths pointing
to libraries in /opt/local/... to relative paths.

But in any case you need to be aware that unless you took some extra
care, the binaries probably won't work on a mac that is older than
yours.

Mojca


More information about the macports-users mailing list