1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
5 version: '18.11.0-rc0',
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()
15 dpdk_static_libraries = []
17 dpdk_extra_ldflags = []
18 dpdk_app_link_libraries = []
20 driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
21 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
23 # configure the build, and make sure configs here and in config folder are
24 # able to be included in any file. We also store a global array of include dirs
25 # for passing to pmdinfogen scripts
26 global_inc = include_directories('.', 'config')
29 # build libs and drivers
34 # build binaries and installable tools
42 # build any examples explicitly requested - useful for developers
43 if get_option('examples') != ''
47 # build kernel modules if enabled
48 if get_option('enable_kmods')
52 # write the build config
53 build_cfg = 'rte_build_config.h'
54 configure_file(output: build_cfg,
55 configuration: dpdk_conf,
56 install_dir: join_paths(get_option('includedir'),
57 get_option('include_subdir_arch')))
59 # for static builds, include the drivers as libs and we need to "whole-archive"
61 dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
63 # driver .so files often depend upon the bus drivers for their connect bus,
64 # e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
65 # to be in the library path, so symlink the drivers from the main lib directory.
66 meson.add_install_script('buildtools/symlink-drivers-solibs.sh',
70 pkg = import('pkgconfig')
71 pkg.generate(name: meson.project_name(),
72 filebase: 'lib' + meson.project_name().to_lower(),
73 version: meson.project_version(),
74 libraries: dpdk_libraries,
75 libraries_private: dpdk_drivers + dpdk_libraries +
76 ['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
77 description: 'The Data Plane Development Kit (DPDK)',
78 subdirs: [get_option('include_subdir_arch'), '.'],
79 extra_cflags: ['-include', 'rte_config.h'] + machine_args
82 # final output, list all the libs and drivers to be built
83 # this does not affect any part of the build, for information only.
84 output_message = '\n=================\nLibraries Enabled\n=================\n'
85 output_message += '\nlibs:\n\t'
87 foreach lib:enabled_libs
88 output_message += lib + ', '
91 output_message += '\n\t'
95 message(output_message + '\n')
98 # prior to 0.47 set_variable didn't work with arrays, so we can't
99 # track driver lists easily
100 if meson.version().version_compare('>=0.47')
101 output_message = '\n===============\nDrivers Enabled\n===============\n'
102 foreach class:driver_classes
103 class_drivers = get_variable(class + '_drivers')
104 output_message += '\n' + class + ':\n\t'
106 foreach drv:class_drivers
107 output_message += drv + ', '
110 output_message += '\n\t'
115 message(output_message + '\n')