From eed0c6be16a4a7c5bf087c1b04b64e20d2206975 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 7 May 2019 18:30:45 +0200 Subject: [PATCH] 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: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453706 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- configure | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/configure b/configure index be0db3659..0380e3a25 100755 --- a/configure +++ b/configure @@ -407,9 +407,17 @@ if [[ "$OSTYPE" == "freebsd"* ]]; then fi if [ "${CONFIG[RDMA]}" = "y" ]; then - if echo -e '#include \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 \n#include \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 \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"