app/testpmd: register driver specific commands
[dpdk.git] / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 project('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'), check: true).stdout().strip(),
9         license: 'BSD',
10         default_options: [
11             'buildtype=release',
12             'default_library=static',
13             'warning_level=2',
14         ],
15         meson_version: '>= 0.49.2'
16 )
17
18 # check for developer mode
19 developer_mode = false
20 if get_option('developer_mode').auto()
21     if meson.version().version_compare('>=0.53') # fs module available
22         fs = import('fs')
23         developer_mode = fs.is_dir('.git')
24     endif
25 else
26     developer_mode = get_option('developer_mode').enabled()
27 endif
28 if developer_mode
29     message('## Building in Developer Mode ##')
30 endif
31
32 # set up some global vars for compiler, platform, configuration, etc.
33 cc = meson.get_compiler('c')
34 dpdk_source_root = meson.current_source_dir()
35 dpdk_build_root = meson.current_build_dir()
36 dpdk_conf = configuration_data()
37 dpdk_libraries = []
38 dpdk_static_libraries = []
39 dpdk_chkinc_headers = []
40 dpdk_driver_classes = []
41 dpdk_drivers = []
42 dpdk_extra_ldflags = []
43 dpdk_libs_disabled = []
44 dpdk_drvs_disabled = []
45 testpmd_drivers_sources = []
46 testpmd_drivers_deps = []
47 abi_version_file = files('ABI_VERSION')
48
49 if host_machine.cpu_family().startswith('x86')
50     arch_subdir = 'x86'
51 elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch')
52     arch_subdir = 'arm'
53 elif host_machine.cpu_family().startswith('ppc')
54     arch_subdir = 'ppc'
55 endif
56
57 # configure the build, and make sure configs here and in config folder are
58 # able to be included in any file. We also store a global array of include dirs
59 # for passing to pmdinfogen scripts
60 global_inc = include_directories('.', 'config',
61     'lib/eal/include',
62     'lib/eal/@0@/include'.format(host_machine.system()),
63     'lib/eal/@0@/include'.format(arch_subdir),
64 )
65
66 # do configuration and get tool paths
67 subdir('buildtools')
68 subdir('config')
69
70 # build libs and drivers
71 subdir('lib')
72 subdir('drivers')
73
74 # build binaries and installable tools
75 subdir('usertools')
76 subdir('app')
77
78 # build docs
79 subdir('doc')
80
81 # build any examples explicitly requested - useful for developers - and
82 # install any example code into the appropriate install path
83 subdir('examples')
84 install_subdir('examples',
85         install_dir: get_option('datadir') + '/dpdk',
86         exclude_files: ex_file_excludes)
87
88 # build kernel modules if enabled
89 if get_option('enable_kmods')
90     subdir('kernel')
91 endif
92
93 # check header includes if requested
94 if get_option('check_includes')
95     subdir('buildtools/chkincs')
96 endif
97
98 # write the build config
99 build_cfg = 'rte_build_config.h'
100 configure_file(output: build_cfg,
101         configuration: dpdk_conf,
102         install_dir: join_paths(get_option('includedir'),
103             get_option('include_subdir_arch')))
104
105 # build pkg-config files for dpdk
106 subdir('buildtools/pkg-config')
107
108 # final output, list all the libs and drivers to be built
109 # this does not affect any part of the build, for information only.
110 output_message = '\n=================\nLibraries Enabled\n=================\n'
111 output_message += '\nlibs:\n\t'
112 output_count = 0
113 foreach lib:enabled_libs
114     output_message += lib + ', '
115     output_count += 1
116     if output_count == 8
117         output_message += '\n\t'
118         output_count = 0
119     endif
120 endforeach
121 message(output_message + '\n')
122
123 output_message = '\n===============\nDrivers Enabled\n===============\n'
124 foreach class:dpdk_driver_classes
125     class_drivers = get_variable(class + '_drivers')
126     output_message += '\n' + class + ':\n\t'
127     output_count = 0
128     foreach drv:class_drivers
129         output_message += drv + ', '
130         output_count += 1
131         if output_count == 8
132             output_message += '\n\t'
133             output_count = 0
134         endif
135     endforeach
136 endforeach
137 message(output_message + '\n')
138
139 output_message = '\n=================\nContent Skipped\n=================\n'
140 output_message += '\nlibs:\n\t'
141 foreach lib:dpdk_libs_disabled
142     reason = get_variable(lib.underscorify() + '_disable_reason')
143     output_message += lib + ':\t' + reason + '\n\t'
144 endforeach
145 output_message += '\ndrivers:\n\t'
146 foreach drv:dpdk_drvs_disabled
147     reason = get_variable(drv.underscorify() + '_disable_reason')
148     output_message += drv + ':\t' + reason + '\n\t'
149 endforeach
150 message(output_message + '\n')