configure.ac: fail if FLAC was enabled explicitly, but not found

This commit is contained in:
Max Kellermann 2011-09-01 18:37:40 +02:00
parent 596f36bb78
commit 446f9973cc

View File

@ -171,9 +171,9 @@ AC_ARG_ENABLE(fifo,
enable_fifo=yes) enable_fifo=yes)
AC_ARG_ENABLE(flac, AC_ARG_ENABLE(flac,
AS_HELP_STRING([--disable-flac], AS_HELP_STRING([--enable-flac],
[disable flac support (default: enable)]),, [enable FLAC decoder]),,
enable_flac=yes) enable_flac=auto)
AC_ARG_ENABLE(fluidsynth, AC_ARG_ENABLE(fluidsynth,
AS_HELP_STRING([--enable-fluidsynth], AS_HELP_STRING([--enable-fluidsynth],
@ -750,10 +750,12 @@ fi
AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes) AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
dnl ----------------------------------- FLAC ---------------------------------- dnl ----------------------------------- FLAC ----------------------------------
MPD_AUTO_PKG(flac, FLAC, [flac >= 1.1],
[FLAC decoder], [libFLAC not found])
if test x$enable_flac = xyes; then if test x$enable_flac = xyes; then
PKG_CHECK_MODULES(FLAC, [flac >= 1.1], AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support])
AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]),
enable_flac=no)
oldcflags="$CFLAGS" oldcflags="$CFLAGS"
oldlibs="$LIBS" oldlibs="$LIBS"