The static library discussion

Marin Saric marin.saric at
Thu Dec 22 20:03:22 PST 2011

This was super informative and I definitely enjoyed reading the
responses. Lots of substantiated technical arguments and interesting
use cases -- I like it.

Jeremy, I think you and I are in general agreement, and we even agree
on most of the particulars.

I'll try to summarize the "3000 ft view" [*] conclusions from our exchange:

1) Dynamic libraries are a very good thing - they are in widespread
use for a good reason.
2) MacPorts targets should be built to work with dynamic libraries
whenever they support it
3) The dynamic library version should be the default.
3) The arrangement in (2 and 3) eases all sorts of maintenance issues
for MacPorts, see (1)
4) In some (definitely much smaller) set of cases, static libraries
can be useful as well, mostly to developers.
5) MacPorts targets can additionally also provide a static version
through a variant, so that it can be stripped out at will by the end
6) If at all possible, the target with the static variant enabled
should deploy the static targets in addition to the dynamic targets
provided by default, instead of forcing the user as to which one to

I think we agree that having (2,3,6) takes care of maintainability
issues while still providing the functionality for those who have, as
you nicely put it, "grown dependent" on using static libraries in some

So assuming the above sounds like a more-less accurate summary, I'll
go ahead and add the static build of x264 as a variant, so that it can
be stripped out at will.

I've already the approach you suggested with my recently submitted
revision of the OpenCV port (ticket #32528)


[*] apologies if my American idioms are not up-to-date :-)

More information about the macports-dev mailing list