f-stack/dpdk/kernel/linux/meson.build

29 lines
864 B
Meson
Raw Normal View History

2019-06-25 11:12:58 +00:00
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation
2021-02-05 08:48:47 +00:00
subdirs = ['kni']
2019-06-25 11:12:58 +00:00
# if we are cross-compiling we need kernel_dir specified
if get_option('kernel_dir') == '' and meson.is_cross_build()
2021-02-05 08:48:47 +00:00
error('Need "kernel_dir" option for kmod compilation when cross-compiling')
2020-06-18 16:55:50 +00:00
endif
2019-06-25 11:12:58 +00:00
2020-06-18 16:55:50 +00:00
kernel_dir = get_option('kernel_dir')
if kernel_dir == ''
# use default path for native builds
kernel_version = run_command('uname', '-r').stdout().strip()
kernel_dir = '/lib/modules/' + kernel_version
endif
2019-06-25 11:12:58 +00:00
2020-06-18 16:55:50 +00:00
# test running make in kernel directory, using "make kernelversion"
make_returncode = run_command('make', '-sC', kernel_dir + '/build',
'kernelversion').returncode()
if make_returncode != 0
2021-02-05 08:48:47 +00:00
error('Cannot compile kernel modules as requested - are kernel headers installed?')
2020-06-18 16:55:50 +00:00
endif
2019-06-25 11:12:58 +00:00
# DO ACTUAL MODULE BUILDING
2020-06-18 16:55:50 +00:00
foreach d:subdirs
subdir(d)
endforeach