[FFmpeg-devel] [PATCH 5/5] build: rename version.h to libavutil/ffversion.h

Timothy Gu timothygu99 at gmail.com
Fri Nov 29 02:00:31 CET 2013


Also the libavutil/ffversion.h will be installed.

Rationale:
* Applications might want to know FFmpeg's version besides the individual
  libraries'.
* Avoids file name clash between FFmpeg's ./version.h and lib*/version.h when
  a library source file includes both and is compiled on an out-of-tree build.

Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
 Makefile           | 6 +++---
 cmdutils.c         | 2 +-
 ffprobe.c          | 2 +-
 libavutil/Makefile | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 495d6c6..51f0a18 100644
--- a/Makefile
+++ b/Makefile
@@ -119,8 +119,8 @@ GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
 .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
 .version: M=@
 
-version.h .version:
-	$(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
+libavutil/ffversion.h .version:
+	$(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
 	$(Q)touch .version
 
 # force version.sh to run whenever version might have changed
@@ -163,7 +163,7 @@ clean::
 
 distclean::
 	$(RM) $(DISTCLEANSUFFIXES)
-	$(RM) config.* .config libavutil/avconfig.h .version version.h libavcodec/codec_names.h
+	$(RM) config.* .config libavutil/avconfig.h .version libavutil/ffversion.h libavcodec/codec_names.h
 
 config:
 	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
diff --git a/cmdutils.c b/cmdutils.c
index 2608bce..46ade3f 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -49,8 +49,8 @@
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
 #include "libavutil/cpu.h"
+#include "libavutil/ffversion.h"
 #include "cmdutils.h"
-#include "version.h"
 #if CONFIG_NETWORK
 #include "libavformat/network.h"
 #endif
diff --git a/ffprobe.c b/ffprobe.c
index d124d4e..43f830b 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "version.h"
+#include "libavutil/ffversion.h"
 
 #include <string.h>
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 02dd728..8b73019 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -62,7 +62,8 @@ ARCH_HEADERS = bswap.h                                                  \
                intreadwrite.h                                           \
                timer.h                                                  \
 
-BUILT_HEADERS = avconfig.h
+BUILT_HEADERS = avconfig.h                                              \
+                ffversion.h
 
 OBJS = adler32.o                                                        \
        aes.o                                                            \
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list