based on a patch by Ismail Dönmez ismail$$at$$pardus$$dot$$org$$dot$$tr Originally committed as revision 5502 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
@@ -67,7 +67,7 @@ SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) | |||||
FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil | FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil | ||||
FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) | 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: | lib: | ||||
$(MAKE) -C libavutil all | $(MAKE) -C libavutil all | ||||
@@ -90,6 +90,10 @@ ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs | |||||
cp -p $< $@ | cp -p $< $@ | ||||
$(STRIP) $@ | $(STRIP) $@ | ||||
.PHONY: version.h | |||||
version.h: | |||||
$(SRC_PATH)/version.sh | |||||
output_example$(EXESUF): output_example.o .libs | output_example$(EXESUF): output_example.o .libs | ||||
$(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS) | $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS) | ||||
@@ -220,7 +224,7 @@ distclean: clean | |||||
$(MAKE) -C libpostproc distclean | $(MAKE) -C libpostproc distclean | ||||
$(MAKE) -C tests distclean | $(MAKE) -C tests distclean | ||||
$(MAKE) -C vhook distclean | $(MAKE) -C vhook distclean | ||||
rm -f .depend config.mak config.h *.pc | |||||
rm -f .depend config.mak config.h version.h *.pc | |||||
TAGS: | TAGS: | ||||
etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch] | etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch] | ||||
@@ -40,6 +40,7 @@ | |||||
#undef time //needed because HAVE_AV_CONFIG_H is defined on top | #undef time //needed because HAVE_AV_CONFIG_H is defined on top | ||||
#include <time.h> | #include <time.h> | ||||
#include "version.h" | |||||
#include "cmdutils.h" | #include "cmdutils.h" | ||||
#undef NDEBUG | #undef NDEBUG | ||||
@@ -19,6 +19,7 @@ | |||||
#define HAVE_AV_CONFIG_H | #define HAVE_AV_CONFIG_H | ||||
#include "avformat.h" | #include "avformat.h" | ||||
#include "version.h" | |||||
#include "cmdutils.h" | #include "cmdutils.h" | ||||
#include <SDL.h> | #include <SDL.h> | ||||
@@ -39,6 +39,7 @@ | |||||
#include <dlfcn.h> | #include <dlfcn.h> | ||||
#endif | #endif | ||||
#include "version.h" | |||||
#include "ffserver.h" | #include "ffserver.h" | ||||
/* maximum number of simultaneous HTTP connections */ | /* maximum number of simultaneous HTTP connections */ | ||||
@@ -14,9 +14,8 @@ extern "C" { | |||||
#include "avutil.h" | #include "avutil.h" | ||||
#include <sys/types.h> /* size_t */ | #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_INT 0x000409 | ||||
#define FFMPEG_VERSION "HEAD" | |||||
#define AV_STRINGIFY(s) AV_TOSTRING(s) | #define AV_STRINGIFY(s) AV_TOSTRING(s) | ||||
#define AV_TOSTRING(s) #s | #define AV_TOSTRING(s) #s | ||||
@@ -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 |