Fixed bug 3043 - fix alsa configury and cmake checks
authorSam Lantinga <slouken@libsdl.org>
Fri, 07 Oct 2016 18:03:08 -0700
changeset 1049024472af11074
parent 10489 1e1ce9f6d215
child 10491 c64e191b5518
Fixed bug 3043 - fix alsa configury and cmake checks

Ozkan Sezer

SDL's alsa uses snd_pcm_recover() which has been available only since alsa-lib-1.0.11.
cmake/sdlchecks.cmake
configure
configure.in
     1.1 --- a/cmake/sdlchecks.cmake	Fri Oct 07 18:00:30 2016 -0700
     1.2 +++ b/cmake/sdlchecks.cmake	Fri Oct 07 18:03:08 2016 -0700
     1.3 @@ -105,7 +105,9 @@
     1.4    if(ALSA)
     1.5      CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H)
     1.6      if(HAVE_ASOUNDLIB_H)
     1.7 -      CHECK_LIBRARY_EXISTS(asound snd_pcm_open "" HAVE_LIBASOUND)
     1.8 +      CHECK_LIBRARY_EXISTS(asound snd_pcm_recover "" HAVE_LIBASOUND)
     1.9 +    endif()
    1.10 +    if(HAVE_LIBASOUND)
    1.11        set(HAVE_ALSA TRUE)
    1.12        file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c)
    1.13        set(SOURCE_FILES ${SOURCE_FILES} ${ALSA_SOURCES})
     2.1 --- a/configure	Fri Oct 07 18:00:30 2016 -0700
     2.2 +++ b/configure	Fri Oct 07 18:03:08 2016 -0700
     2.3 @@ -17604,7 +17604,7 @@
     2.4  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
     2.5  $as_echo "$ALSA_LIBS" >&6; }
     2.6  
     2.7 -min_alsa_version=0.9.0
     2.8 +min_alsa_version=1.0.11
     2.9  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5
    2.10  $as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; }
    2.11  no_alsa=""
     3.1 --- a/configure.in	Fri Oct 07 18:00:30 2016 -0700
     3.2 +++ b/configure.in	Fri Oct 07 18:03:08 2016 -0700
     3.3 @@ -770,7 +770,7 @@
     3.4  AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
     3.5                    , enable_alsa=yes)
     3.6      if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
     3.7 -        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
     3.8 +        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
     3.9          # Restore all flags from before the ALSA detection runs
    3.10          CFLAGS="$alsa_save_CFLAGS"
    3.11          LDFLAGS="$alsa_save_LDFLAGS"