From: Mike Gorse Date: Tue, 24 Oct 2017 01:21:57 +0000 (-0500) Subject: meson: x11 fixes X-Git-Tag: AT_SPI2_CORE_2_26_1~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70705839990f8eb5112b0262bb0960e806c62fbc;hp=5811e35fedbdf7124872b6ffb76ae0bfa851bef2;p=platform%2Fupstream%2Fat-spi2-core.git meson: x11 fixes Meson wasn't defining HAVE_X11, so x11 support wasn't being compiled even if X was determined to be present. Also, add an enable-x11 option (default is to auto-detect). --- diff --git a/atspi/meson.build b/atspi/meson.build index 1ec3ecd..327134a 100644 --- a/atspi/meson.build +++ b/atspi/meson.build @@ -69,7 +69,7 @@ atspi_enum_h = atspi_enums[1] atspi = shared_library('atspi', atspi_sources + atspi_enums, include_directories: [ root_inc, registryd_inc ], - dependencies: [ libdbus_dep, gobject_dep, dbind_dep ], + dependencies: [ libdbus_dep, gobject_dep, dbind_dep, x11_deps ], install: true) atspi_dep = declare_dependency(link_with: atspi, diff --git a/bus/meson.build b/bus/meson.build index 8e4673f..909103c 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -45,7 +45,7 @@ endif executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c', include_directories: [ root_inc, include_directories('.') ], - dependencies: [ gio_dep ], + dependencies: [ gio_dep, x11_deps ], c_args: [ '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), '-DDATADIR="@0@"'.format(atspi_datadir), diff --git a/meson.build b/meson.build index e746e14..4eac857 100644 --- a/meson.build +++ b/meson.build @@ -53,21 +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 - - if cc.has_function('XkbGetMap', dependencies: x11_deps) - 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 diff --git a/meson_options.txt b/meson_options.txt index 305fc8c..c9afe2f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,3 +16,5 @@ option('enable_docs', value: false) option('enable-introspection', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable GObject Introspection (depends on GObject)') + +option('enable-x11', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable X11 support') diff --git a/registryd/meson.build b/registryd/meson.build index 5de6902..eb8236e 100644 --- a/registryd/meson.build +++ b/registryd/meson.build @@ -16,15 +16,18 @@ registryd_deps = [ dl_dep, ] -if x11_dep.found() - registryd_sources += [ - 'deviceeventcontroller-x11.c', - 'display.c', - 'event-source.c', - 'ucs2keysym.c', - ] +x11_option = get_option('enable-x11') +if x11_option != 'no' + if x11_dep.found() + registryd_sources += [ + 'deviceeventcontroller-x11.c', + 'display.c', + 'event-source.c', + 'ucs2keysym.c', + ] - registryd_deps += x11_deps + registryd_deps += x11_deps + endif endif executable('at-spi2-registryd', registryd_sources,