1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
4 subdirs = ['igb_uio', 'kni']
6 # if we are cross-compiling we need kernel_dir specified
7 if get_option('kernel_dir') == '' and meson.is_cross_build()
8 warning('Need "kernel_dir" option for kmod compilation when cross-compiling')
12 kernel_dir = get_option('kernel_dir')
14 # use default path for native builds
15 kernel_version = run_command('uname', '-r').stdout().strip()
16 kernel_dir = '/lib/modules/' + kernel_version
19 # test running make in kernel directory, using "make kernelversion"
20 make_returncode = run_command('make', '-sC', kernel_dir + '/build',
21 'kernelversion').returncode()
22 if make_returncode != 0
23 warning('Cannot compile kernel modules as requested - are kernel headers installed?')
27 # DO ACTUAL MODULE BUILDING