[Swfdec] [PATCH] Fix logic in mad detection

Pavel Roskin proski at gnu.org
Thu Oct 25 10:07:11 PDT 2007


If neither --enable-mad nor --disable-mad was given, try to find mad.
If it wasn't found, warn the user, but don't fail.

If --enable-mad was given, fail if mad is not found.  If --disable-mad
was given, don't warn the user, as the user already knows that mad won't
be enabled.

mad is not and should not be considered a hard requirement, as it's
absent in most distros due to patent problems.

Signed-off-by: Pavel Roskin <proski at gnu.org>
---

 configure.ac |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/configure.ac b/configure.ac
index 918de8f..9c0576e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,19 +189,19 @@ fi
 AC_ARG_ENABLE(mad,
 	AS_HELP_STRING([--enable-mad],
 			[enable mad audio (default=yes)])],
-	enable_mad=$enableval,
-	enable_mad="yes")
+	enable_mad=$enableval)
 
-if test "$enable_mad" = "yes"; then
+if test "$enable_mad" != "no"; then
 	AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no")
 	AC_SUBST(MAD_LIBS)
 	if test "x$HAVE_MAD" = xyes; then
 	  AC_DEFINE(HAVE_MAD, 1, [Define if mad is enabled])
 	else
-	  AC_MSG_ERROR([Couldn't find mad. You might need to install the libmad0-dev package.])
+	  AC_MSG_WARN([Couldn't find mad. You might need to install the libmad0-dev package.])
+	  if test "$enable_mad" = "yes"; then
+	    AC_MSG_ERROR([Cannot enable mad support, aborting.])
+	  fi
 	fi
-else
-	AC_MSG_WARN([*** mad audio support was not enabled. ***])
 fi
 AM_CONDITIONAL(HAVE_MAD, [test "x$HAVE_MAD" = xyes])
 


More information about the Swfdec mailing list