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.
35 default_options: ['buildtype=release'],
36 meson_version: '>= 0.41'
39 # set up some global vars for compiler, platform, configuration, etc.
40 cc = meson.get_compiler('c')
41 dpdk_conf = configuration_data()
44 dpdk_extra_ldflags = []
46 # for static libs, treat the drivers as regular libraries, otherwise
47 # for shared libs, put them in a driver folder
48 if get_option('default_library') == 'static'
49 driver_install_path = get_option('libdir')
52 driver_install_path = join_paths(get_option('datadir'), 'dpdk/drivers')
53 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
56 # configure the build, and make sure configs here and in config folder are
57 # able to be included in any file. We also store a global array of include dirs
58 # for passing to pmdinfogen scripts
59 global_inc = include_directories('.', 'config')
62 # build libs and drivers
67 # TODO build binaries and installable tools
69 # write the build config
70 build_cfg = 'rte_build_config.h'
71 configure_file(output: build_cfg,
72 configuration: dpdk_conf,
73 install_dir: get_option('includedir'))
75 # for static builds, include the drivers as libs, and also any
76 # other dependent libs that DPDK needs to link against
77 if get_option('default_library') == 'static'
78 dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
79 dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
82 pkg = import('pkgconfig')
83 pkg.generate(name: meson.project_name(),
84 version: meson.project_version(),
85 libraries: dpdk_libraries,
86 description: 'The Data Plane Development Kit (DPDK)',
87 extra_cflags: ['-include', 'rte_config.h', '-march=@0@'.format(machine)]