SDL, GCC and static linking

Hello,

I’m using SDL with gcc on linux and windows (cygwin).

I was searching for a possibility, to create one executable, that
does not need any additional libraries/dlls, i.e. to have one static
executable that includes my code, all needed dll libs (e.g. on windows)
and if possible also all needed gl libs.

I did not find any information on how to do that on the sdl hopepage,
maybe I have overlooked something?

Can you point me so such information?

Thanks a lot in advance and best regards

(Denis)-----

Btw. do you know, how to do the same thing for the cygwin dll on windows?

Denis wrote:

I’m using SDL with gcc on linux and windows (cygwin).
I was searching for a possibility, to create one executable, that
does not need any additional libraries/dlls, i.e. to have one
static executable that includes my code, all needed dll libs
(e.g. on windows) and if possible also all needed gl libs.
I did not find any information on how to do that on the sdl hopepage,
maybe I have overlooked something?

There are several reasons you will not find much information on this
subject. Mostly, because the gains from creating such a unified executable
are always outweighed by the pains you have to go through to do it. The
other reasons include, without limitation, (a) this is frowned upon; (b)
arguably legal on Windows (though with gcc it is easier); © no Cygwin
SDL build has ever shipped, including with Cygwin itself (Cygwin ships a
MinGW SDL dll).

The legal side of this is the clause 6 of LGPL license covering SDL code.
This clause, while allowing static linking, also requires that you provide
means to a user to relink your app with, for example, a newer version of the
library. In practice, this usually means shipping both statically linked and
dynamically linked versions. This aspect has been discussed many times on
this list. Please see archives at http://www.devolution.com/pipermail/sdl/.

-Alex.