CFLAGS are separate from EXTRA_CFLAGS
authorSam Lantinga <slouken@libsdl.org>
Tue, 14 Mar 2006 02:46:26 +0000
changeset 15219b9212e4810c
parent 1520 5d264facfd03
child 1522 1078552c83a0
CFLAGS are separate from EXTRA_CFLAGS
Fixed iconv.h detection on Cygwin32
Makefile.in
build-scripts/makedep.sh
configure.in
     1.1 --- a/Makefile.in	Mon Mar 13 18:01:34 2006 +0000
     1.2 +++ b/Makefile.in	Tue Mar 14 02:46:26 2006 +0000
     1.3 @@ -21,7 +21,9 @@
     1.4  CC      = @CC@
     1.5  INCLUDE = @INCLUDE@
     1.6  CFLAGS  = @BUILD_CFLAGS@
     1.7 +EXTRA_CFLAGS = @EXTRA_CFLAGS@
     1.8  LDFLAGS = @BUILD_LDFLAGS@
     1.9 +EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
    1.10  LIBTOOL = @LIBTOOL@
    1.11  INSTALL = @INSTALL@
    1.12  NASM	= @NASM@ @NASMFLAGS@
    1.13 @@ -65,7 +67,7 @@
    1.14  include $(depend)
    1.15  
    1.16  $(objects)/$(TARGET): $(OBJECTS)
    1.17 -	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)
    1.18 +	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
    1.19  
    1.20  $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
    1.21  	$(AR) cru $@ $(SDLMAIN_OBJECTS)
     2.1 --- a/build-scripts/makedep.sh	Mon Mar 13 18:01:34 2006 +0000
     2.2 +++ b/build-scripts/makedep.sh	Tue Mar 14 02:46:26 2006 +0000
     2.3 @@ -47,19 +47,19 @@
     2.4      case $ext in
     2.5          c) cat >>${output}.new <<__EOF__
     2.6  
     2.7 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src  -o \$@
     2.8 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src  -o \$@
     2.9  
    2.10  __EOF__
    2.11          ;;
    2.12          cc) cat >>${output}.new <<__EOF__
    2.13  
    2.14 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src  -o \$@
    2.15 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src  -o \$@
    2.16  
    2.17  __EOF__
    2.18          ;;
    2.19          m) cat >>${output}.new <<__EOF__
    2.20  
    2.21 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src  -o \$@
    2.22 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src  -o \$@
    2.23  
    2.24  __EOF__
    2.25          ;;
    2.26 @@ -71,7 +71,7 @@
    2.27          ;;
    2.28          S) cat >>${output}.new <<__EOF__
    2.29  
    2.30 -	\$(LIBTOOL)  --mode=compile \$(CC) -c $src  -o \$@
    2.31 +	\$(LIBTOOL)  --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src  -o \$@
    2.32  
    2.33  __EOF__
    2.34          ;;
     3.1 --- a/configure.in	Mon Mar 13 18:01:34 2006 +0000
     3.2 +++ b/configure.in	Tue Mar 14 02:46:26 2006 +0000
     3.3 @@ -57,20 +57,23 @@
     3.4  case "$target" in
     3.5      *-*-cygwin*)
     3.6          # We build SDL on cygwin without the UNIX emulation layer
     3.7 -        CFLAGS="$CFLAGS -I/usr/include/mingw -mno-cygwin"
     3.8 -        BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
     3.9 -        BUILD_LDFLAGS="$LDFLAGS -mno-cygwin"
    3.10 -        SDL_CFLAGS="-I/usr/include/mingw -mno-cygwin"
    3.11 -        SDL_LIBS="-lSDL -mno-cygwin"
    3.12 +        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
    3.13 +        BASE_LDFLAGS="-mno-cygwin"
    3.14          ;;
    3.15      *)
    3.16 -        CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
    3.17 -        BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
    3.18 -        BUILD_LDFLAGS="$LDFLAGS"
    3.19 -        SDL_CFLAGS=""
    3.20 -        SDL_LIBS="-lSDL"
    3.21 +        BASE_CFLAGS="-D_GNU_SOURCE=1"
    3.22 +        BASE_LDFLAGS=""
    3.23          ;;
    3.24  esac
    3.25 +BUILD_CFLAGS="$CFLAGS"
    3.26 +EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
    3.27 +BUILD_LDFLAGS="$LDFLAGS"
    3.28 +EXTRA_LDFLAGS="$BASE_LDFLAGS"
    3.29 +SDL_CFLAGS="$BASE_CFLAGS"
    3.30 +SDL_LIBS="-lSDL $BASE_LDFLAGS"
    3.31 +CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
    3.32 +CFLAGS="$CFLAGS $EXTRA_CFLAGS"
    3.33 +LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
    3.34  
    3.35  dnl Check for tools
    3.36  AC_LIBTOOL_WIN32_DLL
    3.37 @@ -118,7 +121,7 @@
    3.38      fi
    3.39      AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
    3.40  
    3.41 -    AC_CHECK_LIB(m, pow, [BUILD_LDFLAGS="$BUILD_LDFLAGS -lm"])
    3.42 +    AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
    3.43  fi
    3.44  
    3.45  if test x$have_inttypes != xyes; then
    3.46 @@ -284,7 +287,7 @@
    3.47              # OpenBSD needs linking with ossaudio emulation library
    3.48              case "$target" in
    3.49                  *-*-openbsd*|*-*-netbsd*)
    3.50 -                    BUILD_LDFLAGS="$BUILD_LDFLAGS -lossaudio";;
    3.51 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
    3.52              esac
    3.53          fi
    3.54      fi
    3.55 @@ -321,7 +324,7 @@
    3.56  
    3.57              AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
    3.58              SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
    3.59 -            BUILD_CFLAGS="$BUILD_CFLAGS $ALSA_CFLAGS"
    3.60 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
    3.61              if test x$have_loadso != xyes && \
    3.62                 test x$enable_alsa_shared = xyes; then
    3.63                  AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
    3.64 @@ -330,7 +333,7 @@
    3.65                 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
    3.66                  AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
    3.67              else
    3.68 -                BUILD_LDFLAGS="$BUILD_LDFLAGS $ALSA_LIBS"
    3.69 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
    3.70              fi
    3.71              have_audio=yes
    3.72          fi
    3.73 @@ -355,7 +358,7 @@
    3.74          if test x$have_dmedia = xyes; then
    3.75              AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
    3.76              SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
    3.77 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -laudio"
    3.78 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
    3.79              have_audio=yes
    3.80          fi
    3.81      fi
    3.82 @@ -392,8 +395,8 @@
    3.83          if test x$have_mme = xyes; then
    3.84              AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
    3.85              SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
    3.86 -            BUILD_CFLAGS="$BUILD_CFLAGS $MME_CFLAGS"
    3.87 -            BUILD_LDFLAGS="$BUILD_LDFLAGS $MME_LIBS"
    3.88 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
    3.89 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
    3.90              have_audio=yes
    3.91          fi
    3.92      fi
    3.93 @@ -417,7 +420,7 @@
    3.94  
    3.95              AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
    3.96              SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
    3.97 -            BUILD_CFLAGS="$BUILD_CFLAGS $ESD_CFLAGS"
    3.98 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
    3.99              if test x$have_loadso != xyes && \
   3.100                 test x$enable_esd_shared = xyes; then
   3.101                  AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
   3.102 @@ -426,7 +429,7 @@
   3.103                 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   3.104                  AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
   3.105              else
   3.106 -                BUILD_LDFLAGS="$BUILD_LDFLAGS $ESD_LIBS"
   3.107 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
   3.108              fi
   3.109              have_audio=yes
   3.110          fi
   3.111 @@ -469,7 +472,7 @@
   3.112  
   3.113                  AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
   3.114                  SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
   3.115 -                BUILD_CFLAGS="$BUILD_CFLAGS $ARTS_CFLAGS"
   3.116 +                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
   3.117                  if test x$have_loadso != xyes && \
   3.118                     test x$enable_arts_shared = xyes; then
   3.119                      AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
   3.120 @@ -478,7 +481,7 @@
   3.121                     test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   3.122                      AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
   3.123                  else
   3.124 -                    BUILD_LDFLAGS="$BUILD_LDFLAGS $ARTS_LIBS"
   3.125 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
   3.126                  fi
   3.127                  have_audio=yes
   3.128              fi
   3.129 @@ -511,8 +514,8 @@
   3.130          if test x$have_nas = xyes; then
   3.131              AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
   3.132              SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
   3.133 -            BUILD_CFLAGS="$BUILD_CFLAGS $NAS_CFLAGS"
   3.134 -            BUILD_LDFLAGS="$BUILD_LDFLAGS $NAS_LIBS"
   3.135 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
   3.136 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
   3.137              have_audio=yes
   3.138          fi
   3.139      fi
   3.140 @@ -588,9 +591,9 @@
   3.141              case "$target" in
   3.142                  # this line is needed for QNX, because it's not defined the __ELF__
   3.143                  *-*-qnx*)
   3.144 -                     BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";;
   3.145 +                     EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
   3.146                  *-*-solaris*)
   3.147 -                     BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";;
   3.148 +                     EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
   3.149              esac
   3.150          fi
   3.151      fi
   3.152 @@ -669,7 +672,7 @@
   3.153              if test x$have_altivec_h_hdr = xyes; then
   3.154                AC_DEFINE(HAVE_ALTIVEC_H)
   3.155              fi
   3.156 -            BUILD_CFLAGS="$BUILD_CFLAGS $altivec_CFLAGS"
   3.157 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   3.158          fi
   3.159      fi
   3.160  }
   3.161 @@ -682,7 +685,7 @@
   3.162          , enable_ipod=yes)
   3.163  
   3.164      if test x$enable_ipod = xyes; then
   3.165 -        BUILD_CFLAGS="$BUILD_CFLAGS -DIPOD"
   3.166 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
   3.167          AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
   3.168          SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
   3.169      fi
   3.170 @@ -700,26 +703,26 @@
   3.171              AC_HELP_STRING([--enable-nanox-debug], [print debug messages [default=no]]),
   3.172              , enable_nanox_debug=no)
   3.173          if test x$enable_nanox_debug = xyes; then
   3.174 -            BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DEBUG"
   3.175 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
   3.176          fi
   3.177  
   3.178          AC_ARG_ENABLE(nanox-share-memory,  
   3.179              AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [default=no]]),
   3.180              , enable_nanox_share_memory=no)
   3.181          if test x$enable_nanox_share_memory = xyes; then
   3.182 -            BUILD_CFLAGS="$BUILD_CFLAGS -DNANOX_SHARE_MEMORY"
   3.183 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
   3.184          fi
   3.185  
   3.186          AC_ARG_ENABLE(nanox_direct_fb, 
   3.187              AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [default=no]]),
   3.188              , enable_nanox_direct_fb=no)
   3.189          if test x$enable_nanox_direct_fb = xyes; then
   3.190 -            BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DIRECT_FB"
   3.191 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
   3.192          fi
   3.193  
   3.194          AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
   3.195          SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
   3.196 -        BUILD_LDFLAGS="$BUILD_LDFLAGS -lnano-X"
   3.197 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
   3.198          have_video=yes
   3.199      fi
   3.200  }
   3.201 @@ -767,7 +770,7 @@
   3.202  
   3.203              AC_DEFINE(SDL_VIDEO_DRIVER_X11)
   3.204              SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
   3.205 -            BUILD_CFLAGS="$BUILD_CFLAGS $X_CFLAGS"
   3.206 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
   3.207              if test x$have_loadso != xyes && \
   3.208                 test x$enable_x11_shared = xyes; then
   3.209                  AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
   3.210 @@ -779,7 +782,7 @@
   3.211                  AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
   3.212                  AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
   3.213              else
   3.214 -                BUILD_LDFLAGS="$BUILD_LDFLAGS $X_LIBS -lX11 -lXext"
   3.215 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
   3.216              fi
   3.217              have_video=yes
   3.218  
   3.219 @@ -857,7 +860,7 @@
   3.220          if test x$video_photon = xyes; then
   3.221              AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
   3.222              SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
   3.223 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lph"
   3.224 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
   3.225              have_video=yes
   3.226  
   3.227              CheckOpenGLQNX
   3.228 @@ -986,8 +989,8 @@
   3.229          if test x$video_directfb = xyes; then
   3.230              AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
   3.231              SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
   3.232 -            BUILD_CFLAGS="$BUILD_CFLAGS $DIRECTFB_CFLAGS"
   3.233 -            BUILD_LDFLAGS="$BUILD_LDFLAGS $DIRECTFB_LIBS"
   3.234 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
   3.235 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
   3.236              have_video=yes
   3.237          fi
   3.238      fi
   3.239 @@ -1038,7 +1041,7 @@
   3.240          if test x$video_ggi = xyes; then
   3.241              AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
   3.242              SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
   3.243 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lggi -lgii -lgg"
   3.244 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
   3.245              have_video=yes
   3.246          fi
   3.247      fi
   3.248 @@ -1068,7 +1071,7 @@
   3.249          if test x$video_svga = xyes; then
   3.250              AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
   3.251              SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
   3.252 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lvga"
   3.253 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
   3.254              have_video=yes
   3.255          fi
   3.256      fi
   3.257 @@ -1098,7 +1101,7 @@
   3.258          if test x$video_vgl = xyes; then
   3.259              AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
   3.260              SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
   3.261 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lvgl"
   3.262 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
   3.263              have_video=yes
   3.264          fi
   3.265      fi
   3.266 @@ -1149,7 +1152,7 @@
   3.267          if test x$video_aalib = xyes; then
   3.268              AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
   3.269              SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
   3.270 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -laa"
   3.271 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
   3.272              have_video=yes
   3.273          fi
   3.274      fi
   3.275 @@ -1180,7 +1183,7 @@
   3.276              AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
   3.277              SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
   3.278              SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
   3.279 -            BUILD_CFLAGS="$BUILD_CFLAGS $QTOPIA_FLAGS"
   3.280 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
   3.281              SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
   3.282              SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
   3.283              have_video=yes
   3.284 @@ -1250,7 +1253,7 @@
   3.285              video_gem=yes
   3.286              AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
   3.287              SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
   3.288 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lgem"
   3.289 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgem"
   3.290              have_video=yes
   3.291          fi
   3.292      fi
   3.293 @@ -1310,7 +1313,7 @@
   3.294          AC_MSG_RESULT($video_opengl)
   3.295          if test x$video_opengl = xyes; then
   3.296              AC_DEFINE(SDL_VIDEO_OPENGL)
   3.297 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lGL"
   3.298 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
   3.299          fi
   3.300      fi
   3.301  }
   3.302 @@ -1329,7 +1332,7 @@
   3.303  {
   3.304      if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   3.305          AC_DEFINE(SDL_VIDEO_OPENGL)
   3.306 -        BUILD_LDFLAGS="$BUILD_LDFLAGS -lGL"
   3.307 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
   3.308      fi
   3.309  }
   3.310  
   3.311 @@ -1340,9 +1343,9 @@
   3.312          AC_DEFINE(SDL_VIDEO_OPENGL)
   3.313          case "$target" in
   3.314              *-*-darwin*)
   3.315 -                BUILD_LDFLAGS="$BUILD_LDFLAGS -framework OpenGL"
   3.316 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework OpenGL"
   3.317                  # The following is probably not available in Darwin:
   3.318 -                BUILD_LDFLAGS="$BUILD_LDFLAGS -framework AGL"
   3.319 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AGL"
   3.320          esac
   3.321      fi
   3.322  }
   3.323 @@ -1368,8 +1371,8 @@
   3.324          fi
   3.325          AC_DEFINE(SDL_VIDEO_OPENGL)
   3.326          AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
   3.327 -        BUILD_CFLAGS="$BUILD_CFLAGS $OSMESA_CFLAGS"
   3.328 -        BUILD_LDFLAGS="$BUILD_LDFLAGS $OSMESA_LIBS"
   3.329 +        EXTRA_CFLAGS="$EXTRA_CFLAGS $OSMESA_CFLAGS"
   3.330 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $OSMESA_LIBS"
   3.331  
   3.332          AC_ARG_ENABLE(osmesa-shared,
   3.333  AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [default=yes]]),
   3.334 @@ -1427,7 +1430,7 @@
   3.335          AC_MSG_RESULT($enable_input_tslib)
   3.336          if test x$enable_input_tslib = xyes; then
   3.337              AC_DEFINE(SDL_INPUT_TSLIB)
   3.338 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lts"
   3.339 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
   3.340          fi
   3.341      fi
   3.342  }
   3.343 @@ -1556,8 +1559,8 @@
   3.344          # Do futher testing if we have pthread support...
   3.345          if test x$use_pthreads = xyes; then
   3.346              AC_DEFINE(SDL_THREAD_PTHREAD)
   3.347 -            BUILD_CFLAGS="$BUILD_CFLAGS $pthread_cflags"
   3.348 -            BUILD_LDFLAGS="$BUILD_LDFLAGS $pthread_lib"
   3.349 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
   3.350 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
   3.351              SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
   3.352              SDL_LIBS="$SDL_LIBS $pthread_lib"
   3.353  
   3.354 @@ -1659,7 +1662,7 @@
   3.355  AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [default=yes]]),
   3.356                    , enable_stdio_redirect=yes)
   3.357      if test x$enable_stdio_redirect != xyes; then
   3.358 -        BUILD_CFLAGS="$BUILD_CFLAGS -DNO_STDIO_REDIRECT"
   3.359 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
   3.360      fi
   3.361  
   3.362      if test x$enable_video = xyes; then
   3.363 @@ -1710,9 +1713,9 @@
   3.364          AC_MSG_RESULT($have_dlopen)
   3.365  
   3.366          if test x$have_dlopen = xyes; then
   3.367 -            AC_CHECK_LIB(c, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS",
   3.368 -               AC_CHECK_LIB(dl, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS -ldl",
   3.369 -                  AC_CHECK_LIB(ltdl, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS -lltdl")))
   3.370 +            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
   3.371 +               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
   3.372 +                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
   3.373              AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
   3.374              if test x$have_dlvsym = xyes; then
   3.375                  AC_DEFINE(HAVE_DLVSYM)
   3.376 @@ -1736,7 +1739,7 @@
   3.377          if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
   3.378              AC_DEFINE(SDL_LOADSO_LDG)
   3.379              SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
   3.380 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lldg -lgem"
   3.381 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lldg -lgem"
   3.382              have_loadso=yes
   3.383          fi
   3.384      fi
   3.385 @@ -1839,8 +1842,8 @@
   3.386  
   3.387              AC_DEFINE(SDL_JOYSTICK_USBHID)
   3.388              SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
   3.389 -            BUILD_CFLAGS="$BUILD_CFLAGS $USB_CFLAGS"
   3.390 -            BUILD_LDFLAGS="$BUILD_LDFLAGS $USB_LIBS"
   3.391 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
   3.392 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
   3.393              have_joystick=yes
   3.394          fi
   3.395          CFLAGS="$save_CFLAGS"
   3.396 @@ -1857,7 +1860,7 @@
   3.397          AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
   3.398          if test x$have_clock_gettime = xyes; then
   3.399              AC_DEFINE(HAVE_CLOCK_GETTIME)
   3.400 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lrt"
   3.401 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
   3.402          fi
   3.403      fi
   3.404  }
   3.405 @@ -1867,7 +1870,7 @@
   3.406  {
   3.407      AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
   3.408      if test x$have_linux_version_h = xyes; then
   3.409 -        BUILD_CFLAGS="$BUILD_CFLAGS -DHAVE_LINUX_VERSION_H"
   3.410 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
   3.411      fi
   3.412  }
   3.413  
   3.414 @@ -2037,7 +2040,7 @@
   3.415          if test x$enable_audio = xyes; then
   3.416              AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
   3.417              SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
   3.418 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -lasound"
   3.419 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
   3.420              have_audio=yes
   3.421          fi
   3.422          # Set up files for the cdrom library
   3.423 @@ -2114,9 +2117,9 @@
   3.424              have_loadso=yes
   3.425          fi
   3.426          # Set up the system libraries we need
   3.427 -        BUILD_LDFLAGS="$BUILD_LDFLAGS -luser32 -lgdi32 -lwinmm"
   3.428 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
   3.429          if test x$have_directx = xyes; then
   3.430 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -ldxguid"
   3.431 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid"
   3.432          fi
   3.433          # The Win32 platform requires special setup
   3.434          SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
   3.435 @@ -2171,7 +2174,7 @@
   3.436          fi
   3.437          # The BeOS platform requires special setup.
   3.438          SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
   3.439 -        BUILD_LDFLAGS="$BUILD_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
   3.440 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
   3.441          ;;
   3.442      *-*-darwin* )
   3.443          # This could be either full "Mac OS X", or plain "Darwin" which is
   3.444 @@ -2190,7 +2193,7 @@
   3.445          CheckAltivec
   3.446  
   3.447          # Need this or things might misbuild on a G3.
   3.448 -        BUILD_CFLAGS="$BUILD_CFLAGS -force_cpusubtype_ALL"
   3.449 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
   3.450  
   3.451          # Set up files for the audio library
   3.452          if test x$enable_audio = xyes; then
   3.453 @@ -2204,7 +2207,7 @@
   3.454          if test x$enable_joystick = xyes; then
   3.455              AC_DEFINE(SDL_JOYSTICK_IOKIT)
   3.456              SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
   3.457 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework IOKit"
   3.458 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework IOKit"
   3.459              have_joystick=yes
   3.460          fi
   3.461          # Set up files for the cdrom library
   3.462 @@ -2227,19 +2230,19 @@
   3.463          fi
   3.464          # The MacOS X platform requires special setup.
   3.465          SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
   3.466 -        BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings"
   3.467 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
   3.468          SDL_LIBS="-lSDLmain $SDL_LIBS"
   3.469          if test x$enable_video_cocoa = xyes; then
   3.470 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework Cocoa"
   3.471 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Cocoa"
   3.472          fi
   3.473          if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
   3.474              # The Cocoa backend still needs Carbon, and the YUV code QuickTime
   3.475 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework QuickTime -framework ApplicationServices"
   3.476 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework Carbon"
   3.477 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework QuickTime -framework ApplicationServices"
   3.478 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Carbon"
   3.479          fi
   3.480          # If either the audio or CD driver is used, add the AudioUnit framework
   3.481          if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
   3.482 -            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework AudioToolbox -framework AudioUnit"
   3.483 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AudioToolbox -framework AudioUnit"
   3.484          fi
   3.485          ;;
   3.486      *-*-mint*)
   3.487 @@ -2310,7 +2313,7 @@
   3.488              have_timers=yes
   3.489          fi
   3.490          # The RISC OS platform requires special setup.
   3.491 -        BUILD_LDFLAGS="$BUILD_LDFLAGS -ljpeg -ltiff -lpng -lz"
   3.492 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
   3.493          ;;
   3.494      *)
   3.495          AC_MSG_ERROR([
   3.496 @@ -2450,7 +2453,9 @@
   3.497  AC_SUBST(SDLMAIN_SOURCES)
   3.498  AC_SUBST(SDLMAIN_OBJECTS)
   3.499  AC_SUBST(BUILD_CFLAGS)
   3.500 +AC_SUBST(EXTRA_CFLAGS)
   3.501  AC_SUBST(BUILD_LDFLAGS)
   3.502 +AC_SUBST(EXTRA_LDFLAGS)
   3.503  
   3.504  AC_OUTPUT([
   3.505      Makefile sdl-config SDL.spec SDL.qpg