summaryrefslogtreecommitdiff
blob: 323913e296f6f0d17c60bf301585b664cc7aabf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 27a4e1f6a5b50e35af8fa29f9cd9fabf5ee777bd Mon Sep 17 00:00:00 2001
From: Benjamin Wolsey <bwy@benjaminwolsey.de>
Date: Fri, 01 Apr 2011 11:15:47 +0000
Subject: FFmpeg trunk uses libavcodec/version.h to store the version.

---
diff --git a/macros/ffmpeg.m4 b/macros/ffmpeg.m4
index 4eb68c2..85f11b8 100644
--- a/macros/ffmpeg.m4
+++ b/macros/ffmpeg.m4
@@ -22,6 +22,7 @@ AC_DEFUN([GNASH_PATH_FFMPEG],
   backupLIBS="$LIBS"
   backupCFLAGS="$CFLAGS"
   avcodec_h=""
+  avcodec_version_h=""
   ffmpeg_top_incl=""
 
   dnl If the user specify an path to include headers from, we assume it's the full
@@ -46,6 +47,9 @@ AC_DEFUN([GNASH_PATH_FFMPEG],
       else
         AC_MSG_ERROR([${with_ffmpeg_incl} directory does not contain the avcodec.h header])
       fi
+      if test -f ${with_ffmpeg_incl}/version.h; then
+        avcodec_version_h=${with_ffmpeg_incl}/version.h
+      fi
     fi
   ])
 
@@ -182,14 +186,24 @@ AC_DEFUN([GNASH_PATH_FFMPEG],
   dnl a modified form of grepping may be better, making sure all old kinds of
   dnl version numbering fail gracefully.
 
+  versionfile=""
+
   dnl Check avcodec version number, if it was found
-  if test x"${avcodec_h}" != x; then
+  if test x"${avcodec_version_h}" != x; then
+    versionfile=${avcodec_version_h}
+  else
+    if test x"${avcodec_h}" != x; then
+      versionfile=${avcodec_h}
+    fi
+  fi
+
+  if test x"${versionfile}" != x; then
 
     AC_MSG_CHECKING([ffmpeg version])
 
-    ffmpeg_major_version=`$EGREP "define LIBAVCODEC_VERSION_MAJOR " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"`
-    ffmpeg_minor_version=`$EGREP "define LIBAVCODEC_VERSION_MINOR " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"`
-    ffmpeg_micro_version=`$EGREP "define LIBAVCODEC_VERSION_MICRO " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"`
+    ffmpeg_major_version=`$EGREP "define LIBAVCODEC_VERSION_MAJOR " ${versionfile} | sed -e "s%[[^0-9]]%%g"`
+    ffmpeg_minor_version=`$EGREP "define LIBAVCODEC_VERSION_MINOR " ${versionfile} | sed -e "s%[[^0-9]]%%g"`
+    ffmpeg_micro_version=`$EGREP "define LIBAVCODEC_VERSION_MICRO " ${versionfile} | sed -e "s%[[^0-9]]%%g"`
 
     if test x"${ffmpeg_major_version}" != x ; then
 
@@ -198,15 +212,15 @@ AC_DEFUN([GNASH_PATH_FFMPEG],
     else
 
       dnl #define LIBAVCODEC_VERSION_TRIPLET 51,50,1
-      ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION_TRIPLET " ${avcodec_h} | awk '{print $'3'}' | sed -e "s%,%.%g"`
+      ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION_TRIPLET " ${versionfile} | awk '{print $'3'}' | sed -e "s%,%.%g"`
 
       if test x"${ffmpeg_version}" = x ; then
 
         dnl NOTE: the [0-9]*d. pattern discards deb-heads rubbish prefix
-        ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION " ${avcodec_h} | awk '{print $'3'}' | sed -e "s%^[[0-9]]d\.%%"` 
+        ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION " ${versionfile} | awk '{print $'3'}' | sed -e "s%^[[0-9]]d\.%%"` 
 
         if test x"${ffmpeg_version}" = x ; then
-          ffmpeg_version=`$EGREP "define LIBAVCODEC_BUILD " ${avcodec_h} | awk '{print $'3'}'`
+          ffmpeg_version=`$EGREP "define LIBAVCODEC_BUILD " ${versionfile} | awk '{print $'3'}'`
         fi
       fi
 
--
cgit v0.8.3.4