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.49.2'
14 # check for developer mode
15 developer_mode = false
16 if get_option('developer_mode').auto()
17 if meson.version().version_compare('>=0.53') # fs module available
19 developer_mode = fs.is_dir('.git')
22 developer_mode = get_option('developer_mode').enabled()
25 message('## Building in Developer Mode ##')
28 # set up some global vars for compiler, platform, configuration, etc.
29 cc = meson.get_compiler('c')
30 dpdk_conf = configuration_data()
32 dpdk_static_libraries = []
33 dpdk_chkinc_headers = []
34 dpdk_driver_classes = []
36 dpdk_extra_ldflags = []
37 dpdk_libs_disabled = []
38 dpdk_drvs_disabled = []
39 abi_version_file = files('ABI_VERSION')
41 if host_machine.cpu_family().startswith('x86')
43 elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch')
45 elif host_machine.cpu_family().startswith('ppc')
49 # configure the build, and make sure configs here and in config folder are
50 # able to be included in any file. We also store a global array of include dirs
51 # for passing to pmdinfogen scripts
52 global_inc = include_directories('.', 'config',
54 'lib/eal/@0@/include'.format(host_machine.system()),
55 'lib/eal/@0@/include'.format(arch_subdir),
58 # do configuration and get tool paths
62 # build libs and drivers
66 # build binaries and installable tools
73 # build any examples explicitly requested - useful for developers - and
74 # install any example code into the appropriate install path
76 install_subdir('examples',
77 install_dir: get_option('datadir') + '/dpdk',
78 exclude_files: ex_file_excludes)
80 # build kernel modules if enabled
81 if get_option('enable_kmods')
85 # check header includes if requested
86 if get_option('check_includes')
87 subdir('buildtools/chkincs')
90 # write the build config
91 build_cfg = 'rte_build_config.h'
92 configure_file(output: build_cfg,
93 configuration: dpdk_conf,
94 install_dir: join_paths(get_option('includedir'),
95 get_option('include_subdir_arch')))
97 # build pkg-config files for dpdk
98 subdir('buildtools/pkg-config')
100 # final output, list all the libs and drivers to be built
101 # this does not affect any part of the build, for information only.
102 output_message = '\n=================\nLibraries Enabled\n=================\n'
103 output_message += '\nlibs:\n\t'
105 foreach lib:enabled_libs
106 output_message += lib + ', '
109 output_message += '\n\t'
113 message(output_message + '\n')
115 output_message = '\n===============\nDrivers Enabled\n===============\n'
116 foreach class:dpdk_driver_classes
117 class_drivers = get_variable(class + '_drivers')
118 output_message += '\n' + class + ':\n\t'
120 foreach drv:class_drivers
121 output_message += drv + ', '
124 output_message += '\n\t'
129 message(output_message + '\n')
131 output_message = '\n=================\nContent Skipped\n=================\n'
132 output_message += '\nlibs:\n\t'
133 foreach lib:dpdk_libs_disabled
134 reason = get_variable(lib.underscorify() + '_disable_reason')
135 output_message += lib + ':\t' + reason + '\n\t'
137 output_message += '\ndrivers:\n\t'
138 foreach drv:dpdk_drvs_disabled
139 reason = get_variable(drv.underscorify() + '_disable_reason')
140 output_message += drv + ':\t' + reason + '\n\t'
142 message(output_message + '\n')