From 4bd6538a87eedd8377fd3d83ed362a0357158a27 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 24 Aug 2015 23:47:27 +0000 Subject: [PATCH] Fix a bug in SDL detection causing false positives. If SDL_CFLAGS is defined to a non-empty value, even spaces, a later test will wrongly succeed and think SDL_CFLAGS is a user override. --- build/autotools/m4/lol-sdl.m4 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/autotools/m4/lol-sdl.m4 b/build/autotools/m4/lol-sdl.m4 index d859ef98..6065eea0 100644 --- a/build/autotools/m4/lol-sdl.m4 +++ b/build/autotools/m4/lol-sdl.m4 @@ -55,7 +55,8 @@ if test "x${ac_cv_my_have_sdl}" = xno; then save_LIBS="${LIBS}" CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}" LIBS="${LIBS} ${SDL_LIBS}" - AC_CHECK_HEADERS(SDL.h SDL/SDL.h SDL2/SDL.h, [ac_cv_my_have_sdl="yes"]) + AC_CHECK_HEADERS(SDL.h SDL/SDL.h SDL2/SDL.h, + [ac_cv_my_have_sdl="yes"]) if test "x${ac_cv_my_have_sdl}" != xno; then AC_CHECK_HEADERS(SDL_mixer.h SDL/SDL_mixer.h SDL2/SDL_mixer.h, [ac_cv_my_have_sdl_mixer="yes"]) @@ -72,9 +73,9 @@ if test "x${ac_cv_my_have_sdl}" = xno; then AC_CHECK_LIB(SDL2_image, main, [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL2_image"], [ac_cv_my_have_sdl_image="no"]) + SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" + SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" fi - SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" - SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" CPPFLAGS="${save_CPPFLAGS}" LIBS="${save_LIBS}" fi