We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3043 - fix alsa configury and cmake checks
Summary: fix alsa configury and cmake checks
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-27 22:04 UTC by Ozkan Sezer
Modified: 2016-10-08 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2015-06-27 22:04:14 UTC
SDL's alsa uses snd_pcm_recover() which has been available
only since alsa-lib-1.0.11. The following patches fix the
configury and cmake checks for both SDL2 and also for SDL1.2.


Patch for SDL2 (current hg):

diff -r 7d5a98aac368 cmake/sdlchecks.cmake
--- a/cmake/sdlchecks.cmake	Thu Jun 25 07:17:08 2015 -0700
+++ b/cmake/sdlchecks.cmake	Sun Jun 28 00:55:51 2015 +0300
@@ -105,7 +105,9 @@
   if(ALSA)
     CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H)
     if(HAVE_ASOUNDLIB_H)
-      CHECK_LIBRARY_EXISTS(asound snd_pcm_open "" HAVE_LIBASOUND)
+      CHECK_LIBRARY_EXISTS(asound snd_pcm_recover "" HAVE_LIBASOUND)
+    endif()
+    if(HAVE_LIBASOUND)
       set(HAVE_ALSA TRUE)
       file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c)
       set(SOURCE_FILES ${SOURCE_FILES} ${ALSA_SOURCES})
diff -r 7d5a98aac368 configure.in
--- a/configure.in	Thu Jun 25 07:17:08 2015 -0700
+++ b/configure.in	Sun Jun 28 00:55:51 2015 +0300
@@ -770,7 +770,7 @@
 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
                   , enable_alsa=yes)
     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
-        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
+        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
         # Restore all flags from before the ALSA detection runs
         CFLAGS="$alsa_save_CFLAGS"
         LDFLAGS="$alsa_save_LDFLAGS"
diff -r 7d5a98aac368 configure
--- a/configure	Thu Jun 25 07:17:08 2015 -0700
+++ b/configure	Sun Jun 28 00:55:51 2015 +0300
@@ -17601,7 +17601,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
 $as_echo "$ALSA_LIBS" >&6; }
 
-min_alsa_version=0.9.0
+min_alsa_version=1.0.11
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5
 $as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; }
 no_alsa=""



Patch for SDL-1.2 (current hg, SDL-1.2 branch):

diff -r 9f8a2b28f61d configure.in
--- a/configure.in	Fri Apr 17 21:41:11 2015 +0200
+++ b/configure.in	Sun Jun 28 00:55:11 2015 +0300
@@ -361,7 +361,7 @@
 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
                   , enable_alsa=yes)
     if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
-        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
+        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
         # Restore all flags from before the ALSA detection runs
         CFLAGS="$alsa_save_CFLAGS"
         LDFLAGS="$alsa_save_LDFLAGS"
Comment 1 Sam Lantinga 2016-10-08 01:03:25 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/24472af11074