9c9347457a3970c4cebed8d38513565e67567235
[dpdk.git] / buildtools / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 pkgconf = find_program('pkg-config', 'pkgconf', required: false)
5 list_dir_globs = find_program('list-dir-globs.py')
6 check_symbols = find_program('check-symbols.sh')
7 ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
8 binutils_avx512_check = find_program('binutils-avx512-check.sh')
9
10 # set up map-to-win script using python, either built-in or external
11 python3 = import('python').find_installation(required: false)
12 if python3.found()
13         py3 = [python3]
14 else
15         py3 = ['meson', 'runpython']
16 endif
17 map_to_win_cmd = py3 + files('map_to_win.py')
18 sphinx_wrapper = py3 + files('call-sphinx-build.py')
19
20 # select library and object file format
21 pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
22 pmdinfogen = py3 + files('pmdinfogen.py')
23 if host_machine.system() == 'windows'
24         if cc.get_id() == 'gcc'
25                 pmdinfo += 'ar'
26         else
27                 pmdinfo += 'llvm-ar'
28         endif
29         pmdinfogen += 'coff'
30 else
31         pmdinfo += 'ar'
32         pmdinfogen += 'elf'
33 endif
34
35 # TODO: starting from Meson 0.51.0 use
36 #       python3 = import('python').find_installation('python',
37 #               modules : python3_required_modules)
38 python3_required_modules = []
39 if host_machine.system() != 'windows'
40         python3_required_modules = ['elftools']
41 endif
42 foreach module : python3_required_modules
43         script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
44         if run_command(py3, '-c', script.format(module)).returncode() != 0
45                 error('missing python module: @0@'.format(module))
46         endif
47 endforeach