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),
16 libnames = [ 'mnl', 'mlx4', 'ibverbs' ]
19 foreach libname:libnames
20 lib = dependency('lib' + libname, required:false)
22 lib = cc.find_library(libname, required:false)
28 reason = 'missing dependency, "' + libname + '"'
33 allow_experimental_apis = true
48 sources += files('mlx4_glue.c')
53 '-Wno-strict-prototypes',
58 foreach option:cflags_options
59 if cc.has_argument(option)
63 if get_option('buildtype').contains('debug')
64 cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]
66 cflags += [ '-DNDEBUG', '-UPEDANTIC' ]
68 # To maintain the compatibility with the make build system
69 # mlx4_autoconf.h file is still generated.
70 # input array for meson member search:
71 # [ "MACRO to define if found", "header for the search",
72 # "symbol to search","struct member to search" ]
75 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
76 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
78 # input array for meson symbol search:
79 # [ "MACRO to define if found", "header for the search",
80 # "symbol to search" ]
82 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
83 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
84 [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h',
85 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ],
87 config = configuration_data()
88 foreach arg:has_sym_args
89 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))
91 foreach arg:has_member_args
92 file_prefix = '#include<' + arg[1] + '>'
93 config.set(arg[0], cc.has_member(arg[2], arg[3],
94 prefix : file_prefix))
96 configure_file(output : 'mlx4_autoconf.h', configuration : config)
99 if pmd_dlopen and build
100 dlopen_name = 'mlx4_glue'
101 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
102 dlopen_so_version = LIB_GLUE_VERSION
103 dlopen_sources = files('mlx4_glue.c')
104 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
105 shared_lib = shared_library(
108 include_directories: global_inc,
112 '-Wl,-export-dynamic',
113 '-Wl,-h,@0@'.format(LIB_GLUE),
115 soversion: dlopen_so_version,
117 install_dir: dlopen_install_dir,