project('at-spi2-core', 'c', version: '2.25.4', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', 'warning_level=1', 'c_std=c99', ], meson_version: '>= 0.40.1') add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c') cc = meson.get_compiler('c') host_system = host_machine.system() soversion = '0.0.1' at_spi_conf = configuration_data() at_spi_conf.set('GETTEXT_PACKAGE', meson.project_name()) root_inc = include_directories('.') registryd_inc = include_directories('registryd') atspi_datadir = join_paths(get_option('prefix'), get_option('datadir')) atspi_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir')) atspi_sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir')) if get_option('dbus_services_dir') != 'default' dbus_services_dir = get_option('dbus_services_dir') else dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1/services') endif if get_option('systemd_user_dir') != 'default' systemd_user_dir = get_option('systemd_user_dir') else systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user') endif # Dependencies libdbus_req_version = '>= 1.5' glib_req_version = '>= 2.32.0' gobject_req_version = '>= 2.0.0' gio_req_version = '>= 2.28.0' libdbus_dep = dependency('dbus-1', version: libdbus_req_version) glib_dep = dependency('glib-2.0', version: glib_req_version) gobject_dep = dependency('gobject-2.0', version: gobject_req_version) gio_dep = dependency('gio-2.0', version: gio_req_version) dl_dep = cc.find_library('dl', required: false) x11_dep = dependency('x11', required: false) x11_deps = [] if x11_dep.found() x11_deps += x11_dep xtest_dep = dependency('xtst') x11_deps += xtest_dep xkb_dep = dependency('xkbcommon-x11', required: false) if xkb_dep.found() x11_deps += xkb_dep at_spi_conf.set('HAVE_XKB', 1) endif xinput_dep = dependency('xi') x11_deps += xinput_dep endif # Alignments at_spi_conf.set('ALIGNOF_CHAR', cc.alignment('char')) at_spi_conf.set('ALIGNOF_DOUBLE', cc.alignment('double')) dbus_alignments = [ 'dbus_bool_t', 'dbus_int16_t', 'dbus_int32_t', 'dbus_int64_t', ] foreach a: dbus_alignments at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(), cc.alignment(a, prefix: '#include ', dependencies: libdbus_dep)) endforeach at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void *dbind_pointer;')) at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } dbind_struct;')) configure_file(output: 'config.h', configuration: at_spi_conf) # Compat variables for pkgconfig pkgconf = configuration_data() pkgconf.set('prefix', get_option('prefix')) pkgconf.set('exec_prefix', get_option('prefix')) pkgconf.set('libdir', get_option('libdir')) pkgconf.set('includedir', get_option('includedir')) pkgconf.set('VERSION', meson.project_version()) configure_file(input: 'atspi-2.pc.in', output: 'atspi-2.pc', configuration: pkgconf, install: true, install_dir: join_paths(get_option('libdir'), 'pkgconfig')) gnome = import('gnome') subdir('dbind') subdir('atspi') subdir('bus') subdir('registryd') subdir('test') if get_option('enable_docs') subdir('doc/libatspi') endif