From 482f34006e6c9709a2f5a219ab6bcc5ff70e1aa0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 18 Apr 2017 14:51:25 +0100 Subject: build: Use the appropriate linker flags We need to check if the linker flags we use are available, depending on the platform, and we need to ensure that the shared library is versioned appropriately. --- meson.build | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 34ba0fb59c..da5505ef27 100644 --- a/meson.build +++ b/meson.build @@ -68,6 +68,8 @@ gtk_binary_version = '4.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version +gtk_soversion = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age) + gtk_api_version = '4.0' x11_enabled = get_option('enable-x11-backend') @@ -272,6 +274,21 @@ if get_option('default_library') != 'static' endif endif +common_ldflags = [] + +if host_machine.system() == 'linux' + foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + if cc.has_argument(ldflag) + common_ldflags += [ ldflag ] + endif + endforeach +endif + +# Maintain compatibility with autotools +if host_machine.system() == 'darwin' + common_ldflags += [ '-compatibility_version=1', '-current_version=1.0', ] +endif + confinc = include_directories('.') gdkinc = include_directories('gdk') gtkinc = include_directories('gtk') -- cgit v1.2.1