configure: Fix check against NASM version

Currently, NASM in version 2.14 or newer is required. However, the
old code assumed that nasm -v returns version in the form of x.y.z,
however, some builds return only the x.y. In such a case, check would
always fail to detect proper version since the following would be
be always true:

NASM version 2.14

2.14 -> 214 -> [[ 214 -lt "21400" ]]

Change-Id: I63bfc7aa84383bf2d71e936ae534536ecf25723a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4809
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Michal Berger 2020-10-21 19:06:08 +02:00 committed by Tomasz Zawadzki
parent 77c4d0f673
commit 65ed603449

5
configure vendored
View File

@ -5,6 +5,7 @@ set -e
trap 'echo -e "\n\nConfiguration failed\n\n" >&2' ERR trap 'echo -e "\n\nConfiguration failed\n\n" >&2' ERR
rootdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $(dirname $0))
source "$rootdir/scripts/common.sh"
function usage() function usage()
{ {
@ -158,8 +159,8 @@ fi
#check nasm only on x86 #check nasm only on x86
if [[ $arch == x86_64* ]]; then if [[ $arch == x86_64* ]]; then
ver=$(nasm -v 2>/dev/null | awk '{print $3}' | sed 's/[^0-9]*//g') ver=$(nasm -v 2>/dev/null | awk '{print $3}')
if [[ "${ver:0:1}" -le "2" ]] && [[ "${ver:0:3}" -le "214" ]] && [[ "${ver:0:5}" -lt "21400" ]]; then if lt "$ver" 2.14; then
# ISA-L, compression & crypto require NASM version 2.14 or newer. # ISA-L, compression & crypto require NASM version 2.14 or newer.
CONFIG[ISAL]=n CONFIG[ISAL]=n
CONFIG[CRYPTO]=n CONFIG[CRYPTO]=n