configure.ac: fail when LAME is enabled but not found

Use MPD_AUTO_RESULT(), and set enable_lame to "auto" by default.
This commit is contained in:
Max Kellermann 2009-04-01 22:06:40 +02:00
parent b9a5e78780
commit 20d50ffbc4

View File

@ -521,9 +521,9 @@ AC_ARG_ENABLE(oggvorbis-encoder,
[enable_oggvorbis_encoder=auto]) [enable_oggvorbis_encoder=auto])
AC_ARG_ENABLE(lame, AC_ARG_ENABLE(lame,
AS_HELP_STRING([--disable-lame], AS_HELP_STRING([--enable-lame],
[disable support for mp3 streaming (default: enable)]),, [disable support for mp3 streaming]),,
enable_lame=yes) enable_lame=auto)
dnl dnl
@ -956,10 +956,10 @@ fi
MPD_AUTO_PKG(oggvorbis_encoder, VORBISENC, [vorbisenc], MPD_AUTO_PKG(oggvorbis_encoder, VORBISENC, [vorbisenc],
[Ogg Vorbis encoder], [libvorbisenc not found]) [Ogg Vorbis encoder], [libvorbisenc not found])
if test x$enable_lame = xyes; then if test x$enable_lame != xno; then
AM_PATH_LAME(, AM_PATH_LAME([found_lame=yes], [found_lame=no])
[enable_lame=no; MPD_AUTO_RESULT(lame, [LAME encoder plugin],
AC_MSG_WARN(You need lame -- disabling lame support)]) [LAME not found])
fi fi
AC_SUBST(LAME_CFLAGS) AC_SUBST(LAME_CFLAGS)