aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2005-12-10 17:14:24 +0000
committerDiego Biurrun <diego@biurrun.de>2005-12-10 17:14:24 +0000
commit5a872801d5e5e287525adfd33bcefa94b185988e (patch)
tree3c1a3cbceae2984ad989ed86c2dfb2deb35f09ed
parent64428d02d1005e911a95476d25d514ffcf41f4d3 (diff)
downloadffmpeg-5a872801d5e5e287525adfd33bcefa94b185988e.tar.gz
SONAME support for shared libs
patch by Luca Barbato < .. lu_zero .. @@ .. gentoo .. . .. org .. > Originally committed as revision 4730 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-xconfigure23
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavformat/Makefile1
-rw-r--r--libavutil/Makefile1
4 files changed, 19 insertions, 7 deletions
diff --git a/configure b/configure
index 0fd14d9de6..a0acc8de3c 100755
--- 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
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index ecbca83884..0b98815236 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -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)"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d4643cb717..378c895db7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -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)
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 4308cd09fd..515bf95eca 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -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)