Bug#951087: jag, mrboom: FTBFS: SDL_mixer.h:25:10: fatal error: SDL_stdinc.h: No such file or directory
Simon McVittie
smcv at debian.org
Sun Feb 23 17:56:05 GMT 2020
On Sun, 23 Feb 2020 at 08:49:11 +0100, Lucas Nussbaum wrote:
> During a rebuild of all packages in sid, your package failed to build
> on amd64.
> > In file included from src/gamesound.h:33,
> > from src/gametools.cpp:33:
> > /usr/include/SDL2/SDL_mixer.h:25:10: fatal error: SDL_stdinc.h: No such file or directory
> > 25 | #include "SDL_stdinc.h"
These two bugs appear to be very similar. They're caused by jag and
mrboom assuming that they can find <SDL2/SDL.h>, <SDL2/SDL_mixer.h>
etc. in the compiler's default header search path, and also assuming
that they can find -lSDL2, -lSDL2_mixer etc. in the linker's default
library search path.
These assumptions are not really correct: games are meant to query each
library's CFLAGS and LIBS, add them to the compiler and linker command
lines respectively, and use #include <SDL.h> (and *not* <SDL2/SDL.h>,
which does not work on all OSs). In a simple Makefile-based build system
like the one in mrboom, that looks like this:
PKG_CONFIG ?= pkg-config
SDL2_CFLAGS = $(shell ${PKG_CONFIG} --cflags sdl2 SDL2_mixer)
SDL2_LIBS = $(shell ${PKG_CONFIG} --libs sdl2 SDL2_mixer)
SDL2LIBS = ${SDL2_LIBS} -lminizip -lmodplug
CFLAGS += ${SDL2_CFLAGS}
jag would need to do the equivalent, but however you spell that in QMake
(sorry, I don't know how that works).
Despite not really being correct, these assumptions used to
work before we modified SDL2 to be multiarch co-installable
(<https://bugs.debian.org/909740>). The alternative solution to #909740
proposed at <https://salsa.debian.org/sdl-team/libsdl2/merge_requests/3>
as a solution to <https://bugs.debian.org/951087> also breaks these
assumptions, although I think it would be possible to modify it so that
the assumptions hold again.
smcv
More information about the Pkg-sdl-maintainers
mailing list