1
# Configure paths for libavcodec
2
# Burkhard Plaum, 2004-08-12
4
dnl Compile an avcodec test program and figure out the version
6
AC_DEFUN([ACL_CHECK_AVCODEC],[
7
AC_MSG_CHECKING([for build ID in libavcodec, libs: $AVCODEC_LIBS])
11
CFLAGS="$GMERLIN_DEP_CFLAGS $CFLAGS $AVCODEC_CFLAGS"
12
LIBS="$GMERLIN_DEP_LIBS $AVCODEC_LIBS"
20
#include <libavcodec/avcodec.h>],[], [found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>" ],)
22
if test $found_header = "false"; then
24
#include <avcodec.h>],[],[found_header="true";AVCODEC_HEADER="<avcodec.h>"])
27
if test $found_header = "false"; then
29
#include <ffmpeg/avcodec.h>],[], [found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>" ],)
35
#include $AVCODEC_HEADER
39
if(LIBAVCODEC_BUILD < $1)
41
output=fopen("avcodec_version", "w");
42
fprintf(output, AV_TOSTRING(LIBAVCODEC_VERSION));
48
# program could be run
49
if test "x$AVCODEC_VERSION" = "x"; then
50
AVCODEC_VERSION=`cat avcodec_version`
57
# program could not be run
64
dnl ACL_PATH_AVCODEC(BUILD_ID [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
65
dnl Test for libavcodec, and define AVCODEC_CFLAGS, AVCODEC_LIBS and
68
AC_DEFUN([ACL_PATH_AVCODEC],[
69
AC_ARG_WITH(avcodec,[ --with-avcodec=PFX Prefix where libavcodec is installed (optional)], avcodec_prefix="$withval", avcodec_prefix="")
70
dnl We need the _save variables because PKG_CHECK_MODULES will change
71
dnl the other variables
72
AVCODEC_CFLAGS_save=""
76
AH_TEMPLATE([AVCODEC_HEADER],
77
[Header for libavcodec])
80
dnl First preference: configure options
83
if test "x$avcodec_prefix" != x; then
84
AVCODEC_CFLAGS="-I$avcodec_prefix/include"
85
AVCODEC_LIBS="-L$avcodec_prefix/lib -lavcodec"
86
ACL_CHECK_AVCODEC([$1])
87
if test "x$avcodec_ok" = "xtrue"; then
93
dnl Second Perference: Autodetect
96
if test "x$avcodec_done" = "xfalse"; then
97
PKG_CHECK_MODULES(AVCODEC, libavcodec, avcodec_orig="true", avcodec_orig="false")
98
ACL_CHECK_AVCODEC([$1])
99
if test "x$avcodec_ok" = "xtrue"; then
104
if test "x$avcodec_done" = "xtrue"; then
105
ifelse([$2], , :, [$2])
106
AC_DEFINE_UNQUOTED(AVCODEC_HEADER, $AVCODEC_HEADER)
108
ifelse([$3], , :, [$3])