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
44 sources += files('mlx4_glue.c')
49 '-Wno-strict-prototypes',
54 foreach option:cflags_options
55 if cc.has_argument(option)
59 if get_option('buildtype').contains('debug')
60 cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]
62 cflags += [ '-DNDEBUG', '-UPEDANTIC' ]
64 # To maintain the compatibility with the make build system
65 # mlx4_autoconf.h file is still generated.
66 # input array for meson member search:
67 # [ "MACRO to define if found", "header for the search",
68 # "symbol to search","struct member to search" ]
71 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
72 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
74 # input array for meson symbol search:
75 # [ "MACRO to define if found", "header for the search",
76 # "symbol to search" ]
78 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
79 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
80 [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h',
81 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ],
83 config = configuration_data()
84 foreach arg:has_sym_args
85 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))
87 foreach arg:has_member_args
88 file_prefix = '#include<' + arg[1] + '>'
89 config.set(arg[0], cc.has_member(arg[2], arg[3],
90 prefix : file_prefix))
92 configure_file(output : 'mlx4_autoconf.h', configuration : config)
95 if pmd_dlopen and build
96 dlopen_name = 'mlx4_glue'
97 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
98 dlopen_so_version = LIB_GLUE_VERSION
99 dlopen_sources = files('mlx4_glue.c')
100 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
101 shared_lib = shared_library(
104 include_directories: global_inc,
108 '-Wl,-export-dynamic',
109 '-Wl,-h,@0@'.format(LIB_GLUE),
111 soversion: dlopen_so_version,
113 install_dir: dlopen_install_dir,