Skip to content

Instantly share code, notes, and snippets.

@chadcatlett
Created August 28, 2014 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadcatlett/fe832e1f625dd66a3845 to your computer and use it in GitHub Desktop.
Save chadcatlett/fe832e1f625dd66a3845 to your computer and use it in GitHub Desktop.
From 9a5a4343f378cf5dbd35f113e374a50db36560a4 Mon Sep 17 00:00:00 2001
From: Alex Samorukov <samm@os2.kiev.ua>
Date: Fri, 8 Aug 2014 14:41:44 +0200
Subject: [PATCH] Fix broken build on systems w/o system versioning support
---
Makefile.am | 2 ++
configure.ac | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 565af85..983b606 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,9 @@ lib_LTLIBRARIES = libstoken.la
libstoken_la_SOURCES = src/library.c src/securid.c src/sdtid.c
libstoken_la_CFLAGS = $(AM_CFLAGS)
libstoken_la_LDFLAGS = -version-number @APIMAJOR@:@APIMINOR@
+if HAVE_LD_VERSION_SCRIPT
libstoken_la_LDFLAGS += -Wl,--version-script,@srcdir@/libstoken.map
+endif
libstoken_la_LIBADD = $(TOMCRYPT_LIBS) $(LIBXML2_LIBS)
libstoken_la_DEPENDENCIES = libstoken.map
include_HEADERS = src/stoken.h
diff --git a/configure.ac b/configure.ac
index 0e10d07..2d53f57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,6 +189,19 @@ AC_ARG_ENABLE([jni-standalone],
[jni_standalone=no])
AM_CONDITIONAL(JNI_STANDALONE, [test $jni_standalone = yes])
+# Check for symbol versioning support
+
+AC_MSG_CHECKING([if libraries can be versioned])
+GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
+if test "$GLD"; then
+ have_ld_version_script=yes
+ AC_MSG_RESULT(yes)
+else
+ have_ld_version_script=no
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+
# library version
libhdr=${srcdir}/src/stoken.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment