1
# CFLAGS and library paths for FFMPEG
2
# taken from Autostar Sandbox, http://autostars.sourceforge.net/
5
dnl AM_PATH_FFMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
6
dnl FIXME: version checking does not work currently
9
dnl AM_PATH_FFMPEG(0.4.6, , AC_MSG_ERROR([*** FFMPEG >= 0.4.6 not installed))
11
dnl Defines FFMPEG_LIBS
12
dnl FIXME: should define FFMPEG_VERSION
15
AC_DEFUN([AM_PATH_FFMPEG],
17
dnl allow for specification of a source path (for uninstalled)
18
AC_ARG_WITH(ffmpeg-source,
19
AC_HELP_STRING([--with-ffmpeg-source=DIR],
20
[Directory where FFmpeg source is (optional)]),
21
ffmpeg_source="$withval")
23
dnl save CFLAGS and LIBS here
26
if test "x$ffmpeg_source" != "x"; then
27
dnl uninstalled FFmpeg copy
28
AC_MSG_NOTICE([Looking for FFmpeg source in $ffmpeg_source])
29
CFLAGS="-I$ffmpeg_source/libav -I$ffmpeg_source/libavcodec"
30
LIBS="-L$ffmpeg_source/libav -L$ffmpeg_source/libavcodec"
31
AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED, 1,
32
[defined if we compile against uninstalled FFmpeg])
33
FFMPEG_COMMON_INCLUDE="#include <common.h>"
35
FFMPEG_COMMON_INCLUDE="#include <ffmpeg/common.h>"
38
dnl check for libavcodec
39
AC_CHECK_LIB(avcodec, avcodec_init, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
41
dnl check for avcodec.h and avformat.h
42
if test "x$ffmpeg_source" != "x"; then
44
AC_CHECK_HEADER(avcodec.h, , HAVE_FFMPEG=no, [/* only compile */])
45
AC_CHECK_HEADER(avformat.h, , HAVE_FFMPEG=no, [/* only compile */])
47
AC_CHECK_HEADER(ffmpeg/avcodec.h, , HAVE_FFMPEG=no)
48
AC_CHECK_HEADER(ffmpeg/avformat.h, , HAVE_FFMPEG=no)
51
dnl now check if it's sufficiently new
56
dnl FIXME: we use strcmp, which we know is going to break if ffmpeg ever uses
57
dnl two digits for any of their version numbers. It makes the test so much
58
dnl easier though so let's ignore that
60
$FFMPEG_COMMON_INCLUDE
67
if (strcmp (FFMPEG_VERSION, "$1") == -1)
70
"ERROR: your copy of ffmpeg is too old (%s)\n", FFMPEG_VERSION);
78
dnl now do the actual "do we have it ?" test
79
if test "x$HAVE_FFMPEG" = "xyes"; then
80
FFMPEG_LIBS="$LIBS -lavcodec -lavformat"
81
FFMPEG_CFLAGS="$CFLAGS"
82
AC_MSG_NOTICE(we have ffmpeg)
83
dnl execute what we have to because it's found
84
ifelse([$2], , :, [$2])
88
dnl execute what we have to because it's not found
89
ifelse([$3], , :, [$3])
92
dnl make variables available
94
AC_SUBST(FFMPEG_CFLAGS)