diff options
author | Max Kellermann <max@duempel.org> | 2009-03-28 11:10:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-28 11:10:40 +0100 |
commit | 53ed647b224c98f74a3198215f9fa2fd1a359eb9 (patch) | |
tree | ec038560dd0f440d951d075b12e8263bafdf5be0 /configure.ac | |
parent | 80e2aaf3792fa662397005e72603d7e0c9e62dfc (diff) | |
download | mpd-53ed647b224c98f74a3198215f9fa2fd1a359eb9.tar.gz mpd-53ed647b224c98f74a3198215f9fa2fd1a359eb9.tar.xz mpd-53ed647b224c98f74a3198215f9fa2fd1a359eb9.zip |
configure.ac: fail when ALSA is enabled but not found
This patch adds a small autoconf M4 library which deals with
auto-detected features. The default for those features is "auto",
which is like the old default: if the library is present on the
system, enable the feature, disable otherwise. If the user explicitly
enables that feature (--enable-alsa), and the library is not present,
configure must fail, because it cannot fulfill the request.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 886ee9431..509ec81eb 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,7 @@ dnl AC_ARG_ENABLE(alsa, AS_HELP_STRING([--disable-alsa], [disable ALSA support (default: enable)]),, - enable_alsa=yes) + enable_alsa=auto) AC_ARG_ENABLE(ao, AS_HELP_STRING([--enable-ao], @@ -687,10 +687,15 @@ fi AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes) -if test x$enable_alsa = xyes; then +if test x$enable_alsa != xno; then PKG_CHECK_MODULES(ALSA, [alsa >= 0.9.0], - AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support]), - enable_alsa=no) + found_alsa=yes, found_alsa=no) +fi + +MPD_AUTO_RESULT([alsa], [ALSA output plugin], [libasound not found]) + +if test x$enable_alsa = xyes; then + AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support]) fi AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes) |