Re: [AD] statically linking small addons

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 10 Aug 2009, at 10:59 , Peter Wang wrote:
Matthew suggested that small addons should be statically linked on
Windows so as to avoid proliferation of DLLs. (I think that's not
necessarily on Linux; don't know about Mac.)

I'm probably the wrong person to give an opinion on this, since I use my Mac as a generic UNIX system. To me, the situation would be the same as on Linux, where I would agree it's not much of an issue. I guess it would depend on what the "preferred" way to link to Allegro on OS X would be. Probably this would involve frameworks or something like that, where I'm not sure how this would be handled.

On the other hand, I seem te recall someone (Peter Hull?) stating that the recommended way to link on OS X would be static linking anyway (so people don't need to install the Allegro framework to run programs using Allegro), or to put the Allegro dylibs inside the application bundle, in which case this is a non-issue.

Indeed it's not very hard to accomodate that in CMake.  However, our
static libraries have the "-static" suffix so users on Windows will need
to write -lallegro-4.9 but -lallegro_color-static-4.9 (or whatever).
Is that okay?

I guess.
The way I would do this would be to allow both static and dynamic linking for small addons, but to change the default to "static". If someone really wants a DLL for a small addon, they can change it to dynamic. I'm not sure how easy *that* is though.

Secondly, ALLEGRO_STATICLINK.  I'm fuzzy on what it does exactly so
would someone explain if there will be any trouble with that?

Do you mean whether there could be issues with addons expecting a statically linked version of Allegro failing to work correctly with a dynamically linked one?

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/