]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Use Subversion revision for FFMPEG_VERSION.
authordiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 20 Jun 2006 10:24:08 +0000 (10:24 +0000)
committerdiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 20 Jun 2006 10:24:08 +0000 (10:24 +0000)
based on a patch by Ismail Dönmez ismail$$at$$pardus$$dot$$org$$dot$$tr

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5502 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

Makefile
ffmpeg.c
ffplay.c
ffserver.c
libavcodec/avcodec.h
version.sh [new file with mode: 0755]

index a3b94a59b6bd1749dd3f2861c45691bcf115cc6a..8335a8716fc935d06f02597b9701e1676568664f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,7 @@ SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
 FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil
 FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF)
 
-all: lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
+all: version.h lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
 
 lib:
        $(MAKE) -C libavutil   all
@@ -90,6 +90,10 @@ ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
        cp -p $< $@
        $(STRIP) $@
 
+.PHONY: version.h
+version.h:
+       $(SRC_PATH)/version.sh
+
 output_example$(EXESUF): output_example.o .libs
        $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
 
@@ -220,7 +224,7 @@ distclean: clean
        $(MAKE) -C libpostproc distclean
        $(MAKE) -C tests       distclean
        $(MAKE) -C vhook       distclean
-       rm -f .depend config.mak config.h *.pc
+       rm -f .depend config.mak config.h version.h *.pc
 
 TAGS:
        etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
index 6653c78a9a8f5e72f00d94dce5a1a97065ef8a80..3834ff6480ee3e15826ed3c1ef4284025e69c070 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -40,6 +40,7 @@
 #undef time //needed because HAVE_AV_CONFIG_H is defined on top
 #include <time.h>
 
+#include "version.h"
 #include "cmdutils.h"
 
 #undef NDEBUG
index 8cffa8f704e6ad34191a109f15fdab200fdd4dcb..7dc5c6033bda108efa9dbf74aec22d416e64578f 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -19,6 +19,7 @@
 #define HAVE_AV_CONFIG_H
 #include "avformat.h"
 
+#include "version.h"
 #include "cmdutils.h"
 
 #include <SDL.h>
index 4fe7b032d71c0d23f538c0445eb7524991bc00f9..cb44f61586b684a260fe117ae5ddf60b3924cde6 100644 (file)
@@ -39,6 +39,7 @@
 #include <dlfcn.h>
 #endif
 
+#include "version.h"
 #include "ffserver.h"
 
 /* maximum number of simultaneous HTTP connections */
index d128cb9c1824f8ac3bd350156ae790ca4afc8b53..52283aa34bcc4a1cd39725ad5d7256f37128fbe4 100644 (file)
@@ -14,9 +14,8 @@ extern "C" {
 #include "avutil.h"
 #include <sys/types.h> /* size_t */
 
-//FIXME the following 2 really dont belong in here
+//FIXME: This really doesn't belong in here..
 #define FFMPEG_VERSION_INT      0x000409
-#define FFMPEG_VERSION          "HEAD"
 
 #define AV_STRINGIFY(s)         AV_TOSTRING(s)
 #define AV_TOSTRING(s) #s
diff --git a/version.sh b/version.sh
new file mode 100755 (executable)
index 0000000..cfed406
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+svn_revision=`svn info | grep Revision | cut -d' ' -f2 || echo UNKNOWN`
+NEW_REVISION="#define FFMPEG_VERSION \"SVN-r$svn_revision\""
+OLD_REVISION=`cat version.h 2> /dev/null`
+
+# Update version.h only on revision changes to avoid spurious rebuilds
+if test "$NEW_REVISION" != "$OLD_REVISION"; then
+    echo "$NEW_REVISION" > version.h
+fi