broadcom/vc5: Convert vc5_cl.h to use the V3DX() macros.
[mesa.git] / meson.build
1 # Copyright © 2017 Intel Corporation
2
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 project(
22 'mesa',
23 ['c', 'cpp'],
24 version : run_command(
25 [find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py']
26 ).stdout(),
27 license : 'MIT',
28 meson_version : '>= 0.42',
29 default_options : ['buildtype=debugoptimized', 'c_std=c99', 'cpp_std=c++11']
30 )
31
32 # Arguments for the preprocessor, put these in a separate array from the C and
33 # C++ (cpp in meson terminology) arguments since they need to be added to the
34 # default arguments for both C and C++.
35 pre_args = [
36 '-D__STDC_CONSTANT_MACROS',
37 '-D__STDC_FORMAT_MACROS',
38 '-D__STDC_LIMIT_MACROS',
39 '-DVERSION="@0@"'.format(meson.project_version()),
40 '-DPACKAGE_VERSION=VERSION',
41 '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"',
42 ]
43
44 with_vulkan_icd_dir = get_option('vulkan-icd-dir')
45 with_tests = get_option('build-tests')
46 with_valgrind = get_option('valgrind')
47 with_libunwind = get_option('libunwind')
48 with_asm = get_option('asm')
49 with_osmesa = get_option('osmesa')
50 with_swr_arches = get_option('swr-arches').split(',')
51 if get_option('texture-float')
52 pre_args += '-DTEXTURE_FLOAT_ENABLED'
53 message('WARNING: Floating-point texture enabled. Please consult docs/patents.txt and your lawyer before building mesa.')
54 endif
55
56 dri_drivers_path = get_option('dri-drivers-path')
57 if dri_drivers_path == ''
58 dri_drivers_path = join_paths(get_option('libdir'), 'dri')
59 endif
60
61 with_gles1 = get_option('gles1')
62 with_gles2 = get_option('gles2')
63 with_opengl = get_option('opengl')
64 with_any_opengl = with_opengl or with_gles1 or with_gles2
65 # Only build shared_glapi if at least one OpenGL API is enabled
66 with_shared_glapi = get_option('shared-glapi') and with_any_opengl
67
68
69 # shared-glapi is required if at least two OpenGL APIs are being built
70 if not with_shared_glapi
71 if ((with_gles1 and with_gles2) or (with_gles1 and with_opengl)
72 or (with_gles2 and with_opengl))
73 error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
74 endif
75 endif
76
77 # We require OpenGL for OpenGL ES
78 if (with_gles1 or with_gles2) and not with_opengl
79 error('building OpenGL ES without OpenGL is not supported.')
80 endif
81
82 with_dri = false
83 with_dri_i915 = false
84 with_dri_i965 = false
85 with_dri_r100 = false
86 with_dri_r200 = false
87 with_dri_nouveau = false
88 with_dri_swrast = false
89 _drivers = get_option('dri-drivers')
90 if _drivers == 'auto'
91 # TODO: PPC, Sparc
92 if not ['darwin', 'windows'].contains(host_machine.system())
93 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
94 _drivers = 'i915,i965,r100,r200,nouveau'
95 else
96 error('Unknown architecture. Please pass -Ddri-drivers to set driver options. Patches gladly accepted to fix this.')
97 endif
98 else
99 error('Unknown OS. Please pass -Ddri-drivers to set driver options. Patches gladly accepted to fix this.')
100 endif
101 endif
102 if _drivers != ''
103 _split = _drivers.split(',')
104 with_dri_i915 = _split.contains('i915')
105 with_dri_i965 = _split.contains('i965')
106 with_dri_r100 = _split.contains('r100')
107 with_dri_r200 = _split.contains('r200')
108 with_dri_nouveau = _split.contains('nouveau')
109 with_dri_swrast = _split.contains('swrast')
110 with_dri = true
111 endif
112
113 with_gallium = false
114 with_gallium_pl111 = false
115 with_gallium_radeonsi = false
116 with_gallium_r300 = false
117 with_gallium_r600 = false
118 with_gallium_nouveau = false
119 with_gallium_freedreno = false
120 with_gallium_softpipe = false
121 with_gallium_vc4 = false
122 with_gallium_vc5 = false
123 with_gallium_etnaviv = false
124 with_gallium_imx = false
125 with_gallium_i915 = false
126 with_gallium_svga = false
127 with_gallium_virgl = false
128 with_gallium_swr = false
129 _drivers = get_option('gallium-drivers')
130 if _drivers == 'auto'
131 if not ['darwin', 'windows'].contains(host_machine.system())
132 # TODO: PPC, Sparc
133 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
134 _drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
135 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
136 _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,virgl,svga,swrast'
137 else
138 error('Unknown architecture. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.')
139 endif
140 else
141 error('Unknown OS. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.')
142 endif
143 endif
144 if _drivers != ''
145 _split = _drivers.split(',')
146 with_gallium_pl111 = _split.contains('pl111')
147 with_gallium_radeonsi = _split.contains('radeonsi')
148 with_gallium_r300 = _split.contains('r300')
149 with_gallium_r600 = _split.contains('r600')
150 with_gallium_nouveau = _split.contains('nouveau')
151 with_gallium_freedreno = _split.contains('freedreno')
152 with_gallium_softpipe = _split.contains('swrast')
153 with_gallium_vc4 = _split.contains('vc4')
154 with_gallium_vc5 = _split.contains('vc5')
155 with_gallium_etnaviv = _split.contains('etnaviv')
156 with_gallium_imx = _split.contains('imx')
157 with_gallium_i915 = _split.contains('i915')
158 with_gallium_svga = _split.contains('svga')
159 with_gallium_virgl = _split.contains('virgl')
160 with_gallium_swr = _split.contains('swr')
161 with_gallium = true
162 endif
163
164 with_intel_vk = false
165 with_amd_vk = false
166 with_any_vk = false
167 _vulkan_drivers = get_option('vulkan-drivers')
168 if _vulkan_drivers == 'auto'
169 if not ['darwin', 'windows'].contains(host_machine.system())
170 if host_machine.cpu_family().startswith('x86')
171 _vulkan_drivers = 'amd,intel'
172 else
173 error('Unknown architecture. Please pass -Dvulkan-drivers to set driver options. Patches gladly accepted to fix this.')
174 endif
175 else
176 # No vulkan driver supports windows or macOS currently
177 _vulkan_drivers = ''
178 endif
179 endif
180 if _vulkan_drivers != ''
181 _split = _vulkan_drivers.split(',')
182 with_intel_vk = _split.contains('intel')
183 with_amd_vk = _split.contains('amd')
184 with_any_vk = with_amd_vk or with_intel_vk
185 endif
186
187 if with_dri_swrast and (with_gallium_softpipe or with_gallium_swr)
188 error('Only one swrast provider can be built')
189 endif
190 if with_dri_i915 and with_gallium_i915
191 error('Only one i915 provider can be built')
192 endif
193 if with_gallium_imx and not with_gallium_etnaviv
194 error('IMX driver requires etnaviv driver')
195 endif
196 if with_gallium_pl111 and not with_gallium_vc4
197 error('pl111 driver requires vc4 driver')
198 endif
199
200 dep_libdrm_intel = []
201 if with_dri_i915 or with_gallium_i915
202 dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
203 endif
204
205 if host_machine.system() == 'darwin'
206 with_dri_platform = 'apple'
207 elif ['windows', 'cygwin'].contains(host_machine.system())
208 with_dri_platform = 'windows'
209 elif host_machine.system() == 'linux'
210 # FIXME: This should include BSD and possibly other systems
211 with_dri_platform = 'drm'
212 else
213 # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should
214 # assert here that one of those cases has been met.
215 # FIXME: GNU (hurd) ends up here as well, but meson doesn't officially
216 # support Hurd at time of writing (2017/11)
217 with_dri_platform = 'none'
218 endif
219
220 with_platform_android = false
221 with_platform_wayland = false
222 with_platform_x11 = false
223 with_platform_drm = false
224 with_platform_surfaceless = false
225 egl_native_platform = ''
226 _platforms = get_option('platforms')
227 if _platforms == 'auto'
228 if ['linux'].contains(host_machine.system())
229 _platforms = 'x11,wayland,drm,surfaceless'
230 else
231 error('Unknown OS, no platforms enabled. Patches gladly accepted to fix this.')
232 endif
233 endif
234 if _platforms != ''
235 _split = _platforms.split(',')
236 with_platform_android = _split.contains('android')
237 with_platform_x11 = _split.contains('x11')
238 with_platform_wayland = _split.contains('wayland')
239 with_platform_drm = _split.contains('drm')
240 with_platform_surfaceless = _split.contains('surfaceless')
241 egl_native_platform = _split[0]
242 endif
243
244 with_glx = get_option('glx')
245 if with_glx == 'auto'
246 if with_dri
247 with_glx = 'dri'
248 elif with_gallium
249 # Even when building just gallium drivers the user probably wants dri
250 with_glx = 'dri'
251 with_dri = true
252 elif with_platform_x11 and with_any_opengl and not with_any_vk
253 # The automatic behavior should not be to turn on xlib based glx when
254 # building only vulkan drivers
255 with_glx = 'xlib'
256 else
257 with_glx = 'disabled'
258 endif
259 endif
260
261 if not (with_dri or with_gallium or with_glx == 'xlib' or with_glx == 'gallium-xlib')
262 with_gles1 = false
263 with_gles2 = false
264 with_opengl = false
265 with_any_opengl = false
266 with_shared_glapi = false
267 endif
268
269 with_gbm = get_option('gbm')
270 if with_gbm == 'auto' and with_dri # TODO: or gallium
271 with_gbm = host_machine.system() == 'linux'
272 elif with_gbm == 'true'
273 if not ['linux', 'bsd'].contains(host_machine.system())
274 error('GBM only supports unix-like platforms')
275 endif
276 with_gbm = true
277 else
278 with_gbm = false
279 endif
280
281 _egl = get_option('egl')
282 if _egl == 'auto'
283 with_egl = with_dri and with_shared_glapi and egl_native_platform != ''
284 elif _egl == 'true'
285 if not with_dri
286 error('EGL requires dri')
287 elif not with_shared_glapi
288 error('EGL requires shared-glapi')
289 elif egl_native_platform == ''
290 error('No platforms specified, consider -Dplatforms=drm,x11 at least')
291 endif
292 with_egl = true
293 else
294 with_egl = false
295 endif
296
297 if with_egl and not (with_platform_drm or with_platform_surfaceless)
298 if with_gallium_radeonsi
299 error('RadeonSI requires drm or surfaceless platform when using EGL')
300 endif
301 if with_gallium_virgl
302 error('Virgl requires drm or surfaceless platform when using EGL')
303 endif
304 endif
305
306 pre_args += '-DGLX_USE_TLS'
307 if with_glx != 'disabled'
308 if not (with_platform_x11 and with_any_opengl)
309 if with_glx == 'auto'
310 with_glx = 'disabled'
311 else
312 error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
313 endif
314 elif with_glx == 'gallium-xlib'
315 if not with_gallium
316 error('Gallium-xlib based GLX requires at least one gallium driver')
317 elif not with_gallium_softpipe
318 error('Gallium-xlib based GLX requires softpipe or llvmpipe.')
319 elif with_dri
320 error('gallium-xlib conflicts with any dri driver')
321 endif
322 elif with_glx == 'xlib'
323 if with_dri
324 error('xlib conflicts with any dri driver')
325 endif
326 elif with_glx == 'dri' and not with_dri
327 error('dri based GLX requires at least one DRI driver')
328 endif
329 endif
330
331 with_glvnd = get_option('glvnd')
332 if with_glvnd
333 if with_glx == 'xlib' or with_glx == 'gallium-xlib'
334 error('Cannot build glvnd support for GLX that is not DRI based.')
335 elif with_glx == 'disabled' and not with_egl
336 error('glvnd requires DRI based GLX and/or EGL')
337 endif
338 endif
339
340 # TODO: toggle for this
341 with_glx_direct = true
342
343 if with_vulkan_icd_dir == ''
344 with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d')
345 endif
346
347 with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
348 with_dri3 = get_option('dri3')
349 if with_dri3 == 'auto'
350 if host_machine.system() == 'linux' and with_dri2
351 with_dri3 = true
352 else
353 with_dri3 = false
354 endif
355 elif with_dri3 == 'true'
356 with_dri3 = true
357 else
358 with_dri3 = false
359 endif
360
361 if with_any_vk and (with_platform_x11 and not with_dri3)
362 error('Vulkan drivers require dri3 for X11 support')
363 endif
364 if with_dri or with_gallium
365 if with_glx == 'disabled' and not with_egl
366 error('building dri or gallium drivers require at least one window system')
367 endif
368 endif
369
370 dep_vdpau = []
371 _vdpau = get_option('gallium-vdpau')
372 if _vdpau == 'auto'
373 if not ['linux', 'bsd'].contains(host_machine.system())
374 with_gallium_vdpau = false
375 elif not with_platform_x11
376 with_gallium_vdpau = false
377 elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
378 with_gallium_nouveau)
379 with_gallium_vdpau = false
380 else
381 dep_vdpau = dependency('vdpau', version : '>= 1.1', required : false)
382 with_gallium_vdpau = dep_vdpau.found()
383 endif
384 elif _vdpau == 'true'
385 if not ['linux', 'bsd'].contains(host_machine.system())
386 error('VDPAU state tracker can only be build on unix-like OSes.')
387 elif not with_platform_x11
388 error('VDPAU state tracker requires X11 support.')
389 with_gallium_vdpau = false
390 elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
391 with_gallium_nouveau)
392 error('VDPAU state tracker requires at least one of the following gallium drivers: r300, r600, radeonsi, nouveau.')
393 endif
394 dep_vdpau = dependency('vdpau', version : '>= 1.1')
395 with_gallium_vdpau = true
396 else
397 with_gallium_vdpau = false
398 endif
399 if with_gallium_vdpau
400 dep_vdpau = declare_dependency(
401 compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
402 )
403 endif
404
405 if with_gallium_vdpau
406 pre_args += '-DHAVE_ST_VDPAU'
407 endif
408 vdpau_drivers_path = get_option('vdpau-libs-path')
409 if vdpau_drivers_path == ''
410 vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
411 endif
412
413 dep_xvmc = []
414 _xvmc = get_option('gallium-xvmc')
415 if _xvmc == 'auto'
416 if not ['linux', 'bsd'].contains(host_machine.system())
417 with_gallium_xvmc = false
418 elif not with_platform_x11
419 with_gallium_xvmc = false
420 elif not (with_gallium_r600 or with_gallium_nouveau)
421 with_gallium_xvmc = false
422 else
423 dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
424 with_gallium_xvmc = dep_xvmc.found()
425 endif
426 elif _xvmc == 'true'
427 if not ['linux', 'bsd'].contains(host_machine.system())
428 error('XVMC state tracker can only be build on unix-like OSes.')
429 elif not with_platform_x11
430 error('XVMC state tracker requires X11 support.')
431 with_gallium_xvmc = false
432 elif not (with_gallium_r600 or with_gallium_nouveau)
433 error('XVMC state tracker requires at least one of the following gallium drivers: r600, nouveau.')
434 endif
435 dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
436 with_gallium_xvmc = true
437 else
438 with_gallium_xvmc = false
439 endif
440 if with_gallium_xvmc
441 dep_xvmc = declare_dependency(
442 compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
443 )
444 endif
445
446 xvmc_drivers_path = get_option('xvmc-libs-path')
447 if xvmc_drivers_path == ''
448 xvmc_drivers_path = get_option('libdir')
449 endif
450
451 dep_omx = []
452 _omx = get_option('gallium-omx')
453 if _omx == 'auto'
454 if not ['linux', 'bsd'].contains(host_machine.system())
455 with_gallium_omx = false
456 elif not with_platform_x11
457 with_gallium_omx = false
458 elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
459 with_gallium_omx = false
460 else
461 dep_omx = dependency('libomxil-bellagio', required : false)
462 with_gallium_omx = dep_omx.found()
463 endif
464 elif _omx == 'true'
465 if not ['linux', 'bsd'].contains(host_machine.system())
466 error('OMX state tracker can only be built on unix-like OSes.')
467 elif not (with_platform_x11 or with_platform_drm)
468 error('OMX state tracker requires X11 or drm platform support.')
469 with_gallium_omx = false
470 elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
471 error('OMX state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
472 endif
473 dep_omx = dependency('libomxil-bellagio')
474 with_gallium_omx = true
475 else
476 with_gallium_omx = false
477 endif
478
479 omx_drivers_path = get_option('omx-libs-path')
480 if with_gallium_omx
481 # Figure out where to put the omx driver.
482 # FIXME: this could all be vastly simplified by adding a 'defined_variable'
483 # argument to meson's get_pkgconfig_variable method.
484 if omx_drivers_path == ''
485 _omx_libdir = dep_omx.get_pkgconfig_variable('libdir')
486 _omx_drivers_dir = dep_omx.get_pkgconfig_variable('pluginsdir')
487 if _omx_libdir == get_option('libdir')
488 omx_drivers_path = _omx_drivers_dir
489 else
490 _omx_base_dir = []
491 # This will fail on windows. Does OMX run on windows?
492 _omx_libdir = _omx_libdir.split('/')
493 _omx_drivers_dir = _omx_drivers_dir.split('/')
494 foreach o : _omx_drivers_dir
495 if not _omx_libdir.contains(o)
496 _omx_base_dir += o
497 endif
498 endforeach
499 omx_drivers_path = join_paths(get_option('libdir'), _omx_base_dir)
500 endif
501 endif
502 endif
503 if with_gallium_omx
504 dep_omx = declare_dependency(
505 compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
506 )
507 endif
508
509 dep_va = []
510 _va = get_option('gallium-va')
511 if _va == 'auto'
512 if not ['linux', 'bsd'].contains(host_machine.system())
513 with_gallium_va = false
514 elif not with_platform_x11
515 with_gallium_va = false
516 elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
517 with_gallium_va = false
518 else
519 dep_va = dependency('libva', version : '>= 0.38.0', required : false)
520 with_gallium_va = dep_va.found()
521 endif
522 elif _va == 'true'
523 if not ['linux', 'bsd'].contains(host_machine.system())
524 error('VA state tracker can only be built on unix-like OSes.')
525 elif not (with_platform_x11 or with_platform_drm)
526 error('VA state tracker requires X11 or drm or wayland platform support.')
527 with_gallium_va = false
528 elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
529 error('VA state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
530 endif
531 dep_va = dependency('libva', version : '>= 0.38.0')
532 with_gallium_va = true
533 else
534 with_gallium_va = false
535 endif
536 if with_gallium_va
537 dep_va = declare_dependency(
538 compile_args : dep_va.get_pkgconfig_variable('cflags').split()
539 )
540 endif
541
542 va_drivers_path = get_option('va-libs-path')
543 if va_drivers_path == ''
544 va_drivers_path = join_paths(get_option('libdir'), 'dri')
545 endif
546
547 _xa = get_option('gallium-xa')
548 if _xa == 'auto'
549 if not ['linux', 'bsd'].contains(host_machine.system())
550 with_gallium_xa = false
551 elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
552 or with_gallium_svga)
553 with_gallium_xa = false
554 else
555 with_gallium_xa = true
556 endif
557 elif _xa == 'true'
558 if not ['linux', 'bsd'].contains(host_machine.system())
559 error('XA state tracker can only be built on unix-like OSes.')
560 elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
561 or with_gallium_svga)
562 error('XA state tracker requires at least one of the following gallium drivers: nouveau, freedreno, i915, svga.')
563 endif
564 with_gallium_xa = true
565 else
566 with_gallium_xa = false
567 endif
568
569 d3d_drivers_path = get_option('d3d-drivers-path')
570 if d3d_drivers_path == ''
571 d3d_drivers_path = join_paths(get_option('libdir'), 'd3d')
572 endif
573
574 with_gallium_st_nine = get_option('gallium-nine')
575 if with_gallium_st_nine
576 if not with_gallium_softpipe
577 error('The nine state tracker requires gallium softpipe/llvmpipe.')
578 elif not (with_gallium_radeonsi or with_gallium_nouveau or with_gallium_r600
579 or with_gallium_r300 or with_gallium_svga or with_gallium_i915)
580 error('The nine state tracker requires at least on non-swrast gallium driver.')
581 endif
582 if not with_dri3
583 error('Using nine with wine requires dri3')
584 endif
585 endif
586
587 _opencl = get_option('gallium-opencl')
588 if _opencl != 'disabled'
589 if not with_gallium
590 error('OpenCL Clover implementation requires at least one gallium driver.')
591 endif
592
593 # TODO: alitvec?
594 dep_clc = dependency('libclc')
595 with_gallium_opencl = true
596 with_opencl_icd = _opencl == 'icd'
597 else
598 dep_clc = []
599 with_gallium_opencl = false
600 with_gallium_icd = false
601 endif
602
603 gl_pkgconfig_c_flags = []
604 if with_platform_x11
605 if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
606 pre_args += '-DHAVE_X11_PLATFORM'
607 endif
608 if with_glx == 'xlib' or with_glx == 'gallium-xlib'
609 pre_args += '-DUSE_XSHM'
610 else
611 pre_args += '-DGLX_INDIRECT_RENDERING'
612 if with_glx_direct
613 pre_args += '-DGLX_DIRECT_RENDERING'
614 endif
615 if with_dri_platform == 'drm'
616 pre_args += '-DGLX_USE_DRM'
617 elif with_dri_platform == 'windows'
618 pre_args += '-DGLX_USE_WINDOWSGL'
619 endif
620 endif
621 else
622 pre_args += '-DMESA_EGL_NO_X11_HEADERS'
623 gl_pkgconfig_c_flags += '-DMESA_EGL_NO_X11_HEADERS'
624 endif
625 if with_platform_drm
626 if with_egl and not with_gbm
627 error('EGL drm platform requires gbm')
628 endif
629 pre_args += '-DHAVE_DRM_PLATFORM'
630 endif
631 if with_platform_surfaceless
632 pre_args += '-DHAVE_SURFACELESS_PLATFORM'
633 endif
634 if with_platform_android
635 dep_android = [
636 dependency('cutils'),
637 dependency('hardware'),
638 dependency('sync'),
639 ]
640 pre_args += '-DHAVE_ANDROID_PLATFORM'
641 endif
642
643 prog_python2 = find_program('python2')
644 has_mako = run_command(prog_python2, '-c', 'import mako')
645 if has_mako.returncode() != 0
646 error('Python (2.x) mako module required to build mesa.')
647 endif
648
649 cc = meson.get_compiler('c')
650 if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6')
651 error('When using GCC, version 4.4.6 or later is required.')
652 endif
653
654 # Define DEBUG for debug builds only (debugoptimized is not included on this one)
655 if get_option('buildtype') == 'debug'
656 pre_args += '-DDEBUG'
657 endif
658
659 if get_option('shader-cache')
660 pre_args += '-DENABLE_SHADER_CACHE'
661 elif with_amd_vk
662 error('Radv requires shader cache support')
663 endif
664
665 # Check for GCC style builtins
666 foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
667 'ffsll', 'popcount', 'popcountll', 'unreachable']
668 if cc.has_function(b)
669 pre_args += '-DHAVE___BUILTIN_@0@'.format(b.to_upper())
670 endif
671 endforeach
672
673 # check for GCC __attribute__
674 foreach a : ['const', 'flatten', 'malloc', 'pure', 'unused',
675 'warn_unused_result', 'weak',]
676 if cc.compiles('int foo(void) __attribute__((@0@));'.format(a),
677 name : '__attribute__((@0@))'.format(a))
678 pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper())
679 endif
680 endforeach
681 if cc.compiles('int foo(const char *p, ...) __attribute__((format(printf, 1, 2)));',
682 name : '__attribute__((format(...)))')
683 pre_args += '-DHAVE_FUNC_ATTRIBUTE_FORMAT'
684 endif
685 if cc.compiles('struct __attribute__((packed)) foo { int bar; };',
686 name : '__attribute__((packed))')
687 pre_args += '-DHAVE_FUNC_ATTRIBUTE_PACKED'
688 endif
689 if cc.compiles('int *foo(void) __attribute__((returns_nonnull));',
690 name : '__attribute__((returns_nonnull))')
691 pre_args += '-DHAVE_FUNC_ATTRIBUTE_NONNULL'
692 endif
693 if cc.compiles('''int foo_def(void) __attribute__((visibility("default")));
694 int foo_hid(void) __attribute__((visibility("hidden")));
695 int foo_int(void) __attribute__((visibility("internal")));
696 int foo_pro(void) __attribute__((visibility("protected")));''',
697 name : '__attribute__((visibility(...)))')
698 pre_args += '-DHAVE_FUNC_ATTRIBUTE_VISBILITY'
699 endif
700 if cc.compiles('int foo(void) { return 0; } int bar(void) __attribute__((alias("foo")));',
701 name : '__attribute__((alias(...)))')
702 pre_args += '-DHAVE_FUNC_ATTRIBUTE_ALIAS'
703 endif
704 if cc.compiles('int foo(void) __attribute__((__noreturn__));',
705 name : '__attribute__((__noreturn__))')
706 pre_args += '-DHAVE_FUNC_ATTRIBUTE_NORETURN'
707 endif
708
709 # TODO: this is very incomplete
710 if ['linux', 'cygwin'].contains(host_machine.system())
711 pre_args += '-D_GNU_SOURCE'
712 endif
713
714 # Check for generic C arguments
715 c_args = []
716 foreach a : ['-Wall', '-Werror=implicit-function-declaration',
717 '-Werror=missing-prototypes', '-fno-math-errno',
718 '-fno-trapping-math', '-Qunused-arguments']
719 if cc.has_argument(a)
720 c_args += a
721 endif
722 endforeach
723 c_vis_args = []
724 if cc.has_argument('-fvisibility=hidden')
725 c_vis_args += '-fvisibility=hidden'
726 endif
727
728 # Check for generic C++ arguments
729 cpp = meson.get_compiler('cpp')
730 cpp_args = []
731 foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
732 '-Qunused-arguments']
733 if cpp.has_argument(a)
734 cpp_args += a
735 endif
736 endforeach
737
738 # For some reason, the test for -Wno-foo always succeeds with gcc, even if the
739 # option is not supported. Hence, check for -Wfoo instead.
740 if cpp.has_argument('-Wnon-virtual-dtor')
741 cpp_args += '-Wno-non-virtual-dtor'
742 endif
743
744 no_override_init_args = []
745 foreach a : ['override-init', 'initializer-overrides']
746 if cc.has_argument('-W' + a)
747 no_override_init_args += '-Wno-' + a
748 endif
749 endforeach
750
751 cpp_vis_args = []
752 if cpp.has_argument('-fvisibility=hidden')
753 cpp_vis_args += '-fvisibility=hidden'
754 endif
755
756 # Check for C and C++ arguments for MSVC2013 compatibility. These are only used
757 # in parts of the mesa code base that need to compile with old versions of
758 # MSVC, mainly common code
759 c_msvc_compat_args = []
760 cpp_msvc_compat_args = []
761 foreach a : ['-Werror=pointer-arith', '-Werror=vla']
762 if cc.has_argument(a)
763 c_msvc_compat_args += a
764 endif
765 if cpp.has_argument(a)
766 cpp_msvc_compat_args += a
767 endif
768 endforeach
769
770 if host_machine.cpu_family().startswith('x86')
771 pre_args += '-DHAVE_SSE41'
772 with_sse41 = true
773 sse41_args = ['-msse4.1']
774
775 # GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
776 # that's not guaranteed
777 if host_machine.cpu_family() == 'x86'
778 sse41_args += '-mstackrealign'
779 endif
780 else
781 with_sse41 = false
782 sse41_args = []
783 endif
784
785 # Check for GCC style atomics
786 if cc.compiles('int main() { int n; return __atomic_load_n(&n, __ATOMIC_ACQUIRE); }',
787 name : 'GCC atomic builtins')
788 pre_args += '-DUSE_GCC_ATOMIC_BUILTINS'
789 endif
790 if not cc.links('''#include <stdint.h>
791 uint64_t v;
792 int main() {
793 return __sync_add_and_fetch(&v, (uint64_t)1);
794 }''',
795 name : 'GCC 64bit atomics')
796 pre_args += '-DMISSING_64_BIT_ATOMICS'
797 endif
798
799 # TODO: endian
800 # TODO: powr8
801 # TODO: shared/static? Is this even worth doing?
802
803 # Building x86 assembly code requires running x86 binaries. It is possible for
804 # x86_64 OSes to run x86 binaries, so don't disable asm in those cases
805 # TODO: it should be possible to use an exe_wrapper to run the binary during
806 # the build.
807 if meson.is_cross_build()
808 if not (build_machine.cpu_family() == 'x86_64' and host_machine.cpu_family() == 'x86'
809 and build_machine.system() == host_machine.system())
810 message('Cross compiling to x86 from non-x86, disabling asm')
811 with_asm = false
812 endif
813 endif
814
815 with_asm_arch = ''
816 if with_asm
817 # TODO: SPARC and PPC
818 if host_machine.cpu_family() == 'x86'
819 if ['linux', 'bsd'].contains(host_machine.system()) # FIXME: hurd?
820 with_asm_arch = 'x86'
821 pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
822 '-DUSE_SSE_ASM']
823 endif
824 elif host_machine.cpu_family() == 'x86_64'
825 if host_machine.system() == 'linux'
826 with_asm_arch = 'x86_64'
827 pre_args += ['-DUSE_X86_64_ASM']
828 endif
829 elif host_machine.cpu_family() == 'arm'
830 if host_machine.system() == 'linux'
831 with_asm_arch = 'arm'
832 pre_args += ['-DUSE_ARM_ASM']
833 endif
834 elif host_machine.cpu_family() == 'aarch64'
835 if host_machine.system() == 'linux'
836 with_asm_arch = 'aarch64'
837 pre_args += ['-DUSE_AARCH64_ASM']
838 endif
839 endif
840 endif
841
842 # Check for standard headers and functions
843 if cc.has_header_symbol('sys/sysmacros.h', 'major')
844 pre_args += '-DMAJOR_IN_SYSMACROS'
845 elif cc.has_header_symbol('sys/mkdev.h', 'major')
846 pre_args += '-DMAJOR_IN_MKDEV'
847 endif
848
849 foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
850 if cc.has_header(h)
851 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
852 endif
853 endforeach
854
855 foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
856 if cc.has_function(f)
857 pre_args += '-DHAVE_@0@'.format(f.to_upper())
858 endif
859 endforeach
860
861 # strtod locale support
862 if cc.links('''
863 #define _GNU_SOURCE
864 #include <stdlib.h>
865 #include <locale.h>
866 #ifdef HAVE_XLOCALE_H
867 #include <xlocale.h>
868 #endif
869 int main() {
870 locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
871 const char *s = "1.0";
872 char *end;
873 double d = strtod_l(s, end, loc);
874 float f = strtof_l(s, end, loc);
875 freelocale(loc);
876 return 0;
877 }''',
878 extra_args : pre_args,
879 name : 'strtod has locale support')
880 pre_args += '-DHAVE_STRTOD_L'
881 endif
882
883 # Check for some linker flags
884 ld_args_bsymbolic = []
885 if cc.links('int main() { return 0; }', args : '-Wl,-Bsymbolic', name : 'Bsymbolic')
886 ld_args_bsymbolic += '-Wl,-Bsymbolic'
887 endif
888 ld_args_gc_sections = []
889 if cc.links('static char unused() { return 5; } int main() { return 0; }',
890 args : '-Wl,--gc-sections', name : 'gc-sections')
891 ld_args_gc_sections += '-Wl,--gc-sections'
892 endif
893 with_ld_version_script = false
894 if cc.links('int main() { return 0; }',
895 args : '-Wl,--version-script=@0@'.format(
896 join_paths(meson.source_root(), 'build-support/conftest.map')),
897 name : 'version-script')
898 with_ld_version_script = true
899 endif
900 with_ld_dynamic_list = false
901 if cc.links('int main() { return 0; }',
902 args : '-Wl,--dynamic-list=@0@'.format(
903 join_paths(meson.source_root(), 'build-support/conftest.dyn')),
904 name : 'dynamic-list')
905 with_ld_dynamic_list = true
906 endif
907
908 # check for dl support
909 if cc.has_function('dlopen')
910 dep_dl = []
911 else
912 dep_dl = cc.find_library('dl')
913 endif
914 if cc.has_function('dladdr', dependencies : dep_dl)
915 # This is really only required for megadrivers
916 pre_args += '-DHAVE_DLADDR'
917 endif
918
919 if cc.has_function('dl_iterate_phdr')
920 pre_args += '-DHAVE_DL_ITERATE_PHDR'
921 elif with_intel_vk
922 error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
923 elif with_dri_i965 and get_option('shader-cache')
924 error('Intel i965 GL driver requires dl_iterate_phdr when built with shader caching.')
925 endif
926
927 # Determine whether or not the rt library is needed for time functions
928 if cc.has_function('clock_gettime')
929 dep_clock = []
930 else
931 dep_clock = cc.find_library('rt')
932 endif
933
934 with_gallium_drisw_kms = false
935 dep_libdrm = dependency('libdrm', version : '>= 2.4.75',
936 required : with_dri2 or with_dri3)
937 if dep_libdrm.found()
938 pre_args += '-DHAVE_LIBDRM'
939 if with_dri_platform == 'drm' and with_dri
940 with_gallium_drisw_kms = true
941 endif
942 endif
943
944 # TODO: some of these may be conditional
945 dep_zlib = dependency('zlib', version : '>= 1.2.3')
946 dep_thread = dependency('threads')
947 if dep_thread.found() and host_machine.system() != 'windows'
948 pre_args += '-DHAVE_PTHREAD'
949 endif
950 if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or with_gallium_opencl
951 dep_elf = dependency('libelf', required : false)
952 if not dep_elf.found()
953 dep_elf = cc.find_library('elf')
954 endif
955 else
956 dep_elf = []
957 endif
958 dep_expat = dependency('expat')
959 # this only exists on linux so either this is linux and it will be found, or
960 # its not linux and and wont
961 dep_m = cc.find_library('m', required : false)
962
963 dep_libdrm_amdgpu = []
964 dep_libdrm_radeon = []
965 dep_libdrm_nouveau = []
966 dep_libdrm_etnaviv = []
967 dep_libdrm_freedreno = []
968 if with_amd_vk or with_gallium_radeonsi
969 dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.89')
970 endif
971 if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
972 with_gallium_r300 or with_gallium_r600)
973 dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
974 endif
975 if with_gallium_nouveau or with_dri_nouveau
976 dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
977 endif
978 if with_gallium_etnaviv
979 dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= 2.4.82')
980 endif
981 if with_gallium_freedreno
982 dep_libdrm_freedreno = dependency('libdrm_freedreno', version : '>= 2.4.89')
983 endif
984
985 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
986 if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
987 llvm_modules += ['amdgpu', 'bitreader', 'ipo']
988 if with_gallium_r600
989 llvm_modules += 'asmparser'
990 endif
991 endif
992 if with_gallium_opencl
993 llvm_modules += [
994 'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
995 'lto', 'option', 'objcarcopts', 'profiledata',
996 ]
997 # TODO: optional modules
998 endif
999
1000 _llvm = get_option('llvm')
1001 if _llvm == 'auto'
1002 dep_llvm = dependency(
1003 'llvm', version : '>= 3.9.0', modules : llvm_modules,
1004 required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl,
1005 )
1006 with_llvm = dep_llvm.found()
1007 elif _llvm == 'true'
1008 dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : llvm_modules)
1009 with_llvm = true
1010 else
1011 dep_llvm = []
1012 with_llvm = false
1013 endif
1014 if with_llvm
1015 _llvm_version = dep_llvm.version().split('.')
1016 # Development versions of LLVM have an 'svn' suffix, we don't want that for
1017 # our version checks.
1018 _llvm_patch = _llvm_version[2]
1019 if _llvm_patch.endswith('svn')
1020 _llvm_patch = _llvm_patch.split('s')[0]
1021 endif
1022 pre_args += [
1023 '-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch),
1024 '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
1025 ]
1026 elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
1027 error('The following drivers requires LLVM: Radv, RadeonSI, SWR. One of these is enabled, but LLVM is disabled.')
1028 endif
1029
1030 dep_glvnd = []
1031 if with_glvnd
1032 dep_glvnd = dependency('libglvnd', version : '>= 0.2.0')
1033 pre_args += '-DUSE_LIBGLVND=1'
1034 endif
1035
1036 if with_valgrind != 'false'
1037 dep_valgrind = dependency('valgrind', required : with_valgrind == 'true')
1038 if dep_valgrind.found()
1039 pre_args += '-DHAVE_VALGRIND'
1040 endif
1041 else
1042 dep_valgrind = []
1043 endif
1044
1045 # pthread stubs. Lets not and say we didn't
1046
1047 prog_bison = find_program('bison', required : with_any_opengl)
1048 prog_flex = find_program('flex', required : with_any_opengl)
1049
1050 dep_selinux = []
1051 if get_option('selinux')
1052 dep_selinux = dependency('libselinux')
1053 pre_args += '-DMESA_SELINUX'
1054 endif
1055
1056 # TODO: llvm-prefix and llvm-shared-libs
1057
1058 if with_libunwind != 'false'
1059 dep_unwind = dependency('libunwind', required : with_libunwind == 'true')
1060 if dep_unwind.found()
1061 pre_args += '-DHAVE_LIBUNWIND'
1062 endif
1063 else
1064 dep_unwind = []
1065 endif
1066
1067 # TODO: gallium-hud
1068
1069 if with_osmesa != 'none'
1070 if with_osmesa == 'classic' and not with_dri_swrast
1071 error('OSMesa classic requires dri (classic) swrast.')
1072 endif
1073 if with_osmesa == 'gallium' and not with_gallium_softpipe
1074 error('OSMesa gallium requires gallium softpipe or llvmpipe.')
1075 endif
1076 osmesa_lib_name = 'OSMesa'
1077 osmesa_bits = get_option('osmesa-bits')
1078 if osmesa_bits != '8'
1079 if with_dri or with_glx != 'disabled'
1080 error('OSMesa bits must be 8 if building glx or dir based drivers')
1081 endif
1082 osmesa_lib_name = osmesa_lib_name + osmesa_bits
1083 pre_args += [
1084 '-DCHAN_BITS=@0@'.format(osmesa_bits), '-DDEFAULT_SOFTWARE_DEPTH_BITS=31'
1085 ]
1086 endif
1087 endif
1088
1089 # TODO: symbol mangling
1090
1091 if with_platform_wayland
1092 prog_wl_scanner = find_program('wayland-scanner')
1093 dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.8')
1094 dep_wayland_client = dependency('wayland-client', version : '>=1.11')
1095 dep_wayland_server = dependency('wayland-server', version : '>=1.11')
1096 wayland_dmabuf_xml = join_paths(
1097 dep_wl_protocols.get_pkgconfig_variable('pkgdatadir'), 'unstable',
1098 'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml'
1099 )
1100 pre_args += ['-DHAVE_WAYLAND_PLATFORM', '-DWL_HIDE_DEPRECATED']
1101 else
1102 prog_wl_scanner = []
1103 dep_wl_protocols = []
1104 dep_wayland_client = []
1105 dep_wayland_server = []
1106 wayland_dmabuf_xml = ''
1107 endif
1108
1109 dep_x11 = []
1110 dep_xext = []
1111 dep_xdamage = []
1112 dep_xfixes = []
1113 dep_x11_xcb = []
1114 dep_xcb = []
1115 dep_xcb_glx = []
1116 dep_xcb_dri2 = []
1117 dep_xcb_dri3 = []
1118 dep_dri2proto = []
1119 dep_glproto = []
1120 dep_xxf86vm = []
1121 dep_xcb_dri3 = []
1122 dep_xcb_present = []
1123 dep_xcb_sync = []
1124 dep_xcb_xfixes = []
1125 dep_xshmfence = []
1126 if with_platform_x11
1127 if with_glx == 'xlib' or with_glx == 'gallium-xlib'
1128 dep_x11 = dependency('x11')
1129 dep_xext = dependency('xext')
1130 dep_xcb = dependency('xcb')
1131 elif with_glx == 'dri'
1132 dep_x11 = dependency('x11')
1133 dep_xext = dependency('xext')
1134 dep_xdamage = dependency('xdamage', version : '>= 1.1')
1135 dep_xfixes = dependency('xfixes')
1136 dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
1137 dep_xxf86vm = dependency('xxf86vm', required : false)
1138 endif
1139 if (with_any_vk or with_glx == 'dri' or
1140 (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
1141 with_gallium_xa))
1142 dep_xcb = dependency('xcb')
1143 dep_x11_xcb = dependency('x11-xcb')
1144 endif
1145 if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
1146 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
1147
1148 if with_dri3
1149 pre_args += '-DHAVE_DRI3'
1150 dep_xcb_dri3 = dependency('xcb-dri3')
1151 dep_xcb_present = dependency('xcb-present')
1152 dep_xcb_sync = dependency('xcb-sync')
1153 dep_xshmfence = dependency('xshmfence', version : '>= 1.1')
1154 endif
1155 endif
1156 if with_glx == 'dri'
1157 if with_dri_platform == 'drm'
1158 dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
1159 endif
1160 dep_glproto = dependency('glproto', version : '>= 1.4.14')
1161 endif
1162 if with_egl
1163 dep_xcb_xfixes = dependency('xcb-xfixes')
1164 endif
1165 endif
1166
1167 if get_option('gallium-extra-hud')
1168 pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1'
1169 endif
1170
1171 _sensors = get_option('lmsensors')
1172 if _sensors != 'false'
1173 dep_lmsensors = cc.find_library('libsensors', required : _sensors == 'true')
1174 if dep_lmsensors.found()
1175 pre_args += '-DHAVE_LIBSENSORS=1'
1176 endif
1177 else
1178 dep_lmsensors = []
1179 endif
1180
1181 # TODO: gallium tests
1182
1183 # TODO: various libdirs
1184
1185 # TODO: gallium driver dirs
1186
1187 # FIXME: this is a workaround for #2326
1188 prog_touch = find_program('touch')
1189 dummy_cpp = custom_target(
1190 'dummy_cpp',
1191 output : 'dummy.cpp',
1192 command : [prog_touch, '@OUTPUT@'],
1193 )
1194
1195 foreach a : pre_args
1196 add_project_arguments(a, language : ['c', 'cpp'])
1197 endforeach
1198 foreach a : c_args
1199 add_project_arguments(a, language : ['c'])
1200 endforeach
1201 foreach a : cpp_args
1202 add_project_arguments(a, language : ['cpp'])
1203 endforeach
1204
1205 inc_include = include_directories('include')
1206
1207 gl_priv_reqs = [
1208 'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
1209 'xcb-glx >= 1.8.1', 'libdrm >= 2.4.75',
1210 ]
1211 if dep_xxf86vm != [] and dep_xxf86vm.found()
1212 gl_priv_reqs += 'xxf86vm'
1213 endif
1214 if with_dri_platform == 'drm'
1215 gl_priv_reqs += 'xcb-dri2 >= 1.8'
1216 endif
1217
1218 gl_priv_libs = []
1219 if dep_thread.found()
1220 gl_priv_libs += ['-lpthread', '-pthread']
1221 endif
1222 if dep_m.found()
1223 gl_priv_libs += '-lm'
1224 endif
1225 if dep_dl != [] and dep_dl.found()
1226 gl_priv_libs += '-ldl'
1227 endif
1228
1229 pkg = import('pkgconfig')
1230
1231 subdir('include')
1232 subdir('bin')
1233 subdir('src')