Update po/Makevars
[platform/upstream/at-spi2-core.git] / meson.build
1 project('at-spi2-core', 'c',
2         version: '2.25.1',
3         license: 'LGPLv2.1+',
4         default_options: [
5           'buildtype=debugoptimized',
6           'warning_level=1',
7           'c_std=c99',
8         ],
9         meson_version: '>= 0.40.1')
10
11 add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c')
12
13 cc = meson.get_compiler('c')
14 host_system = host_machine.system()
15
16 soversion = '0.0.1'
17
18 at_spi_conf = configuration_data()
19 at_spi_conf.set('GETTEXT_PACKAGE', meson.project_name())
20
21 root_inc = include_directories('.')
22 registryd_inc = include_directories('registryd')
23
24 atspi_datadir = join_paths(get_option('prefix'), get_option('datadir'))
25 atspi_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
26 atspi_sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
27
28 if get_option('dbus_services_dir') != 'default'
29   dbus_services_dir = get_option('dbus_services_dir')
30 else
31   dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1/services')
32 endif
33
34 if get_option('systemd_user_dir') != 'default'
35   systemd_user_dir = get_option('systemd_user_dir')
36 else
37   systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user')
38 endif
39
40 # Dependencies
41 libdbus_req_version = '>= 1.5'
42 glib_req_version = '>= 2.32.0'
43 gobject_req_version = '>= 2.0.0'
44 gio_req_version = '>= 2.28.0'
45
46 libdbus_dep = dependency('dbus-1', version: libdbus_req_version)
47 glib_dep = dependency('glib-2.0', version: glib_req_version)
48 gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
49 gio_dep = dependency('gio-2.0', version: gio_req_version)
50 dl_dep = cc.find_library('dl', required: false)
51 x11_dep = dependency('x11', required: false)
52
53 x11_deps = []
54 if x11_dep.found()
55   x11_deps += x11_dep
56
57   xtest_dep = dependency('xtst')
58   x11_deps += xtest_dep
59
60   xkb_dep = dependency('xkbcommon-x11', required: false)
61   if xkb_dep.found()
62     x11_deps += xkb_dep
63     at_spi_conf.set('HAVE_XKB', 1)
64   endif
65
66   xinput_dep = dependency('xi')
67   x11_deps += xinput_dep
68 endif
69
70 # Alignments
71 at_spi_conf.set('ALIGNOF_CHAR', cc.alignment('char'))
72 at_spi_conf.set('ALIGNOF_DOUBLE', cc.alignment('double'))
73
74 dbus_alignments = [
75   'dbus_bool_t',
76   'dbus_int16_t',
77   'dbus_int32_t',
78   'dbus_int64_t',
79 ]
80
81 foreach a: dbus_alignments
82   at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(),
83                   cc.alignment(a, prefix: '#include <dbus/dbus.h>', dependencies: libdbus_dep))
84 endforeach
85
86 at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void *dbind_pointer;'))
87 at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } dbind_struct;'))
88
89 configure_file(output: 'config.h', configuration: at_spi_conf)
90
91 # Compat variables for pkgconfig
92 pkgconf = configuration_data()
93 pkgconf.set('prefix', get_option('prefix'))
94 pkgconf.set('exec_prefix', get_option('prefix'))
95 pkgconf.set('libdir', get_option('libdir'))
96 pkgconf.set('includedir', get_option('includedir'))
97 pkgconf.set('VERSION', meson.project_version())
98
99 configure_file(input: 'atspi-2.pc.in',
100                output: 'atspi-2.pc',
101                configuration: pkgconf,
102                install: true,
103                install_dir: join_paths(get_option('libdir'), 'pkgconfig'))
104
105 gnome = import('gnome')
106
107 subdir('dbind')
108 subdir('atspi')
109 subdir('bus')
110 subdir('registryd')
111 subdir('test')
112
113 if get_option('enable_docs')
114   subdir('doc/libatspi')
115 endif