mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] SDL_mixer in mingw-cross-env crashing


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] SDL_mixer in mingw-cross-env crashing
Date: Sat, 6 Mar 2010 14:24:54 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

David Bruce <address@hidden> schrieb:
> 3. pkgconfig can't seem to find SDL_net, which is used by tuxmath but
> not (yet) by tuxtype. I added SDL_net to the code you kindly provided:
> 
> AS_IF([test "x$native_win32" = xyes],
> dnl What we do for mingw crossbuild:
> [
>       # Check for SDL, SDL_image, SDL_mixer, SDL_net, and SDL_Pango
>       [echo "Mingw crossbuild detected - using pkgconfig to check for SDL 
> libs:"],
>       PKG_CHECK_MODULES([SDL], [sdl >= 1.2.0 SDL_image SDL_mixer SDL_net 
> SDL_Pango])
>       CFLAGS="$CFLAGS $SDL_CFLAGS"
>       LIBS="$LIBS $SDL_LIBS"
> ],

SDL_net doesn't provide a *.pc script, so you'll have to check for
it via AC_CHECK_LIB. Then, you'll only have to add "-lws2_32", for
which you could check via AC_CHECK_LIB(ws2_32) before SDL_net.

Alternatively, you could add "-lws2_32" unconditionally to LIBS
since it should exist on any MinGW system as part of the w32api.
But AC_CHECK_LIB(ws2_32) is more clean, I think.

I added a test script to mingw-cross-env to ensure that
"-lSDL_net -lws2_32" will indeed always be sufficient for
a working SDL_net:
http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/5bf28532f533


BTW, I strongly recommend against conditional build snippets like that:

    test "x$native_win32" = xyes

because these should not be necessary. The only real difference to
win32 is the AC_CHECK_LIB(ws2_32), which should also work on Unix
systems if you don't cancel when the check fails. And another
difference is using PKG_CONFIG for SDL_mixer and SDL_image, for
which I already donated a portable code snippet in an earlier mail.

In case my suggestions were confusing, I could also create a working
patch for your configure.ac, if you like, to make things clear.


Greets,

    Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]