added --with-sdl1 option to configure scripts, to force the use of SDL 1.x, over SDL 2.x

This commit is contained in:
David Ludwig 2017-09-09 15:15:28 +00:00
parent 20ad70cb35
commit cbda5759bb

View File

@ -36,6 +36,7 @@ AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphi
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
AC_ARG_WITH(sdl1, [ --with-sdl1 use SDL 1.x, rather than SDL 2.x [default=no]], [WANT_SDL_VERSION_MAJOR=1], [])
dnl JIT compiler options.
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
@ -300,7 +301,16 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
ac_cv_framework_SDL=no
fi
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
WANT_SDL_VERSION_MAJOR=2
dnl use PKG_PROG_PKG_CONFIG to declare PKG_CONFIG variables. Otherwise,
dnl PKG_* macros may fail, without much explanation. The lack of this
dnl was causing --with-sdl1 to fail, as SDL 1.x could not be detected,
dnl as the 2nd call to PKG_CHECK_MODULES would fail, as $PKG_CONFIG
dnl never got defined (bizarrely-enough). -- dludwig@pobox.com
PKG_PROG_PKG_CONFIG
if [[ "x$WANT_SDL_VERSION_MAJOR" = "x" ]]; then
WANT_SDL_VERSION_MAJOR=2
fi
if [[ "x$WANT_SDL_VERSION_MAJOR" = "x2" ]]; then
PKG_CHECK_MODULES([sdl2], [sdl2 >= 2.0], [
CFLAGS="$CFLAGS $sdl2_CFLAGS"
@ -1849,6 +1859,7 @@ echo
echo Mac OS X GUI ........................... : $WANT_MACOSX_GUI
echo Mac OS X Sound ......................... : $WANT_MACOSX_SOUND
echo SDL support ............................ : $SDL_SUPPORT
echo SDL major-version ...................... : $WANT_SDL_VERSION_MAJOR
echo BINCUE support ......................... : $have_bincue
echo LIBVHD support ......................... : $have_libvhd
echo XFree86 DGA support .................... : $WANT_XF86_DGA