1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
7 default_options: ['buildtype=release', 'default_library=static'],
8 meson_version: '>= 0.41'
11 # set up some global vars for compiler, platform, configuration, etc.
12 cc = meson.get_compiler('c')
13 dpdk_conf = configuration_data()
16 dpdk_extra_ldflags = []
18 driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
19 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
21 # configure the build, and make sure configs here and in config folder are
22 # able to be included in any file. We also store a global array of include dirs
23 # for passing to pmdinfogen scripts
24 global_inc = include_directories('.', 'config')
27 # build libs and drivers
33 # build binaries and installable tools
38 # build any examples explicitly requested - useful for developers
39 if get_option('examples') != ''
43 # write the build config
44 build_cfg = 'rte_build_config.h'
45 configure_file(output: build_cfg,
46 configuration: dpdk_conf,
47 install_dir: join_paths(get_option('includedir'),
48 get_option('include_subdir_arch')))
50 # for static builds, include the drivers as libs and we need to "whole-archive"
52 dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
54 # driver .so files often depend upon the bus drivers for their connect bus,
55 # e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
56 # to be in the library path, so symlink the drivers from the main lib directory.
57 meson.add_install_script('buildtools/symlink-drivers-solibs.sh',
61 pkg = import('pkgconfig')
62 pkg.generate(name: meson.project_name(),
63 filebase: 'lib' + meson.project_name().to_lower(),
64 version: meson.project_version(),
65 libraries: dpdk_libraries,
66 libraries_private: dpdk_drivers + dpdk_libraries +
67 ['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
68 description: 'The Data Plane Development Kit (DPDK)',
69 subdirs: [get_option('include_subdir_arch'), '.'],
70 extra_cflags: ['-include', 'rte_config.h'] + machine_args