WIP: Be Multi-Arch: same by having sdl2-config ask ${CC} for its multiarch tuple
This is one of several possible solutions to #909740. It includes !2 (merged).
Alternatives include !3 (merged) and !5 (merged).
-
libsdl2-dev:amd64 and libsdl2-dev:i386 are co-installable -
the debian/tests/build autopkgtest passes -
the debian/tests/cmake autopkgtest passes -
x86_64-linux-gnu-pkg-config --cflags --libs sdl2 has reasonable results (-D_REENTRANT -I/usr/include/x86_64-linux-gnu/SDL2 -lSDL2) -
i686-linux-gnu-pkg-config --cflags --libs sdl2 has reasonable results (-D_REENTRANT -I/usr/include/i386-linux-gnu/SDL2 -lSDL2) -
sdl2-config --cflags --libs has reasonable results (-I/usr/include/x86_64-linux-gnu/SDL2 -D_REENTRANT -lSDL2) -
"CC=i686-linux-gnu-gcc PKG_CONFIG=i686-linux-gnu-pkg-config
sdl2-config --cflags --libs" has reasonable results (-I/usr/include/i386-linux-gnu/SDL2 -D_REENTRANT -lSDL2) -
"CC='gcc -m32' PKG_CONFIG=i686-linux-gnu-pkg-config
sdl2-config --cflags --libs" has reasonable results (-I/usr/include/i386-linux-gnu/SDL2 -D_REENTRANT -lSDL2)
Advantages:
- Follows a pattern that is familiar from other packages, with no weird forwarding header.
Disadvantages:
- We have to patch sdl2-config.
- If you're using something like "meson --native-file=..." to specify your C compiler and pkg-config, you'll still have to set $CC even though your build system doesn't use it.
- Third-party compilers don't necessarily have cc -multiarch, and cc -dumpmachine isn't guaranteed to give the right answer.
Edited by Simon McVittie