tizen: Add additional unit for "unified" user session
[platform/upstream/at-spi2-core.git] / meson.build
1 project('at-spi2-core', 'c',
2         version: '2.31.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=200809L', '-D_DEFAULT_SOURCE' ], language: 'c')
12
13 atspi_gir_ns = 'Atspi'
14
15 cc = meson.get_compiler('c')
16 host_system = host_machine.system()
17
18 soversion = '0.0.1'
19
20 at_spi_conf = configuration_data()
21 at_spi_conf.set('GETTEXT_PACKAGE', meson.project_name())
22
23 root_inc = include_directories('.')
24 registryd_inc = include_directories('registryd')
25
26 atspi_prefix = get_option('prefix')
27 atspi_datadir = join_paths(atspi_prefix, get_option('datadir'))
28 atspi_libexecdir = join_paths(atspi_prefix, get_option('libexecdir'))
29 atspi_sysconfdir = join_paths(atspi_prefix, get_option('sysconfdir'))
30 atspi_libdir = join_paths(atspi_prefix, get_option('libdir'))
31 atspi_includedir = join_paths(atspi_prefix, get_option('includedir'))
32
33 if get_option('dbus_services_dir') != 'default'
34   dbus_services_dir = get_option('dbus_services_dir')
35 else
36   dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1/services')
37 endif
38
39 if get_option('systemd_user_dir') != 'default'
40   systemd_user_dir = get_option('systemd_user_dir')
41 else
42   systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user')
43 endif
44
45 if get_option('systemd_system_dir') != 'default'
46   systemd_system_dir = get_option('systemd_system_dir')
47 else
48   systemd_system_dir = join_paths(get_option('prefix'), 'lib/systemd/system')
49 endif
50
51 # Dependencies
52 libdbus_req_version = '>= 1.5'
53 glib_req_version = '>= 2.32.0'
54 gobject_req_version = '>= 2.0.0'
55 gio_req_version = '>= 2.28.0'
56 app_svc_req_version = '>= 0.0.0'
57
58 libdbus_dep = dependency('dbus-1', version: libdbus_req_version)
59 glib_dep = dependency('glib-2.0', version: glib_req_version)
60 gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
61 gio_dep = dependency('gio-2.0', version: gio_req_version)
62 app_svc_dep = dependency('appsvc', version: app_svc_req_version)
63 dl_dep = cc.find_library('dl', required: false)
64
65 x11_deps = []
66 x11_option = get_option('enable-x11')
67 if x11_option != 'no'
68   x11_dep = dependency('x11', required: false)
69
70   if x11_dep.found()
71     x11_deps += x11_dep
72     at_spi_conf.set('HAVE_X11', 1)
73     xtest_dep = dependency('xtst')
74     x11_deps += xtest_dep
75
76     if cc.has_function('XkbGetMap', dependencies: x11_deps)
77       at_spi_conf.set('HAVE_XKB', 1)
78     endif
79
80     xinput_dep = dependency('xi')
81     x11_deps += xinput_dep
82   endif
83 endif
84
85 # Alignments
86 at_spi_conf.set('ALIGNOF_CHAR', cc.alignment('char'))
87 at_spi_conf.set('ALIGNOF_DOUBLE', cc.alignment('double'))
88
89 dbus_alignments = [
90   'dbus_bool_t',
91   'dbus_int16_t',
92   'dbus_int32_t',
93   'dbus_int64_t',
94 ]
95
96 foreach a: dbus_alignments
97   at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(),
98                   cc.alignment(a, prefix: '#include <dbus/dbus.h>', dependencies: libdbus_dep))
99 endforeach
100
101 at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void *dbind_pointer;'))
102 at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } dbind_struct;'))
103
104 # introspection support
105 have_gir = false
106
107 introspection_option = get_option('enable-introspection')
108 if introspection_option != 'no'
109   gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false)
110
111   if gir_dep.found()
112     have_gir = true
113   endif
114 endif
115
116 xgettext = find_program('xgettext', required : false)
117
118 configure_file(output: 'config.h', configuration: at_spi_conf)
119
120 gnome = import('gnome')
121
122 subdir('dbind')
123 subdir('atspi')
124 subdir('bus')
125 subdir('registryd')
126 subdir('test')
127
128 if get_option('enable_docs')
129   subdir('doc/libatspi')
130 endif
131
132 if xgettext.found()
133   subdir('po')
134 endif