Sdl-config on Windows

In latest stable SDL release for MinGW (
http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz )
sdl-config provides following arguments for linker:
–libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDLmain -lSDL -mwindows
;;
–static-libs)

–libs|–static-libs)

  echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
  ;;

This may be fine for MinGW/cmd, but it’s a pure horror for MinGW/MSys.
Because conftest for sdl is an executable and has to be linked WITH
static libraries (-lmingw32 and -lSDLmain) to satisfy WinMain at 16
dependency, while actual project being built may not be an executable
(for example - sdlvideosink from gst-plugins-bad) and when it is so it
should be built WITHOUT static libraries, else libtool complains that it
can’t link static libraries to a shared library and refuses to link it
together.

P.S. There’s no sdl.pc in that release either. It’s ok for projects that
are aware of sdl-config, but some of them may not be.

This may be fine for MinGW/cmd, but it’s a pure horror for MinGW/MSys.
Because conftest for sdl is an executable and has to be linked WITH
static libraries (-lmingw32 and -lSDLmain) to satisfy WinMain at 16
dependency, while actual project being built may not be an executable
(for example - sdlvideosink from gst-plugins-bad) and when it is so it
should be built WITHOUT static libraries, else libtool complains that it
can’t link static libraries to a shared library and refuses to link it
together.

Yes, sdl-config assumes you’re building an application. I think there was
a proposal for something like --dll-libs which wouldn’t include -lSDLmain,
but I haven’t investigated it fully. Patches are welcome! :slight_smile:

See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC