diff --git a/lib/nvme/Makefile b/lib/nvme/Makefile index 3db1df3ca..1c02965f5 100644 --- a/lib/nvme/Makefile +++ b/lib/nvme/Makefile @@ -44,6 +44,24 @@ C_SRCS-$(CONFIG_NVME_CUSE) += nvme_cuse.c LIBNAME = nvme LOCAL_SYS_LIBS = -luuid +ifeq ($(CONFIG_RDMA),y) +LOCAL_SYS_LIBS += -libverbs -lrdmacm +#Attach only if FreeBSD and RDMA is specified with configure +ifeq ($(OS),FreeBSD) +# Mellanox - MLX4 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx4.*)","") +LOCAL_SYS_LIBS += -lmlx4 +endif +# Mellanox - MLX5 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx5.*)","") +LOCAL_SYS_LIBS += -lmlx5 +endif +# Chelsio HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libcxgb4.*)","") +LOCAL_SYS_LIBS += -lcxgb4 +endif +endif +endif ifeq ($(CONFIG_NVME_CUSE),y) # fuse requires to set _FILE_OFFSET_BITS to 64 bits even for 64 bit machines diff --git a/lib/nvmf/Makefile b/lib/nvmf/Makefile index e23c403d8..b4556564a 100644 --- a/lib/nvmf/Makefile +++ b/lib/nvmf/Makefile @@ -43,6 +43,24 @@ C_SRCS = ctrlr.c ctrlr_discovery.c ctrlr_bdev.c \ C_SRCS-$(CONFIG_RDMA) += rdma.c LIBNAME = nvmf LOCAL_SYS_LIBS = -luuid +ifeq ($(CONFIG_RDMA),y) +LOCAL_SYS_LIBS += -libverbs -lrdmacm +#Attach only if FreeBSD and RDMA is specified with configure +ifeq ($(OS),FreeBSD) +# Mellanox - MLX4 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx4.*)","") +LOCAL_SYS_LIBS += -lmlx4 +endif +# Mellanox - MLX5 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx5.*)","") +LOCAL_SYS_LIBS += -lmlx5 +endif +# Chelsio HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libcxgb4.*)","") +LOCAL_SYS_LIBS += -lcxgb4 +endif +endif +endif ifeq ($(CONFIG_FC),y) C_SRCS += fc.c fc_ls.c