- On FreeBSD, XOPEN_SOURCE=600 is missing 'strlen' prototype.
The default XOPEN_SOURCE value (700) is used.
Signed-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh@oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu@juniper.net>
---
drivers/net/mlx5/freebsd/meson.build | 14 ++++++++++++++
drivers/net/mlx5/meson.build | 14 ++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/mlx5/freebsd/meson.build
new file mode 100644
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020 Mellanox Technologies, Ltd
+
+includes += include_directories('.')
+sources += files(
+ 'mlx5_socket.c',
+ 'mlx5_os.c',
+ 'mlx5_ethdev_os.c',
+ 'mlx5_verbs.c',
+ 'mlx5_mp_os.c',
+ 'mlx5_vlan_os.c',
+ 'mlx5_flow_os.c',
+)
+
@@ -2,9 +2,9 @@
# Copyright 2018 6WIND S.A.
# Copyright 2018 Mellanox Technologies, Ltd
-if not (is_linux or is_windows)
+if not (is_linux or is_windows or is_freebsd)
build = false
- reason = 'only supported on Linux and Windows'
+ reason = 'only supported on Linux, Windows and FreeBSD'
subdir_done()
endif
@@ -38,7 +38,7 @@ sources = files(
'mlx5_devx.c',
)
-if is_linux
+if is_linux or is_freebsd
sources += files(
'mlx5_flow_verbs.c',
)
@@ -54,8 +54,14 @@ cflags_options = [
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
'-D_DEFAULT_SOURCE',
- '-D_XOPEN_SOURCE=600',
]
+
+if not is_freebsd
+ cflags_options += [
+ '-D_XOPEN_SOURCE=600',
+ ]
+endif
+
foreach option:cflags_options
if cc.has_argument(option)
cflags += option