dnl === libmad MPEG decoder check - begin ===
AC_ARG_WITH(
	libmad, 
	AS_HELP_STRING([--without-libmad], [build K3b without libmad support (default=no)]), 
	[ac_cv_use_libmad=$withval], 
	[ac_cv_use_libmad=yes]
)

if test "$ac_cv_use_libmad" = "yes"; then
  MAD_LIB=""
  KDE_CHECK_HEADER(mad.h, [
	KDE_CHECK_LIB(mad, mad_synth_frame, [
		MAD_LIB="-lmad"
		AC_DEFINE(HAVE_LIBMAD,1,[defined if you have libmad headers and libraries])],
		[],
		$all_libraries
	)
  ])
  AC_SUBST(MAD_LIB)

fi

AM_CONDITIONAL(include_MP3, [test -n "$MAD_LIB"])
dnl === libmad MPeg decoder check - end ===
