]> granicus.if.org Git - p11-kit/commitdiff
autotools: Use symbol versioning if possible
authorDaiki Ueno <dueno@redhat.com>
Wed, 11 Sep 2019 10:05:15 +0000 (12:05 +0200)
committerDaiki Ueno <ueno@gnu.org>
Fri, 13 Sep 2019 09:52:28 +0000 (11:52 +0200)
The meson build already using it for:
https://github.com/mesonbuild/meson/issues/3047

Suggested by Jan Alexander Steffens

configure.ac
p11-kit/Makefile.am

index 6ff4aa745a8289deb90cfed03c447b6538d943a7..37cda410c5cef052720d840c592166ea2496e89d 100644 (file)
@@ -36,6 +36,9 @@ AC_USE_SYSTEM_EXTENSIONS
 LT_PREREQ([2.2.6])
 LT_INIT([dlopen disable-static])
 
+dnl Check if -Wl,--version-script is supported by the linker
+gl_LD_VERSION_SCRIPT
+
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_CPP
index 4cb540acd05f4da415884477d41168615f2edd70..234a5a6096bdbf89823cacdb28830500fef3d673 100644 (file)
@@ -86,8 +86,13 @@ libp11_kit_la_CFLAGS = $(COMMON_CFLAGS)
 
 libp11_kit_la_LDFLAGS = \
        -no-undefined \
-       -version-info $(P11KIT_LT_RELEASE) \
-       -export-symbols-regex '^C_GetFunctionList|^p11_kit_'
+       -version-info $(P11KIT_LT_RELEASE)
+
+if HAVE_LD_VERSION_SCRIPT
+libp11_kit_la_LDFLAGS += -Wl,--version-script=$(srcdir)/p11-kit/libp11-kit.map
+else
+libp11_kit_la_LDFLAGS += -export-symbols-regex '^C_GetFunctionList|^p11_kit_'
+endif
 
 libp11_kit_la_SOURCES = \
        p11-kit/proxy.c p11-kit/proxy.h p11-kit/proxy-init.c \