Remove dependency on libxkbcommon
[platform/upstream/at-spi2-core.git] / meson.build
index bf4bbe9..e746e14 100644 (file)
@@ -1,5 +1,5 @@
 project('at-spi2-core', 'c',
-        version: '2.25.1',
+        version: '2.26.0',
         license: 'LGPLv2.1+',
         default_options: [
           'buildtype=debugoptimized',
@@ -10,6 +10,8 @@ project('at-spi2-core', 'c',
 
 add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c')
 
+atspi_gir_ns = 'Atspi'
+
 cc = meson.get_compiler('c')
 host_system = host_machine.system()
 
@@ -21,9 +23,12 @@ 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'))
+atspi_prefix = get_option('prefix')
+atspi_datadir = join_paths(atspi_prefix, get_option('datadir'))
+atspi_libexecdir = join_paths(atspi_prefix, get_option('libexecdir'))
+atspi_sysconfdir = join_paths(atspi_prefix, get_option('sysconfdir'))
+atspi_libdir = join_paths(atspi_prefix, get_option('libdir'))
+atspi_includedir = join_paths(atspi_prefix, get_option('includedir'))
 
 if get_option('dbus_services_dir') != 'default'
   dbus_services_dir = get_option('dbus_services_dir')
@@ -57,9 +62,7 @@ if x11_dep.found()
   xtest_dep = dependency('xtst')
   x11_deps += xtest_dep
 
-  xkb_dep = dependency('xkbcommon-x11', required: false)
-  if xkb_dep.found()
-    x11_deps += xkb_dep
+  if cc.has_function('XkbGetMap', dependencies: x11_deps)
     at_spi_conf.set('HAVE_XKB', 1)
   endif
 
@@ -86,14 +89,28 @@ 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;'))
 
+# introspection support
+have_gir = false
+
+introspection_option = get_option('enable-introspection')
+if introspection_option != 'no'
+  gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false)
+
+  if gir_dep.found()
+    have_gir = true
+  endif
+endif
+
+xgettext = find_program('xgettext', required : false)
+
 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('libdir', atspi_libdir)
+pkgconf.set('includedir', atspi_includedir)
 pkgconf.set('VERSION', meson.project_version())
 
 configure_file(input: 'atspi-2.pc.in',
@@ -113,3 +130,7 @@ subdir('test')
 if get_option('enable_docs')
   subdir('doc/libatspi')
 endif
+
+if xgettext.found()
+  subdir('po')
+endif