numam-dpdk/lib/librte_eal/meson.build
Dmitry Kozlyuk ff5db45d47 eal/windows: use bundled getopt with MinGW
Clang builds use getopt.c in librte_eal while MinGW provides
implementation as part of the toolchain. Statically linking librte_eal
to an application that depends on getopt results in undefined reference
errors with MinGW. There are no such errors with Clang, because with
Clang librte_eal actually defines getopt functions.

Use getopt.c in EAL with Clang and MinGW to get identical behavior.
Adjust code for MinGW. Incidentally, this removes a bug when free() is
called on uninitialized memory.

Fixes: 5e373e456e ("eal/windows: add getopt implementation")
Cc: stable@dpdk.org

Reported-by: Khoa To <khot@microsoft.com>
Reported-by: Tal Shnaiderman <talshn@nvidia.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Khoa To <khot@microsoft.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
2020-10-05 09:12:24 +02:00

28 lines
519 B
Meson

# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2019 Intel Corporation
includes += global_inc
subdir('include')
subdir('common')
if not is_windows
subdir('unix')
endif
dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
subdir(exec_env)
subdir(arch_subdir)
deps += ['kvargs']
if not is_windows
deps += ['telemetry']
endif
if dpdk_conf.has('RTE_USE_LIBBSD')
ext_deps += libbsd
endif
if cc.has_function('getentropy', prefix : '#include <unistd.h>')
cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
endif