synthetix
Posts: 1
Joined: Thu Mar 23, 2023 12:50 pm

Compiling with static SDL fails

Hello, I just want to report a problem I found in /mame/scripts/src/osd/sdl.lua. The problem causes static compilation of libSDL2 to fail on Linux. The reason is this block of code starting on line 47 in sdl.lua (I'm looking at commit bd59a0d):

Code: Select all

if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" and _OPTIONS["targetos"]~="asmjs" then
	links {
		"SDL2_ttf",
	}
As you can see, this only links in SDL2_ttf, not the main SDL2 library itself. Because it's not included, compilation fails with a bunch of undefined functions because libSDL2.a isn't being linked. The fix is to just add "SDL2" to the list. It fixes it, works great, and shouldn't affect anything negatively.

Code: Select all

if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" and _OPTIONS["targetos"]~="asmjs" then
	links {
		"SDL2",
		"SDL2_ttf",
	}
I ask you please make this change. Thank you.

Return to “MAME Discussion”