1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright(c) 2017 Intel Corporation 3 4project('DPDK', 'C', 5 version: '18.08-rc0', 6 license: 'BSD', 7 default_options: ['buildtype=release', 'default_library=static'], 8 meson_version: '>= 0.41' 9) 10 11# set up some global vars for compiler, platform, configuration, etc. 12cc = meson.get_compiler('c') 13dpdk_conf = configuration_data() 14dpdk_libraries = [] 15dpdk_drivers = [] 16dpdk_extra_ldflags = [] 17 18driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers') 19eal_pmd_path = join_paths(get_option('prefix'), driver_install_path) 20 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 24global_inc = include_directories('.', 'config') 25subdir('config') 26 27# build libs and drivers 28subdir('lib') 29subdir('buildtools') 30subdir('drivers') 31 32# build binaries and installable tools 33subdir('usertools') 34subdir('app') 35subdir('test') 36 37# build any examples explicitly requested - useful for developers 38if get_option('examples') != '' 39 subdir('examples') 40endif 41 42# build kernel modules if enabled 43if get_option('enable_kmods') 44 subdir('kernel') 45endif 46 47# write the build config 48build_cfg = 'rte_build_config.h' 49configure_file(output: build_cfg, 50 configuration: dpdk_conf, 51 install_dir: join_paths(get_option('includedir'), 52 get_option('include_subdir_arch'))) 53 54# for static builds, include the drivers as libs and we need to "whole-archive" 55# them. 56dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] 57 58# driver .so files often depend upon the bus drivers for their connect bus, 59# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need 60# to be in the library path, so symlink the drivers from the main lib directory. 61meson.add_install_script('buildtools/symlink-drivers-solibs.sh', 62 driver_install_path, 63 get_option('libdir')) 64 65pkg = import('pkgconfig') 66pkg.generate(name: meson.project_name(), 67 filebase: 'lib' + meson.project_name().to_lower(), 68 version: meson.project_version(), 69 libraries: dpdk_libraries, 70 libraries_private: dpdk_drivers + dpdk_libraries + 71 ['-Wl,-Bdynamic'] + dpdk_extra_ldflags, 72 description: 'The Data Plane Development Kit (DPDK)', 73 subdirs: [get_option('include_subdir_arch'), '.'], 74 extra_cflags: ['-include', 'rte_config.h'] + machine_args 75) 76