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:
parent
2ed46eeab3
commit
a482e61bd6
@ -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
5
configure
vendored
@ -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
3
libavcodec/libavcodec.v
Normal file
@ -0,0 +1,3 @@
|
||||
LIBAVCODEC_$MAJOR {
|
||||
global: *;
|
||||
};
|
4
libavdevice/libavdevice.v
Normal file
4
libavdevice/libavdevice.v
Normal file
@ -0,0 +1,4 @@
|
||||
LIBAVDEVICE_$MAJOR {
|
||||
global: avdevice_*;
|
||||
local: *;
|
||||
};
|
4
libavfilter/libavfilter.v
Normal file
4
libavfilter/libavfilter.v
Normal file
@ -0,0 +1,4 @@
|
||||
LIBAVFILTER_$MAJOR {
|
||||
global: avfilter_*; av_*;
|
||||
local: *;
|
||||
};
|
3
libavformat/libavformat.v
Normal file
3
libavformat/libavformat.v
Normal file
@ -0,0 +1,3 @@
|
||||
LIBAVFORMAT_$MAJOR {
|
||||
global: *;
|
||||
};
|
4
libavutil/libavutil.v
Normal file
4
libavutil/libavutil.v
Normal file
@ -0,0 +1,4 @@
|
||||
LIBAVUTIL_$MAJOR {
|
||||
global: av_*; ff_*; avutil_*;
|
||||
local: *;
|
||||
};
|
4
libpostproc/libpostproc.v
Normal file
4
libpostproc/libpostproc.v
Normal file
@ -0,0 +1,4 @@
|
||||
LIBPOSTPROC_$MAJOR {
|
||||
global: postproc_*; pp_*;
|
||||
local: *;
|
||||
};
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user