1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright(c) 2017-2019 Intel Corporation 3 4project('DPDK', 'C', 5 # Get version number from file. 6 # Fallback to "more" for Windows compatibility. 7 version: run_command(find_program('cat', 'more'), 8 files('VERSION')).stdout().strip(), 9 license: 'BSD', 10 default_options: ['buildtype=release', 'default_library=static'], 11 meson_version: '>= 0.47.1' 12) 13 14# set up some global vars for compiler, platform, configuration, etc. 15cc = meson.get_compiler('c') 16dpdk_conf = configuration_data() 17dpdk_libraries = [] 18dpdk_static_libraries = [] 19dpdk_graph_nodes = [] 20dpdk_driver_classes = [] 21dpdk_drivers = [] 22dpdk_extra_ldflags = [] 23dpdk_libs_disabled = [] 24dpdk_drvs_disabled = [] 25abi_version_file = files('ABI_VERSION') 26 27if host_machine.cpu_family().startswith('x86') 28 arch_subdir = 'x86' 29elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch') 30 arch_subdir = 'arm' 31elif host_machine.cpu_family().startswith('ppc') 32 arch_subdir = 'ppc' 33endif 34 35# configure the build, and make sure configs here and in config folder are 36# able to be included in any file. We also store a global array of include dirs 37# for passing to pmdinfogen scripts 38global_inc = include_directories('.', 'config', 39 'lib/librte_eal/include', 40 'lib/librte_eal/@0@/include'.format(host_machine.system()), 41 'lib/librte_eal/@0@/include'.format(arch_subdir), 42) 43subdir('config') 44 45# build libs and drivers 46subdir('buildtools') 47subdir('lib') 48subdir('drivers') 49 50# build binaries and installable tools 51subdir('usertools') 52subdir('app') 53 54# build docs 55subdir('doc') 56 57# build any examples explicitly requested - useful for developers - and 58# install any example code into the appropriate install path 59subdir('examples') 60 61# build kernel modules if enabled 62if get_option('enable_kmods') 63 subdir('kernel') 64endif 65 66# write the build config 67build_cfg = 'rte_build_config.h' 68configure_file(output: build_cfg, 69 configuration: dpdk_conf, 70 install_dir: join_paths(get_option('includedir'), 71 get_option('include_subdir_arch'))) 72 73# build pkg-config files for dpdk 74subdir('buildtools/pkg-config') 75 76# final output, list all the libs and drivers to be built 77# this does not affect any part of the build, for information only. 78output_message = '\n=================\nLibraries Enabled\n=================\n' 79output_message += '\nlibs:\n\t' 80output_count = 0 81foreach lib:enabled_libs 82 output_message += lib + ', ' 83 output_count += 1 84 if output_count == 8 85 output_message += '\n\t' 86 output_count = 0 87 endif 88endforeach 89message(output_message + '\n') 90 91output_message = '\n===============\nDrivers Enabled\n===============\n' 92foreach class:dpdk_driver_classes 93 class_drivers = get_variable(class + '_drivers') 94 output_message += '\n' + class + ':\n\t' 95 output_count = 0 96 foreach drv:class_drivers 97 output_message += drv + ', ' 98 output_count += 1 99 if output_count == 8 100 output_message += '\n\t' 101 output_count = 0 102 endif 103 endforeach 104endforeach 105message(output_message + '\n') 106 107output_message = '\n=================\nContent Skipped\n=================\n' 108output_message += '\nlibs:\n\t' 109foreach lib:dpdk_libs_disabled 110 reason = get_variable(lib.underscorify() + '_disable_reason') 111 output_message += lib + ':\t' + reason + '\n\t' 112endforeach 113output_message += '\ndrivers:\n\t' 114foreach drv:dpdk_drvs_disabled 115 reason = get_variable(drv.underscorify() + '_disable_reason') 116 output_message += drv + ':\t' + reason + '\n\t' 117endforeach 118message(output_message + '\n') 119