add Version_script listing exported symbols for GNU (ELF only) and Solaris ld.
authorConrad Parker <conrad@xiph.org>
Fri, 5 Aug 2005 04:20:17 +0000 (04:20 +0000)
committerConrad Parker <conrad@xiph.org>
Fri, 5 Aug 2005 04:20:17 +0000 (04:20 +0000)
* For background discussion, see:
  http://lists.xiph.org/pipermail/theora-dev/2005-August/002823.html

* For details on version-script, see:
  http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_25.html

svn path=/trunk/theora/; revision=9699

configure.ac
lib/Makefile.am
lib/Version_script.in [new file with mode: 0644]

index 9ec95bf..7cb5f3a 100644 (file)
@@ -23,6 +23,9 @@ AC_SUBST(V_LIB_CURRENT)
 AC_SUBST(V_LIB_REVISION)
 AC_SUBST(V_LIB_AGE)
 
+dnl Extra linker options (for version script)
+SHLIB_VERSION_ARG=""
+
 dnl --------------------------------------------------  
 dnl Check for programs
 dnl --------------------------------------------------  
@@ -74,6 +77,16 @@ fi
 CFLAGS="$CFLAGS $cflags_save"
 LDFLAGS="$LDFLAGS $ldflags_save"
 
+dnl Set extra linker options
+case "$target_os" in
+       linux* | solaris* )
+               SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
+               ;;
+       *)
+               ;;
+esac
+AC_SUBST(SHLIB_VERSION_ARG)
+
 dnl --------------------------------------------------
 dnl Checks for support libraries and headers
 dnl --------------------------------------------------
@@ -224,6 +237,7 @@ AC_OUTPUT([
   examples/Makefile
   doc/Makefile doc/Doxyfile
   debian/Makefile
+  lib/Version_script
   libtheora.spec
   theora.pc
   theora-uninstalled.pc
index 4505086..5408688 100644 (file)
@@ -1,5 +1,7 @@
 INCLUDES = -I$(top_srcdir)/include
 
+EXTRA_DIST = Version_script.in
+
 lib_LTLIBRARIES = libtheora.la
 
 if THEORA_DISABLE_ENCODE
@@ -40,7 +42,7 @@ noinst_HEADERS = \
        toplevel_lookup.h
 
 libtheora_la_CFLAGS = $(OGG_CFLAGS)
-libtheora_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
+libtheora_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@ @SHLIB_VERSION_ARG@
 libtheora_la_LIBS = $(OGG_LIBS)
 
 debug:
diff --git a/lib/Version_script.in b/lib/Version_script.in
new file mode 100644 (file)
index 0000000..9fa2398
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Export file for libtheora
+#
+# Only the symbols listed in the global section will be callable from
+# applications linking to libtheora.
+#
+
+@PACKAGE@.so.1.0
+{
+       global:
+               theora_version_string;
+               theora_version_number;
+
+               theora_encode_init;
+               theora_encode_YUVin;
+               theora_encode_packetout;
+               theora_encode_header;
+               theora_encode_comment;
+               theora_encode_tables;
+
+               theora_decode_header;
+               theora_decode_init;
+               theora_decode_packetin;
+               theora_decode_YUVout;
+
+               theora_packet_isheader;
+               theora_packet_iskeyframe;
+
+               theora_granule_shift;
+               theora_granule_frame;
+               theora_granule_time;
+
+               theora_info_init;
+               theora_info_clear;
+
+               theora_clear;
+
+               theora_comment_init;
+               theora_comment_add;
+               theora_comment_add_tag;
+               theora_comment_query;
+               theora_comment_query_count;
+               theora_comment_clear;
+
+       local:
+               *;
+};