SDL 2’s installation page contains the following comment on static linking:
However, we encourage you to not do this for various technical and
moral reasons
I totally get why they would mention technical reasons, and the document linked in the same paragraph makes some very good points about the advantages of dynamic linking and a “best of both worlds” approach.
However, how can there be moral reasons to avoid static linking? What?
However, how can there be moral reasons to avoid static linking? What?
You (ethically) should be helpful to your user, and make his life easier. If you link dynamically to some free software libraries (like zlib
), he could upgrade his system and your software on it would profit of the upgraded library immediately.
If you distribute a statically linked executable against an LGPL library and do not provide means to re-link it to some newer (or improved, or modified) version of that library (typically by releasing object files for your application), you probably are violating the LGPL license (and it might happen that some organization -or some competitors- would sue you, see http://gpl-violations.org/ & https://www.gnu.org/licenses/gpl-violation.html ….).
The http://www.fsf.org/about/what-is-free-software page is mostly about ethics
And some customers might actually care about a software using free software and being unfriendly to it. For that precise reason, I avoid buying Nvidia products.
Also, some potential hires might also be turned off by such behavior.
And using often shared libraries (and avoiding static ones) decrease the total disk space required on the user’s computer, and decrease RAM usage (since the code segment of shared libraries used by several processes is mapped only once).
7
I think the author is trying to be a little bit comical, but it seems there is a bit of history behind this, as can be seen in the readme file:
We like the zlib license, but the biggest complaint from the open source community about the license change is the static linking. The LGPL forced this
as a legal, not technical issue, but zlib doesn’t care. Even those that aren’t
concerned about the GNU freedoms found themselves solving the same problems:
swapping in a newer SDL to an older game often times can save the day. Static linking stops this dead.
5