e16b972b1a
Starting in meson 0.56, the functions meson.source_root() and meson.build_root() are deprecated and to be replaced by the [more descriptive] functions: project_source_root()/global_source_root() and project_build_root()/global_build_root(). Unfortunately, these new replacement functions were only added in 0.56 release too, so to use them we would need version checks for old/new functions to remove the deprecation warnings. However, the functions "current_build_dir()" and "current_source_dir()" remain unaffected by all this, so we can bypass the versioning problem, by saving off these values to "dpdk_source_root" and "dpdk_build_root" in the top-level meson.build file Bugzilla ID: 926 Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Jerin Jacob <jerinj@marvell.com>
36 lines
1.4 KiB
Meson
36 lines
1.4 KiB
Meson
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright(c) 2018 Intel Corporation
|
|
|
|
kmods = ['contigmem', 'nic_uio']
|
|
|
|
# for building kernel modules, we use kernel build system using make, as
|
|
# with Linux. We have a skeleton BSDmakefile, which pulls many of its
|
|
# values from the environment. Each module only has a single source file
|
|
# right now, which allows us to simplify things. We pull in the sourcer
|
|
# files from the individual meson.build files, and then use a custom
|
|
# target to call make, passing in the values as env parameters.
|
|
kmod_cflags = ['-I' + dpdk_build_root,
|
|
'-I' + join_paths(dpdk_source_root, 'config'),
|
|
'-include rte_config.h']
|
|
|
|
# to avoid warnings due to race conditions with creating the dev_if.h, etc.
|
|
# files, serialize the kernel module builds. Each module will depend on
|
|
# previous ones
|
|
built_kmods = []
|
|
foreach k:kmods
|
|
subdir(k)
|
|
built_kmods += custom_target(k,
|
|
input: [files('BSDmakefile.meson'), sources],
|
|
output: k + '.ko',
|
|
command: ['make', '-f', '@INPUT0@',
|
|
'KMOD_OBJDIR=@OUTDIR@',
|
|
'KMOD_SRC=@INPUT1@',
|
|
'KMOD=' + k,
|
|
'KMOD_CFLAGS=' + ' '.join(kmod_cflags),
|
|
'CC=clang'],
|
|
depends: built_kmods, # make each module depend on prev
|
|
build_by_default: get_option('enable_kmods'),
|
|
install: get_option('enable_kmods'),
|
|
install_dir: '/boot/modules/')
|
|
endforeach
|