Martin Storsjö <[email protected]> writes: > On Wed, 28 Mar 2012, Måns Rullgård wrote: > >> Martin Storsjö <[email protected]> writes: >> >>> SDL 1.3 (which is the current version available e.g. in >>> macports) doesn't contain SDL_Linked_Version. >>> >>> The current check for SDL_Linked_Version (available since SDL >>> 1.2.13) was added 8f1b06c8, because including the headers for >>> SDL_Init redirects the main function, requiring linking the >>> SDLmain library for linking to work. When using the normal >>> function checks in configure, we don't link to any extra >>> libraries. >>> --- >>> configure | 3 ++- >>> 1 files changed, 2 insertions(+), 1 deletions(-) >>> >>> diff --git a/configure b/configure >>> index 7418bca..3e24f00 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -2983,7 +2983,8 @@ if enabled libdc1394; then >>> die "ERROR: No version of libdc1394 found " >>> fi >>> >>> -if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then >>> +if check_pkg_config sdl SDL_version.h SDL_Linked_Version || >>> + check_pkg_config sdl SDL.h SDL_Init; then >> >> If checking for SDL_Init works at all, then there should be no need to >> check for SDL_Linked_Version. > > It doesn't, on the platforms where SDL redirects the main > function. Thankfully, the new ones that lack SDL_Linked_Version don't > do any such redirection afaik. > > That is - the headers that define SDL_Init also redefine main, to > redirect initialization via their main wrapper. If this header is > included, one has to link with the SDLmain library, otherwise one ends > up with undefined references to main.
Why does so much as thinking about SDL make me angry? > We could either link to this library while checking for SDL_Init - Wouldn't that break on systems that don't have the wrapper? -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
