summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2005-07-31 14:47:24 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2005-07-31 14:47:24 +0000
commit0e91a5bc3a848675f4043cb9826f8f5f69264531 (patch)
treeac782c9d8965aa00f5646496cee745506efa8951
parent18c5ecf77162abf61b191b30127c47a3c050aac4 (diff)
downloadxine-lib-0e91a5bc3a848675f4043cb9826f8f5f69264531.tar.gz
xine-lib-0e91a5bc3a848675f4043cb9826f8f5f69264531.tar.bz2
Check for ALSA >= 1.0.9 (HAVE_ALSA_1_0_9).
Rework the existing checks (common code) and simplify slightly. CVS patchset: 7703 CVS date: 2005/07/31 14:47:24
-rw-r--r--configure.ac12
-rw-r--r--m4/alsa.m498
2 files changed, 52 insertions, 58 deletions
diff --git a/configure.ac b/configure.ac
index dea08fb7d..da72db3b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1254,12 +1254,16 @@ dnl ---------------------------------------------
AM_PATH_ALSA(0.9.0rc4,
[ AC_DEFINE(HAVE_ALSA,1,[Define this if you have Alsa (libasound) installed])
if test x"$have_alsa09" = "xyes"; then
- AC_DEFINE(HAVE_ALSA09,1,[Define this if you have alsa 0.9.x and more installed])
+ AC_DEFINE(HAVE_ALSA09,1,[Define this if you have ALSA 0.9.x or later installed])
+ fi
+ if test x"$have_alsa_1_0_9" = "xyes"; then
+ AC_DEFINE(HAVE_ALSA_1_0_9,1,[Define this if you have ALSA 1.0.9 or later installed])
fi
],
AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "xyes")
AM_CONDITIONAL(HAVE_ALSA09, test x"$have_alsa09" = "xyes")
+AM_CONDITIONAL(HAVE_ALSA_1_0_9, test x"$have_alsa_1_0_9" = "xyes")
dnl ---------------------------------------------
@@ -2813,8 +2817,10 @@ if test x"$have_ossaudio" = "xyes"; then
echo " - oss (Open Sound System)"
fi
if test x"$no_alsa" != "xyes"; then
- if test x"$have_alsa09" = "xyes"; then
- echo " - alsa (Alsa 0.9.x)"
+ if test x"$have_alsa_1_0_9" = "xyes"; then
+ echo " - alsa (ALSA >= 1.0.9)"
+ elif test x"$have_alsa09" = "xyes"; then
+ echo " - alsa (ALSA >= 0.9, < 1.0.9)"
fi
fi
if test x"$no_esd" != "xyes"; then
diff --git a/m4/alsa.m4 b/m4/alsa.m4
index 6c56d36ed..e74d32175 100644
--- a/m4/alsa.m4
+++ b/m4/alsa.m4
@@ -30,7 +30,46 @@ dnl AC_DEFINE() HAVE_GL,
dnl $no_alsa is set to "yes" if alsa isn't found.
dnl $have_alsa05 is set to "yes" if installed alsa version is <= 0.5
dnl $have_alsa09 is set to "yes" if installed alsa version is >= 0.9
+dnl $have_alsa_1_0_9 is set to "yes" if installed alsa version is >= 1.0.9
dnl
+
+dnl Internal macro XINE_ALSA_CHECK_VERSION
+dnl Usage: XINE_ALSA_CHECK_VERSION(reason, variable name, version test expr.)
+AC_DEFUN([XINE_ALSA_CHECK_VERSION],
+ [
+ AC_MSG_CHECKING([for ALSA $1])
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <$asoundlib_h>
+
+int main() {
+
+ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
+ #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
+ #endif
+ #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
+ #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
+ #endif
+ #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
+ #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
+ #endif
+ #ifndef SND_LIB_VERSION
+ #define SND_LIB_VERSION ((SND_LIB_MAJOR<<16)|(SND_LIB_MINOR<<8)|SND_LIB_SUBMINOR)
+ #endif
+
+ if($3)
+ return 0;
+
+ return 1;
+}
+], [ AC_MSG_RESULT(yes)
+ eval $2=yes ],
+ AC_MSG_RESULT(no),[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ ])
+
AC_DEFUN([AM_PATH_ALSA],
[
AC_ARG_ENABLE(alsa, AC_HELP_STRING([--disable-alsa], [do not build ALSA support]),
@@ -45,6 +84,7 @@ AC_DEFUN([AM_PATH_ALSA],
no_alsa="yes"
have_alsa05="no"
have_alsa09="no"
+ have_alsa_1_0_9="no"
if test x"$enable_alsa" != "xno"; then
@@ -170,64 +210,12 @@ dnl
dnl now check for installed version.
dnl
-dnl
-dnl Check for alsa 0.5.x series
-dnl
- AC_MSG_CHECKING([for ALSA <= 0.5 series])
- AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <$asoundlib_h>
-
-int main() {
-
- #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
- #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
- #endif
- #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
- #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
- #endif
-
- if((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR <= 5))
- return 0;
-
- return 1;
-}
-], [ AC_MSG_RESULT(yes)
- have_alsa05=yes ],
- AC_MSG_RESULT(no),[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-
-dnl
-dnl Check for alsa >= 0.9.x
-dnl
- AC_MSG_CHECKING([for ALSA >= 0.9 series])
- AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <$asoundlib_h>
+XINE_ALSA_CHECK_VERSION([<= 0.5 series], have_alsa05, [SND_LIB_VERSION < 0x000600])
-int main() {
-
- #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
- #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
- #endif
- #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
- #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
- #endif
+XINE_ALSA_CHECK_VERSION([>= 0.9 series], have_alsa09, [SND_LIB_VERSION >= 0x000900])
- if(((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)) ||
- ((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0)))
- return 0;
+XINE_ALSA_CHECK_VERSION([>= 1.0.9], have_alsa_1_0_9, [SND_LIB_VERSION >= 0x010009])
- return 1;
-}
-], [ AC_MSG_RESULT(yes)
- have_alsa09=yes ],
- AC_MSG_RESULT(no),[echo $ac_n "cross compiling; assumed OK... $ac_c"])
dnl
dnl Version checking done.
dnl