From b2af90dcb6fa6cd2bf86928dd58bd2817a6d8a21 Mon Sep 17 00:00:00 2001 From: Richard Boulton Date: Tue, 29 May 2001 12:31:21 +0000 Subject: [PATCH] Simplify alsa checking: we can use the standard AM_PATH_ALSA macro to check that we don't have alsa 0.9.x: we just ne... Original commit message from CVS: Simplify alsa checking: we can use the standard AM_PATH_ALSA macro to check that we don't have alsa 0.9.x: we just need to specify something for ACTION_NOT_FOUND to override the default AC_MSG_ERROR behaviour, so I've put a colon for ACTION_NOT_FOUND. ;-) Also, update the alsa macro in acinclude with the latest from the alsa project CVS. --- acinclude.m4 | 6 ++++++ configure.ac | 32 ++++---------------------------- configure.in | 32 ++++---------------------------- 3 files changed, 14 insertions(+), 56 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 28c178a305..0c3ea11deb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -53,6 +53,9 @@ fi dnl add the alsa library ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/ //'` LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) @@ -122,6 +125,9 @@ AC_CHECK_LIB([asound], [snd_defaults_card],, if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" fi if test "x$alsa_found" = "xno" ; then ifelse([$3], , :, [$3]) diff --git a/configure.ac b/configure.ac index 4a24d70dc4..316705af4e 100644 --- a/configure.ac +++ b/configure.ac @@ -254,37 +254,13 @@ dnl AM_PATH_XMMS(0.1.0, HAVE_LIBXMMS=yes, HAVE_LIBXMMS=no) dnl Check for libasound alsa_save_LIBS=$LIBS alsa_save_CFLAGS=$CFLAGS -AM_PATH_ALSA(0.5.0, HAVE_LIBASOUND=yes, +AM_PATH_ALSA(0.5.0, HAVE_LIBASOUND=yes, HAVE_LIBASOUND=no) +AM_PATH_ALSA(0.9.0, HAVE_LIBASOUND=no - AC_MSG_WARN( -***** NOTE: These plugins won't be built: gstalsa -)) -if test x$HAVE_LIBASOUND = xyes;then - AC_MSG_CHECKING(alsa libs == 0.5.x, not 0.9.x) - AC_TRY_COMPILE([ -#include -], [ -#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) -#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR -#endif - -void main(void) { - // succeed only if it's 0.5.x -#if (SND_LIB_MINOR == 5) - exit(0); -#else -#error not 0.5.x -#endif - - exit(1); -} -],AC_MSG_RESULT(0.5.x), - AC_MSG_RESULT(no) - AC_MSG_WARN( + AC_MSG_WARN(Alsa 0.9.x not yet supported. ***** NOTE: These plugins won't be built: gstalsa ) - HAVE_LIBASOUND=no) -fi + ,:) LIBS=$alsa_save_LIBS CFLAGS=$alsa_save_CFLAGS diff --git a/configure.in b/configure.in index 44277417dd..427a43b932 100644 --- a/configure.in +++ b/configure.in @@ -251,37 +251,13 @@ dnl AM_PATH_XMMS(0.1.0, HAVE_LIBXMMS=yes, HAVE_LIBXMMS=no) dnl Check for libasound alsa_save_LIBS=$LIBS alsa_save_CFLAGS=$CFLAGS -AM_PATH_ALSA(0.5.0, HAVE_LIBASOUND=yes, +AM_PATH_ALSA(0.5.0, HAVE_LIBASOUND=yes, HAVE_LIBASOUND=no) +AM_PATH_ALSA(0.9.0, HAVE_LIBASOUND=no - AC_MSG_WARN( -***** NOTE: These plugins won't be built: gstalsa -)) -if test x$HAVE_LIBASOUND = xyes;then - AC_MSG_CHECKING(alsa libs == 0.5.x, not 0.9.x) - AC_TRY_COMPILE([ -#include -], [ -#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) -#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR -#endif - -void main(void) { - // succeed only if it's 0.5.x -#if (SND_LIB_MINOR == 5) - exit(0); -#else -#error not 0.5.x -#endif - - exit(1); -} -],AC_MSG_RESULT(0.5.x), - AC_MSG_RESULT(no) - AC_MSG_WARN( + AC_MSG_WARN(Alsa 0.9.x not yet supported. ***** NOTE: These plugins won't be built: gstalsa ) - HAVE_LIBASOUND=no) -fi + ,:) LIBS=$alsa_save_LIBS CFLAGS=$alsa_save_CFLAGS