1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Add symbol versioning for shared libraries

Based on patch by Reinhard Tartler <siretart tauware de>

Originally committed as revision 21236 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-01-16 04:49:02 +00:00
parent 2ed46eeab3
commit a482e61bd6
9 changed files with 33 additions and 2 deletions

View File

@ -9,6 +9,7 @@ vpath %.c $(SRC_DIR)
vpath %.h $(SRC_DIR)
vpath %.S $(SRC_DIR)
vpath %.asm $(SRC_DIR)
vpath %.v $(SRC_DIR)
ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
BUILD_ROOT_REL = .
@ -33,6 +34,9 @@ CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
%$(EXESUF): %.c
%.ver: %.v
sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
@ -77,7 +81,7 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
DEPS := $(OBJS:.o=.d)
depend dep: $(DEPS)
CLEANSUFFIXES = *.d *.o *~ *.ho *.map
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp

5
configure vendored
View File

@ -1561,6 +1561,7 @@ tmpfile TMPE $EXESUF
tmpfile TMPH .h
tmpfile TMPO .o
tmpfile TMPS .S
tmpfile TMPV .ver
tmpfile TMPSH .sh
unset -f mktemp
@ -2568,6 +2569,10 @@ check_ldflags -Wl,--as-needed
check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
check_ldflags -Wl,-Bsymbolic
echo "X{};" > $TMPV
test_ldflags -Wl,--version-script,$TMPV &&
append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
if enabled small; then
check_cflags -Os # not all compilers support -Os
optimizations="small"

3
libavcodec/libavcodec.v Normal file
View File

@ -0,0 +1,3 @@
LIBAVCODEC_$MAJOR {
global: *;
};

View File

@ -0,0 +1,4 @@
LIBAVDEVICE_$MAJOR {
global: avdevice_*;
local: *;
};

View File

@ -0,0 +1,4 @@
LIBAVFILTER_$MAJOR {
global: avfilter_*; av_*;
local: *;
};

View File

@ -0,0 +1,3 @@
LIBAVFORMAT_$MAJOR {
global: *;
};

4
libavutil/libavutil.v Normal file
View File

@ -0,0 +1,4 @@
LIBAVUTIL_$MAJOR {
global: av_*; ff_*; avutil_*;
local: *;
};

View File

@ -0,0 +1,4 @@
LIBPOSTPROC_$MAJOR {
global: postproc_*; pp_*;
local: *;
};

View File

@ -51,7 +51,7 @@ install-libs: install-lib$(NAME)-shared
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
$(SLIB_EXTRA_CMD)