[fpc-pascal] Packaging shared libraries for OSX, recommendations?
Jonas Maebe
jonas.maebe at elis.ugent.be
Mon Jun 10 11:55:42 CEST 2013
On 10 Jun 2013, at 11:41, Bruce Tulloch wrote:
> On Mon, Jun 10, 2013 at 6:59 PM, Jonas Maebe <jonas.maebe at elis.ugent.be
> >wrote:
>
>> Under Mac OS X (and *BSD, and probably even most Linux
>> distributions these
>> days), you would put it under /usr/local/[lib,include,share].
>
> Understood. So if we install our library, headers etc to
> /usr/local/[lib,include,share] is it true that like any UN*X, in OSX:
>
> - Command line programs *and* GUI apps will be able to use our
> library,
There is no difference between the two as far as the dynamic linker is
concerned.
> - XCode will be able to find and access the headers and,
Yes.
> - XCode App programmers can copy the .dylib file (from
> /usr/local/lib/libMyLib.dylib) to their project to include the
> library and
> avoid the need to redistribute our package?
The last part is incorrect. See e.g. http://qin.laya.com/tech_coding_help/dylib_linking.html
and https://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac
for more information. You need at least two versions of your
library, or tell developers that want to include the library in their
program to adapt the library's path with install_name_tool and compile/
link against this modified version because otherwise their application
will still insist on only looking for the /usr/local/lib version
(which is why distributing a /usr/local/lib version is such a bad
idea, because developers won't notice on their own machine if they
make a mistake since that version can be used without them realising it)
> Presuming the answers are all yes, is packagemaker the tool we
> should be
> using to package the library for distribution?
Yes.
Jonas
More information about the fpc-pascal
mailing list