2.31.1
[platform/upstream/at-spi2-core.git] / meson.build
index c8f6951..351b207 100644 (file)
@@ -1,5 +1,5 @@
 project('at-spi2-core', 'c',
-        version: '2.25.91',
+        version: '2.31.1',
         license: 'LGPLv2.1+',
         default_options: [
           'buildtype=debugoptimized',
@@ -8,7 +8,7 @@ project('at-spi2-core', 'c',
         ],
         meson_version: '>= 0.40.1')
 
-add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c')
+add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE' ], language: 'c')
 
 atspi_gir_ns = 'Atspi'
 
@@ -53,23 +53,25 @@ 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)
+x11_option = get_option('enable-x11')
+if x11_option != 'no'
+  x11_dep = dependency('x11', required: false)
+
+  if x11_dep.found()
+    x11_deps += x11_dep
+    at_spi_conf.set('HAVE_X11', 1)
+    xtest_dep = dependency('xtst')
+    x11_deps += xtest_dep
+
+    if cc.has_function('XkbGetMap', dependencies: x11_deps)
+      at_spi_conf.set('HAVE_XKB', 1)
+    endif
+
+    xinput_dep = dependency('xi')
+    x11_deps += xinput_dep
   endif
-
-  xinput_dep = dependency('xi')
-  x11_deps += xinput_dep
 endif
 
 # Alignments
@@ -107,20 +109,6 @@ 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', atspi_libdir)
-pkgconf.set('includedir', atspi_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')