From 69d9c04a2235649b76bfccd1e3446f35c412073c Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 28 Mar 2022 18:41:23 +0000 Subject: [PATCH] configure.ac: if linking -lSDL2 fails, try pkg-config if SDL2 is a static library (like when using pspsdk), it may depend on additional libraries that pkg-config can supply. --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 69bb1c5..1b3a8d3 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,8 @@ with_svgalib=no ])], [with_svgalib=no]) fi +test -z "$PKG_CONFIG" && PKG_CONFIG=pkg-config + if test "$with_sdl2" != no ; then SDL2_LIBS=-lSDL2 AC_CHECK_LIB(SDL2, SDL_Init, [ @@ -82,7 +84,15 @@ AC_CHECK_LIB(SDL2, SDL_Init, [ AC_MSG_WARN(SDL2 found but headers are missing!!) with_sdl2=no ]) -], [with_sdl2=no], $SDL2_LIBS) +], [ + AC_MSG_WARN(testing pkg-config for SDL2) + if "$PKG_CONFIG" --libs sdl2 >/dev/null 2>&1 ; then + with_sdl2=yes + SDL2_LIBS=$("$PKG_CONFIG" --libs sdl2) + else + with_sdl2=no + fi +], $SDL2_LIBS) fi if test "$with_sdl2" = "no" && test "$with_sdl" != "no" ; then -- 2.11.4.GIT