1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-26 20:02:37 +00:00

Update SDL dependent code and makefile segments to prepare for SDL3 (#497)

* Update SDL dependent code and makefile segments to prepare for SDL3

Many APIs have changed between SDL2 and SDL3.  This update adds
preprocessor conditionals to adapt the Maiko SDL code to allow selection of
the SDL major version (2 or 3) from the -DSDL=n define.

The SDL3 implementation is currently available as a preview release, 3.1.0, at
   https://github.com/libsdl-org/SDL/releases/tag/prerelease-3.1.0

* Add updates for makefile-haiku.x86_64-sdl to prepare for SDL3

* Allow makeright to accept sdl3 as display type to ease SDL3 experiments

* Update CMakeLists.txt for SDL3 library

 * Replaces configuration option -DMAIKO_DISPLAY_SDL=ON/OFF with
   -DMAIKO_DISPLAY_SDL=OFF/2/3
 * Replaces PUBLIC definitions with PRIVATE definitions on targets since
   we are not exporting definitions outside this local compilation
 * Update messages to indicate which version of SDL is being configured
 * Add fixup for SDL3.xcframework on macOS to compensate for missing
   RPATH specification (CMake issue 25998)
This commit is contained in:
Nick Briggs
2024-05-21 12:07:13 -07:00
committed by GitHub
parent 3ac46abc5c
commit c765ca5cc8
16 changed files with 246 additions and 41 deletions

View File

@@ -5,7 +5,13 @@ CC = gcc -m64 $(GCC_CFLAGS) -I/usr/local/include
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -4,7 +4,14 @@ CC = clang -target aarch64-apple-darwin $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL -F /Library/Frameworks
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -framework SDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -framework SDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2 -F /Library/Frameworks
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g

View File

@@ -2,9 +2,15 @@
CC = clang -m64 -target x86_64-apple-darwin $(CLANG_CFLAGS)
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -framework SDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -framework SDL3 in LDFLAGS
#
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL -F /Library/Frameworks
SDLFLAGS = -DSDL=2 -F /Library/Frameworks
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g

View File

@@ -4,7 +4,13 @@ CC = emcc $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL -sUSE_SDL=2
#
# For SDL version 2
# -DSDL=2 and -sUSE_SDL=2 in XFLAGS and -sUSE_SDL=2 in LDFLAGS
# For SDL version 3
# -DSDL=3 and -sUSE_SDL=3 in XFLAGS and -sUSE_SDL=3 in LDFLAGS
#
XFLAGS = -DSDL=2 -sUSE_SDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2

View File

@@ -4,7 +4,13 @@ CC = emcc $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL -sUSE_SDL=2
#
# For SDL version 2
# -DSDL=2 and -sUSE_SDL=2 in XFLAGS and -sUSE_SDL=2 in LDFLAGS
# For SDL version 3
# -DSDL=3 and -sUSE_SDL=3 in XFLAGS and -sUSE_SDL=3 in LDFLAGS
#
XFLAGS = -DSDL=2 -sUSE_SDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2

View File

@@ -4,7 +4,13 @@ CC = clang -m32 $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL -I/usr/local/include
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2 -I/usr/local/include
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g

View File

@@ -4,7 +4,13 @@ CC = clang -m64 $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL -I/usr/local/include
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2 -I/usr/local/include
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g

View File

@@ -4,7 +4,13 @@ CC = clang -m64 $(CLANG_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL -I/usr/local/include
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2 -I/usr/local/include
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g

View File

@@ -5,7 +5,13 @@ CC = gcc -m64 $(GCC_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -5,7 +5,13 @@ CC = gcc -m32 $(GCC_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -5,7 +5,13 @@ CC = gcc $(GCC_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
SDLFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
#
SDLFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -5,7 +5,13 @@ CC = gcc $(GCC_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -5,7 +5,13 @@ CC = gcc -m64 $(GCC_CFLAGS)
XFILES = $(OBJECTDIR)sdl.o
XFLAGS = -DSDL
#
# For SDL version 2
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
# For SDL version 3
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
#
XFLAGS = -DSDL=2
# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3

View File

@@ -71,7 +71,7 @@ case "$display" in
x) releasename=${osversion}.${architecture}-${display}
ldename=ldex
;;
sdl) releasename=${osversion}.${architecture}-${display}
sdl*) releasename=${osversion}.${architecture}-${display}
ldename=ldesdl
;;
wasm) osversion=emscripten