23cefd4beb4e80cd34d061cedc42b7c6e42e315c
[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 pmdinfo = find_program('gen-pmdinfo-cfile.sh')
6 list_dir_globs = find_program('list-dir-globs.py')
7 check_symbols = find_program('check-symbols.sh')
8 ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
9 binutils_avx512_check = find_program('binutils-avx512-check.sh')
10
11 # set up map-to-win script using python, either built-in or external
12 python3 = import('python').find_installation(required: false)
13 if python3.found()
14         py3 = [python3]
15 else
16         py3 = ['meson', 'runpython']
17 endif
18 map_to_win_cmd = py3 + files('map_to_win.py')
19 sphinx_wrapper = py3 + files('call-sphinx-build.py')
20
21 # select object file format
22 pmdinfogen = py3 + files('pmdinfogen.py')
23 if host_machine.system() == 'windows'
24         pmdinfogen += 'coff'
25 else
26         pmdinfogen += 'elf'
27 endif
28
29 # TODO: starting from Meson 0.51.0 use
30 #       python3 = import('python').find_installation('python',
31 #               modules : python3_required_modules)
32 python3_required_modules = []
33 if host_machine.system() != 'windows'
34         python3_required_modules = ['elftools']
35 endif
36 foreach module : python3_required_modules
37         script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
38         if run_command(py3, '-c', script.format(module)).returncode() != 0
39                 error('missing python module: @0@'.format(module))
40         endif
41 endforeach