summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-02-01 16:00:09 +0000
committerReinhard Tartler <siretart@tauware.de>2010-02-01 16:00:09 +0000
commita9785f58c670bf5bbd2d8700437f4f36c641fa88 (patch)
treed9dbe6fe41cd6c20363d30069f1a8b6b8a6a256c
parent7a5e131735f1139a622fe99ab486bf46d6e53c26 (diff)
backport symbol versioning patch
Originally committed as revision 21595 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5
-rw-r--r--common.mak6
-rwxr-xr-xconfigure16
-rw-r--r--libavcodec/libavcodec.v3
-rw-r--r--libavdevice/libavdevice.v4
-rw-r--r--libavfilter/libavfilter.v4
-rw-r--r--libavformat/libavformat.v3
-rw-r--r--libavutil/libavutil.v4
-rw-r--r--libpostproc/libpostproc.v4
-rw-r--r--libswscale/libswscale.v3
-rw-r--r--subdir.mak2
10 files changed, 44 insertions, 5 deletions
diff --git a/common.mak b/common.mak
index 4be056c876..a98ccd75e2 100644
--- a/common.mak
+++ b/common.mak
@@ -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 = .
@@ -43,6 +44,9 @@ CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
%$(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 @@ checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
DEPS := $(OBJS:.o=.d)
depend dep: $(DEPS)
-CLEANSUFFIXES = *.o *~ *.ho
+CLEANSUFFIXES = *.o *~ *.ho *.ver
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
DISTCLEANSUFFIXES = *.d *.pc
diff --git a/configure b/configure
index fd11501e22..229b84d21f 100755
--- a/configure
+++ b/configure
@@ -566,13 +566,18 @@ int x;
EOF
}
-check_ldflags(){
- log check_ldflags "$@"
- check_ld "$@" <<EOF && add_ldflags "$@"
+test_ldflags(){
+ log test_ldflags "$@"
+ check_ld "$@" <<EOF
int main(void){ return 0; }
EOF
}
+check_ldflags(){
+ log check_ldflags "$@"
+ test_ldflags "$@" && add_ldflags "$@"
+}
+
check_header(){
log check_header "$@"
header=$1
@@ -1356,6 +1361,7 @@ TMPE="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
TMPH="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
TMPO="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPV="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.ver"
TMPSH="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
# make sure we can execute files in $TMPDIR
@@ -2160,6 +2166,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"
diff --git a/libavcodec/libavcodec.v b/libavcodec/libavcodec.v
new file mode 100644
index 0000000000..561a42cd4f
--- /dev/null
+++ b/libavcodec/libavcodec.v
@@ -0,0 +1,3 @@
+LIBAVCODEC_$MAJOR {
+ global: *;
+};
diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v
new file mode 100644
index 0000000000..663af85ba8
--- /dev/null
+++ b/libavdevice/libavdevice.v
@@ -0,0 +1,4 @@
+LIBAVDEVICE_$MAJOR {
+ global: avdevice_*;
+ local: *;
+};
diff --git a/libavfilter/libavfilter.v b/libavfilter/libavfilter.v
new file mode 100644
index 0000000000..83e8887080
--- /dev/null
+++ b/libavfilter/libavfilter.v
@@ -0,0 +1,4 @@
+LIBAVFILTER_$MAJOR {
+ global: avfilter_*; av_*;
+ local: *;
+};
diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
new file mode 100644
index 0000000000..da2311eb36
--- /dev/null
+++ b/libavformat/libavformat.v
@@ -0,0 +1,3 @@
+LIBAVFORMAT_$MAJOR {
+ global: *;
+};
diff --git a/libavutil/libavutil.v b/libavutil/libavutil.v
new file mode 100644
index 0000000000..ec52f2be7a
--- /dev/null
+++ b/libavutil/libavutil.v
@@ -0,0 +1,4 @@
+LIBAVUTIL_$MAJOR {
+ global: av_*; ff_*; avutil_*;
+ local: *;
+};
diff --git a/libpostproc/libpostproc.v b/libpostproc/libpostproc.v
new file mode 100644
index 0000000000..e65d76f4f6
--- /dev/null
+++ b/libpostproc/libpostproc.v
@@ -0,0 +1,4 @@
+LIBPOSTPROC_$MAJOR {
+ global: postproc_*; pp_*;
+ local: *;
+};
diff --git a/libswscale/libswscale.v b/libswscale/libswscale.v
new file mode 100644
index 0000000000..d6bd39a8c5
--- /dev/null
+++ b/libswscale/libswscale.v
@@ -0,0 +1,3 @@
+LIBSWSCALE_%MAJOR% {
+ global: *;
+};
diff --git a/subdir.mak b/subdir.mak
index df5bb8a09a..4749d4efd6 100644
--- a/subdir.mak
+++ b/subdir.mak
@@ -27,7 +27,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)
$(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter-out $(DEP_LIBS),$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
$(SLIB_EXTRA_CMD)