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