1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2018 6WIND S.A.
3 # Copyright 2018 Mellanox Technologies, Ltd
5 pmd_dlopen = (get_option('ibverbs_link') == 'dlopen')
6 LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so'
7 LIB_GLUE_VERSION = '18.02.0'
8 LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
10 dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1)
12 '-DMLX4_GLUE="@0@"'.format(LIB_GLUE),
13 '-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION),
17 dependency('libmnl', required:false),
18 dependency('libmlx4', required:false),
19 dependency('libibverbs', required:false),
29 allow_experimental_apis = true
43 sources += files('mlx4_glue.c')
48 '-Wno-strict-prototypes',
53 foreach option:cflags_options
54 if cc.has_argument(option)
58 if get_option('buildtype').contains('debug')
59 cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]
61 cflags += [ '-DNDEBUG', '-UPEDANTIC' ]
63 # To maintain the compatibility with the make build system
64 # mlx4_autoconf.h file is still generated.
65 # input array for meson member search:
66 # [ "MACRO to define if found", "header for the search",
67 # "symbol to search","struct member to search" ]
70 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
71 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
73 # input array for meson symbol search:
74 # [ "MACRO to define if found", "header for the search",
75 # "symbol to search" ]
77 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
78 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
80 config = configuration_data()
81 foreach arg:has_sym_args
82 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))
84 foreach arg:has_member_args
85 file_prefix = '#include<' + arg[1] + '>'
86 config.set(arg[0], cc.has_member(arg[2], arg[3],
87 prefix : file_prefix))
89 configure_file(output : 'mlx4_autoconf.h', configuration : config)
92 if pmd_dlopen and build
93 dlopen_name = 'mlx4_glue'
94 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
95 dlopen_so_version = LIB_GLUE_VERSION
96 dlopen_sources = files('mlx4_glue.c')
97 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
98 shared_lib = shared_library(
101 include_directories: global_inc,
105 '-Wl,-export-dynamic',
106 '-Wl,-h,@0@'.format(LIB_GLUE),
108 soversion: dlopen_so_version,
110 install_dir: dlopen_install_dir,