Ignore:
Timestamp:
Jan 31, 2013, 2:17:09 AM (7 years ago)
Author:
sam
Message:

build: add SDL detection code in new file lol-sdl.m4. The SDL2 version is
disabled until the engine code itself is ported to SDL2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2285 r2300  
    219219LOL_CHECK_OPENGL
    220220
    221 
    222 dnl Use SDL? (always required on Linux or Win32)
    223 ac_cv_my_have_sdl="no"
    224 ac_cv_my_have_sdl_image="no"
    225 ac_cv_my_have_sdl_mixer="no"
    226 dnl
    227 dnl  First, try the proper pkg-config check
    228 PKG_CHECK_MODULES(SDL, sdl, [ac_cv_my_have_sdl="yes"], [:])
    229 PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [ac_cv_my_have_sdl_mixer="yes"], [:])
    230 PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [ac_cv_my_have_sdl_image="yes"], [:])
    231 dnl
    232 dnl  Then the old sdl-config method
    233 if test "x${cross_compiling}" != xyes -a "${ac_cv_my_have_sdl}" != yes; then
    234   AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
    235   if test "${SDL_CONFIG}" != "no"; then
    236     SDL_CFLAGS="${SDL_CFLAGS} `${SDL_CONFIG} --cflags`"
    237     SDL_LIBS="${SDL_LIBS} `${SDL_CONFIG} --libs`"
    238     ac_cv_my_have_sdl="yes"
    239   fi
    240 fi
    241 dnl
    242 dnl  Maybe all this has failed, try direct inclusion
    243 save_CPPFLAGS="${CPPFLAGS}"
    244 save_LIBS="${LIBS}"
    245 CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
    246 LIBS="${LIBS} ${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
    247 AC_CHECK_HEADERS(SDL.h SDL/SDL.h, [ac_cv_my_have_sdl="yes"])
    248 AC_CHECK_HEADERS(SDL_mixer.h SDL/SDL_mixer.h, [ac_cv_my_have_sdl_mixer="yes"])
    249 AC_CHECK_HEADERS(SDL_image.h SDL/SDL_image.h, [ac_cv_my_have_sdl_image="yes"])
    250 AC_CHECK_LIB(SDL, main,
    251  [SDL_LIBS="${SDL_LIBS} -lSDL"],
    252  [ac_cv_my_have_sdl="no"])
    253 AC_CHECK_LIB(SDLmain, main,
    254  [SDL_LIBS="${SDL_LIBS} -lSDLmain -lSDL"])
    255 AC_CHECK_LIB(SDL_mixer, main,
    256  [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"],
    257  [ac_cv_my_have_sdl_mixer="no"])
    258 AC_CHECK_LIB(SDL_image, main,
    259  [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"],
    260  [ac_cv_my_have_sdl_image="no"])
    261 SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
    262 SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
    263 CPPFLAGS="${save_CPPFLAGS}"
    264 LIBS="${save_LIBS}"
    265 if test "${ac_cv_my_have_sdl}" = "no"; then
    266   AC_MSG_WARN([SDL not found])
    267 else
    268   AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL)
    269 fi
    270 if test "${ac_cv_my_have_sdl_mixer}" = "no"; then
    271   AC_MSG_WARN([SDL_mixer not found])
    272 else
    273   AC_DEFINE(USE_SDL_MIXER, 1, Define to 1 to use SDL_mixer)
    274 fi
    275 if test "${ac_cv_my_have_sdl_image}" = "no"; then
    276   AC_MSG_WARN([SDL_image not found])
    277 else
    278   AC_DEFINE(USE_SDL_IMAGE, 1, Define to 1 to use SDL_image)
    279 fi
    280 AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
    281 AM_CONDITIONAL(USE_SDL_MIXER, test "${ac_cv_my_have_sdl_mixer}" = "yes")
    282 AM_CONDITIONAL(USE_SDL_IMAGE, test "${ac_cv_my_have_sdl_image}" = "yes")
    283 
     221LOL_CHECK_SDL
    284222
    285223dnl  Use Flex's FlexLexer.h or ours?
Note: See TracChangeset for help on using the changeset viewer.