diff --git a/include/meson.build b/include/meson.build index 9a7547c47..5864ced5c 100644 --- a/include/meson.build +++ b/include/meson.build @@ -53,7 +53,17 @@ conf_data.set('HAS_APERTURE_DRV', host_machine.system() == 'openbsd') # XXX: BUNDLE_ID_PREFIX conf_data.set_quoted('OSNAME', 'Linux') # XXX -conf_data.set('HAVE_INPUTTHREAD', '1') # XXX + +if get_option('input_thread') == 'false' + enable_input_thread = false +else + enable_input_thread = cc.has_header_symbol('pthread.h', + 'PTHREAD_MUTEX_RECURSIVE') + if not enable_input_thread and get_option('input_thread') == 'true' + error('Input thread enabled and PTHREAD_MUTEX_RECURSIVE not found') + endif +endif +conf_data.set('HAVE_INPUTTHREAD', enable_input_thread) if cc.compiles(''' #define _GNU_SOURCE 1 diff --git a/meson_options.txt b/meson_options.txt index 3f02d5066..6b9641756 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,6 +30,7 @@ option('xdmcp', type: 'boolean', value: true) option('xdm-auth-1', type: 'boolean', value: true) option('secure-rpc', type: 'boolean', value: true) option('ipv6', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto') +option('input_thread', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto') option('xkb_dir', type: 'string') option('xkb_output_dir', type: 'string')