SONAME support for shared libs
authorLuca Barbato <lu_zero@gentoo.org>
Sat, 10 Dec 2005 17:14:24 +0000 (17:14 +0000)
committerDiego Biurrun <diego@biurrun.de>
Sat, 10 Dec 2005 17:14:24 +0000 (17:14 +0000)
patch by Luca Barbato < .. lu_zero .. @@ .. gentoo .. . .. org .. >

Originally committed as revision 4730 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavcodec/Makefile
libavformat/Makefile
libavutil/Makefile

index 0fd14d9de6cd7591e2d7372b80fe1af92f63a361..a0acc8de3cbba36ad94c4413a07f93a606a3565e 100755 (executable)
--- a/configure
+++ b/configure
@@ -215,7 +215,7 @@ vhook="default"
 dlfcn="no"
 dlopen="no"
 mpegaudio_hp="yes"
-SHFLAGS=-shared
+SHFLAGS='-shared -Wl,-soname,$@.$(LIBVERSION)'
 netserver="no"
 need_inet_aton="no"
 ffserver="yes"
@@ -1447,11 +1447,24 @@ if test "$vhook" = "yes" ; then
   echo "BUILD_VHOOK=yes" >> config.mak
   echo "#define HAVE_VHOOK 1" >> $TMPH
 fi
+
+lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
+lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
+lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
+
+
+
 if test "$lshared" = "yes" ; then
   echo "BUILD_SHARED=yes" >> config.mak
   echo "PIC=-fPIC -DPIC" >> config.mak
-  echo "SPPMAJOR=0" >> config.mak
-  echo "SPPVERSION=0.0.1" >> config.mak 
+  echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
+  echo "SPPVERSION=$lavc_version" >> config.mak
+  echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
+  echo "LAVCVERSION=$lavc_version" >> config.mak
+  echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
+  echo "LAVFVERSION=$lavf_version" >> config.mak
+  echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak
+  echo "LAVUVERSION=$lavu_version" >> config.mak
 fi
 echo "EXTRALIBS=$extralibs" >> config.mak
 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
@@ -1789,10 +1802,6 @@ rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
 
 
 # build pkg-config files libav*.pc and libpostproc.pc
-lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
-lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
-lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
-
 # libavutil.pc
 cat <<EOF >libavutil.pc
 prefix=$prefix
index ecbca838847a0d37c2c8776e7d9cff088c4ba32b..0b9881523698d0724ee769a3a7592e4494f50fc5 100644 (file)
@@ -488,6 +488,7 @@ fft-test: fft-test.o $(LIB)
        $(CC) -o $@ $^ $(LIBAVUTIL) -lm
 
 ifeq ($(BUILD_SHARED),yes)
+LIBVERSION=$(LAVCMAJOR)
 install: all install-headers
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
index d4643cb717e48a498adb966b5dfb15b2e6f38858..378c895db7f76b28fa2973889470f9df8f22e4c6 100644 (file)
@@ -80,6 +80,7 @@ endif
 
 LIB= $(LIBPREF)avformat$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
+LIBVERSION=$(LAVFMAJOR)
 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
 ifeq ($(CONFIG_DARWIN),yes)
index 4308cd09fd2f61350d1b5173e2bc3629666d9c70..515bf95eca86c8f026cd52261629639cdd9cdf46 100644 (file)
@@ -22,6 +22,7 @@ SRCS := $(OBJS:.o=.c)
 
 LIB= $(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
+LIBVERSION=$(LAVUMAJOR)
 SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
 ifeq ($(CONFIG_DARWIN),yes)
 SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)