[Swfdec] [PATCH] Fix logic in ffmpeg detection

Pavel Roskin proski at gnu.org
Thu Oct 25 09:56:11 PDT 2007


If neither --enable-ffmpeg nor --disable-ffmpeg was given, try to find
ffmpeg.  If it wasn't found, print the warning, but don't fail.

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

It's important that ffmpeg is not viewed as 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 97d474b..918de8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,20 +212,20 @@ dnl  Or you submit a patch that detects ffmpeg reliably on the distros.
 AC_ARG_ENABLE(ffmpeg,
 	AS_HELP_STRING([--enable-ffmpeg],
 			[enable ffmpeg support (default=yes)])],
-	enable_ffmpeg=$enableval,
-	enable_ffmpeg="yes")
+	enable_ffmpeg=$enableval)
 
-if test "$enable_ffmpeg" = "yes"; then
+if test "$enable_ffmpeg" != "no"; then
 	PKG_CHECK_MODULES(FFMPEG, libavcodec libswscale, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
 	AC_SUBST(FFMPEG_CFLAGS)
 	AC_SUBST(FFMPEG_LIBS)
 	if test "x$HAVE_FFMPEG" = xyes; then
 	  AC_DEFINE(HAVE_FFMPEG, 1, [Define if ffmpeg is enabled])
 	else
-	  AC_MSG_ERROR([Couldn't find ffmpeg. You might need to install the libavcodec-dev and libswscale-dev packages.])
+	  AC_MSG_WARN([Couldn't find ffmpeg. You might need to install the libavcodec-dev and libswscale-dev packages.])
+	  if test "$enable_ffmpeg" = "yes"; then
+	    AC_MSG_ERROR([Cannot enable ffmpeg support, aborting.])
+	  fi
 	fi
-else
-	AC_MSG_WARN([*** ffmpeg support was not enabled. ***])
 fi
 AM_CONDITIONAL(HAVE_FFMPEG, [test "x$HAVE_FFMPEG" = xyes])
 AC_ARG_ENABLE(gstreamer,


More information about the Swfdec mailing list