configure: detect IBV_WR_SEND_WITH_INV instead checking version

Checking version of libibverbs is error prone as custom version might be
installed that implements needed features but version number is not
incremented. Instead test if we can compile with needed features.

Fixes #524

Change-Id: I18e9ca923eea92b124e95a5f660955a01afad5c4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443387
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Pawel Wodkowski 2019-02-05 12:19:05 +01:00 committed by Jim Harris
parent 06ccc49eef
commit c796c54794

17
configure vendored
View File

@ -359,20 +359,9 @@ fi
if [ "${CONFIG[RDMA]}" = "y" ]; then
if [ "$OSTYPE" != "FreeBSD"* ]; then
ibv_lib_file="$(ldconfig -p | grep 'libibverbs.so ' || true)"
if [ ! -z "$ibv_lib_file" ]; then
ibv_lib_file="${ibv_lib_file##*=> }"
ibv_lib_file="$(readlink -f $ibv_lib_file)" || true
fi
if [ -z $ibv_lib_file ]; then
ibv_lib_file="libibverbs.so.0.0.0"
fi
ibv_ver_str="$(basename $ibv_lib_file)"
ibv_maj_ver=`echo $ibv_ver_str | cut -d. -f3`
ibv_min_ver=`echo $ibv_ver_str | cut -d. -f4`
if [[ "$ibv_maj_var" -gt 1 || ("$ibv_maj_ver" -eq 1 && "$ibv_min_ver" -ge 1) ]]; 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
CONFIG[RDMA_SEND_WITH_INVAL]="y"
else
CONFIG[RDMA_SEND_WITH_INVAL]="n"