Skip to content

Commit

Permalink
build: change indentation in infrastructure files
Browse files Browse the repository at this point in the history
Switch from using tabs to 4 spaces for meson.build indentation, for the
basic infrastructure and tooling files, as well as doc and kernel
directories.

Signed-off-by: Bruce Richardson <[email protected]>
  • Loading branch information
bruce-richardson authored and tmonjalo committed Apr 21, 2021
1 parent cf59165 commit 8dcb898
Show file tree
Hide file tree
Showing 16 changed files with 797 additions and 806 deletions.
24 changes: 12 additions & 12 deletions buildtools/chkincs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# Copyright(c) 2021 Intel Corporation

if not get_option('check_includes')
build = false
subdir_done()
build = false
subdir_done()
endif

if is_windows
# for windows, the shebang line in the script won't work.
error('option "check_includes" is not supported on windows')
# for windows, the shebang line in the script won't work.
error('option "check_includes" is not supported on windows')
endif

gen_c_file_for_header = find_program('gen_c_file_for_header.py')
gen_c_files = generator(gen_c_file_for_header,
output: '@[email protected]',
arguments: ['@INPUT@', '@OUTPUT@'])
output: '@[email protected]',
arguments: ['@INPUT@', '@OUTPUT@'])

cflags = machine_args
cflags += '-DALLOW_EXPERIMENTAL_API'
Expand All @@ -24,12 +24,12 @@ sources += gen_c_files.process(dpdk_chkinc_headers)

deps = []
foreach l:enabled_libs
deps += get_variable('static_rte_' + l)
deps += get_variable('static_rte_' + l)
endforeach

executable('chkincs', sources,
c_args: cflags,
include_directories: includes,
dependencies: deps,
link_whole: dpdk_static_libraries + dpdk_drivers,
install: false)
c_args: cflags,
include_directories: includes,
dependencies: deps,
link_whole: dpdk_static_libraries + dpdk_drivers,
install: false)
34 changes: 17 additions & 17 deletions buildtools/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ binutils_avx512_check = find_program('binutils-avx512-check.sh')
# set up map-to-win script using python, either built-in or external
python3 = import('python').find_installation(required: false)
if python3.found()
py3 = [python3]
py3 = [python3]
else
py3 = ['meson', 'runpython']
py3 = ['meson', 'runpython']
endif
map_to_win_cmd = py3 + files('map_to_win.py')
sphinx_wrapper = py3 + files('call-sphinx-build.py')
Expand All @@ -21,27 +21,27 @@ sphinx_wrapper = py3 + files('call-sphinx-build.py')
pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
pmdinfogen = py3 + files('pmdinfogen.py')
if host_machine.system() == 'windows'
if cc.get_id() == 'gcc'
pmdinfo += 'ar'
else
pmdinfo += 'llvm-ar'
endif
pmdinfogen += 'coff'
if cc.get_id() == 'gcc'
pmdinfo += 'ar'
else
pmdinfo += 'llvm-ar'
endif
pmdinfogen += 'coff'
else
pmdinfo += 'ar'
pmdinfogen += 'elf'
pmdinfo += 'ar'
pmdinfogen += 'elf'
endif

# TODO: starting from Meson 0.51.0 use
# python3 = import('python').find_installation('python',
# modules : python3_required_modules)
# python3 = import('python').find_installation('python',
# modules : python3_required_modules)
python3_required_modules = []
if host_machine.system() != 'windows'
python3_required_modules = ['elftools']
python3_required_modules = ['elftools']
endif
foreach module : python3_required_modules
script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
if run_command(py3, '-c', script.format(module)).returncode() != 0
error('missing python module: @0@'.format(module))
endif
script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
if run_command(py3, '-c', script.format(module)).returncode() != 0
error('missing python module: @0@'.format(module))
endif
endforeach
34 changes: 17 additions & 17 deletions buildtools/pkg-config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pkg = import('pkgconfig')
pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
if is_freebsd
pkg_extra_cflags += ['-D__BSD_VISIBLE']
pkg_extra_cflags += ['-D__BSD_VISIBLE']
endif

# When calling pkg-config --static --libs, pkg-config will always output the
Expand All @@ -28,30 +28,30 @@ endif


pkg.generate(name: 'dpdk-libs',
filebase: 'libdpdk-libs',
description: '''Internal-only DPDK pkgconfig file. Not for direct use.
filebase: 'libdpdk-libs',
description: '''Internal-only DPDK pkgconfig file. Not for direct use.
Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
version: meson.project_version(),
subdirs: [get_option('include_subdir_arch'), '.'],
extra_cflags: pkg_extra_cflags,
libraries: ['-Wl,--as-needed'] + dpdk_libraries,
libraries_private: dpdk_extra_ldflags)
version: meson.project_version(),
subdirs: [get_option('include_subdir_arch'), '.'],
extra_cflags: pkg_extra_cflags,
libraries: ['-Wl,--as-needed'] + dpdk_libraries,
libraries_private: dpdk_extra_ldflags)

platform_flags = []
if not is_windows
platform_flags += ['-Wl,--export-dynamic'] # ELF only
platform_flags += ['-Wl,--export-dynamic'] # ELF only
endif
pkg.generate(name: 'DPDK', # main DPDK pkgconfig file
filebase: 'libdpdk',
version: meson.project_version(),
description: '''The Data Plane Development Kit (DPDK).
filebase: 'libdpdk',
version: meson.project_version(),
description: '''The Data Plane Development Kit (DPDK).
Note that CFLAGS might contain an -march flag higher than typical baseline.
This is required for a number of static inline functions in the public headers.''',
requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
# if libbsd is not enabled, then this is blank
libraries_private: ['-Wl,--whole-archive'] +
dpdk_drivers + dpdk_static_libraries +
['-Wl,--no-whole-archive'] + platform_flags
requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
# if libbsd is not enabled, then this is blank
libraries_private: ['-Wl,--whole-archive'] +
dpdk_drivers + dpdk_static_libraries +
['-Wl,--no-whole-archive'] + platform_flags
)

# For static linking with dependencies as shared libraries,
Expand Down
Loading

0 comments on commit 8dcb898

Please sign in to comment.