Ignore:
Timestamp:
Sep 13, 2011, 6:09:44 PM (8 years ago)
Author:
sam
Message:

build: move SDL_image and SDL_mixer binaries to an i686-only directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r943 r949  
    174174dnl Use SDL? (always required on Linux or Win32)
    175175ac_cv_my_have_sdl="no"
    176 if test "x$cross_compiling" != xyes; then
    177   ac_cv_my_have_sdl="yes"
     176ac_cv_my_have_sdl_image="no"
     177ac_cv_my_have_sdl_mixer="no"
     178dnl
     179dnl  First, try the proper pkg-config check
     180PKG_CHECK_MODULES(SDL, sdl, [ac_cv_my_have_sdl="yes"], [:])
     181PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [ac_cv_my_have_sdl_mixer="yes"], [:])
     182PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [ac_cv_my_have_sdl_image="yes"], [:])
     183dnl
     184dnl  Then the old sdl-config method
     185if test "x${cross_compiling}" != xyes -a "${ac_cv_my_have_sdl}" != yes; then
    178186  AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
    179   if test "${SDL_CONFIG}" != "no" -a "x$cross_compiling" != xyes; then
    180     SDL_CFLAGS="${SDL_CFLAGS} `sdl-config --cflags`"
    181     SDL_LIBS="${SDL_LIBS} `sdl-config --libs`"
     187  if test "${SDL_CONFIG}" != "no"; then
     188    SDL_CFLAGS="${SDL_CFLAGS} `${SDL_CONFIG} --cflags`"
     189    SDL_LIBS="${SDL_LIBS} `${SDL_CONFIG} --libs`"
     190    ac_cv_my_have_sdl="yes"
    182191  fi
    183   PKG_CHECK_MODULES(SDL, sdl, [:],
    184    [SDL_LIBS="${SDL_LIBS} -lSDL"])
    185   PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:],
    186    [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"])
    187   PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:],
    188    [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"])
    189   SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
    190   SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
    191   save_CPPFLAGS="${CPPFLAGS}"
    192   CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}"
    193   AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"])
    194   AC_CHECK_HEADERS(SDL_image.h, [:], [ac_cv_my_have_sdl="no"])
    195   CPPFLAGS="${save_CPPFLAGS}"
    196   if test "${ac_cv_my_have_sdl}" = "no"; then
    197     AC_MSG_WARN([[One of SDL, SDL_Image or SDL_Mixer not found]])
    198   else
    199     AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL)
    200   fi
     192fi
     193dnl
     194dnl  Maybe all this has failed, try direct inclusion
     195save_CPPFLAGS="${CPPFLAGS}"
     196save_LIBS="${LIBS}"
     197CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
     198LIBS="${LIBS} ${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
     199AC_CHECK_HEADERS(SDL.h SDL/SDL.h, [ac_cv_my_have_sdl="yes"])
     200AC_CHECK_HEADERS(SDL_mixer.h, [ac_cv_my_have_sdl_mixer="yes"])
     201AC_CHECK_HEADERS(SDL_image.h, [ac_cv_my_have_sdl_image="yes"])
     202AC_CHECK_LIB(SDL, main,
     203 [SDL_LIBS="${SDL_LIBS} -lSDL"],
     204 [ac_cv_my_have_sdl="no"])
     205AC_CHECK_LIB(SDL_mixer, main,
     206 [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"],
     207 [ac_cv_my_have_sdl_mixer="no"])
     208AC_CHECK_LIB(SDL_image, main,
     209 [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"],
     210 [ac_cv_my_have_sdl_image="no"])
     211SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
     212SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
     213CPPFLAGS="${save_CPPFLAGS}"
     214LIBS="${save_LIBS}"
     215if test "${ac_cv_my_have_sdl}" = "no"; then
     216  AC_MSG_WARN([SDL not found])
     217else
     218  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL)
     219fi
     220if test "${ac_cv_my_have_sdl_mixer}" = "no"; then
     221  AC_MSG_WARN([SDL_mixer not found])
     222fi
     223if test "${ac_cv_my_have_sdl_image}" = "no"; then
     224  AC_MSG_WARN([SDL_image not found])
    201225fi
    202226AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
     227AM_CONDITIONAL(USE_SDL_MIXER, test "${ac_cv_my_have_sdl_mixer}" = "yes")
     228AM_CONDITIONAL(USE_SDL_IMAGE, test "${ac_cv_my_have_sdl_image}" = "yes")
    203229
    204230
Note: See TracChangeset for help on using the changeset viewer.