3 # Copyright(c) 2017 Intel Corporation.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
16 # * Neither the name of Intel Corporation nor the names of its
17 # contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 # Custom EAL processing. EAL is complicated enough that it can't just
33 # have a straight list of headers and source files.
34 # Initially pull in common settings
35 eal_inc = [global_inc]
36 subdir('common') # defines common_sources, common_objs, etc.
38 # Now do OS/exec-env specific settings, including building kernel modules
39 # The <exec-env>/eal/meson.build file should define env_sources, etc.
40 if host_machine.system() == 'linux'
41 dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
42 subdir('linuxapp/eal')
43 subdir('linuxapp/igb_uio')
45 elif host_machine.system() == 'freebsd'
46 dpdk_conf.set('RTE_EXEC_ENV_BSDAPP', 1)
48 kmods = ['contigmem', 'nic_uio']
50 # for building kernel modules, we use kernel build system using make, as
51 # with Linux. We have a skeleton BSDmakefile, which pulls many of its
52 # values from the environment. Each module only has a single source file
53 # right now, which allows us to simplify things. We pull in the sourcer
54 # files from the individual meson.build files, and then use a custom
55 # target to call make, passing in the values as env parameters.
56 kmod_cflags = ['-I' + meson.build_root(),
57 '-I' + join_paths(meson.source_root(), 'config'),
58 '-include rte_config.h']
60 subdir(join_paths('bsdapp', k))
62 input: [files('bsdapp/BSDmakefile.meson'), sources],
64 command: ['make', '-f', '@INPUT0@',
67 'VPATH=' + join_paths(meson.current_source_dir(), k),
68 'KMOD_CFLAGS=' + ' '.join(kmod_cflags)],
69 build_by_default: get_option('enable_kmods'))
72 error('unsupported system type @0@'.format(hostmachine.system()))
75 version = 6 # the version of the EAL API
76 allow_experimental_apis = true
77 cflags += '-D_GNU_SOURCE'
78 sources = common_sources + env_sources
79 objs = common_objs + env_objs
80 headers = common_headers + env_headers