Commit eed0c6be authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

configure: fail --with-rdma if it's not available



While here, also refactor IBV_WR_SEND_WITH_INV check
to use the new BUILD_CMD command.

Change-Id: Ieefe77d769f2b1369d204ec54b976fa11441af46
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453706


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 32b356cd
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -407,9 +407,17 @@ if [[ "$OSTYPE" == "freebsd"* ]]; then
fi

if [ "${CONFIG[RDMA]}" = "y" ]; then
	if echo -e '#include <infiniband/verbs.h>\n \
		int main(void){ return !!IBV_WR_SEND_WITH_INV; }\n' \
		| ${CC:-cc} ${CFLAGS} -x c -c -o /dev/null - 2>/dev/null; then
	if ! echo -e '#include <infiniband/verbs.h>\n#include <rdma/rdma_verbs.h>\n' \
		'int main(void) { return 0; }\n' \
		| $BUILD_CMD -libverbs -lrdmacm - 2>/dev/null; then
		echo --with-rdma requires libverbs and librdmacm.
		echo Please install then re-run this script.
		exit 1
	fi

	if echo -e '#include <infiniband/verbs.h>\n' \
		'int main(void) { return !!IBV_WR_SEND_WITH_INV; }\n' \
		| $BUILD_CMD -c - 2>/dev/null; then
		CONFIG[RDMA_SEND_WITH_INVAL]="y"
	else
		CONFIG[RDMA_SEND_WITH_INVAL]="n"