mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-21 11:00:39 +01:00
Autodetect and use libepoll-shim on FreeBSD
This commit is contained in:
parent
61f3e38544
commit
4e3ea4b8e6
2 changed files with 33 additions and 0 deletions
29
meson.build
29
meson.build
|
|
@ -173,6 +173,34 @@ litest_groups_rules_file = configure_file(input : 'udev/80-libinput-device-group
|
|||
install : false,
|
||||
configuration : litest_udev_rules_config)
|
||||
|
||||
############ libepoll-shim (BSD) ############
|
||||
|
||||
if cc.has_header_symbol('sys/epoll.h', 'epoll_create1', prefix : prefix)
|
||||
# epoll is built-in (Linux, illumos)
|
||||
dep_libepoll = declare_dependency()
|
||||
else
|
||||
# epoll is implemented in userspace by libepoll-shim (FreeBSD)
|
||||
dir_libepoll = get_option('epoll-dir')
|
||||
if dir_libepoll == ''
|
||||
dir_libepoll = get_option('prefix')
|
||||
endif
|
||||
includes_epoll = include_directories(join_paths(dir_libepoll, 'include/libepoll-shim'))
|
||||
dep_libepoll = cc.find_library('epoll-shim', dirs : join_paths(dir_libepoll, 'lib'))
|
||||
code = '''
|
||||
#include <sys/epoll.h>
|
||||
int main(void) { epoll_create1(0); }
|
||||
'''
|
||||
if not cc.links(code,
|
||||
name : 'libepoll-shim check',
|
||||
dependencies : [dep_libepoll, dep_rt],
|
||||
include_directories : includes_epoll) # note: wants an include_directories object
|
||||
error('No built-in epoll or libepoll-shim found.')
|
||||
endif
|
||||
dep_libepoll = declare_dependency(
|
||||
include_directories : includes_epoll,
|
||||
dependencies : [dep_libepoll, dep_rt])
|
||||
endif
|
||||
|
||||
############ libinput-util.a ############
|
||||
src_libinput_util = [
|
||||
'src/libinput-util.c',
|
||||
|
|
@ -286,6 +314,7 @@ deps_libinput = [
|
|||
dep_mtdev,
|
||||
dep_udev,
|
||||
dep_libevdev,
|
||||
dep_libepoll,
|
||||
dep_lm,
|
||||
dep_rt,
|
||||
dep_libwacom,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ option('udev-dir',
|
|||
type: 'string',
|
||||
value: '',
|
||||
description: 'udev base directory [default=$prefix/lib/udev]')
|
||||
option('epoll-dir',
|
||||
type: 'string',
|
||||
value: '',
|
||||
description: 'libepoll-shim base directory (for non-Linux OS) [default=$prefix]')
|
||||
option('libwacom',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue