2017-12-18 15:56:25 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2019-04-02 03:54:58 +00:00
|
|
|
# Copyright(c) 2017-2019 Intel Corporation
|
|
|
|
|
2022-10-28 12:34:19 +00:00
|
|
|
disable_apps = ',' + get_option('disable_apps')
|
|
|
|
disable_apps = run_command(list_dir_globs, disable_apps, check: true).stdout().split()
|
|
|
|
|
|
|
|
enable_apps = ',' + get_option('enable_apps')
|
|
|
|
enable_apps = run_command(list_dir_globs, enable_apps, check: true).stdout().split()
|
|
|
|
if enable_apps.length() == 0
|
|
|
|
enable_apps = run_command(list_dir_globs, '*', check: true).stdout().split()
|
|
|
|
endif
|
2022-10-14 07:51:17 +00:00
|
|
|
|
2019-02-26 12:18:59 +00:00
|
|
|
apps = [
|
2021-10-20 21:42:31 +00:00
|
|
|
'dumpcap',
|
2021-04-20 10:22:21 +00:00
|
|
|
'pdump',
|
|
|
|
'proc-info',
|
|
|
|
'test-acl',
|
|
|
|
'test-bbdev',
|
|
|
|
'test-cmdline',
|
|
|
|
'test-compress-perf',
|
|
|
|
'test-crypto-perf',
|
|
|
|
'test-eventdev',
|
|
|
|
'test-fib',
|
|
|
|
'test-flow-perf',
|
2021-11-08 18:57:57 +00:00
|
|
|
'test-gpudev',
|
2021-04-20 10:22:21 +00:00
|
|
|
'test-pipeline',
|
|
|
|
'test-pmd',
|
|
|
|
'test-regex',
|
|
|
|
'test-sad',
|
2022-11-03 12:46:11 +00:00
|
|
|
'test-security-perf',
|
2021-04-20 10:22:21 +00:00
|
|
|
]
|
2018-02-16 16:53:34 +00:00
|
|
|
|
2020-04-13 14:55:30 +00:00
|
|
|
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
|
2020-12-18 13:14:22 +00:00
|
|
|
default_ldflags = []
|
2021-01-12 00:36:02 +00:00
|
|
|
if get_option('default_library') == 'static' and not is_windows
|
2021-04-20 10:22:21 +00:00
|
|
|
default_ldflags += ['-Wl,--export-dynamic']
|
2020-12-18 13:14:22 +00:00
|
|
|
endif
|
2018-10-04 10:20:33 +00:00
|
|
|
|
2022-10-28 12:34:19 +00:00
|
|
|
enabled_apps = [] # used to print summary at the end
|
|
|
|
|
2018-02-16 16:53:34 +00:00
|
|
|
foreach app:apps
|
2021-04-20 10:22:21 +00:00
|
|
|
name = app
|
2022-10-28 12:34:19 +00:00
|
|
|
build = true
|
|
|
|
reason = '<unknown reason>' # set if build == false to explain
|
2021-04-20 10:22:21 +00:00
|
|
|
sources = []
|
|
|
|
includes = []
|
|
|
|
cflags = default_cflags
|
|
|
|
ldflags = default_ldflags
|
|
|
|
objs = [] # other object files to link against, used e.g. for
|
|
|
|
# instruction-set optimized versions of code
|
2018-02-16 16:53:34 +00:00
|
|
|
|
2021-04-20 10:22:21 +00:00
|
|
|
# use "deps" for internal DPDK dependencies, and "ext_deps" for
|
|
|
|
# external package/library requirements
|
|
|
|
ext_deps = []
|
|
|
|
deps = []
|
2018-02-16 16:53:34 +00:00
|
|
|
|
2022-10-28 12:34:19 +00:00
|
|
|
if not enable_apps.contains(app)
|
|
|
|
build = false
|
|
|
|
reason = 'not in enabled apps build config'
|
|
|
|
elif disable_apps.contains(app)
|
|
|
|
build = false
|
|
|
|
reason = 'explicitly disabled via build config'
|
2022-10-14 07:51:17 +00:00
|
|
|
endif
|
|
|
|
|
2022-10-28 12:34:19 +00:00
|
|
|
if build
|
|
|
|
subdir(name)
|
|
|
|
endif
|
2018-02-16 16:53:34 +00:00
|
|
|
|
2021-11-17 11:28:46 +00:00
|
|
|
if build
|
|
|
|
dep_objs = []
|
|
|
|
foreach d:deps
|
|
|
|
var_name = get_option('default_library') + '_rte_' + d
|
|
|
|
if not is_variable(var_name)
|
|
|
|
build = false
|
2022-10-28 12:34:19 +00:00
|
|
|
reason = 'missing internal dependency, "@0@"'.format(d)
|
2021-11-17 11:28:46 +00:00
|
|
|
message('Missing dependency "@0@" for app "@1@"'.format(d, name))
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
dep_objs += [get_variable(var_name)]
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2021-04-20 10:22:21 +00:00
|
|
|
if not build
|
2022-10-28 12:34:19 +00:00
|
|
|
if reason != ''
|
|
|
|
dpdk_apps_disabled += app
|
|
|
|
set_variable(app.underscorify() + '_disable_reason', reason)
|
|
|
|
endif
|
2021-04-20 10:22:21 +00:00
|
|
|
continue
|
|
|
|
endif
|
2018-02-16 16:53:34 +00:00
|
|
|
|
2022-10-28 12:34:19 +00:00
|
|
|
enabled_apps += app
|
2021-04-20 10:22:21 +00:00
|
|
|
link_libs = []
|
|
|
|
if get_option('default_library') == 'static'
|
|
|
|
link_libs = dpdk_static_libraries + dpdk_drivers
|
|
|
|
endif
|
|
|
|
|
|
|
|
executable('dpdk-' + name,
|
|
|
|
sources,
|
|
|
|
c_args: cflags,
|
|
|
|
link_args: ldflags,
|
|
|
|
link_whole: link_libs,
|
2021-11-05 13:29:51 +00:00
|
|
|
dependencies: ext_deps + dep_objs,
|
2021-04-20 10:22:21 +00:00
|
|
|
include_directories: includes,
|
|
|
|
install_rpath: join_paths(get_option('prefix'), driver_install_path),
|
|
|
|
install: true)
|
2018-02-16 16:53:34 +00:00
|
|
|
endforeach
|
2019-02-26 12:19:03 +00:00
|
|
|
|
|
|
|
# special case the autotests
|
|
|
|
subdir('test')
|