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 cc.find_library('mnl', required:false),
18 cc.find_library('mlx4', required:false),
19 cc.find_library('ibverbs', 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 config = configuration_data()
74 foreach arg:has_member_args
75 file_prefix = '#include<' + arg[1] + '>'
76 config.set(arg[0], cc.has_member(arg[2], arg[3],
77 prefix : file_prefix))
79 configure_file(output : 'mlx4_autoconf.h', configuration : config)
82 if pmd_dlopen and build
83 dlopen_name = 'mlx4_glue'
84 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
85 dlopen_so_version = LIB_GLUE_VERSION
86 dlopen_sources = files('mlx4_glue.c')
87 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
88 shared_lib = shared_library(
91 include_directories: global_inc,
95 '-Wl,-export-dynamic',
96 '-Wl,-h,@0@'.format(LIB_GLUE),
98 soversion: dlopen_so_version,
100 install_dir: dlopen_install_dir,