1d722e3fbSopenharmony_ci# Copyright © 2017-2018 Intel Corporation
2d722e3fbSopenharmony_ci
3d722e3fbSopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
4d722e3fbSopenharmony_ci# of this software and associated documentation files (the "Software"), to deal
5d722e3fbSopenharmony_ci# in the Software without restriction, including without limitation the rights
6d722e3fbSopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7d722e3fbSopenharmony_ci# copies of the Software, and to permit persons to whom the Software is
8d722e3fbSopenharmony_ci# furnished to do so, subject to the following conditions:
9d722e3fbSopenharmony_ci
10d722e3fbSopenharmony_ci# The above copyright notice and this permission notice shall be included in
11d722e3fbSopenharmony_ci# all copies or substantial portions of the Software.
12d722e3fbSopenharmony_ci
13d722e3fbSopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14d722e3fbSopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15d722e3fbSopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16d722e3fbSopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17d722e3fbSopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18d722e3fbSopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19d722e3fbSopenharmony_ci# SOFTWARE.
20d722e3fbSopenharmony_ci
21d722e3fbSopenharmony_ciproject(
22d722e3fbSopenharmony_ci  'libdrm',
23d722e3fbSopenharmony_ci  ['c'],
24d722e3fbSopenharmony_ci  version : '2.4.111',
25d722e3fbSopenharmony_ci  license : 'MIT',
26d722e3fbSopenharmony_ci  meson_version : '>= 0.53',
27d722e3fbSopenharmony_ci  default_options : ['buildtype=debugoptimized', 'c_std=c99'],
28d722e3fbSopenharmony_ci)
29d722e3fbSopenharmony_ci
30d722e3fbSopenharmony_cipkg = import('pkgconfig')
31d722e3fbSopenharmony_ci
32d722e3fbSopenharmony_ciconfig = configuration_data()
33d722e3fbSopenharmony_ci
34d722e3fbSopenharmony_ciconfig.set10('UDEV', get_option('udev'))
35d722e3fbSopenharmony_ciwith_freedreno_kgsl = get_option('freedreno-kgsl')
36d722e3fbSopenharmony_ciwith_install_tests = get_option('install-test-programs')
37d722e3fbSopenharmony_ci
38d722e3fbSopenharmony_ciif ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system())
39d722e3fbSopenharmony_ci  dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
40d722e3fbSopenharmony_cielse
41d722e3fbSopenharmony_ci  dep_pthread_stubs = []
42d722e3fbSopenharmony_ciendif
43d722e3fbSopenharmony_cidep_threads = dependency('threads')
44d722e3fbSopenharmony_ci
45d722e3fbSopenharmony_cicc = meson.get_compiler('c')
46d722e3fbSopenharmony_ci
47d722e3fbSopenharmony_ciandroid = cc.compiles('''int func() { return __ANDROID__; }''')
48d722e3fbSopenharmony_ci
49d722e3fbSopenharmony_cisymbols_check = find_program('symbols-check.py')
50d722e3fbSopenharmony_ciprog_nm = find_program('nm')
51d722e3fbSopenharmony_ci
52d722e3fbSopenharmony_ci# Check for atomics
53d722e3fbSopenharmony_ciintel_atomics = false
54d722e3fbSopenharmony_cilib_atomics = false
55d722e3fbSopenharmony_ci
56d722e3fbSopenharmony_cipython3 = import('python').find_installation()
57d722e3fbSopenharmony_ciformat_mod_static_table = custom_target(
58d722e3fbSopenharmony_ci  'format_mod_static_table',
59d722e3fbSopenharmony_ci  output : 'generated_static_table_fourcc.h',
60d722e3fbSopenharmony_ci  input : 'include/drm/drm_fourcc.h',
61d722e3fbSopenharmony_ci  command : [python3, files('gen_table_fourcc.py'), '@INPUT@', '@OUTPUT@'])
62d722e3fbSopenharmony_ci
63d722e3fbSopenharmony_cidep_atomic_ops = dependency('atomic_ops', required : false)
64d722e3fbSopenharmony_ciif cc.links('''
65d722e3fbSopenharmony_ci    int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
66d722e3fbSopenharmony_ci    int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
67d722e3fbSopenharmony_ci    int main() { }
68d722e3fbSopenharmony_ci    ''',
69d722e3fbSopenharmony_ci    name : 'Intel Atomics')
70d722e3fbSopenharmony_ci  intel_atomics = true
71d722e3fbSopenharmony_ci  with_atomics = true
72d722e3fbSopenharmony_ci  dep_atomic_ops = []
73d722e3fbSopenharmony_cielif dep_atomic_ops.found()
74d722e3fbSopenharmony_ci  lib_atomics = true
75d722e3fbSopenharmony_ci  with_atomics = true
76d722e3fbSopenharmony_cielif cc.has_function('atomic_cas_uint')
77d722e3fbSopenharmony_ci  with_atomics = true
78d722e3fbSopenharmony_cielse
79d722e3fbSopenharmony_ci  with_atomics = false
80d722e3fbSopenharmony_ciendif
81d722e3fbSopenharmony_ci
82d722e3fbSopenharmony_ciconfig.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
83d722e3fbSopenharmony_ciconfig.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
84d722e3fbSopenharmony_ci
85d722e3fbSopenharmony_ciwith_intel = false
86d722e3fbSopenharmony_ci_intel = get_option('intel')
87d722e3fbSopenharmony_ciif _intel != 'false'
88d722e3fbSopenharmony_ci  if _intel == 'true' and not with_atomics
89d722e3fbSopenharmony_ci    error('libdrm_intel requires atomics.')
90d722e3fbSopenharmony_ci  else
91d722e3fbSopenharmony_ci    with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
92d722e3fbSopenharmony_ci  endif
93d722e3fbSopenharmony_ciendif
94d722e3fbSopenharmony_cisummary('Intel', with_intel)
95d722e3fbSopenharmony_ci
96d722e3fbSopenharmony_ciwith_radeon = false
97d722e3fbSopenharmony_ci_radeon = get_option('radeon')
98d722e3fbSopenharmony_ciif _radeon != 'false'
99d722e3fbSopenharmony_ci  if _radeon == 'true' and not with_atomics
100d722e3fbSopenharmony_ci    error('libdrm_radeon requires atomics.')
101d722e3fbSopenharmony_ci  endif
102d722e3fbSopenharmony_ci  with_radeon = true
103d722e3fbSopenharmony_ciendif
104d722e3fbSopenharmony_cisummary('Radeon', with_radeon)
105d722e3fbSopenharmony_ci
106d722e3fbSopenharmony_ciwith_amdgpu = false
107d722e3fbSopenharmony_ci_amdgpu = get_option('amdgpu')
108d722e3fbSopenharmony_ciif _amdgpu != 'false'
109d722e3fbSopenharmony_ci  if _amdgpu == 'true' and not with_atomics
110d722e3fbSopenharmony_ci    error('libdrm_amdgpu requires atomics.')
111d722e3fbSopenharmony_ci  endif
112d722e3fbSopenharmony_ci  with_amdgpu = true
113d722e3fbSopenharmony_ciendif
114d722e3fbSopenharmony_cisummary('AMDGPU', with_amdgpu)
115d722e3fbSopenharmony_ci
116d722e3fbSopenharmony_ciwith_nouveau = false
117d722e3fbSopenharmony_ci_nouveau = get_option('nouveau')
118d722e3fbSopenharmony_ciif _nouveau != 'false'
119d722e3fbSopenharmony_ci  if _nouveau == 'true' and not with_atomics
120d722e3fbSopenharmony_ci    error('libdrm_nouveau requires atomics.')
121d722e3fbSopenharmony_ci  endif
122d722e3fbSopenharmony_ci  with_nouveau = true
123d722e3fbSopenharmony_ciendif
124d722e3fbSopenharmony_cisummary('Nouveau', with_nouveau)
125d722e3fbSopenharmony_ci
126d722e3fbSopenharmony_ciwith_vmwgfx = false
127d722e3fbSopenharmony_ci_vmwgfx = get_option('vmwgfx')
128d722e3fbSopenharmony_ciif _vmwgfx != 'false'
129d722e3fbSopenharmony_ci  with_vmwgfx = true
130d722e3fbSopenharmony_ciendif
131d722e3fbSopenharmony_cisummary('vmwgfx', with_vmwgfx)
132d722e3fbSopenharmony_ci
133d722e3fbSopenharmony_ciwith_omap = false
134d722e3fbSopenharmony_ci_omap = get_option('omap')
135d722e3fbSopenharmony_ciif _omap == 'true'
136d722e3fbSopenharmony_ci  if not with_atomics
137d722e3fbSopenharmony_ci    error('libdrm_omap requires atomics.')
138d722e3fbSopenharmony_ci  endif
139d722e3fbSopenharmony_ci  with_omap = true
140d722e3fbSopenharmony_ciendif
141d722e3fbSopenharmony_cisummary('OMAP', with_omap)
142d722e3fbSopenharmony_ci
143d722e3fbSopenharmony_ciwith_freedreno = false
144d722e3fbSopenharmony_ci_freedreno = get_option('freedreno')
145d722e3fbSopenharmony_ciif _freedreno != 'false'
146d722e3fbSopenharmony_ci  if _freedreno == 'true' and not with_atomics
147d722e3fbSopenharmony_ci    error('libdrm_freedreno requires atomics.')
148d722e3fbSopenharmony_ci  else
149d722e3fbSopenharmony_ci    with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
150d722e3fbSopenharmony_ci  endif
151d722e3fbSopenharmony_ciendif
152d722e3fbSopenharmony_cisummary('Freedreno', with_freedreno)
153d722e3fbSopenharmony_cisummary('Freedreon-kgsl', with_freedreno_kgsl)
154d722e3fbSopenharmony_ci
155d722e3fbSopenharmony_ciwith_tegra = false
156d722e3fbSopenharmony_ci_tegra = get_option('tegra')
157d722e3fbSopenharmony_ciif _tegra == 'true'
158d722e3fbSopenharmony_ci  if not with_atomics
159d722e3fbSopenharmony_ci    error('libdrm_tegra requires atomics.')
160d722e3fbSopenharmony_ci  endif
161d722e3fbSopenharmony_ci  with_tegra = true
162d722e3fbSopenharmony_ciendif
163d722e3fbSopenharmony_cisummary('Tegra', with_tegra)
164d722e3fbSopenharmony_ci
165d722e3fbSopenharmony_ciwith_etnaviv = false
166d722e3fbSopenharmony_ci_etnaviv = get_option('etnaviv')
167d722e3fbSopenharmony_ciif _etnaviv == 'true'
168d722e3fbSopenharmony_ci  if not with_atomics
169d722e3fbSopenharmony_ci    error('libdrm_etnaviv requires atomics.')
170d722e3fbSopenharmony_ci  endif
171d722e3fbSopenharmony_ci  with_etnaviv = true
172d722e3fbSopenharmony_ciendif
173d722e3fbSopenharmony_cisummary('Etnaviv', with_etnaviv)
174d722e3fbSopenharmony_ci
175d722e3fbSopenharmony_ciwith_exynos = get_option('exynos') == 'true'
176d722e3fbSopenharmony_cisummary('EXYNOS', with_exynos)
177d722e3fbSopenharmony_ci
178d722e3fbSopenharmony_ciwith_vc4 = false
179d722e3fbSopenharmony_ci_vc4 = get_option('vc4')
180d722e3fbSopenharmony_ciif _vc4 != 'false'
181d722e3fbSopenharmony_ci  with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
182d722e3fbSopenharmony_ciendif
183d722e3fbSopenharmony_cisummary('VC4', with_vc4)
184d722e3fbSopenharmony_ci
185d722e3fbSopenharmony_ci# Among others FreeBSD does not have a separate dl library.
186d722e3fbSopenharmony_ciif not cc.has_function('dlsym')
187d722e3fbSopenharmony_ci  dep_dl = cc.find_library('dl', required : with_nouveau)
188d722e3fbSopenharmony_cielse
189d722e3fbSopenharmony_ci  dep_dl = []
190d722e3fbSopenharmony_ciendif
191d722e3fbSopenharmony_ci# clock_gettime might require -rt, or it might not. find out
192d722e3fbSopenharmony_ciif not cc.has_function('clock_gettime', prefix : '#define _GNU_SOURCE\n#include <time.h>')
193d722e3fbSopenharmony_ci  # XXX: untested
194d722e3fbSopenharmony_ci  dep_rt = cc.find_library('rt')
195d722e3fbSopenharmony_cielse
196d722e3fbSopenharmony_ci  dep_rt = []
197d722e3fbSopenharmony_ciendif
198d722e3fbSopenharmony_cidep_m = cc.find_library('m', required : false)
199d722e3fbSopenharmony_ci
200d722e3fbSopenharmony_ci# The header is not required on Linux, and is in fact deprecated in glibc 2.30+
201d722e3fbSopenharmony_ciif ['linux'].contains(host_machine.system())
202d722e3fbSopenharmony_ci  config.set10('HAVE_SYS_SYSCTL_H', false)
203d722e3fbSopenharmony_cielse
204d722e3fbSopenharmony_ci  # From Niclas Zeising:
205d722e3fbSopenharmony_ci  # FreeBSD requires sys/types.h for sys/sysctl.h, so add it as part of
206d722e3fbSopenharmony_ci  # the includes when checking for headers.
207d722e3fbSopenharmony_ci  config.set10('HAVE_SYS_SYSCTL_H',
208d722e3fbSopenharmony_ci    cc.compiles('#include <sys/types.h>\n#include <sys/sysctl.h>', name : 'sys/sysctl.h works'))
209d722e3fbSopenharmony_ciendif
210d722e3fbSopenharmony_ci
211d722e3fbSopenharmony_ciforeach header : ['sys/select.h', 'alloca.h']
212d722e3fbSopenharmony_ci  config.set10('HAVE_' + header.underscorify().to_upper(), cc.check_header(header))
213d722e3fbSopenharmony_ciendforeach
214d722e3fbSopenharmony_ci
215d722e3fbSopenharmony_ciif (cc.has_header_symbol('sys/sysmacros.h', 'major') and
216d722e3fbSopenharmony_ci  cc.has_header_symbol('sys/sysmacros.h', 'minor') and
217d722e3fbSopenharmony_ci  cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
218d722e3fbSopenharmony_ci  config.set10('MAJOR_IN_SYSMACROS', true)
219d722e3fbSopenharmony_ciendif
220d722e3fbSopenharmony_ciif (cc.has_header_symbol('sys/mkdev.h', 'major') and
221d722e3fbSopenharmony_ci  cc.has_header_symbol('sys/mkdev.h', 'minor') and
222d722e3fbSopenharmony_ci  cc.has_header_symbol('sys/mkdev.h', 'makedev'))
223d722e3fbSopenharmony_ci  config.set10('MAJOR_IN_MKDEV', true)
224d722e3fbSopenharmony_ciendif
225d722e3fbSopenharmony_ciconfig.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
226d722e3fbSopenharmony_ci
227d722e3fbSopenharmony_cilibdrm_c_args = cc.get_supported_arguments([
228d722e3fbSopenharmony_ci  '-Wsign-compare', '-Werror=undef', '-Werror=implicit-function-declaration',
229d722e3fbSopenharmony_ci  '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes',
230d722e3fbSopenharmony_ci  '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs',
231d722e3fbSopenharmony_ci  '-Wpacked', '-Wswitch-enum', '-Wmissing-format-attribute',
232d722e3fbSopenharmony_ci  '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
233d722e3fbSopenharmony_ci  '-Wdeclaration-after-statement', '-Wold-style-definition',
234d722e3fbSopenharmony_ci  '-Wno-unused-parameter', '-Wno-attributes', '-Wno-long-long',
235d722e3fbSopenharmony_ci  '-Wno-missing-field-initializers'])
236d722e3fbSopenharmony_ci
237d722e3fbSopenharmony_cidep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel)
238d722e3fbSopenharmony_cidep_cunit = dependency('cunit', version : '>= 2.1', required : false)
239d722e3fbSopenharmony_ci_cairo_tests = get_option('cairo-tests')
240d722e3fbSopenharmony_ciif _cairo_tests != 'false'
241d722e3fbSopenharmony_ci  dep_cairo = dependency('cairo', required : _cairo_tests == 'true')
242d722e3fbSopenharmony_ci  with_cairo_tests = dep_cairo.found()
243d722e3fbSopenharmony_cielse
244d722e3fbSopenharmony_ci  dep_cairo = []
245d722e3fbSopenharmony_ci  with_cairo_tests = false
246d722e3fbSopenharmony_ciendif
247d722e3fbSopenharmony_ci_valgrind = get_option('valgrind')
248d722e3fbSopenharmony_ciif _valgrind != 'false'
249d722e3fbSopenharmony_ci  if with_freedreno
250d722e3fbSopenharmony_ci    dep_valgrind = dependency('valgrind', required : _valgrind == 'true', version : '>=3.10.0')
251d722e3fbSopenharmony_ci  else
252d722e3fbSopenharmony_ci    dep_valgrind = dependency('valgrind', required : _valgrind == 'true')
253d722e3fbSopenharmony_ci  endif
254d722e3fbSopenharmony_ci  with_valgrind = dep_valgrind.found()
255d722e3fbSopenharmony_cielse
256d722e3fbSopenharmony_ci  dep_valgrind = []
257d722e3fbSopenharmony_ci  with_valgrind = false
258d722e3fbSopenharmony_ciendif
259d722e3fbSopenharmony_ci
260d722e3fbSopenharmony_ciwith_man_pages = get_option('man-pages')
261d722e3fbSopenharmony_ciprog_rst2man = find_program('rst2man', 'rst2man.py', required: with_man_pages == 'true')
262d722e3fbSopenharmony_ciwith_man_pages = with_man_pages != 'false' and prog_rst2man.found()
263d722e3fbSopenharmony_ci
264d722e3fbSopenharmony_ciconfig.set10('HAVE_VISIBILITY', cc.has_function_attribute('visibility:hidden'))
265d722e3fbSopenharmony_ci
266d722e3fbSopenharmony_ciforeach t : [
267d722e3fbSopenharmony_ci             [with_exynos, 'EXYNOS'],
268d722e3fbSopenharmony_ci             [with_freedreno_kgsl, 'FREEDRENO_KGSL'],
269d722e3fbSopenharmony_ci             [with_intel, 'INTEL'],
270d722e3fbSopenharmony_ci             [with_nouveau, 'NOUVEAU'],
271d722e3fbSopenharmony_ci             [with_radeon, 'RADEON'],
272d722e3fbSopenharmony_ci             [with_vc4, 'VC4'],
273d722e3fbSopenharmony_ci             [with_vmwgfx, 'VMWGFX'],
274d722e3fbSopenharmony_ci             [with_cairo_tests, 'CAIRO'],
275d722e3fbSopenharmony_ci             [with_valgrind, 'VALGRIND'],
276d722e3fbSopenharmony_ci            ]
277d722e3fbSopenharmony_ci  config.set10('HAVE_@0@'.format(t[1]), t[0])
278d722e3fbSopenharmony_ciendforeach
279d722e3fbSopenharmony_ciif with_freedreno_kgsl and not with_freedreno
280d722e3fbSopenharmony_ci  error('cannot enable freedreno-kgsl without freedreno support')
281d722e3fbSopenharmony_ciendif
282d722e3fbSopenharmony_ciconfig.set10('_GNU_SOURCE', true)
283d722e3fbSopenharmony_ciconfig_file = configure_file(
284d722e3fbSopenharmony_ci  configuration : config,
285d722e3fbSopenharmony_ci  output : 'config.h',
286d722e3fbSopenharmony_ci)
287d722e3fbSopenharmony_ciadd_project_arguments('-include', '@0@'.format(config_file), language : 'c')
288d722e3fbSopenharmony_ci
289d722e3fbSopenharmony_ciinc_root = include_directories('.')
290d722e3fbSopenharmony_ciinc_drm = include_directories('include/drm')
291d722e3fbSopenharmony_ci
292d722e3fbSopenharmony_cilibdrm_files = [files(
293d722e3fbSopenharmony_ci   'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
294d722e3fbSopenharmony_ci   'xf86drmMode.c'
295d722e3fbSopenharmony_ci  ),
296d722e3fbSopenharmony_ci  config_file, format_mod_static_table
297d722e3fbSopenharmony_ci]
298d722e3fbSopenharmony_ci
299d722e3fbSopenharmony_ci# Build an unversioned so on android
300d722e3fbSopenharmony_ciif android
301d722e3fbSopenharmony_ci  libdrm_kw = {}
302d722e3fbSopenharmony_cielse
303d722e3fbSopenharmony_ci  libdrm_kw = {'version' : '2.4.0'}
304d722e3fbSopenharmony_ciendif
305d722e3fbSopenharmony_ci
306d722e3fbSopenharmony_cilibdrm = library(
307d722e3fbSopenharmony_ci  'drm',
308d722e3fbSopenharmony_ci  libdrm_files,
309d722e3fbSopenharmony_ci  c_args : libdrm_c_args,
310d722e3fbSopenharmony_ci  dependencies : [dep_valgrind, dep_rt, dep_m],
311d722e3fbSopenharmony_ci  include_directories : inc_drm,
312d722e3fbSopenharmony_ci  install : true,
313d722e3fbSopenharmony_ci  kwargs : libdrm_kw,
314d722e3fbSopenharmony_ci  gnu_symbol_visibility : 'hidden',
315d722e3fbSopenharmony_ci)
316d722e3fbSopenharmony_ci
317d722e3fbSopenharmony_citest(
318d722e3fbSopenharmony_ci  'core-symbols-check',
319d722e3fbSopenharmony_ci  symbols_check,
320d722e3fbSopenharmony_ci  args : [
321d722e3fbSopenharmony_ci    '--lib', libdrm,
322d722e3fbSopenharmony_ci    '--symbols-file', files('core-symbols.txt'),
323d722e3fbSopenharmony_ci    '--nm', prog_nm.path(),
324d722e3fbSopenharmony_ci  ],
325d722e3fbSopenharmony_ci)
326d722e3fbSopenharmony_ci
327d722e3fbSopenharmony_ciext_libdrm = declare_dependency(
328d722e3fbSopenharmony_ci  link_with : libdrm,
329d722e3fbSopenharmony_ci  include_directories : [inc_root, inc_drm],
330d722e3fbSopenharmony_ci)
331d722e3fbSopenharmony_ci
332d722e3fbSopenharmony_ciif meson.version().version_compare('>= 0.54.0')
333d722e3fbSopenharmony_ci  meson.override_dependency('libdrm', ext_libdrm)
334d722e3fbSopenharmony_ciendif
335d722e3fbSopenharmony_ci
336d722e3fbSopenharmony_ciinstall_headers('libsync.h', 'xf86drm.h', 'xf86drmMode.h')
337d722e3fbSopenharmony_ciinstall_headers(
338d722e3fbSopenharmony_ci  'include/drm/drm.h', 'include/drm/drm_fourcc.h', 'include/drm/drm_mode.h',
339d722e3fbSopenharmony_ci  'include/drm/drm_sarea.h', 'include/drm/i915_drm.h',
340d722e3fbSopenharmony_ci  'include/drm/mach64_drm.h', 'include/drm/mga_drm.h',
341d722e3fbSopenharmony_ci  'include/drm/msm_drm.h', 'include/drm/nouveau_drm.h',
342d722e3fbSopenharmony_ci  'include/drm/qxl_drm.h', 'include/drm/r128_drm.h',
343d722e3fbSopenharmony_ci  'include/drm/radeon_drm.h', 'include/drm/amdgpu_drm.h',
344d722e3fbSopenharmony_ci  'include/drm/savage_drm.h', 'include/drm/sis_drm.h',
345d722e3fbSopenharmony_ci  'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h',
346d722e3fbSopenharmony_ci  'include/drm/via_drm.h', 'include/drm/virtgpu_drm.h',
347d722e3fbSopenharmony_ci  subdir : 'libdrm',
348d722e3fbSopenharmony_ci)
349d722e3fbSopenharmony_ciif with_vmwgfx
350d722e3fbSopenharmony_ci  install_headers('include/drm/vmwgfx_drm.h', subdir : 'libdrm')
351d722e3fbSopenharmony_ciendif
352d722e3fbSopenharmony_ci
353d722e3fbSopenharmony_cipkg.generate(
354d722e3fbSopenharmony_ci  libdrm,
355d722e3fbSopenharmony_ci  name : 'libdrm',
356d722e3fbSopenharmony_ci  subdirs : ['.', 'libdrm'],
357d722e3fbSopenharmony_ci  description : 'Userspace interface to kernel DRM services',
358d722e3fbSopenharmony_ci)
359d722e3fbSopenharmony_ci
360d722e3fbSopenharmony_ciif with_intel
361d722e3fbSopenharmony_ci  subdir('intel')
362d722e3fbSopenharmony_ciendif
363d722e3fbSopenharmony_ciif with_nouveau
364d722e3fbSopenharmony_ci  subdir('nouveau')
365d722e3fbSopenharmony_ciendif
366d722e3fbSopenharmony_ciif with_radeon
367d722e3fbSopenharmony_ci  subdir('radeon')
368d722e3fbSopenharmony_ciendif
369d722e3fbSopenharmony_ciif with_amdgpu
370d722e3fbSopenharmony_ci  subdir('amdgpu')
371d722e3fbSopenharmony_ciendif
372d722e3fbSopenharmony_ciif with_omap
373d722e3fbSopenharmony_ci  subdir('omap')
374d722e3fbSopenharmony_ciendif
375d722e3fbSopenharmony_ciif with_exynos
376d722e3fbSopenharmony_ci  subdir('exynos')
377d722e3fbSopenharmony_ciendif
378d722e3fbSopenharmony_ciif with_freedreno
379d722e3fbSopenharmony_ci  subdir('freedreno')
380d722e3fbSopenharmony_ciendif
381d722e3fbSopenharmony_ciif with_tegra
382d722e3fbSopenharmony_ci  subdir('tegra')
383d722e3fbSopenharmony_ciendif
384d722e3fbSopenharmony_ciif with_vc4
385d722e3fbSopenharmony_ci  subdir('vc4')
386d722e3fbSopenharmony_ciendif
387d722e3fbSopenharmony_ciif with_etnaviv
388d722e3fbSopenharmony_ci  subdir('etnaviv')
389d722e3fbSopenharmony_ciendif
390d722e3fbSopenharmony_ciif with_man_pages
391d722e3fbSopenharmony_ci  subdir('man')
392d722e3fbSopenharmony_ciendif
393d722e3fbSopenharmony_cisubdir('data')
394d722e3fbSopenharmony_cisubdir('tests')
395