Maelstrom: Updated SDL requirements to SDL 2.0

https://github.com/libsdl-org/Maelstrom/commit/c7ed727bbe399167658755a45bdd78f1ed383636

From c7ed727bbe399167658755a45bdd78f1ed383636 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 30 May 2012 15:03:31 -0400
Subject: [PATCH] Updated SDL requirements to SDL 2.0

---
 Makefile.in                   |  2 +-
 acinclude/{sdl.m4 => sdl2.m4} | 37 +++++++++---------
 aclocal.m4                    |  2 +-
 configure                     | 72 ++++++++++++++++-------------------
 configure.in                  |  8 ++--
 game/Makefile.in              |  2 +-
 maclib/Makefile.in            |  2 +-
 screenlib/Makefile.in         |  2 +-
 utils/Makefile.in             |  2 +-
 9 files changed, 60 insertions(+), 69 deletions(-)
 rename acinclude/{sdl.m4 => sdl2.m4} (83%)

diff --git a/Makefile.in b/Makefile.in
index a600a2ff..0e5ada86 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,7 +44,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Maelstrom.spec.in \
 	build-scripts/missing build-scripts/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude/check_zlib.m4 \
-	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl.m4 \
+	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl2.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
diff --git a/acinclude/sdl.m4 b/acinclude/sdl2.m4
similarity index 83%
rename from acinclude/sdl.m4
rename to acinclude/sdl2.m4
index d85d02e2..302b419c 100644
--- a/acinclude/sdl.m4
+++ b/acinclude/sdl2.m4
@@ -10,9 +10,9 @@
 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
 dnl
-AC_DEFUN([AM_PATH_SDL],
+AC_DEFUN([AM_PATH_SDL2],
 [dnl 
-dnl Get the cflags and libraries from the sdl-config script
+dnl Get the cflags and libraries from the sdl2-config script
 dnl
 AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
             sdl_prefix="$withval", sdl_prefix="")
@@ -21,40 +21,37 @@ AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL
 AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
 		    , enable_sdltest=yes)
 
-  min_sdl_version=ifelse([$1], ,1.2.0,$1)
+  min_sdl_version=ifelse([$1], ,0.9.0,$1)
 
   if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
-    PKG_CHECK_MODULES(SDL, [sdl >= $min_sdl_version],
+    PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
            [sdl_pc=yes],
-           [dnl
-             AC_MSG_RESULT(no)
-             sdl_pc=no
-           ])
+           [sdl_pc=no])
   else
     sdl_pc=no
     if test x$sdl_exec_prefix != x ; then
       sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
       if test x${SDL_CONFIG+set} != xset ; then
-        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+        SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
       fi
     fi
     if test x$sdl_prefix != x ; then
       sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
       if test x${SDL_CONFIG+set} != xset ; then
-        SDL_CONFIG=$sdl_prefix/bin/sdl-config
+        SDL_CONFIG=$sdl_prefix/bin/sdl2-config
       fi
     fi
   fi
 
   if test "x$sdl_pc" = xyes ; then
     no_sdl=""
-    SDL_CONFIG="pkg-config sdl"
+    SDL_CONFIG="pkg-config sdl2"
   else
     as_save_PATH="$PATH"
     if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
       PATH="$prefix/bin:$prefix/usr/bin:$PATH"
     fi
-    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+    AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
     PATH="$as_save_PATH"
     AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
     no_sdl=""
@@ -80,7 +77,7 @@ AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run
         LIBS="$LIBS $SDL_LIBS"
 dnl
 dnl Now check if the installed SDL is sufficiently new. (Also sanity
-dnl checks the results of sdl-config to some extent
+dnl checks the results of sdl2-config to some extent
 dnl
       rm -f conf.sdltest
       AC_TRY_RUN([
@@ -130,11 +127,11 @@ int main (int argc, char *argv[])
     }
   else
     {
-      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
-      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+      printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+      printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
       printf("*** best to upgrade to the required version.\n");
-      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
-      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+      printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
+      printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
       printf("*** config.cache before re-running configure\n");
       return 1;
     }
@@ -156,10 +153,10 @@ int main (int argc, char *argv[])
      ifelse([$2], , :, [$2])
   else
      if test "$SDL_CONFIG" = "no" ; then
-       echo "*** The sdl-config script installed by SDL could not be found"
+       echo "*** The sdl2-config script installed by SDL could not be found"
        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
        echo "*** your path, or set the SDL_CONFIG environment variable to the"
-       echo "*** full path to sdl-config."
+       echo "*** full path to sdl2-config."
      else
        if test -f conf.sdltest ; then
         :
@@ -189,7 +186,7 @@ int main(int argc, char *argv[])
         [ echo "*** The test program failed to compile or link. See the file config.log for the"
           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
-          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+          echo "*** may want to edit the sdl2-config script: $SDL_CONFIG" ])
           CFLAGS="$ac_save_CFLAGS"
           CXXFLAGS="$ac_save_CXXFLAGS"
           LIBS="$ac_save_LIBS"
diff --git a/aclocal.m4 b/aclocal.m4
index 472bf5f5..75e6d2c7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -862,4 +862,4 @@ AC_SUBST([am__untar])
 
 m4_include([acinclude/check_zlib.m4])
 m4_include([acinclude/pkg.m4])
-m4_include([acinclude/sdl.m4])
+m4_include([acinclude/sdl2.m4])
diff --git a/configure b/configure
index 01e0790b..2036b02f 100755
--- a/configure
+++ b/configure
@@ -4172,7 +4172,7 @@ esac
 
 
 
-SDL_VERSION=1.3.0
+SDL_VERSION=2.0.0
 
 
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
@@ -4331,12 +4331,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_SDL_CFLAGS="$SDL_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl >= \$min_sdl_version\"") >&5
-  ($PKG_CONFIG --exists --print-errors "sdl >= $min_sdl_version") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\"") >&5
+  ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl >= $min_sdl_version" 2>/dev/null`
+  pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -4349,12 +4349,12 @@ if test -n "$PKG_CONFIG"; then
         pkg_cv_SDL_LIBS="$SDL_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl >= \$min_sdl_version\"") >&5
-  ($PKG_CONFIG --exists --print-errors "sdl >= $min_sdl_version") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\"") >&5
+  ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl >= $min_sdl_version" 2>/dev/null`
+  pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -4373,24 +4373,18 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl >= $min_sdl_version"`
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"`
         else
-	        SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl >= $min_sdl_version"`
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$SDL_PKG_ERRORS" >&5
 
 	{ echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
-                             { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-             sdl_pc=no
-
+                sdl_pc=no
 elif test $pkg_failed = untried; then
-	             { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-             sdl_pc=no
-
+	sdl_pc=no
 else
 	SDL_CFLAGS=$pkg_cv_SDL_CFLAGS
 	SDL_LIBS=$pkg_cv_SDL_LIBS
@@ -4403,27 +4397,27 @@ fi
     if test x$sdl_exec_prefix != x ; then
       sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
       if test x${SDL_CONFIG+set} != xset ; then
-        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+        SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
       fi
     fi
     if test x$sdl_prefix != x ; then
       sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
       if test x${SDL_CONFIG+set} != xset ; then
-        SDL_CONFIG=$sdl_prefix/bin/sdl-config
+        SDL_CONFIG=$sdl_prefix/bin/sdl2-config
       fi
     fi
   fi
 
   if test "x$sdl_pc" = xyes ; then
     no_sdl=""
-    SDL_CONFIG="pkg-config sdl"
+    SDL_CONFIG="pkg-config sdl2"
   else
     as_save_PATH="$PATH"
     if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
       PATH="$prefix/bin:$prefix/usr/bin:$PATH"
     fi
-    # Extract the first word of "sdl-config", so it can be a program name with args.
-set dummy sdl-config; ac_word=$2
+    # Extract the first word of "sdl2-config", so it can be a program name with args.
+set dummy sdl2-config; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_SDL_CONFIG+set}" = set; then
@@ -4544,11 +4538,11 @@ int main (int argc, char *argv[])
     }
   else
     {
-      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
-      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+      printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+      printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
       printf("*** best to upgrade to the required version.\n");
-      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
-      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+      printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
+      printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
       printf("*** config.cache before re-running configure\n");
       return 1;
     }
@@ -4606,10 +4600,10 @@ echo "${ECHO_T}no" >&6; }
      :
   else
      if test "$SDL_CONFIG" = "no" ; then
-       echo "*** The sdl-config script installed by SDL could not be found"
+       echo "*** The sdl2-config script installed by SDL could not be found"
        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
        echo "*** your path, or set the SDL_CONFIG environment variable to the"
-       echo "*** full path to sdl-config."
+       echo "*** full path to sdl2-config."
      else
        if test -f conf.sdltest ; then
         :
@@ -4675,7 +4669,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 	 echo "*** The test program failed to compile or link. See the file config.log for the"
           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
-          echo "*** may want to edit the sdl-config script: $SDL_CONFIG"
+          echo "*** may want to edit the sdl2-config script: $SDL_CONFIG"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
@@ -4699,13 +4693,13 @@ echo "$as_me: error: *** SDL version $SDL_VERSION not found!" >&2;}
 CFLAGS="$CFLAGS $SDL_CFLAGS"
 LIBS="$LIBS $SDL_LIBS"
 
-{ echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL_net" >&5
-echo $ECHO_N "checking for SDLNet_Init in -lSDL_net... $ECHO_C" >&6; }
-if test "${ac_cv_lib_SDL_net_SDLNet_Init+set}" = set; then
+{ echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL2_net" >&5
+echo $ECHO_N "checking for SDLNet_Init in -lSDL2_net... $ECHO_C" >&6; }
+if test "${ac_cv_lib_SDL2_net_SDLNet_Init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSDL_net  $LIBS"
+LIBS="-lSDL2_net  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4746,26 +4740,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_SDL_net_SDLNet_Init=yes
+  ac_cv_lib_SDL2_net_SDLNet_Init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_SDL_net_SDLNet_Init=no
+	ac_cv_lib_SDL2_net_SDLNet_Init=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_net_SDLNet_Init" >&5
-echo "${ECHO_T}$ac_cv_lib_SDL_net_SDLNet_Init" >&6; }
-if test $ac_cv_lib_SDL_net_SDLNet_Init = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL2_net_SDLNet_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_SDL2_net_SDLNet_Init" >&6; }
+if test $ac_cv_lib_SDL2_net_SDLNet_Init = yes; then
   have_SDL_net=yes
 fi
 
 if test x$have_SDL_net = xyes; then
-    LIBS="$LIBS -lSDL_net"
+    LIBS="$LIBS -lSDL2_net"
 else
     { { echo "$as_me:$LINENO: error: *** Can't find the SDL_net library
 The SDL_net library can be found at:
diff --git a/configure.in b/configure.in
index 9945194b..3afd1f3a 100644
--- a/configure.in
+++ b/configure.in
@@ -47,8 +47,8 @@ AC_SUBST(MATHLIB)
 AC_SUBST(INETLIB)
 
 dnl Check for SDL
-SDL_VERSION=1.3.0
-AM_PATH_SDL($SDL_VERSION,
+SDL_VERSION=2.0.0
+AM_PATH_SDL2($SDL_VERSION,
             :,
             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
 )
@@ -56,9 +56,9 @@ CFLAGS="$CFLAGS $SDL_CFLAGS"
 LIBS="$LIBS $SDL_LIBS"
 
 dnl Check for SDL_net
-AC_CHECK_LIB(SDL_net, SDLNet_Init, have_SDL_net=yes)
+AC_CHECK_LIB(SDL2_net, SDLNet_Init, have_SDL_net=yes)
 if test x$have_SDL_net = xyes; then
-    LIBS="$LIBS -lSDL_net"
+    LIBS="$LIBS -lSDL2_net"
 else
     AC_MSG_ERROR([*** Can't find the SDL_net library
 The SDL_net library can be found at:
diff --git a/game/Makefile.in b/game/Makefile.in
index 9d01f934..3e24f3fa 100644
--- a/game/Makefile.in
+++ b/game/Makefile.in
@@ -37,7 +37,7 @@ subdir = game
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude/check_zlib.m4 \
-	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl.m4 \
+	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl2.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
diff --git a/maclib/Makefile.in b/maclib/Makefile.in
index 45eec8f6..6d7d46ac 100644
--- a/maclib/Makefile.in
+++ b/maclib/Makefile.in
@@ -38,7 +38,7 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude/check_zlib.m4 \
-	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl.m4 \
+	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl2.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
diff --git a/screenlib/Makefile.in b/screenlib/Makefile.in
index d791de47..05c23ac2 100644
--- a/screenlib/Makefile.in
+++ b/screenlib/Makefile.in
@@ -38,7 +38,7 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude/check_zlib.m4 \
-	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl.m4 \
+	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl2.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 2346910e..388ff4b7 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -37,7 +37,7 @@ subdir = utils
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude/check_zlib.m4 \
-	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl.m4 \
+	$(top_srcdir)/acinclude/pkg.m4 $(top_srcdir)/acinclude/sdl2.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)