2009-05-08 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / m4 / ffmpeg.m4
blobe37c335e5cf65de1b9796bbcc06265333f7b6b63
1 AC_DEFUN([MOONLIGHT_CHECK_FFMPEG],
3         AC_ARG_WITH(ffmpeg, AC_HELP_STRING([--with-ffmpeg=yes|no],
4                 [If you want to enable support for ffmpeg]),
5                 [], [with_ffmpeg=yes])
7         if test x$with_ffmpeg = xyes; then
8                 if pkg-config --exists libavutil libavcodec; then
9                 AC_DEFINE([INCLUDE_FFMPEG], [1], [Include support for ffmpeg])
10                         PKG_CHECK_MODULES(FFMPEG, [libavutil libavcodec])
11                         save_CFLAGS=$CFLAGS
12                         CFLAGS="$FFMPEG_CFLAGS $CFLAGS"
13                         AC_CHECK_HEADERS([libavcodec/avcodec.h])
14                         CFLAGS=$save_CFLAGS
15                 else
16                         with_ffmpeg=no
17                         ffmpeg_reason="(reason: could not find libavutil and libavcodec packages)"
18                 fi
19         fi
21         AM_CONDITIONAL(INCLUDE_FFMPEG, test x$with_ffmpeg = xyes)
23         if test x$with_ffmpeg = no; then
24                 media_warning="WARNING: No media decoding backends configured.  AUDIO AND VIDEO WON'T WORK"
25         fi