net/mlx5: fix multi-process port ID
[dpdk.git] / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 project('DPDK', 'C',
5         # Get version number from file.
6         # Fallback to "more" for Windows compatibility.
7         version: run_command(find_program('cat', 'more'),
8                 files('VERSION')).stdout().strip(),
9         license: 'BSD',
10         default_options: ['buildtype=release', 'default_library=static'],
11         meson_version: '>= 0.47.1'
12 )
13
14 # set up some global vars for compiler, platform, configuration, etc.
15 cc = meson.get_compiler('c')
16 dpdk_conf = configuration_data()
17 dpdk_libraries = []
18 dpdk_static_libraries = []
19 dpdk_chkinc_headers = []
20 dpdk_driver_classes = []
21 dpdk_drivers = []
22 dpdk_extra_ldflags = []
23 dpdk_libs_disabled = []
24 dpdk_drvs_disabled = []
25 abi_version_file = files('ABI_VERSION')
26
27 if host_machine.cpu_family().startswith('x86')
28         arch_subdir = 'x86'
29 elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch')
30         arch_subdir = 'arm'
31 elif host_machine.cpu_family().startswith('ppc')
32         arch_subdir = 'ppc'
33 endif
34
35 # configure the build, and make sure configs here and in config folder are
36 # able to be included in any file. We also store a global array of include dirs
37 # for passing to pmdinfogen scripts
38 global_inc = include_directories('.', 'config',
39         'lib/librte_eal/include',
40         'lib/librte_eal/@0@/include'.format(host_machine.system()),
41         'lib/librte_eal/@0@/include'.format(arch_subdir),
42 )
43
44 # do configuration and get tool paths
45 subdir('buildtools')
46 subdir('config')
47
48 # build libs and drivers
49 subdir('lib')
50 subdir('drivers')
51
52 # build binaries and installable tools
53 subdir('usertools')
54 subdir('app')
55
56 # build docs
57 subdir('doc')
58
59 # build any examples explicitly requested - useful for developers - and
60 # install any example code into the appropriate install path
61 subdir('examples')
62 install_subdir('examples',
63         install_dir: get_option('datadir') + '/dpdk',
64         exclude_files: 'meson.build')
65
66 # build kernel modules if enabled
67 if get_option('enable_kmods')
68         subdir('kernel')
69 endif
70
71 # check header includes if requested
72 if get_option('check_includes')
73         subdir('buildtools/chkincs')
74 endif
75
76 # write the build config
77 build_cfg = 'rte_build_config.h'
78 configure_file(output: build_cfg,
79                 configuration: dpdk_conf,
80                 install_dir: join_paths(get_option('includedir'),
81                                 get_option('include_subdir_arch')))
82
83 # build pkg-config files for dpdk
84 subdir('buildtools/pkg-config')
85
86 # final output, list all the libs and drivers to be built
87 # this does not affect any part of the build, for information only.
88 output_message = '\n=================\nLibraries Enabled\n=================\n'
89 output_message += '\nlibs:\n\t'
90 output_count = 0
91 foreach lib:enabled_libs
92         output_message += lib + ', '
93         output_count += 1
94         if output_count == 8
95                 output_message += '\n\t'
96                 output_count = 0
97         endif
98 endforeach
99 message(output_message + '\n')
100
101 output_message = '\n===============\nDrivers Enabled\n===============\n'
102 foreach class:dpdk_driver_classes
103         class_drivers = get_variable(class + '_drivers')
104         output_message += '\n' + class + ':\n\t'
105         output_count = 0
106         foreach drv:class_drivers
107                 output_message += drv + ', '
108                 output_count += 1
109                 if output_count == 8
110                         output_message += '\n\t'
111                         output_count = 0
112                 endif
113         endforeach
114 endforeach
115 message(output_message + '\n')
116
117 output_message = '\n=================\nContent Skipped\n=================\n'
118 output_message += '\nlibs:\n\t'
119 foreach lib:dpdk_libs_disabled
120         reason = get_variable(lib.underscorify() + '_disable_reason')
121         output_message += lib + ':\t' + reason + '\n\t'
122 endforeach
123 output_message += '\ndrivers:\n\t'
124 foreach drv:dpdk_drvs_disabled
125         reason = get_variable(drv.underscorify() + '_disable_reason')
126         output_message += drv + ':\t' + reason + '\n\t'
127 endforeach
128 message(output_message + '\n')