From: Andre Noll Date: Mon, 7 Jan 2008 16:50:15 +0000 (+0100) Subject: configure.ac: Improve alsa checks. X-Git-Tag: v0.3.0~10 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=d0f57b4ec3bdc0074010df66cc347165a42a7c01;p=paraslash.git configure.ac: Improve alsa checks. On non-Linux systems, do not check for alsa, and do not print the warning message stating that alsa could not be found. Also, skip further alsa-checks on the first failure. --- diff --git a/configure.ac b/configure.ac index 8e9ca7d0..6c555538 100644 --- a/configure.ac +++ b/configure.ac @@ -36,8 +36,6 @@ AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h limits.h netdb.h netinet/in.h \ sys/ipc.h unistd.h utime.h stddef.h], [], [AC_MSG_ERROR([$ac_header not found])]) -AC_CHECK_HEADER(linux/soundcard.h, [extras="$extras para_fade"], - [AC_MSG_WARN([linux/soundcard.h not found, cannot build para_fade])]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -427,15 +425,34 @@ have_alsa="yes" OLD_CPPFLAGS="$CPPFLAGS" OLD_LD_FLAGS="$LDFLAGS" OLD_LIBS="$LIBS" -msg="=> no alsa support for para_audiod/para_write" -AC_CHECK_HEADERS([alsa/asoundlib.h], [], [ - AC_MSG_WARN([no alsa/asoundlib $msg]) +if test "$OSTYPE" != "Linux"; then have_alsa="no" -]) -AC_CHECK_LIB([asound], [snd_pcm_open], [], [ - AC_MSG_WARN([no libasound $msg]) - have_alsa="no" -]) +fi +msg="=> can not build para_fade, and no alsa support for para_audiod/para_write" +if test "$have_alsa" = "yes"; then + AC_CHECK_HEADER(linux/soundcard.h, + [extras="$extras para_fade"], + [ + have_alsa="no" + AC_MSG_WARN([no linux/soundcard.h $msg]) + ] + ) +fi + +if test "$have_alsa" = "yes"; then + AC_CHECK_HEADERS([alsa/asoundlib.h], [], [ + have_alsa="no" + AC_MSG_WARN([no alsa/asoundlib $msg]) + ]) +fi + +if test "$have_alsa" = "yes"; then + AC_CHECK_LIB([asound], [snd_pcm_open], [], [ + have_alsa="no" + AC_MSG_WARN([no libasound $msg]) + ]) +fi + if test "$have_alsa" = "yes"; then all_errlist_objs="$all_errlist_objs alsa_write" audiod_errlist_objs="$audiod_errlist_objs alsa_write"