meson: Add configure option and autodetection of HAVE_INPUTTHREAD.

Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2018-09-19 13:07:16 -07:00
parent a56da0ff28
commit bfa6e84641
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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')