f-stack/dpdk/meson.build

145 lines
4.3 KiB
Meson
Raw Normal View History

2019-06-25 11:12:58 +00:00
# SPDX-License-Identifier: BSD-3-Clause
2020-06-18 16:55:50 +00:00
# Copyright(c) 2017-2019 Intel Corporation
2019-06-25 11:12:58 +00:00
project('DPDK', 'C',
2022-09-06 04:00:10 +00:00
# Get version number from file.
# Fallback to "more" for Windows compatibility.
version: run_command(find_program('cat', 'more'),
files('VERSION'), check: true).stdout().strip(),
license: 'BSD',
default_options: ['buildtype=release', 'default_library=static'],
meson_version: '>= 0.49.2'
2019-06-25 11:12:58 +00:00
)
2022-09-06 04:00:10 +00:00
# check for developer mode
developer_mode = false
if get_option('developer_mode').auto()
if meson.version().version_compare('>=0.53') # fs module available
fs = import('fs')
developer_mode = fs.is_dir('.git')
endif
else
developer_mode = get_option('developer_mode').enabled()
endif
if developer_mode
message('## Building in Developer Mode ##')
endif
2019-06-25 11:12:58 +00:00
# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
2022-09-02 04:40:05 +00:00
dpdk_source_root = meson.current_source_dir()
dpdk_build_root = meson.current_build_dir()
2019-06-25 11:12:58 +00:00
dpdk_conf = configuration_data()
dpdk_libraries = []
dpdk_static_libraries = []
2022-09-06 04:00:10 +00:00
dpdk_chkinc_headers = []
2020-06-18 16:55:50 +00:00
dpdk_driver_classes = []
2019-06-25 11:12:58 +00:00
dpdk_drivers = []
dpdk_extra_ldflags = []
2020-06-18 16:55:50 +00:00
dpdk_libs_disabled = []
dpdk_drvs_disabled = []
abi_version_file = files('ABI_VERSION')
2019-06-25 11:12:58 +00:00
2021-02-05 08:48:47 +00:00
if host_machine.cpu_family().startswith('x86')
2022-09-06 04:00:10 +00:00
arch_subdir = 'x86'
2021-02-05 08:48:47 +00:00
elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch')
2022-09-06 04:00:10 +00:00
arch_subdir = 'arm'
2021-02-05 08:48:47 +00:00
elif host_machine.cpu_family().startswith('ppc')
2022-09-06 04:00:10 +00:00
arch_subdir = 'ppc'
2021-02-05 08:48:47 +00:00
endif
2019-06-25 11:12:58 +00:00
# configure the build, and make sure configs here and in config folder are
# able to be included in any file. We also store a global array of include dirs
# for passing to pmdinfogen scripts
2020-06-18 16:55:50 +00:00
global_inc = include_directories('.', 'config',
2022-09-06 04:00:10 +00:00
'lib/eal/include',
'lib/eal/@0@/include'.format(host_machine.system()),
'lib/eal/@0@/include'.format(arch_subdir),
2020-06-18 16:55:50 +00:00
)
2021-02-05 08:48:47 +00:00
# do configuration and get tool paths
subdir('buildtools')
2019-06-25 11:12:58 +00:00
subdir('config')
# build libs and drivers
2020-06-18 16:55:50 +00:00
subdir('lib')
2019-06-25 11:12:58 +00:00
subdir('drivers')
# build binaries and installable tools
subdir('usertools')
subdir('app')
# build docs
subdir('doc')
2020-06-18 16:55:50 +00:00
# build any examples explicitly requested - useful for developers - and
# install any example code into the appropriate install path
subdir('examples')
2021-01-28 17:08:59 +00:00
install_subdir('examples',
2022-09-06 04:00:10 +00:00
install_dir: get_option('datadir') + '/dpdk',
exclude_files: ex_file_excludes)
2019-06-25 11:12:58 +00:00
# build kernel modules if enabled
if get_option('enable_kmods')
2022-09-06 04:00:10 +00:00
subdir('kernel')
endif
# check header includes if requested
if get_option('check_includes')
subdir('buildtools/chkincs')
2019-06-25 11:12:58 +00:00
endif
# write the build config
build_cfg = 'rte_build_config.h'
configure_file(output: build_cfg,
2022-09-06 04:00:10 +00:00
configuration: dpdk_conf,
install_dir: join_paths(get_option('includedir'),
get_option('include_subdir_arch')))
2019-06-25 11:12:58 +00:00
2021-01-28 17:08:59 +00:00
# build pkg-config files for dpdk
subdir('buildtools/pkg-config')
2019-06-25 11:12:58 +00:00
# final output, list all the libs and drivers to be built
# this does not affect any part of the build, for information only.
output_message = '\n=================\nLibraries Enabled\n=================\n'
output_message += '\nlibs:\n\t'
output_count = 0
foreach lib:enabled_libs
2022-09-06 04:00:10 +00:00
output_message += lib + ', '
output_count += 1
if output_count == 8
output_message += '\n\t'
output_count = 0
endif
2019-06-25 11:12:58 +00:00
endforeach
message(output_message + '\n')
2020-06-18 16:55:50 +00:00
output_message = '\n===============\nDrivers Enabled\n===============\n'
foreach class:dpdk_driver_classes
2022-09-06 04:00:10 +00:00
class_drivers = get_variable(class + '_drivers')
output_message += '\n' + class + ':\n\t'
output_count = 0
foreach drv:class_drivers
output_message += drv + ', '
output_count += 1
if output_count == 8
output_message += '\n\t'
output_count = 0
endif
endforeach
2020-06-18 16:55:50 +00:00
endforeach
message(output_message + '\n')
output_message = '\n=================\nContent Skipped\n=================\n'
output_message += '\nlibs:\n\t'
foreach lib:dpdk_libs_disabled
2022-09-06 04:00:10 +00:00
reason = get_variable(lib.underscorify() + '_disable_reason')
output_message += lib + ':\t' + reason + '\n\t'
2020-06-18 16:55:50 +00:00
endforeach
output_message += '\ndrivers:\n\t'
foreach drv:dpdk_drvs_disabled
2022-09-06 04:00:10 +00:00
reason = get_variable(drv.underscorify() + '_disable_reason')
output_message += drv + ':\t' + reason + '\n\t'
2020-06-18 16:55:50 +00:00
endforeach
message(output_message + '\n')