Skip to content

Commit

Permalink
Don't fail if we don't have ALSA available
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 24, 2004
1 parent 1586690 commit 5f326eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
27 changes: 14 additions & 13 deletions acinclude.m4
Expand Up @@ -19,24 +19,22 @@ __EOF__
cat >>$new <$old
])

#
# --- alsa.m4 ---
#
##############################################################################
dnl Configure Paths for Alsa
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
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 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"
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -164,8 +165,7 @@ AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
])



##############################################################################
#
# --- esd.m4 ---
#
Expand Down Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions configure.in
Expand Up @@ -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]],
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5f326eb

Please sign in to comment.