Don't fail if we don't have ALSA available

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40949
This commit is contained in:
Sam Lantinga 2004-08-24 06:32:50 +00:00
parent 6be22e6739
commit bc515ab0b8
2 changed files with 17 additions and 18 deletions

View file

@ -19,24 +19,22 @@ __EOF__
cat >>$new <$old cat >>$new <$old
]) ])
# ##############################################################################
# --- alsa.m4 ---
#
dnl Configure Paths for Alsa dnl Configure Paths for Alsa
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org> dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
dnl Christopher Lansdown <lansdoct@cs.alfred.edu> dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
dnl Jaroslav Kysela <perex@suse.cz> dnl Jaroslav Kysela <perex@suse.cz>
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 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 Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
dnl enables arguments --with-alsa-prefix= dnl enables arguments --with-alsa-prefix=
dnl --with-alsa-enc-prefix= dnl --with-alsa-enc-prefix=
dnl --disable-alsatest (this has no effect, as yet) dnl --disable-alsatest
dnl dnl
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, 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 and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
dnl dnl
AC_DEFUN(AM_PATH_ALSA, AC_DEFUN([AM_PATH_ALSA],
[dnl Save the original CFLAGS, LDFLAGS, and LIBS [dnl Save the original CFLAGS, LDFLAGS, and LIBS
alsa_save_CFLAGS="$CFLAGS" alsa_save_CFLAGS="$CFLAGS"
alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LDFLAGS="$LDFLAGS"
@ -57,7 +55,7 @@ AC_ARG_WITH(alsa-inc-prefix,
dnl FIXME: this is not yet implemented dnl FIXME: this is not yet implemented
AC_ARG_ENABLE(alsatest, AC_ARG_ENABLE(alsatest,
[ --disable-alsatest Do not try to compile and run a test Alsa program], [ --disable-alsatest Do not try to compile and run a test Alsa program],
[enable_alsatest=no], [enable_alsatest="$enableval"],
[enable_alsatest=yes]) [enable_alsatest=yes])
dnl Add any special include directories dnl Add any special include directories
@ -140,17 +138,20 @@ exit(0);
AC_LANG_RESTORE 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. 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],, AC_CHECK_LIB([asound], [snd_ctl_open],,
[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
alsa_found=no] alsa_found=no]
) )
fi
CFLAGS="$alsa_save_CFLAGS"
LDFLAGS="$alsa_save_LDFLAGS"
LIBS="$alsa_save_LIBS"
if test "x$alsa_found" = "xyes" ; then if test "x$alsa_found" = "xyes" ; then
ifelse([$2], , :, [$2]) 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]) ifelse([$3], , :, [$3])
CFLAGS="$alsa_save_CFLAGS" CFLAGS="$alsa_save_CFLAGS"
LDFLAGS="$alsa_save_LDFLAGS" LDFLAGS="$alsa_save_LDFLAGS"
@ -164,8 +165,7 @@ AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS) AC_SUBST(ALSA_LIBS)
]) ])
##############################################################################
# #
# --- esd.m4 --- # --- esd.m4 ---
# #
@ -334,6 +334,7 @@ int main ()
rm -f conf.esdtest rm -f conf.esdtest
]) ])
##############################################################################
# Based on libtool-1.5.8 # Based on libtool-1.5.8
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004

View file

@ -282,8 +282,7 @@ CheckALSA()
[ --enable-alsa support the ALSA audio API [default=yes]], [ --enable-alsa support the ALSA audio API [default=yes]],
, enable_alsa=yes) , enable_alsa=yes)
if test x$enable_audio = xyes -a x$enable_alsa = xyes; then if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
have_alsa=no AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
AM_PATH_ALSA(0.9.0, have_alsa=yes)
if test x$have_alsa = xyes; then if test x$have_alsa = xyes; then
AC_ARG_ENABLE(alsa-shared, AC_ARG_ENABLE(alsa-shared,
[ --enable-alsa-shared dynamically load ALSA audio support [default=yes]], [ --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 support the Enlightened Sound Daemon [default=yes]],
, enable_esd=yes) , enable_esd=yes)
if test x$enable_audio = xyes -a x$enable_esd = xyes; then if test x$enable_audio = xyes -a x$enable_esd = xyes; then
use_esd=no AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
AM_PATH_ESD(0.2.8, use_esd=yes) if test x$have_esd = xyes; then
if test x$use_esd = xyes; then
AC_ARG_ENABLE(esd-shared, AC_ARG_ENABLE(esd-shared,
[ --enable-esd-shared dynamically load ESD audio support [default=yes]], [ --enable-esd-shared dynamically load ESD audio support [default=yes]],
, enable_esd_shared=yes) , enable_esd_shared=yes)