[FFmpeg-devel] [PATCH] configure: support raising major version in soname

Michael Niedermayer michaelni at gmx.at
Wed Dec 18 05:20:11 CET 2013


this allows seperate installation that should not conflict with
whatever is officially installed on a platform

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 configure          |    3 +++
 libavcodec/utils.c |   10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3c6d766..7391185 100755
--- a/configure
+++ b/configure
@@ -107,6 +107,7 @@ Configuration options:
   --disable-all            disable building components, libraries and programs
   --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
   --enable-incompatible-fork-abi  enable incompatible Libav fork ABI (deprecated) [no]
+  --enable-raise-major     increase major version numbers in sonames [no]
 
 Program options:
   --disable-programs       do not build command line programs
@@ -1363,6 +1364,7 @@ CONFIG_LIST="
     network
     nonfree
     pic
+    raise_major
     rdft
     runtime_cpudetect
     safe_bitstream_reader
@@ -5025,6 +5027,7 @@ get_version(){
     name=$(toupper $lcname)
     file=$source_path/$lcname/version.h
     eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
+    enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
     eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
     eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
     eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 07947dd..b8a8d47 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -117,13 +117,19 @@ static int volatile entangled_thread_counter = 0;
 static void *codec_mutex;
 static void *avformat_mutex;
 
+#if CONFIG_RAISE_MAJOR
+#    define LIBNAME "LIBAVCODEC_155"
+#else
+#    define LIBNAME "LIBAVCODEC_55"
+#endif
+
 #if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
-FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
+FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
 {
     return av_fast_realloc(ptr, size, min_size);
 }
 
-FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
+FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
 {
     av_fast_malloc(ptr, size, min_size);
 }
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list