summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Fomichev <dmitry.fomichev@wdc.com>2020-08-04 10:38:25 +0900
committerJens Axboe <axboe@kernel.dk>2020-08-11 10:42:39 -0600
commit38551c04b740949c8a0f5a7235b9842d155e5dfb (patch)
treee5a18a1e738b328c8832567515fd8ca9db4adaac
parentcb7d7abbab67e03c901bfaf9517e0cae40a548bf (diff)
downloadfio-38551c04b740949c8a0f5a7235b9842d155e5dfb.tar.gz
fio-38551c04b740949c8a0f5a7235b9842d155e5dfb.tar.bz2
configure: improve libzbc version check
Avoid parsing pkg-config output and just use --atleast-version to check if libzbc is present and has an up to date version. Currently, support for libzbc ioengine is always included if libzbc is found at the build system. Add the option to disable libzbc ioengine support even if libzbc is found. This can be useful for cross-compilation. Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xconfigure29
1 files changed, 16 insertions, 13 deletions
diff --git a/configure b/configure
index 5925e94f..81fd32bb 100755
--- a/configure
+++ b/configure
@@ -152,6 +152,7 @@ march_set="no"
libiscsi="no"
libnbd="no"
libaio_uring="no"
+libzbc=""
dynamic_engines="no"
prefix=/usr/local
@@ -213,6 +214,8 @@ for opt do
;;
--enable-libnbd) libnbd="yes"
;;
+ --disable-libzbc) libzbc="no"
+ ;;
--disable-tcmalloc) disable_tcmalloc="yes"
;;
--enable-libaio-uring) libaio_uring="yes"
@@ -256,6 +259,7 @@ if test "$show_help" = "yes" ; then
echo "--with-ime= Install path for DDN's Infinite Memory Engine"
echo "--enable-libiscsi Enable iscsi support"
echo "--enable-libnbd Enable libnbd (NBD engine) support"
+ echo "--disable-libzbc Disable libzbc even if found"
echo "--disable-tcmalloc Disable tcmalloc support"
echo "--enable-libaio-uring Enable libaio emulated over io_uring"
echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
@@ -2454,9 +2458,6 @@ fi
##########################################
# libzbc probe
-if test "$libzbc" != "yes" ; then
- libzbc="no"
-fi
cat > $TMPC << EOF
#include <libzbc/zbc.h>
int main(int argc, char **argv)
@@ -2466,19 +2467,21 @@ int main(int argc, char **argv)
return zbc_open("foo=bar", O_RDONLY, &dev);
}
EOF
-if compile_prog "" "-lzbc" "libzbc"; then
- libzbcvermaj=$(pkg-config --modversion libzbc | sed 's/\.[0-9]*\.[0-9]*//')
- if test "$libzbcvermaj" -ge "5" ; then
- libzbc="yes"
+if test "$libzbc" != "no" ; then
+ if compile_prog "" "-lzbc" "libzbc"; then
+ minimum_libzbc=5
+ if $(pkg-config --atleast-version=$minimum_libzbc libzbc); then
+ libzbc="yes"
+ else
+ print_config "libzbc engine" "libzbc version $minimum_libzbc or above required"
+ libzbc="no"
+ fi
else
- print_config "libzbc engine" "Unsupported libzbc version (version 5 or above required)"
- libzbc="no"
- fi
-else
- if test "$libzbc" = "yes" ; then
+ if test "$libzbc" = "yes" ; then
feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
+ fi
+ libzbc="no"
fi
- libzbc="no"
fi
print_config "libzbc engine" "$libzbc"