1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
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(),
10 default_options: ['buildtype=release', 'default_library=static'],
11 meson_version: '>= 0.47.1'
14 # set up some global vars for compiler, platform, configuration, etc.
15 cc = meson.get_compiler('c')
16 dpdk_conf = configuration_data()
18 dpdk_static_libraries = []
19 dpdk_driver_classes = []
21 dpdk_extra_ldflags = []
22 dpdk_libs_disabled = []
23 dpdk_drvs_disabled = []
24 abi_version_file = files('ABI_VERSION')
26 if host_machine.cpu_family().startswith('x86')
28 elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch')
30 elif host_machine.cpu_family().startswith('ppc')
34 # configure the build, and make sure configs here and in config folder are
35 # able to be included in any file. We also store a global array of include dirs
36 # for passing to pmdinfogen scripts
37 global_inc = include_directories('.', 'config',
38 'lib/librte_eal/include',
39 'lib/librte_eal/@0@/include'.format(host_machine.system()),
40 'lib/librte_eal/@0@/include'.format(arch_subdir),
43 # do configuration and get tool paths
47 # build libs and drivers
51 # build binaries and installable tools
58 # build any examples explicitly requested - useful for developers - and
59 # install any example code into the appropriate install path
61 install_subdir('examples',
62 install_dir: get_option('datadir') + '/dpdk',
63 exclude_files: 'meson.build')
65 # build kernel modules if enabled
66 if get_option('enable_kmods')
70 # write the build config
71 build_cfg = 'rte_build_config.h'
72 configure_file(output: build_cfg,
73 configuration: dpdk_conf,
74 install_dir: join_paths(get_option('includedir'),
75 get_option('include_subdir_arch')))
77 # build pkg-config files for dpdk
78 subdir('buildtools/pkg-config')
80 # final output, list all the libs and drivers to be built
81 # this does not affect any part of the build, for information only.
82 output_message = '\n=================\nLibraries Enabled\n=================\n'
83 output_message += '\nlibs:\n\t'
85 foreach lib:enabled_libs
86 output_message += lib + ', '
89 output_message += '\n\t'
93 message(output_message + '\n')
95 output_message = '\n===============\nDrivers Enabled\n===============\n'
96 foreach class:dpdk_driver_classes
97 class_drivers = get_variable(class + '_drivers')
98 output_message += '\n' + class + ':\n\t'
100 foreach drv:class_drivers
101 output_message += drv + ', '
104 output_message += '\n\t'
109 message(output_message + '\n')
111 output_message = '\n=================\nContent Skipped\n=================\n'
112 output_message += '\nlibs:\n\t'
113 foreach lib:dpdk_libs_disabled
114 reason = get_variable(lib.underscorify() + '_disable_reason')
115 output_message += lib + ':\t' + reason + '\n\t'
117 output_message += '\ndrivers:\n\t'
118 foreach drv:dpdk_drvs_disabled
119 reason = get_variable(drv.underscorify() + '_disable_reason')
120 output_message += drv + ':\t' + reason + '\n\t'
122 message(output_message + '\n')