Skip to content

Commit

Permalink
Add symbol versioning to libopenconnect shared library
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed May 13, 2012
1 parent 4c4b5db commit 825da35
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile.am
Expand Up @@ -24,11 +24,15 @@ libopenconnect_la_LIBADD = $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS) $(LI
libopenconnect_la_LDFLAGS = -version-number 1:4
noinst_HEADERS = openconnect-internal.h openconnect.h
include_HEADERS = openconnect.h
if HAVE_SYMBOL_VERSIONING
libopenconnect_la_LDFLAGS += -Wl,--version-script,libopenconnect.map
libopenconnect_la_DEPENDENCIES = libopenconnect.map
endif

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = openconnect.pc

EXTRA_DIST = version.sh openconnect.8 COPYING.LGPL
EXTRA_DIST = version.sh openconnect.8 COPYING.LGPL libopenconnect.map

DISTCLEANFILES = $(pkgconfig_DATA)

Expand Down
19 changes: 19 additions & 0 deletions configure.ac
Expand Up @@ -188,6 +188,25 @@ AC_ARG_WITH([openssl],
# Needs to happen after we default to static/shared libraries based on OpenSSL
AC_PROG_LIBTOOL

# Ick. This seems like it's likely to be very fragile, but I can't see a better
# way. I shall console myself with the observation that the failure mode isn't
# particularly horrible — you just don't get symbol versioning if it fails.
symvers=no
if test "$enable_shared" = "yes" ; then
AC_MSG_CHECKING([if library symbol versioning is available]);
echo 'FOO { global: foo; };' > conftest.map
echo 'int foo = 0;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
soname=conftest
libobjs=conftest.$ac_objext
if AC_TRY_EVAL(archive_cmds ${wl}--version-script ${wl}conftest.map); then
symvers=yes
fi
fi
AC_MSG_RESULT(${symvers})
fi
AM_CONDITIONAL(HAVE_SYMBOL_VERSIONING, [test "${symvers}" = "yes"])

PKG_CHECK_MODULES(LIBXML2, libxml-2.0)

PKG_CHECK_MODULES(ZLIB, zlib, [],
Expand Down
50 changes: 50 additions & 0 deletions libopenconnect.map
@@ -0,0 +1,50 @@
OPENCONNECT_1.2 {
global:
openconnect_clear_cookie;
openconnect_get_cert_sha1;
openconnect_get_cookie;
openconnect_get_hostname;
openconnect_get_peer_cert;
openconnect_get_port;
openconnect_get_urlpath;
openconnect_get_version;
openconnect_init_openssl;
openconnect_obtain_cookie;
openconnect_parse_url;
openconnect_passphrase_from_fsid;
openconnect_reset_ssl;
openconnect_set_cafile;
openconnect_set_client_cert;
openconnect_set_hostname;
openconnect_set_http_proxy;
openconnect_setup_csd;
openconnect_set_urlpath;
openconnect_set_xmlsha1;
openconnect_vpninfo_free;
openconnect_vpninfo_new;
openconnect_vpninfo_new_with_cbdata;
local:
*;
};

OPENCONNECT_1.3 {
global:
openconnect_set_cert_expiry_warning;
} OPENCONNECT_1.2;

OPENCONNECT_1.4 {
global:
openconnect_set_cancel_fd;
} OPENCONNECT_1.3;

OPENCONNECT_PRIVATE {
global:
openconnect_SSL_gets;
openconnect_close_https;
openconnect_open_https;
openconnect_SSL_printf;
openconnect_version_str;
openconnect_create_useragent;
internal_parse_url;
report_ssl_errors;
};

0 comments on commit 825da35

Please sign in to comment.