From 94179adeebb24f390cad6abed1f1f8f89c41f451 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 11 Sep 2019 12:05:15 +0200 Subject: [PATCH] autotools: Use symbol versioning if possible The meson build already using it for: https://github.com/mesonbuild/meson/issues/3047 Suggested by Jan Alexander Steffens --- configure.ac | 3 +++ p11-kit/Makefile.am | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6ff4aa7..37cda41 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am index 4cb540a..234a5a6 100644 --- a/p11-kit/Makefile.am +++ b/p11-kit/Makefile.am @@ -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 \ -- 2.50.1