Date: Wed, 17 Aug 2005 11:23:40 -0400
authorRyan C. Gordon <icculus@icculus.org>
Thu, 18 Aug 2005 06:06:02 +0000
changeset 111865f4b2dd46b7
parent 1117 95b261f445b1
child 1119 430d8d701f69
Date: Wed, 17 Aug 2005 11:23:40 -0400
From: Matt L <prometheus.uw@gmail.com>
To: "Ryan C. Gordon" <icculus@clutteredmind.org>
Subject: SDL Patch

Hio,

I saw your last call on the mailing list. Here's a patch which I
submitted about two weeks ago which hasn't made it in.

In the current sdl.m4, there's a bug where if your configure.ac, you
have AC_LANG(C++) specified, it won't properly compile and link the SDL
test program when you run the configure script. This is because only the
default CFLAGS is overriden in sdl.m4, and in the patch below, I've
fixed it so it overrides CXXFLAGS as well, allowing it to work with g++.
sdl.m4
     1.1 --- a/sdl.m4	Wed Aug 17 00:19:45 2005 +0000
     1.2 +++ b/sdl.m4	Thu Aug 18 06:06:02 2005 +0000
     1.3 @@ -52,8 +52,10 @@
     1.4             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     1.5      if test "x$enable_sdltest" = "xyes" ; then
     1.6        ac_save_CFLAGS="$CFLAGS"
     1.7 +      ac_save_CXXFLAGS="$CXXFLAGS"
     1.8        ac_save_LIBS="$LIBS"
     1.9        CFLAGS="$CFLAGS $SDL_CFLAGS"
    1.10 +      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    1.11        LIBS="$LIBS $SDL_LIBS"
    1.12  dnl
    1.13  dnl Now check if the installed SDL is sufficiently new. (Also sanity
    1.14 @@ -138,6 +140,7 @@
    1.15         else
    1.16            echo "*** Could not run SDL test program, checking why..."
    1.17            CFLAGS="$CFLAGS $SDL_CFLAGS"
    1.18 +          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    1.19            LIBS="$LIBS $SDL_LIBS"
    1.20            AC_TRY_LINK([
    1.21  #include <stdio.h>
    1.22 @@ -162,10 +165,12 @@
    1.23            echo "*** or that you have moved SDL since it was installed. In the latter case, you"
    1.24            echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
    1.25            CFLAGS="$ac_save_CFLAGS"
    1.26 +          CXXFLAGS="$ac_save_CXXFLAGS"
    1.27            LIBS="$ac_save_LIBS"
    1.28         fi
    1.29       fi
    1.30       SDL_CFLAGS=""
    1.31 +     SDL_CXXFLAGS=""
    1.32       SDL_LIBS=""
    1.33       ifelse([$3], , :, [$3])
    1.34    fi