First pass at changing SDL 2.0 to SDL 3.0

This commit is contained in:
Sam Lantinga
2022-11-21 20:28:58 -08:00
parent 0bfeed061b
commit 2c4159b99a
146 changed files with 2633 additions and 2635 deletions

108
test/configure vendored
View File

@@ -627,7 +627,7 @@ OPENGLES2_TARGETS
OPENGLES1_TARGETS
CPP
XMKMF
SDL2_CONFIG
SDL3_CONFIG
SDL_LIBS
SDL_CFLAGS
PKG_CONFIG_LIBDIR
@@ -3719,7 +3719,7 @@ esac
SDL_VERSION=2.0.18
SDL_VERSION=3.0.0
@@ -3881,19 +3881,19 @@ fi
if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl2 >= $min_sdl_version" >&5
printf %s "checking for sdl2 >= $min_sdl_version... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl3 >= $min_sdl_version" >&5
printf %s "checking for sdl3 >= $min_sdl_version... " >&6; }
if test -n "$SDL_CFLAGS"; then
pkg_cv_SDL_CFLAGS="$SDL_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5
($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5
($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null`
pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl3 >= $min_sdl_version" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -3904,12 +3904,12 @@ if test -n "$SDL_LIBS"; then
pkg_cv_SDL_LIBS="$SDL_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5
($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5
($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null`
pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl3 >= $min_sdl_version" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -3929,9 +3929,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl2 >= $min_sdl_version" 2>&1`
SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl3 >= $min_sdl_version" 2>&1`
else
SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl2 >= $min_sdl_version" 2>&1`
SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl3 >= $min_sdl_version" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$SDL_PKG_ERRORS" >&5
@@ -3952,37 +3952,37 @@ fi
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${SDL2_CONFIG+set} != xset ; then
SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config
if test x${SDL3_CONFIG+set} != xset ; then
SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
if test x${SDL2_CONFIG+set} != xset ; then
SDL2_CONFIG=$sdl_prefix/bin/sdl2-config
if test x${SDL3_CONFIG+set} != xset ; then
SDL3_CONFIG=$sdl_prefix/bin/sdl3-config
fi
fi
fi
if test "x$sdl_pc" = xyes ; then
no_sdl=""
SDL2_CONFIG="pkg-config sdl2"
SDL3_CONFIG="pkg-config sdl3"
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 "sdl2-config", so it can be a program name with args.
set dummy sdl2-config; ac_word=$2
# Extract the first word of "sdl3-config", so it can be a program name with args.
set dummy sdl3-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_SDL2_CONFIG+y}
if test ${ac_cv_path_SDL3_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $SDL2_CONFIG in
case $SDL3_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path.
ac_cv_path_SDL3_CONFIG="$SDL3_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3996,7 +3996,7 @@ do
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_SDL2_CONFIG="$as_dir$ac_word$ac_exec_ext"
ac_cv_path_SDL3_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -4004,14 +4004,14 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no"
test -z "$ac_cv_path_SDL3_CONFIG" && ac_cv_path_SDL3_CONFIG="no"
;;
esac
fi
SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG
if test -n "$SDL2_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5
printf "%s\n" "$SDL2_CONFIG" >&6; }
SDL3_CONFIG=$ac_cv_path_SDL3_CONFIG
if test -n "$SDL3_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL3_CONFIG" >&5
printf "%s\n" "$SDL3_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
@@ -4023,17 +4023,17 @@ fi
printf %s "checking for SDL - version >= $min_sdl_version... " >&6; }
no_sdl=""
if test "$SDL2_CONFIG" = "no" ; then
if test "$SDL3_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags`
SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs`
SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags`
SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs`
sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \
sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \
sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \
sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
@@ -4074,11 +4074,11 @@ int main (int argc, char *argv[])
}
else
{
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("\n*** 'sdl3-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 sdl3-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n");
printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n");
printf("*** to point to the correct copy of sdl3-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
@@ -4112,11 +4112,11 @@ printf "%s\n" "no" >&6; }
if test "x$no_sdl" = x ; then
:
else
if test "$SDL2_CONFIG" = "no" ; then
echo "*** The sdl2-config script installed by SDL could not be found"
if test "$SDL3_CONFIG" = "no" ; then
echo "*** The sdl3-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 SDL2_CONFIG environment variable to the"
echo "*** full path to sdl2-config."
echo "*** your path, or set the SDL3_CONFIG environment variable to the"
echo "*** full path to sdl3-config."
else
if test -f conf.sdltest ; then
:
@@ -4159,7 +4159,7 @@ else $as_nop
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 sdl2-config script: $SDL2_CONFIG"
echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
@@ -4178,7 +4178,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
rm -f conf.sdltest
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS -lSDL2_test $SDL_LIBS"
LIBS="$LIBS -lSDL3_test $SDL_LIBS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -4832,14 +4832,14 @@ esac
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL2_ttf" >&5
printf %s "checking for TTF_Init in -lSDL2_ttf... " >&6; }
if test ${ac_cv_lib_SDL2_ttf_TTF_Init+y}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL3_ttf" >&5
printf %s "checking for TTF_Init in -lSDL3_ttf... " >&6; }
if test ${ac_cv_lib_SDL3_ttf_TTF_Init+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lSDL2_ttf $LIBS"
LIBS="-lSDL3_ttf $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4857,24 +4857,24 @@ return TTF_Init ();
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_SDL2_ttf_TTF_Init=yes
ac_cv_lib_SDL3_ttf_TTF_Init=yes
else $as_nop
ac_cv_lib_SDL2_ttf_TTF_Init=no
ac_cv_lib_SDL3_ttf_TTF_Init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL2_ttf_TTF_Init" >&5
printf "%s\n" "$ac_cv_lib_SDL2_ttf_TTF_Init" >&6; }
if test "x$ac_cv_lib_SDL2_ttf_TTF_Init" = xyes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL3_ttf_TTF_Init" >&5
printf "%s\n" "$ac_cv_lib_SDL3_ttf_TTF_Init" >&6; }
if test "x$ac_cv_lib_SDL3_ttf_TTF_Init" = xyes
then :
have_SDL_ttf=yes
fi
if test x$have_SDL_ttf = xyes; then
CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
SDL_TTF_LIB="-lSDL2_ttf"
SDL_TTF_LIB="-lSDL3_ttf"
fi