|
0 |
project('xf86-input-libinput', 'c',
|
|
1 |
version: '1.2.1', # bump version in configure.ac
|
|
2 |
default_options: ['warning_level=2'],
|
|
3 |
meson_version: '>= 0.50.0')
|
|
4 |
|
|
5 |
driver_version = meson.project_version().split('.')
|
|
6 |
|
|
7 |
dir_pkgconf = get_option('prefix') / get_option('libdir') / 'pkgconfig'
|
|
8 |
dir_man4 = get_option('prefix') / get_option('mandir') / 'man4'
|
|
9 |
|
|
10 |
cc = meson.get_compiler('c')
|
|
11 |
cflags = [
|
|
12 |
'-Wno-unused-parameter',
|
|
13 |
'-Wno-sign-compare', # lots of work to get rid of this
|
|
14 |
'-Wmissing-prototypes',
|
|
15 |
'-Wstrict-prototypes',
|
|
16 |
'-Wlogical-op',
|
|
17 |
'-Wpointer-arith',
|
|
18 |
'-Wuninitialized',
|
|
19 |
'-Winit-self',
|
|
20 |
'-Wstrict-prototypes',
|
|
21 |
'-Wimplicit-fallthrough',
|
|
22 |
'-Wredundant-decls',
|
|
23 |
'-Wincompatible-pointer-types',
|
|
24 |
'-Wformat=2',
|
|
25 |
'-Wno-missing-field-initializers',
|
|
26 |
'-Wmissing-declarations',
|
|
27 |
|
|
28 |
'-fvisibility=hidden',
|
|
29 |
]
|
|
30 |
add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
|
|
31 |
|
|
32 |
pkgconfig = import('pkgconfig')
|
|
33 |
dep_xserver = dependency('xorg-server', version: '>= 1.19')
|
|
34 |
dep_xproto = dependency('xproto')
|
|
35 |
dep_inputproto = dependency('inputproto', version: '>= 2.2')
|
|
36 |
dep_libinput = dependency('libinput', version: '>= 1.11.0')
|
|
37 |
|
|
38 |
config_h = configuration_data()
|
|
39 |
config_h.set('PACKAGE_VERSION_MAJOR', driver_version[0])
|
|
40 |
config_h.set('PACKAGE_VERSION_MINOR', driver_version[1])
|
|
41 |
config_h.set('PACKAGE_VERSION_PATCHLEVEL', driver_version[2])
|
|
42 |
|
|
43 |
if dep_inputproto.version().version_compare('>= 2.3.99.1')
|
|
44 |
config_h.set('HAVE_INPUTPROTO24', 1)
|
|
45 |
endif
|
|
46 |
|
|
47 |
if cc.has_function('libinput_device_config_scroll_get_button_lock',
|
|
48 |
dependencies: dep_libinput)
|
|
49 |
config_h.set('HAVE_LIBINPUT_SCROLL_BUTTON_LOCK', 1)
|
|
50 |
endif
|
|
51 |
if cc.has_function('libinput_event_pointer_get_scroll_value_v120',
|
|
52 |
dependencies: dep_libinput)
|
|
53 |
config_h.set('HAVE_LIBINPUT_AXIS_VALUE_V120', 1)
|
|
54 |
endif
|
|
55 |
|
|
56 |
dir_headers = get_option('sdkdir')
|
|
57 |
if dir_headers == ''
|
|
58 |
dir_headers = dep_xserver.get_pkgconfig_variable('sdkdir')
|
|
59 |
endif
|
|
60 |
|
|
61 |
dir_xorg_module = get_option('xorg-module-dir')
|
|
62 |
if dir_xorg_module == ''
|
|
63 |
dir_xorg_module = dep_xserver.get_pkgconfig_variable('moduledir') / 'input'
|
|
64 |
endif
|
|
65 |
|
|
66 |
dir_xorg_conf = get_option('xorg-conf-dir')
|
|
67 |
if dir_xorg_conf == ''
|
|
68 |
dir_xorg_conf = dep_xserver.get_pkgconfig_variable('sysconfigdir')
|
|
69 |
endif
|
|
70 |
|
|
71 |
libbezier = static_library('bezier', ['src/bezier.c', 'src/bezier.h'])
|
|
72 |
dep_libbezier = declare_dependency(link_with: libbezier)
|
|
73 |
|
|
74 |
libdraglock = static_library('draglock', ['src/draglock.c', 'src/draglock.h'])
|
|
75 |
dep_libdraglock = declare_dependency(link_with: libdraglock)
|
|
76 |
|
|
77 |
dep_drivers = [
|
|
78 |
dep_xserver,
|
|
79 |
dep_xproto,
|
|
80 |
dep_inputproto,
|
|
81 |
dep_libinput,
|
|
82 |
dep_libbezier,
|
|
83 |
dep_libdraglock,
|
|
84 |
]
|
|
85 |
|
|
86 |
driver_src = ['src/xf86libinput.c']
|
|
87 |
driver_lib = shared_module(
|
|
88 |
'libinput_drv',
|
|
89 |
driver_src,
|
|
90 |
name_prefix: '', # we want libinput_drv.so, not liblibinput_drv.so
|
|
91 |
include_directories: include_directories('include'),
|
|
92 |
dependencies: dep_drivers,
|
|
93 |
install: true,
|
|
94 |
install_dir: dir_xorg_module,
|
|
95 |
)
|
|
96 |
|
|
97 |
test_bezier = executable('test-bezier',
|
|
98 |
['test/test-bezier.c'],
|
|
99 |
dependencies: dep_libbezier,
|
|
100 |
include_directories: include_directories('src'),
|
|
101 |
install: false)
|
|
102 |
test('test-bezier', test_bezier)
|
|
103 |
|
|
104 |
test_draglock = executable('test-draglock',
|
|
105 |
['test/test-draglock.c'],
|
|
106 |
dependencies: dep_libdraglock,
|
|
107 |
include_directories: include_directories('src'),
|
|
108 |
install: false)
|
|
109 |
test('test-draglock', test_draglock)
|
|
110 |
|
|
111 |
|
|
112 |
conf_pkgconf = configuration_data()
|
|
113 |
conf_pkgconf.set('PACKAGE_VERSION', meson.project_version())
|
|
114 |
conf_pkgconf.set('sdkdir', dir_headers)
|
|
115 |
|
|
116 |
configure_file(
|
|
117 |
input: 'xorg-libinput.pc.in',
|
|
118 |
output: 'xorg-libinput.pc',
|
|
119 |
configuration: conf_pkgconf,
|
|
120 |
install_dir: dir_pkgconf,
|
|
121 |
)
|
|
122 |
|
|
123 |
config_man = configuration_data()
|
|
124 |
config_man.set('VERSION', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
|
|
125 |
|
|
126 |
configure_file(
|
|
127 |
input: 'man/libinput.man',
|
|
128 |
output: 'libinput.4',
|
|
129 |
configuration: config_man,
|
|
130 |
install_dir: dir_man4
|
|
131 |
)
|
|
132 |
|
|
133 |
install_data('conf/40-libinput.conf', install_dir: dir_xorg_conf)
|
|
134 |
|
|
135 |
# Now generate config.h
|
|
136 |
configure_file(output: 'config.h', configuration: config_h)
|