5 'buildtype=debugoptimized',
9 meson_version : '>= 0.40.1')
11 cc = meson.get_compiler('c')
12 host_system = host_machine.system()
14 version = meson.project_version().split('.')
15 atk_major_version = version[0].to_int()
16 atk_minor_version = version[1].to_int()
17 atk_micro_version = version[2].to_int()
20 atk_binary_age = 10000 * atk_major_version + 100 * atk_minor_version + 10 + atk_micro_version
22 atk_api_version = '1.0'
23 atk_api_path = 'atk-@0@/atk'.format(atk_api_version)
25 atk_prefix = get_option('prefix')
26 atk_libdir = join_paths(atk_prefix, get_option('libdir'))
27 atk_sysconfdir = join_paths(atk_prefix, get_option('sysconfdir'))
28 atk_includedir = join_paths(atk_prefix, get_option('includedir'))
29 atk_datadir = join_paths(atk_prefix, get_option('datadir'))
30 atk_libexecdir = join_paths(atk_prefix, get_option('libexecdir'))
32 atk_conf = configuration_data()
34 atk_conf.set_quoted('VERSION', meson.project_version())
35 atk_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
37 # Maintain version scheme with libtool
38 atk_soversion = '0.@0@.@1@'.format((atk_binary_age - atk_interface_age), atk_interface_age)
40 add_project_arguments([ '-DG_DISABLE_SINGLE_INCLUDES', '-DATK_DISABLE_SINGLE_INCLUDES' ], language: 'c')
42 # Compiler and linker flags
49 if get_option('default_library') != 'static'
50 if host_system == 'windows'
51 atk_conf.set('DLL_EXPORT', true)
52 atk_conf.set('_ATK_EXTERN', '__declspec(dllexport) extern')
53 if cc.get_id() != 'msvc'
54 test_cflags += ['-fvisibility=hidden']
57 atk_conf.set('_ATK_EXTERN', '__attribute__((visibility("default"))) extern')
58 test_cflags += ['-fvisibility=hidden']
62 # Check all compiler flags
63 foreach cflag: test_cflags
64 if cc.has_argument(cflag)
65 common_cflags += [ cflag ]
70 if host_machine.system() == 'linux'
71 foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
72 if cc.has_argument(ldflag)
73 common_ldflags += [ ldflag ]
78 # Maintain compatibility with autotools on macOS
79 if host_machine.system() == 'darwin'
80 common_ldflags += [ '-compatibility_version=1', '-current_version=1.0', ]
85 'bind_textdomain_codeset',
88 foreach f: checked_funcs
90 atk_conf.set('HAVE_' + f.underscorify().to_upper(), 1)
95 gobject_req_version = '>= 2.31.2'
97 gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
99 # Compat variables for pkgconfig
100 pkgconf = configuration_data()
101 pkgconf.set('prefix', atk_prefix)
102 pkgconf.set('exec_prefix', atk_prefix)
103 pkgconf.set('libdir', atk_libdir)
104 pkgconf.set('includedir', atk_includedir)
105 pkgconf.set('VERSION', meson.project_version())
106 pkgconf.set('GLIB_PACKAGES', 'gobject-2.0')
107 pkgconf.set('ATK_API_VERSION', atk_api_version)
108 pkgconf.set('srcdir', '.')
110 foreach pkg: [ 'atk.pc', ]
111 configure_file(input: pkg + '.in',
113 configuration: pkgconf,
115 install_dir: join_paths(atk_libdir, 'pkgconfig'))
118 gnome = import('gnome')
120 # Internal configuration header
121 configure_file(output: 'config.h', configuration: atk_conf)
123 root_inc = include_directories('.')
129 if get_option('enable_docs')