From 5f326ebfd8582acd536c640234f1a1224cfb3b6b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 24 Aug 2004 06:32:50 +0000 Subject: [PATCH] Don't fail if we don't have ALSA available --- acinclude.m4 | 27 ++++++++++++++------------- configure.in | 8 +++----- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index becbac576..afd60019e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -19,24 +19,22 @@ __EOF__ cat >>$new <$old ]) -# -# --- alsa.m4 --- -# +############################################################################## dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela -dnl Last modification: alsa.m4,v 1.22 2002/05/27 11:14:20 tiwai Exp +dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. dnl enables arguments --with-alsa-prefix= dnl --with-alsa-enc-prefix= -dnl --disable-alsatest (this has no effect, as yet) +dnl --disable-alsatest dnl dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. dnl -AC_DEFUN(AM_PATH_ALSA, +AC_DEFUN([AM_PATH_ALSA], [dnl Save the original CFLAGS, LDFLAGS, and LIBS alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" @@ -57,7 +55,7 @@ AC_ARG_WITH(alsa-inc-prefix, dnl FIXME: this is not yet implemented AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], -[enable_alsatest=no], +[enable_alsatest="$enableval"], [enable_alsatest=yes]) dnl Add any special include directories @@ -140,17 +138,20 @@ exit(0); AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. +if test "x$enable_alsatest" = "xyes"; then AC_CHECK_LIB([asound], [snd_ctl_open],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) alsa_found=no] ) +fi -CFLAGS="$alsa_save_CFLAGS" -LDFLAGS="$alsa_save_LDFLAGS" -LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) -else + 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]) CFLAGS="$alsa_save_CFLAGS" LDFLAGS="$alsa_save_LDFLAGS" @@ -164,8 +165,7 @@ AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) ]) - - +############################################################################## # # --- esd.m4 --- # @@ -334,6 +334,7 @@ int main () rm -f conf.esdtest ]) +############################################################################## # Based on libtool-1.5.8 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 diff --git a/configure.in b/configure.in index 722c8feb9..7073bf1d3 100644 --- a/configure.in +++ b/configure.in @@ -282,8 +282,7 @@ CheckALSA() [ --enable-alsa support the ALSA audio API [default=yes]], , enable_alsa=yes) if test x$enable_audio = xyes -a x$enable_alsa = xyes; then - have_alsa=no - AM_PATH_ALSA(0.9.0, have_alsa=yes) + AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no) if test x$have_alsa = xyes; then AC_ARG_ENABLE(alsa-shared, [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]], @@ -364,9 +363,8 @@ CheckESD() [ --enable-esd support the Enlightened Sound Daemon [default=yes]], , enable_esd=yes) if test x$enable_audio = xyes -a x$enable_esd = xyes; then - use_esd=no - AM_PATH_ESD(0.2.8, use_esd=yes) - if test x$use_esd = xyes; then + AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) + if test x$have_esd = xyes; then AC_ARG_ENABLE(esd-shared, [ --enable-esd-shared dynamically load ESD audio support [default=yes]], , enable_esd_shared=yes)