build: replace license text with SPDX tag
[dpdk.git] / lib / librte_eal / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
3
4 # Custom EAL processing. EAL is complicated enough that it can't just
5 # have a straight list of headers and source files.
6 # Initially pull in common settings
7 eal_inc = [global_inc]
8 subdir('common') # defines common_sources, common_objs, etc.
9
10 # Now do OS/exec-env specific settings, including building kernel modules
11 # The <exec-env>/eal/meson.build file should define env_sources, etc.
12 if host_machine.system() == 'linux'
13         dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
14         subdir('linuxapp/eal')
15         subdir('linuxapp/igb_uio')
16
17 elif host_machine.system() == 'freebsd'
18         dpdk_conf.set('RTE_EXEC_ENV_BSDAPP', 1)
19         subdir('bsdapp/eal')
20         kmods = ['contigmem', 'nic_uio']
21
22         # for building kernel modules, we use kernel build system using make, as
23         # with Linux. We have a skeleton BSDmakefile, which pulls many of its
24         # values from the environment. Each module only has a single source file
25         # right now, which allows us to simplify things. We pull in the sourcer
26         # files from the individual meson.build files, and then use a custom
27         # target to call make, passing in the values as env parameters.
28         kmod_cflags = ['-I' + meson.build_root(),
29                         '-I' + join_paths(meson.source_root(), 'config'),
30                         '-include rte_config.h']
31         foreach k:kmods
32                 subdir(join_paths('bsdapp', k))
33                 custom_target(k,
34                         input: [files('bsdapp/BSDmakefile.meson'), sources],
35                         output: k + '.ko',
36                         command: ['make', '-f', '@INPUT0@',
37                                 'KMOD_SRC=@INPUT1@',
38                                 'KMOD=' + k,
39                                 'VPATH=' + join_paths(meson.current_source_dir(), k),
40                                 'KMOD_CFLAGS=' + ' '.join(kmod_cflags)],
41                         build_by_default: get_option('enable_kmods'))
42         endforeach
43 else
44         error('unsupported system type @0@'.format(hostmachine.system()))
45 endif
46
47 version = 6  # the version of the EAL API
48 allow_experimental_apis = true
49 cflags += '-D_GNU_SOURCE'
50 sources = common_sources + env_sources
51 objs = common_objs + env_objs
52 headers = common_headers + env_headers
53 includes = eal_inc