3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h $CFLAGS"
48 CONFIGURE_CFLAGS="-Werror-implicit-function-declaration"
51 # Print a helpful header at the top of config.log
52 echo "# FIO configure log $(date)" >> config.log
53 printf "# Configured with:" >> config.log
54 printf " '%s'" "$0" "$@" >> config.log
56 echo "#" >> config.log
58 # Print configure header at the top of $config_host_h
59 echo "/*" > $config_host_h
60 echo " * Automatically generated by configure - do not modify" >> $config_host_h
61 printf " * Configured with:" >> $config_host_h
62 printf " * '%s'" "$0" "$@" >> $config_host_h
63 echo "" >> $config_host_h
64 echo " */" >> $config_host_h
67 # Run the compiler, capturing its output to the log.
68 echo $cc "$@" >> config.log
69 $cc "$@" >> config.log 2>&1 || return $?
70 # Test passed. If this is an --enable-werror build, rerun
71 # the test with -Werror and bail out if it fails. This
72 # makes warning-generating-errors in configure test code
73 # obvious to developers.
74 if test "$werror" != "yes"; then
77 # Don't bother rerunning the compile if we were already using -Werror
83 echo $cc -Werror "$@" >> config.log
84 $cc -Werror "$@" >> config.log 2>&1 && return $?
85 echo "ERROR: configure test passed without -Werror but failed with -Werror."
86 echo "This is probably a bug in the configure script. The failing command"
87 echo "will be at the bottom of config.log."
88 fatal "You can run configure with --disable-werror to bypass this check."
92 do_cc $CFLAGS $CONFIGURE_CFLAGS -c -o $TMPO $TMPC
97 local_ldflags="$2 $LIBS"
98 echo "Compiling test case $3" >> config.log
99 do_cc $CFLAGS $CONFIGURE_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
102 feature_not_found() {
107 echo "ERROR: User requested feature $feature"
108 if test ! -z "$packages" ; then
109 echo "ERROR: That feature needs $packages installed"
111 echo "ERROR: configure was not able to find it"
116 type "$1" >/dev/null 2>&1
122 #error $1 not defined
133 echo "$1=y" >> $config_host_mak
134 echo "#define $1" >> $config_host_h
137 check_min_lib_version() {
140 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
143 : "${_feature:=${1}}"
144 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
145 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
146 feature_not_found "$_feature" "$1 >= $2"
149 print_config "$1" "missing pkg-config, can't check $_feature version"
182 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
184 --prefix=*) prefix="$optarg"
186 --cpu=*) cpu="$optarg"
188 # esx is cross compiled and cannot be detect through simple uname calls
194 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
196 --build-32bit-win) build_32bit_win="yes"
198 --target-win-ver=*) target_win_ver="$optarg"
200 --enable-pdb) pdb="yes"
202 --build-static) build_static="yes"
204 --enable-gfio) gfio_check="yes"
206 --disable-numa) disable_numa="yes"
208 --disable-rdma) disable_rdma="yes"
210 --disable-rados) disable_rados="yes"
212 --disable-rbd) disable_rbd="yes"
214 --disable-http) disable_http="yes"
216 --disable-gfapi) disable_gfapi="yes"
218 --enable-libhdfs) libhdfs="yes"
220 --disable-lex) disable_lex="yes"
222 --enable-lex) disable_lex="no"
224 --disable-shm) no_shm="yes"
226 --disable-optimizations) disable_opt="yes"
228 --disable-pmem) disable_pmem="yes"
230 --enable-cuda) cuda="yes"
232 --enable-libcufile) libcufile="yes"
234 --disable-native) disable_native="yes"
236 --with-ime=*) ime_path="$optarg"
238 --enable-libiscsi) libiscsi="yes"
240 --enable-libnbd) libnbd="yes"
242 --disable-libzbc) libzbc="no"
244 --disable-xnvme) xnvme="no"
246 --disable-tcmalloc) disable_tcmalloc="yes"
248 --disable-libnfs) libnfs="no"
250 --enable-libnfs) libnfs="yes"
252 --dynamic-libengines) dynamic_engines="yes"
254 --disable-dfs) dfs="no"
256 --enable-asan) asan="yes"
262 echo "Bad option $opt"
268 if test "$show_help" = "yes" ; then
269 echo "--prefix= Use this directory as installation prefix"
270 echo "--cpu= Specify target CPU if auto-detect fails"
271 echo "--cc= Specify compiler to use"
272 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
273 echo "--build-32bit-win Enable 32-bit build on Windows"
274 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
275 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
276 echo "--build-static Build a static fio"
277 echo "--esx Configure build options for esx"
278 echo "--enable-gfio Enable building of gtk gfio"
279 echo "--disable-numa Disable libnuma even if found"
280 echo "--disable-rdma Disable RDMA support even if found"
281 echo "--disable-rados Disable Rados support even if found"
282 echo "--disable-rbd Disable Rados Block Device even if found"
283 echo "--disable-http Disable HTTP support even if found"
284 echo "--disable-gfapi Disable gfapi"
285 echo "--enable-libhdfs Enable hdfs support"
286 echo "--enable-libnfs Enable nfs support"
287 echo "--disable-libnfs Disable nfs support"
288 echo "--disable-lex Disable use of lex/yacc for math"
289 echo "--disable-pmem Disable pmem based engines even if found"
290 echo "--enable-lex Enable use of lex/yacc for math"
291 echo "--disable-shm Disable SHM support"
292 echo "--disable-optimizations Don't enable compiler optimizations"
293 echo "--enable-cuda Enable GPUDirect RDMA support"
294 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
295 echo "--disable-native Don't build for native host"
296 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
297 echo "--enable-libiscsi Enable iscsi support"
298 echo "--enable-libnbd Enable libnbd (NBD engine) support"
299 echo "--disable-xnvme Disable xnvme support even if found"
300 echo "--disable-libzbc Disable libzbc even if found"
301 echo "--disable-tcmalloc Disable tcmalloc support"
302 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
303 echo "--disable-dfs Disable DAOS File System support even if found"
304 echo "--enable-asan Enable address sanitizer"
308 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
309 # Preferred compiler (can be overriden later after we know the platform):
311 # ${cross_prefix}gcc (if cross-prefix specified)
314 if test -z "${CC}${cross_prefix}"; then
321 cc="${CC-${cross_prefix}gcc}"
324 if check_define __ANDROID__ ; then
326 elif check_define __linux__ ; then
328 elif check_define __OpenBSD__ ; then
330 elif check_define __NetBSD__ ; then
332 elif check_define __sun__ ; then
334 CFLAGS="$CFLAGS -D_REENTRANT"
335 elif check_define _WIN32 ; then
341 echo "# Automatically generated by configure - do not modify" > $config_host_mak
342 printf "# Configured with:" >> $config_host_mak
343 printf " '%s'" "$0" "$@" >> $config_host_mak
344 echo >> $config_host_mak
345 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
347 if test "$no_shm" = "yes" ; then
348 output_sym "CONFIG_NO_SHM"
351 if test "$disable_opt" = "yes" ; then
352 output_sym "CONFIG_FIO_NO_OPT"
355 # Some host OSes need non-standard checks for which CPU to use.
356 # Note that these checks are broken for cross-compilation: if you're
357 # cross-compiling to one of these OSes then you'll need to specify
358 # the correct CPU with the --cpu option.
361 # Unless explicitly enabled, turn off lex.
362 # OpenBSD will hit syntax error when enabled.
363 if test -z "$disable_lex" ; then
370 CFLAGS="$CFLAGS -I/usr/local/include"
371 LDFLAGS="$LDFLAGS -L/usr/local/lib"
374 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
375 # we can run 64-bit userspace code.
376 # If the user didn't specify a CPU explicitly and the kernel says this is
377 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
379 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
382 # Avoid configure feature detection of features provided by weak symbols
389 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
390 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
394 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
395 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
398 LIBS="-lnsl -lsocket"
401 # We still force some options, so keep this message here.
402 echo "Forcing some known good options on Windows"
403 if test -z "${CC}${cross_prefix}"; then
404 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
405 cc="i686-w64-mingw32-gcc"
407 cc="x86_64-w64-mingw32-gcc"
411 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
412 if test -z "$target_win_ver"; then
413 # Default Windows API target
416 if test "$target_win_ver" = "7"; then
417 output_sym "CONFIG_WINDOWS_7"
418 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
420 fatal "Unknown target Windows version"
423 # We need this to be output_sym'd here because this is Windows specific.
424 # The regular configure path never sets this config.
425 output_sym "CONFIG_WINDOWSAIO"
426 # We now take the regular configuration path without having exit 0 here.
427 # Flags below are still necessary mostly for MinGW.
431 clock_gettime="yes" # clock_monotonic probe has dependency on this
432 clock_monotonic="yes"
434 pthread_condattr_setclock="no"
435 pthread_affinity="no"
439 # Now we know the target platform we can have another guess at the preferred
440 # compiler when it wasn't explictly set
441 if test -z "${CC}${cross_prefix}"; then
442 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
448 if test -z "$cc"; then
449 echo "configure: failed to find compiler"
453 if test ! -z "$cpu" ; then
454 # command line argument
456 elif check_define __i386__ ; then
458 elif check_define __x86_64__ ; then
460 elif check_define __sparc__ ; then
461 if check_define __arch64__ ; then
466 elif check_define _ARCH_PPC ; then
467 if check_define _ARCH_PPC64 ; then
472 elif check_define __mips__ ; then
474 elif check_define __ia64__ ; then
476 elif check_define __s390__ ; then
477 if check_define __s390x__ ; then
482 elif check_define __arm__ ; then
484 elif check_define __aarch64__ ; then
486 elif check_define __hppa__ ; then
492 # Normalise host CPU name and set ARCH.
494 ia64|ppc|ppc64|s390|s390x|sparc64)
497 i386|i486|i586|i686|i86pc|BePC)
509 hppa|parisc|parisc64)
523 ##########################################
524 # check cross compile
526 if test "$cross_compile" != "yes" ; then
535 if compile_prog "" "" "cross"; then
536 $TMPE 2>/dev/null || cross_compile="yes"
538 fatal "compile test failed"
541 ##########################################
543 if test "$bigendian" != "yes" ; then
546 if test "$cross_compile" = "no" ; then
548 #include <inttypes.h>
551 volatile uint32_t i=0x01234567;
552 return (*((uint8_t*)(&i))) == 0x67;
555 if compile_prog "" "" "endian"; then
556 $TMPE && bigendian="yes"
559 # If we're cross compiling, try our best to work it out and rely on the
560 # run-time check to fail if we get it wrong.
565 #if __BYTE_ORDER != __BIG_ENDIAN
566 # error "Unknown endianness"
570 compile_prog "" "" "endian" && bigendian="yes"
571 check_define "__ARMEB__" && bigendian="yes"
572 check_define "__MIPSEB__" && bigendian="yes"
576 print_config "Operating system" "$targetos"
577 print_config "CPU" "$cpu"
578 print_config "Big endian" "$bigendian"
579 if test ! -z "$target_win_ver"; then
580 print_config "Target Windows version" "$target_win_ver"
582 print_config "Compiler" "$cc"
583 print_config "Cross compile" "$cross_compile"
586 ##########################################
587 # See if we need to build a static build
588 if test "$build_static" = "yes" ; then
589 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
590 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
594 print_config "Static build" "$build_static"
596 ##########################################
597 # check for C11 atomics support
599 #include <stdatomic.h>
607 if ! compile_prog "" "" "C11 atomics"; then
609 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
610 echo "minimum versions with it - perhaps your compiler is too old?"
611 fatal "C11 atomics support not found"
615 ##########################################
620 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
623 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
627 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
629 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
632 fatal "Unknown wordsize"
634 print_config "Wordsize" "$wordsize"
636 ##########################################
638 if test "$zlib" != "yes" ; then
646 if (inflateInit(&stream) != Z_OK)
651 if compile_prog "" "-lz" "zlib" ; then
655 print_config "zlib" "$zlib"
657 ##########################################
658 # fcntl(F_FULLFSYNC) support
659 if test "$fcntl_sync" != "yes" ; then
666 int main(int argc, char **argv)
668 return fcntl(0, F_FULLFSYNC);
671 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
674 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
676 ##########################################
678 if test "$libaio" != "yes" ; then
681 if test "$esx" != "yes" ; then
691 if compile_prog "" "-laio" "libaio" ; then
694 if test "$libaio" = "yes" ; then
695 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
705 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
706 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
710 if compile_prog "" "" "libaio rw flags" ; then
716 print_config "Linux AIO support" "$libaio"
717 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
719 ##########################################
721 if test "$posix_aio" != "yes" ; then
724 if test "$posix_aio_lrt" != "yes" ; then
736 if compile_prog "" "" "posixaio" ; then
738 elif compile_prog "" "-lrt" "posixaio -lrt"; then
743 print_config "POSIX AIO support" "$posix_aio"
744 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
746 ##########################################
747 # posix aio fsync probe
748 if test "$posix_aio_fsync" != "yes" ; then
751 if test "$posix_aio" = "yes" ; then
758 return aio_fsync(O_SYNC, &cb);
762 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
766 print_config "POSIX AIO fsync" "$posix_aio_fsync"
768 ##########################################
769 # POSIX pshared attribute probe
770 if test "$posix_pshared" != "yes" ; then
777 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
778 # if defined(__CYGWIN__)
779 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
780 # elif defined(__APPLE__)
781 # include <AvailabilityMacros.h>
782 # include <TargetConditionals.h>
783 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
784 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
788 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
793 if compile_prog "" "$LIBS" "posix_pshared" ; then
796 print_config "POSIX pshared support" "$posix_pshared"
798 ##########################################
799 # POSIX pthread_condattr_setclock() probe
800 if test "$pthread_condattr_setclock" != "no" ; then
805 pthread_condattr_t condattr;
806 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
810 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
811 pthread_condattr_setclock=yes
812 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
813 pthread_condattr_setclock=yes
814 LIBS="$LIBS -lpthread"
817 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
819 ##########################################
820 # pthread_sigmask() probe
821 if test "$pthread_sigmask" != "yes" ; then
825 #include <stddef.h> /* NULL */
826 #include <signal.h> /* pthread_sigmask() */
829 return pthread_sigmask(0, NULL, NULL);
832 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
834 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
836 LIBS="$LIBS -lpthread"
838 print_config "pthread_sigmask()" "$pthread_sigmask"
840 ##########################################
841 # pthread_getaffinity_np() probe
842 if test "$pthread_getaffinity" != "yes" ; then
843 pthread_getaffinity="no"
846 #include <stddef.h> /* NULL */
847 #include <signal.h> /* pthread_sigmask() */
852 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
855 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
856 pthread_getaffinity="yes"
857 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
858 pthread_getaffinity="yes"
859 LIBS="$LIBS -lpthread"
861 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
863 ##########################################
865 if test "$solaris_aio" != "yes" ; then
869 #include <sys/types.h>
870 #include <sys/asynch.h>
875 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
879 if compile_prog "" "-laio" "solarisaio" ; then
883 print_config "Solaris AIO support" "$solaris_aio"
885 ##########################################
886 # __sync_fetch_and_add test
887 if test "$sfaa" != "yes" ; then
891 #include <inttypes.h>
892 static int sfaa(uint64_t *ptr)
894 return __sync_fetch_and_add(ptr, 0);
897 int main(int argc, char **argv)
904 if compile_prog "" "" "__sync_fetch_and_add()" ; then
907 print_config "__sync_fetch_and_add" "$sfaa"
909 ##########################################
910 # __sync_synchronize() test
911 if test "$sync_sync" != "yes" ; then
915 #include <inttypes.h>
917 int main(int argc, char **argv)
919 __sync_synchronize();
923 if compile_prog "" "" "__sync_synchronize()" ; then
926 print_config "__sync_synchronize" "$sync_sync"
928 ##########################################
929 # __sync_val_compare_and_swap() test
930 if test "$cmp_swap" != "yes" ; then
934 #include <inttypes.h>
936 int main(int argc, char **argv)
939 return __sync_val_compare_and_swap(&x, 1, 2);
942 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
945 print_config "__sync_val_compare_and_swap" "$cmp_swap"
947 ##########################################
949 if test "$libverbs" != "yes" ; then
953 #include <infiniband/verbs.h>
954 int main(int argc, char **argv)
956 struct ibv_pd *pd = ibv_alloc_pd(NULL);
960 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
963 print_config "libverbs" "$libverbs"
965 ##########################################
967 if test "$rdmacm" != "yes" ; then
972 #include <rdma/rdma_cma.h>
973 int main(int argc, char **argv)
975 rdma_destroy_qp(NULL);
979 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
982 print_config "rdmacm" "$rdmacm"
984 ##########################################
986 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
987 if test "$librpma" != "yes" ; then
994 void *ptr = rpma_cq_get_wc;
995 (void) ptr; /* unused */
999 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1002 print_config "librpma" "$librpma"
1004 ##########################################
1005 # libprotobuf-c probe
1006 if test "$libprotobuf_c" != "yes" ; then
1011 #include <protobuf-c/protobuf-c.h>
1012 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1013 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1015 int main(int argc, char **argv)
1017 (void)protobuf_c_message_check(NULL);
1021 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1024 print_config "libprotobuf_c" "$libprotobuf_c"
1026 ##########################################
1027 # asprintf() and vasprintf() probes
1028 if test "$have_asprintf" != "yes" ; then
1034 int main(int argc, char **argv)
1037 return asprintf(&buf, "%s", "str") == 0;
1040 if compile_prog "" "" "have_asprintf"; then
1043 print_config "asprintf()" "$have_asprintf"
1045 if test "$have_vasprintf" != "yes" ; then
1051 int main(int argc, char **argv)
1055 return vasprintf(&buf, "%s", ap) == 0;
1058 if compile_prog "" "" "have_vasprintf"; then
1059 have_vasprintf="yes"
1061 print_config "vasprintf()" "$have_vasprintf"
1063 ##########################################
1064 # Linux fallocate probe
1065 if test "$linux_fallocate" != "yes" ; then
1066 linux_fallocate="no"
1071 #include <linux/falloc.h>
1072 int main(int argc, char **argv)
1074 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1078 if compile_prog "" "" "linux_fallocate"; then
1079 linux_fallocate="yes"
1081 print_config "Linux fallocate" "$linux_fallocate"
1083 ##########################################
1084 # POSIX fadvise probe
1085 if test "$posix_fadvise" != "yes" ; then
1091 int main(int argc, char **argv)
1093 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1097 if compile_prog "" "" "posix_fadvise"; then
1100 print_config "POSIX fadvise" "$posix_fadvise"
1102 ##########################################
1103 # POSIX fallocate probe
1104 if test "$posix_fallocate" != "yes" ; then
1105 posix_fallocate="no"
1110 int main(int argc, char **argv)
1112 int r = posix_fallocate(0, 0, 1024);
1116 if compile_prog "" "" "posix_fallocate"; then
1117 posix_fallocate="yes"
1119 print_config "POSIX fallocate" "$posix_fallocate"
1121 ##########################################
1122 # sched_set/getaffinity 2 or 3 argument test
1123 if test "$linux_2arg_affinity" != "yes" ; then
1124 linux_2arg_affinity="no"
1126 if test "$linux_3arg_affinity" != "yes" ; then
1127 linux_3arg_affinity="no"
1131 int main(int argc, char **argv)
1133 cpu_set_t mask = { };
1135 return sched_setaffinity(0, sizeof(mask), &mask);
1138 if compile_prog "" "" "sched_setaffinity(,,)"; then
1139 linux_3arg_affinity="yes"
1143 int main(int argc, char **argv)
1145 cpu_set_t mask = { };
1147 return sched_setaffinity(0, &mask);
1150 if compile_prog "" "" "sched_setaffinity(,)"; then
1151 linux_2arg_affinity="yes"
1154 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1155 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1157 ##########################################
1158 # clock_gettime probe
1159 if test "$clock_gettime" != "yes" ; then
1165 int main(int argc, char **argv)
1167 return clock_gettime(0, NULL);
1170 if compile_prog "" "" "clock_gettime"; then
1172 elif compile_prog "" "-lrt" "clock_gettime"; then
1176 print_config "clock_gettime" "$clock_gettime"
1178 ##########################################
1179 # CLOCK_MONOTONIC probe
1180 if test "$clock_monotonic" != "yes" ; then
1181 clock_monotonic="no"
1183 if test "$clock_gettime" = "yes" ; then
1187 int main(int argc, char **argv)
1189 return clock_gettime(CLOCK_MONOTONIC, NULL);
1192 if compile_prog "" "$LIBS" "clock monotonic"; then
1193 clock_monotonic="yes"
1196 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1198 ##########################################
1200 if test "$clockid_t" != "yes" ; then
1206 int main(int argc, char **argv)
1208 volatile clockid_t cid;
1209 memset((void*)&cid, 0, sizeof(cid));
1213 if compile_prog "" "$LIBS" "clockid_t"; then
1216 print_config "clockid_t" "$clockid_t"
1218 ##########################################
1219 # gettimeofday() probe
1220 if test "$gettimeofday" != "yes" ; then
1224 #include <sys/time.h>
1226 int main(int argc, char **argv)
1229 return gettimeofday(&tv, NULL);
1232 if compile_prog "" "" "gettimeofday"; then
1235 print_config "gettimeofday" "$gettimeofday"
1237 ##########################################
1239 if test "$fdatasync" != "yes" ; then
1245 int main(int argc, char **argv)
1247 return fdatasync(0);
1250 if compile_prog "" "" "fdatasync"; then
1253 print_config "fdatasync" "$fdatasync"
1255 ##########################################
1257 if test "$pipe" != "yes" ; then
1262 int main(int argc, char **argv)
1268 if compile_prog "" "" "pipe"; then
1271 print_config "pipe()" "$pipe"
1273 ##########################################
1275 if test "$pipe2" != "yes" ; then
1280 int main(int argc, char **argv)
1283 return pipe2(fd, 0);
1286 if compile_prog "" "" "pipe2"; then
1289 print_config "pipe2()" "$pipe2"
1291 ##########################################
1293 if test "$pread" != "yes" ; then
1298 int main(int argc, char **argv)
1300 return pread(0, NULL, 0, 0);
1303 if compile_prog "" "" "pread"; then
1306 print_config "pread()" "$pread"
1308 ##########################################
1309 # sync_file_range() probe
1310 if test "$sync_file_range" != "yes" ; then
1311 sync_file_range="no"
1317 #include <linux/fs.h>
1318 int main(int argc, char **argv)
1320 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1321 SYNC_FILE_RANGE_WAIT_AFTER;
1322 return sync_file_range(0, 0, 0, flags);
1325 if compile_prog "" "" "sync_file_range"; then
1326 sync_file_range="yes"
1328 print_config "sync_file_range" "$sync_file_range"
1330 ##########################################
1331 # ext4 move extent probe
1332 if test "$ext4_me" != "yes" ; then
1337 #include <sys/ioctl.h>
1338 int main(int argc, char **argv)
1340 struct move_extent me;
1341 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1344 if compile_prog "" "" "ext4 move extent" ; then
1346 elif test $targetos = "Linux" ; then
1347 # On Linux, just default to it on and let it error at runtime if we really
1348 # don't have it. None of my updated systems have it defined, but it does
1349 # work. Takes a while to bubble back.
1352 print_config "EXT4 move extent" "$ext4_me"
1354 ##########################################
1356 if test "$linux_splice" != "yes" ; then
1362 int main(int argc, char **argv)
1364 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1367 if compile_prog "" "" "linux splice"; then
1370 print_config "Linux splice(2)" "$linux_splice"
1372 ##########################################
1374 if test "$libnuma" != "yes" ; then
1379 int main(int argc, char **argv)
1381 return numa_available();
1384 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1388 print_config "libnuma" "$libnuma"
1390 ##########################################
1391 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1392 if test "$libnuma" = "yes" ; then
1396 int main(int argc, char **argv)
1398 struct bitmask *mask = numa_parse_nodestring(NULL);
1399 return mask->size == 0;
1402 if compile_prog "" "" "libnuma api"; then
1405 print_config "libnuma v2" "$libnuma_v2"
1408 ##########################################
1410 if test "$strsep" != "yes" ; then
1415 int main(int argc, char **argv)
1417 static char *string = "This is a string";
1418 strsep(&string, "needle");
1422 if compile_prog "" "" "strsep"; then
1425 print_config "strsep" "$strsep"
1427 ##########################################
1428 # strcasestr() probe
1429 if test "$strcasestr" != "yes" ; then
1434 int main(int argc, char **argv)
1436 return strcasestr(argv[0], argv[1]) != NULL;
1439 if compile_prog "" "" "strcasestr"; then
1442 print_config "strcasestr" "$strcasestr"
1444 ##########################################
1446 if test "$strlcat" != "yes" ; then
1451 int main(int argc, char **argv)
1453 static char dst[64];
1454 static char *string = "This is a string";
1455 memset(dst, 0, sizeof(dst));
1456 strlcat(dst, string, sizeof(dst));
1460 if compile_prog "" "" "strlcat"; then
1463 print_config "strlcat" "$strlcat"
1465 ##########################################
1466 # getopt_long_only() probe
1467 if test "$getopt_long_only" != "yes" ; then
1468 getopt_long_only="no"
1474 int main(int argc, char **argv)
1476 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1480 if compile_prog "" "" "getopt_long_only"; then
1481 getopt_long_only="yes"
1483 print_config "getopt_long_only()" "$getopt_long_only"
1485 ##########################################
1487 if test "$inet_aton" != "yes" ; then
1492 #include <winsock2.h>
1494 #include <sys/socket.h>
1495 #include <arpa/inet.h>
1498 int main(int argc, char **argv)
1501 return inet_aton(NULL, &in);
1504 if compile_prog "" "" "inet_aton"; then
1507 print_config "inet_aton" "$inet_aton"
1509 ##########################################
1511 if test "$socklen_t" != "yes" ; then
1516 #include <winsock2.h>
1517 #include <ws2tcpip.h>
1519 #include <sys/socket.h>
1521 int main(int argc, char **argv)
1527 if compile_prog "" "" "socklen_t"; then
1530 print_config "socklen_t" "$socklen_t"
1532 ##########################################
1533 # Whether or not __thread is supported for TLS
1534 if test "$tls_thread" != "yes" ; then
1539 static __thread int ret;
1540 int main(int argc, char **argv)
1545 if compile_prog "" "" "__thread"; then
1548 print_config "__thread" "$tls_thread"
1550 ##########################################
1551 # Check if we have required gtk/glib support for gfio
1552 if test "$gfio" != "yes" ; then
1555 if test "$gfio_check" = "yes" ; then
1559 #include <gtk/gtk.h>
1562 gdk_threads_enter();
1563 gdk_threads_leave();
1565 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1568 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1569 ORG_LDFLAGS=$LDFLAGS
1570 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1571 if test "$?" != "0" ; then
1572 echo "configure: gtk and gthread not found"
1575 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1576 if test "$?" != "0" ; then
1577 echo "configure: gtk and gthread not found"
1581 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1582 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1583 GFIO_LIBS="$LIBS $GTK_LIBS"
1584 CFLAGS="$CFLAGS $GTK_CFLAGS"
1586 echo "Please install gtk and gdk libraries"
1592 LDFLAGS=$ORG_LDFLAGS
1595 if test "$gfio_check" = "yes" ; then
1596 print_config "gtk 2.18 or higher" "$gfio"
1599 ##########################################
1600 # Check whether we have getrusage(RUSAGE_THREAD)
1601 if test "$rusage_thread" != "yes" ; then
1605 #include <sys/time.h>
1606 #include <sys/resource.h>
1607 int main(int argc, char **argv)
1610 getrusage(RUSAGE_THREAD, &ru);
1614 if compile_prog "" "" "RUSAGE_THREAD"; then
1617 print_config "RUSAGE_THREAD" "$rusage_thread"
1619 ##########################################
1620 # Check whether we have SCHED_IDLE
1621 if test "$sched_idle" != "yes" ; then
1626 int main(int argc, char **argv)
1628 struct sched_param p = { };
1630 return sched_setscheduler(0, SCHED_IDLE, &p);
1633 if compile_prog "" "" "SCHED_IDLE"; then
1636 print_config "SCHED_IDLE" "$sched_idle"
1638 ##########################################
1639 # Check whether we have TCP_NODELAY
1640 if test "$tcp_nodelay" != "yes" ; then
1645 #include <winsock2.h>
1648 #include <sys/types.h>
1649 #include <sys/socket.h>
1650 #include <netinet/tcp.h>
1652 int main(int argc, char **argv)
1654 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1657 if compile_prog "" "" "TCP_NODELAY"; then
1659 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1661 LIBS="$LIBS -lws2_32"
1663 print_config "TCP_NODELAY" "$tcp_nodelay"
1665 ##########################################
1666 # Check whether we have SO_SNDBUF
1667 if test "$window_size" != "yes" ; then
1672 #include <winsock2.h>
1675 #include <sys/types.h>
1676 #include <sys/socket.h>
1677 #include <netinet/tcp.h>
1679 int main(int argc, char **argv)
1681 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1682 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1685 if compile_prog "" "" "SO_SNDBUF"; then
1687 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1689 LIBS="$LIBS -lws2_32"
1691 print_config "Net engine window_size" "$window_size"
1693 ##########################################
1694 # Check whether we have TCP_MAXSEG
1695 if test "$mss" != "yes" ; then
1700 #include <winsock2.h>
1703 #include <sys/types.h>
1704 #include <sys/socket.h>
1705 #include <netinet/tcp.h>
1706 #include <arpa/inet.h>
1707 #include <netinet/in.h>
1709 int main(int argc, char **argv)
1711 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1714 if compile_prog "" "" "TCP_MAXSEG"; then
1716 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1718 LIBS="$LIBS -lws2_32"
1720 print_config "TCP_MAXSEG" "$mss"
1722 ##########################################
1723 # Check whether we have RLIMIT_MEMLOCK
1724 if test "$rlimit_memlock" != "yes" ; then
1728 #include <sys/time.h>
1729 #include <sys/resource.h>
1730 int main(int argc, char **argv)
1733 return getrlimit(RLIMIT_MEMLOCK, &rl);
1736 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1737 rlimit_memlock="yes"
1739 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1741 ##########################################
1742 # Check whether we have pwritev/preadv
1743 if test "$pwritev" != "yes" ; then
1748 #include <sys/uio.h>
1749 int main(int argc, char **argv)
1751 struct iovec iov[1] = { };
1753 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1756 if compile_prog "" "" "pwritev"; then
1759 print_config "pwritev/preadv" "$pwritev"
1761 ##########################################
1762 # Check whether we have pwritev2/preadv2
1763 if test "$pwritev2" != "yes" ; then
1768 #include <sys/uio.h>
1769 int main(int argc, char **argv)
1771 struct iovec iov[1] = { };
1773 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1776 if compile_prog "" "" "pwritev2"; then
1779 print_config "pwritev2/preadv2" "$pwritev2"
1781 ##########################################
1782 # Check whether we have the required functions for ipv6
1783 if test "$ipv6" != "yes" ; then
1788 #include <winsock2.h>
1789 #include <ws2tcpip.h>
1791 #include <sys/types.h>
1792 #include <sys/socket.h>
1793 #include <netinet/in.h>
1797 int main(int argc, char **argv)
1799 struct addrinfo hints = { };
1800 struct in6_addr addr = in6addr_any;
1803 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1805 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1810 if compile_prog "" "" "ipv6"; then
1813 print_config "IPv6 helpers" "$ipv6"
1815 ##########################################
1817 if test "$http" != "yes" ; then
1820 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1822 #include <curl/curl.h>
1823 #include <openssl/hmac.h>
1825 int main(int argc, char **argv)
1830 curl = curl_easy_init();
1831 curl_easy_cleanup(curl);
1833 ctx = HMAC_CTX_new();
1834 HMAC_CTX_reset(ctx);
1839 # openssl < 1.1.0 uses the HMAC_CTX type directly
1841 #include <curl/curl.h>
1842 #include <openssl/hmac.h>
1844 int main(int argc, char **argv)
1849 curl = curl_easy_init();
1850 curl_easy_cleanup(curl);
1852 HMAC_CTX_init(&ctx);
1853 HMAC_CTX_cleanup(&ctx);
1857 if test "$disable_http" != "yes"; then
1858 HTTP_LIBS="-lcurl -lssl -lcrypto"
1859 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1860 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1862 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1866 print_config "http engine" "$http"
1868 ##########################################
1870 if test "$rados" != "yes" ; then
1874 #include <rados/librados.h>
1876 int main(int argc, char **argv)
1879 rados_ioctx_t io_ctx;
1880 const char cluster_name[] = "ceph";
1881 const char user_name[] = "client.admin";
1882 const char pool[] = "rados";
1884 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1885 rados_create2(&cluster, cluster_name, user_name, 0);
1886 rados_ioctx_create(cluster, pool, &io_ctx);
1891 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1894 print_config "Rados engine" "$rados"
1896 ##########################################
1898 if test "$rbd" != "yes" ; then
1902 #include <rbd/librbd.h>
1904 int main(int argc, char **argv)
1907 rados_ioctx_t io_ctx;
1908 const char cluster_name[] = "ceph";
1909 const char user_name[] = "client.admin";
1910 const char pool[] = "rbd";
1911 int major, minor, extra;
1913 rbd_version(&major, &minor, &extra);
1914 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1915 rados_create2(&cluster, cluster_name, user_name, 0);
1916 rados_ioctx_create(cluster, pool, &io_ctx);
1921 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1924 print_config "Rados Block Device engine" "$rbd"
1926 ##########################################
1927 # check for rbd_poll
1928 if test "$rbd_poll" != "yes" ; then
1931 if test "$rbd" = "yes"; then
1933 #include <rbd/librbd.h>
1934 #include <sys/eventfd.h>
1936 int main(int argc, char **argv)
1939 rbd_completion_t comp;
1941 int fd = eventfd(0, EFD_NONBLOCK);
1942 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1943 rbd_poll_io_events(image, comp, 1);
1948 if compile_prog "" "-lrbd -lrados" "rbd"; then
1951 print_config "rbd_poll" "$rbd_poll"
1954 ##########################################
1955 # check for rbd_invalidate_cache()
1956 if test "$rbd_inval" != "yes" ; then
1959 if test "$rbd" = "yes"; then
1961 #include <rbd/librbd.h>
1963 int main(int argc, char **argv)
1967 return rbd_invalidate_cache(image);
1970 if compile_prog "" "-lrbd -lrados" "rbd"; then
1973 print_config "rbd_invalidate_cache" "$rbd_inval"
1976 ##########################################
1977 # Check whether we have setvbuf
1978 if test "$setvbuf" != "yes" ; then
1983 int main(int argc, char **argv)
1987 setvbuf(f, buf, _IOFBF, sizeof(buf));
1991 if compile_prog "" "" "setvbuf"; then
1994 print_config "setvbuf" "$setvbuf"
1996 ##########################################
1998 if test "$gfapi" != "yes" ; then
2002 #include <glusterfs/api/glfs.h>
2004 int main(int argc, char **argv)
2006 glfs_t *g = glfs_new("foo");
2011 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2014 print_config "Gluster API engine" "$gfapi"
2016 ##########################################
2017 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2018 if test "$gfapi" = "yes" ; then
2021 #include <glusterfs/api/glfs.h>
2023 int main(int argc, char **argv)
2026 int ret = glfs_fadvise(fd, 0, 0, 1);
2031 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2034 print_config "Gluster API use fadvise" "$gf_fadvise"
2037 ##########################################
2038 # check for newer gfapi
2039 if test "$gfapi" = "yes" ; then
2042 #include <glusterfs/api/glfs.h>
2044 int main(int argc, char **argv)
2046 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2049 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2052 print_config "Gluster new API" "$gf_new"
2055 ##########################################
2056 # check for gfapi trim support
2057 if test "$gf_trim" != "yes" ; then
2060 if test "$gfapi" = "yes" ; then
2062 #include <glusterfs/api/glfs.h>
2064 int main(int argc, char **argv)
2066 return glfs_discard_async(NULL, 0, 0);
2069 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2072 print_config "Gluster API trim support" "$gf_trim"
2075 ##########################################
2076 # Check if we support stckf on s390
2077 if test "$s390_z196_facilities" != "yes" ; then
2078 s390_z196_facilities="no"
2081 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2082 int main(int argc, char **argv)
2084 /* We want just 1 double word to be returned. */
2085 register unsigned long reg0 asm("0") = 0;
2086 unsigned long stfle_bits;
2087 asm volatile(".machine push" "\n\t"
2088 ".machine \"z9-109\"" "\n\t"
2091 : "=QS" (stfle_bits), "+d" (reg0)
2094 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2100 if compile_prog "" "" "s390_z196_facilities"; then
2102 if [ $? -eq 0 ]; then
2103 s390_z196_facilities="yes"
2106 print_config "s390_z196_facilities" "$s390_z196_facilities"
2108 ##########################################
2109 # Check if we have required environment variables configured for libhdfs
2110 if test "$libhdfs" = "yes" ; then
2112 if test "$JAVA_HOME" = "" ; then
2113 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2116 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2117 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2120 if test "$FIO_LIBHDFS_LIB" = "" ; then
2121 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2124 if test "$hdfs_conf_error" = "1" ; then
2125 feature_not_found "libhdfs" ""
2128 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2129 FIO_HDFS_CPU="amd64"
2132 print_config "HDFS engine" "$libhdfs"
2134 ##########################################
2135 # Check whether we have MTD
2136 if test "$mtd" != "yes" ; then
2141 #include <mtd/mtd-user.h>
2142 #include <sys/ioctl.h>
2143 int main(int argc, char **argv)
2145 struct mtd_write_req ops;
2146 struct mtd_info_user info;
2147 memset(&ops, 0, sizeof(ops));
2148 info.type = MTD_MLCNANDFLASH;
2149 return ioctl(0, MEMGETINFO, &info);
2152 if compile_prog "" "" "mtd"; then
2155 print_config "MTD" "$mtd"
2157 ##########################################
2158 # Check whether we have libpmem
2159 if test "$libpmem" != "yes" ; then
2163 #include <libpmem.h>
2165 int main(int argc, char **argv)
2167 return pmem_is_pmem(NULL, 0);
2170 if compile_prog "" "-lpmem" "libpmem"; then
2173 print_config "libpmem" "$libpmem"
2175 ##########################################
2176 # Check whether libpmem's version >= 1.5
2177 if test "$libpmem1_5" != "yes" ; then
2180 if test "$libpmem" = "yes"; then
2182 #include <libpmem.h>
2184 int main(int argc, char **argv)
2186 pmem_memcpy(NULL, NULL, 0, 0);
2190 if compile_prog "" "-lpmem" "libpmem1_5"; then
2194 print_config "libpmem1_5" "$libpmem1_5"
2196 ##########################################
2197 # Check whether we have libpmemblk
2198 # libpmem is a prerequisite
2199 if test "$libpmemblk" != "yes" ; then
2202 if test "$libpmem" = "yes"; then
2204 #include <libpmemblk.h>
2205 int main(int argc, char **argv)
2208 pbp = pmemblk_open("", 0);
2212 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2216 print_config "libpmemblk" "$libpmemblk"
2218 # Choose libpmem-based ioengines
2219 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2221 if test "$libpmem1_5" = "yes"; then
2224 if test "$libpmemblk" = "yes"; then
2229 ##########################################
2230 # Report whether pmemblk engine is enabled
2231 print_config "PMDK pmemblk engine" "$pmemblk"
2233 ##########################################
2234 # Report whether dev-dax engine is enabled
2235 print_config "PMDK dev-dax engine" "$devdax"
2237 ##########################################
2238 # Report whether libpmem engine is enabled
2239 print_config "PMDK libpmem engine" "$pmem"
2241 ##########################################
2242 # Check whether we support DDN's IME
2243 if test "$libime" != "yes" ; then
2247 #include <ime_native.h>
2248 int main(int argc, char **argv)
2252 rc = ime_native_finalize();
2256 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2258 CFLAGS="-I${ime_path}/include $CFLAGS"
2259 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2260 LIBS="-lim_client $LIBS"
2262 print_config "DDN's Infinite Memory Engine" "$libime"
2264 ##########################################
2265 # Check if we have libiscsi
2266 if test "$libiscsi" != "no" ; then
2267 if check_min_lib_version libiscsi 1.9.0; then
2269 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2270 libiscsi_libs=$(pkg-config --libs libiscsi)
2275 print_config "iscsi engine" "$libiscsi"
2277 ##########################################
2278 # Check if we have libnbd (for NBD support)
2279 if test "$libnbd" != "no" ; then
2280 if check_min_lib_version libnbd 0.9.8; then
2282 libnbd_cflags=$(pkg-config --cflags libnbd)
2283 libnbd_libs=$(pkg-config --libs libnbd)
2288 print_config "NBD engine" "$libnbd"
2290 ##########################################
2291 # check for dfs (DAOS File System)
2292 if test "$dfs" != "no" ; then
2296 #include <daos_fs.h>
2298 int main(int argc, char **argv)
2304 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2309 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2315 print_config "DAOS File System (dfs) Engine" "$dfs"
2317 ##########################################
2318 # Check if we have libnfs (for userspace nfs support).
2319 if test "$libnfs" != "no" ; then
2320 if $(pkg-config libnfs > /dev/null 2>&1); then
2322 libnfs_cflags=$(pkg-config --cflags libnfs)
2323 libnfs_libs=$(pkg-config --libs libnfs)
2325 if test "$libnfs" = "yes" ; then
2326 feature_not_found "libnfs" "libnfs"
2331 print_config "NFS engine" "$libnfs"
2333 ##########################################
2334 # Check if we have lex/yacc available
2339 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2340 if test "$targetos" != "SunOS" ; then
2350 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2354 if test "$arith" = "yes" ; then
2356 extern int yywrap(void);
2358 int main(int argc, char **argv)
2364 if compile_prog "" "-lfl" "flex"; then
2366 elif compile_prog "" "-ll" "lex"; then
2375 # Check if lex fails using -o
2376 if test "$arith" = "yes" ; then
2377 if test "$force_no_lex_o" = "yes" ; then
2380 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2388 print_config "lex/yacc for arithmetic" "$arith"
2390 ##########################################
2391 # Check whether we have setmntent/getmntent
2392 if test "$getmntent" != "yes" ; then
2398 int main(int argc, char **argv)
2400 FILE *mtab = setmntent(NULL, "r");
2401 struct mntent *mnt = getmntent(mtab);
2406 if compile_prog "" "" "getmntent"; then
2409 print_config "getmntent" "$getmntent"
2411 ##########################################
2412 # Check whether we have getmntinfo
2413 # These are originally added for BSDs, but may also work
2414 # on other operating systems with getmntinfo(3).
2416 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2417 # Note that NetBSD needs -Werror to catch warning as error.
2418 if test "$getmntinfo" != "yes" ; then
2423 #include <sys/param.h>
2424 #include <sys/mount.h>
2425 int main(int argc, char **argv)
2428 return getmntinfo(&st, MNT_NOWAIT);
2431 if compile_prog "-Werror" "" "getmntinfo"; then
2434 print_config "getmntinfo" "$getmntinfo"
2436 # getmntinfo(3) for NetBSD.
2437 if test "$getmntinfo_statvfs" != "yes" ; then
2438 getmntinfo_statvfs="no"
2442 #include <sys/statvfs.h>
2443 int main(int argc, char **argv)
2446 return getmntinfo(&st, MNT_NOWAIT);
2449 # Skip the test if the one with statfs arg is detected.
2450 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2451 getmntinfo_statvfs="yes"
2452 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2455 ##########################################
2456 # Check whether we have _Static_assert
2457 if test "$static_assert" != "yes" ; then
2469 int main(int argc, char **argv)
2471 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2475 if compile_prog "" "" "static_assert"; then
2478 print_config "Static Assert" "$static_assert"
2480 ##########################################
2481 # Check whether we have bool / stdbool.h
2482 if test "$have_bool" != "yes" ; then
2486 #include <stdbool.h>
2487 int main(int argc, char **argv)
2490 return var != false;
2493 if compile_prog "" "" "bool"; then
2496 print_config "bool" "$have_bool"
2498 ##########################################
2499 # Check whether we have strndup()
2504 int main(int argc, char **argv)
2506 char *res = strndup("test string", 8);
2512 if compile_prog "" "" "strndup"; then
2515 print_config "strndup" "$strndup"
2517 ##########################################
2518 # <valgrind/drd.h> probe
2519 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2520 # also available but not the other way around.
2521 if test "$valgrind_dev" != "yes" ; then
2525 #include <valgrind/drd.h>
2526 int main(int argc, char **argv)
2531 if compile_prog "" "" "valgrind_dev"; then
2534 print_config "Valgrind headers" "$valgrind_dev"
2536 if test "$targetos" = "Linux" ; then
2537 ##########################################
2538 # <linux/blkzoned.h> probe
2539 if test "$linux_blkzoned" != "yes" ; then
2543 #include <linux/blkzoned.h>
2544 int main(int argc, char **argv)
2549 if compile_prog "" "" "linux_blkzoned"; then
2550 linux_blkzoned="yes"
2552 print_config "Zoned block device support" "$linux_blkzoned"
2554 ##########################################
2555 # Check BLK_ZONE_REP_CAPACITY
2557 #include <linux/blkzoned.h>
2560 return BLK_ZONE_REP_CAPACITY;
2563 if compile_prog "" "" "blkzoned report capacity"; then
2564 output_sym "CONFIG_HAVE_REP_CAPACITY"
2569 print_config "Zoned block device capacity" "$rep_capacity"
2572 ##########################################
2575 #include <libzbc/zbc.h>
2576 int main(int argc, char **argv)
2578 struct zbc_device *dev = NULL;
2580 return zbc_open("foo=bar", O_RDONLY, &dev);
2583 if test "$libzbc" != "no" ; then
2584 if [ -e /usr/include/libzbc/libzbc ]; then
2586 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2588 if compile_prog "" "-lzbc" "libzbc"; then
2590 if ! check_min_lib_version libzbc 5; then
2594 if test "$libzbc" = "yes" ; then
2595 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2600 print_config "libzbc engine" "$libzbc"
2602 if test "$targetos" = "Linux" ; then
2603 ##########################################
2604 # Check NVME_URING_CMD support
2606 #include <linux/nvme_ioctl.h>
2609 struct nvme_uring_cmd *cmd;
2611 return sizeof(struct nvme_uring_cmd);
2614 if compile_prog "" "" "nvme uring cmd"; then
2615 output_sym "CONFIG_NVME_URING_CMD"
2616 nvme_uring_cmd="yes"
2620 print_config "NVMe uring command support" "$nvme_uring_cmd"
2623 ##########################################
2624 # Check if we have xnvme
2625 if test "$xnvme" != "no" ; then
2626 if check_min_lib_version xnvme 0.2.0; then
2628 xnvme_cflags=$(pkg-config --cflags xnvme)
2629 xnvme_libs=$(pkg-config --libs xnvme)
2634 print_config "xnvme engine" "$xnvme"
2636 ##########################################
2637 # check march=armv8-a+crc+crypto
2638 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2639 march_armv8_a_crc_crypto="no"
2641 if test "$cpu" = "arm64" ; then
2643 #include <arm_acle.h>
2644 #include <arm_neon.h>
2645 #include <sys/auxv.h>
2649 /* Can we also do a runtime probe? */
2651 return getauxval(AT_HWCAP);
2653 # error "Don't know how to do runtime probe for ARM CRC32c"
2657 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2658 march_armv8_a_crc_crypto="yes"
2659 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2663 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2665 ##########################################
2667 if test "$cuda" != "no" ; then
2670 int main(int argc, char **argv)
2675 if compile_prog "" "-lcuda" "cuda"; then
2679 if test "$cuda" = "yes" ; then
2680 feature_not_found "cuda" ""
2685 print_config "cuda" "$cuda"
2687 ##########################################
2689 if test "$libcufile" != "no" ; then
2693 int main(int argc, char* argv[]) {
2698 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2700 LIBS="-lcuda -lcudart -lcufile $LIBS"
2702 if test "$libcufile" = "yes" ; then
2703 feature_not_found "libcufile" ""
2708 print_config "libcufile" "$libcufile"
2710 ##########################################
2711 # check for cc -march=native
2714 int main(int argc, char **argv)
2719 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2720 compile_prog "-march=native" "" "march=native"; then
2723 print_config "Build march=native" "$build_native"
2725 ##########################################
2727 if test "$cunit" != "yes" ; then
2731 #include <CUnit/CUnit.h>
2732 #include <CUnit/Basic.h>
2735 if (CU_initialize_registry() != CUE_SUCCESS)
2736 return CU_get_error();
2737 CU_basic_set_mode(CU_BRM_VERBOSE);
2738 CU_basic_run_tests();
2739 CU_cleanup_registry();
2740 return CU_get_error();
2743 if compile_prog "" "-lcunit" "CUnit"; then
2746 print_config "CUnit" "$cunit"
2748 ##########################################
2749 # check for __kernel_rwf_t
2752 #include <linux/fs.h>
2753 int main(int argc, char **argv)
2760 if compile_prog "" "" "__kernel_rwf_t"; then
2761 __kernel_rwf_t="yes"
2763 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2765 ##########################################
2766 # check if gcc has -Wimplicit-fallthrough=2
2769 int main(int argc, char **argv)
2774 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2777 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2779 ##########################################
2780 # check for MADV_HUGEPAGE support
2781 if test "$thp" != "yes" ; then
2784 if test "$esx" != "yes" ; then
2786 #include <sys/mman.h>
2789 return madvise(0, 0x1000, MADV_HUGEPAGE);
2792 if compile_prog "" "" "thp" ; then
2795 if test "$thp" = "yes" ; then
2796 feature_not_found "Transparent Huge Page" ""
2801 print_config "MADV_HUGEPAGE" "$thp"
2803 ##########################################
2804 # check for gettid()
2808 int main(int argc, char **argv)
2813 if compile_prog "" "" "gettid"; then
2816 print_config "gettid" "$gettid"
2818 ##########################################
2819 # check for statx(2) support by libc
2823 #include <sys/stat.h>
2825 int main(int argc, char **argv)
2828 return statx(-1, *argv, 0, 0, &st);
2831 if compile_prog "" "" "statx"; then
2834 print_config "statx(2)/libc" "$statx"
2836 ##########################################
2837 # check for statx(2) support by kernel
2841 #include <linux/stat.h>
2842 #include <sys/stat.h>
2843 #include <sys/syscall.h>
2845 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2846 struct statx *buffer)
2848 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2851 int main(int argc, char **argv)
2854 return _statx(-1, *argv, 0, 0, &st);
2857 if compile_prog "" "" "statx_syscall"; then
2860 print_config "statx(2)/syscall" "$statx_syscall"
2862 ##########################################
2863 # check for Windows PDB generation support
2864 if test "pdb" != "no" ; then
2871 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2874 if test "$pdb" = "yes"; then
2875 feature_not_found "PDB" "clang and lld"
2882 print_config "Windows PDB generation" "$pdb"
2884 ##########################################
2885 # check for timerfd support
2887 if test "$esx" != "yes" ; then
2889 #include <sys/time.h>
2890 #include <sys/timerfd.h>
2892 int main(int argc, char **argv)
2894 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2897 if compile_prog "" "" "timerfd_create"; then
2898 timerfd_create="yes"
2901 print_config "timerfd_create" "$timerfd_create"
2903 #############################################################################
2905 if test "$wordsize" = "64" ; then
2906 output_sym "CONFIG_64BIT"
2907 elif test "$wordsize" = "32" ; then
2908 output_sym "CONFIG_32BIT"
2910 fatal "Unknown wordsize!"
2912 if test "$bigendian" = "yes" ; then
2913 output_sym "CONFIG_BIG_ENDIAN"
2915 output_sym "CONFIG_LITTLE_ENDIAN"
2917 if test "$zlib" = "yes" ; then
2918 output_sym "CONFIG_ZLIB"
2920 if test "$libaio" = "yes" ; then
2921 output_sym "CONFIG_LIBAIO"
2922 if test "$libaio_rw_flags" = "yes" ; then
2923 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2926 if test "$posix_aio" = "yes" ; then
2927 output_sym "CONFIG_POSIXAIO"
2929 if test "$posix_aio_fsync" = "yes" ; then
2930 output_sym "CONFIG_POSIXAIO_FSYNC"
2932 if test "$posix_pshared" = "yes" ; then
2933 output_sym "CONFIG_PSHARED"
2935 if test "$pthread_condattr_setclock" = "yes" ; then
2936 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2938 if test "$pthread_sigmask" = "yes" ; then
2939 output_sym "CONFIG_PTHREAD_SIGMASK"
2941 if test "$pthread_getaffinity" = "yes" ; then
2942 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2944 if test "$have_asprintf" = "yes" ; then
2945 output_sym "CONFIG_HAVE_ASPRINTF"
2947 if test "$have_vasprintf" = "yes" ; then
2948 output_sym "CONFIG_HAVE_VASPRINTF"
2950 if test "$linux_fallocate" = "yes" ; then
2951 output_sym "CONFIG_LINUX_FALLOCATE"
2953 if test "$posix_fallocate" = "yes" ; then
2954 output_sym "CONFIG_POSIX_FALLOCATE"
2956 if test "$fdatasync" = "yes" ; then
2957 output_sym "CONFIG_FDATASYNC"
2959 if test "$pipe" = "yes" ; then
2960 output_sym "CONFIG_PIPE"
2962 if test "$pipe2" = "yes" ; then
2963 output_sym "CONFIG_PIPE2"
2965 if test "$pread" = "yes" ; then
2966 output_sym "CONFIG_PREAD"
2968 if test "$sync_file_range" = "yes" ; then
2969 output_sym "CONFIG_SYNC_FILE_RANGE"
2971 if test "$sfaa" = "yes" ; then
2972 output_sym "CONFIG_SFAA"
2974 if test "$sync_sync" = "yes" ; then
2975 output_sym "CONFIG_SYNC_SYNC"
2977 if test "$cmp_swap" = "yes" ; then
2978 output_sym "CONFIG_CMP_SWAP"
2980 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2981 output_sym "CONFIG_RDMA"
2983 # librpma is supported on the 'x86_64' architecture for now
2984 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2985 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2986 output_sym "CONFIG_LIBRPMA_APM"
2988 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2989 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2990 output_sym "CONFIG_LIBRPMA_GPSPM"
2992 if test "$clock_gettime" = "yes" ; then
2993 output_sym "CONFIG_CLOCK_GETTIME"
2995 if test "$clock_monotonic" = "yes" ; then
2996 output_sym "CONFIG_CLOCK_MONOTONIC"
2998 if test "$clockid_t" = "yes"; then
2999 output_sym "CONFIG_CLOCKID_T"
3001 if test "$gettimeofday" = "yes" ; then
3002 output_sym "CONFIG_GETTIMEOFDAY"
3004 if test "$posix_fadvise" = "yes" ; then
3005 output_sym "CONFIG_POSIX_FADVISE"
3007 if test "$linux_3arg_affinity" = "yes" ; then
3008 output_sym "CONFIG_3ARG_AFFINITY"
3009 elif test "$linux_2arg_affinity" = "yes" ; then
3010 output_sym "CONFIG_2ARG_AFFINITY"
3012 if test "$strsep" = "yes" ; then
3013 output_sym "CONFIG_STRSEP"
3015 if test "$strcasestr" = "yes" ; then
3016 output_sym "CONFIG_STRCASESTR"
3018 if test "$strlcat" = "yes" ; then
3019 output_sym "CONFIG_STRLCAT"
3021 if test "$getopt_long_only" = "yes" ; then
3022 output_sym "CONFIG_GETOPT_LONG_ONLY"
3024 if test "$inet_aton" = "yes" ; then
3025 output_sym "CONFIG_INET_ATON"
3027 if test "$socklen_t" = "yes" ; then
3028 output_sym "CONFIG_SOCKLEN_T"
3030 if test "$ext4_me" = "yes" ; then
3031 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3033 if test "$linux_splice" = "yes" ; then
3034 output_sym "CONFIG_LINUX_SPLICE"
3036 if test "$libnuma_v2" = "yes" ; then
3037 output_sym "CONFIG_LIBNUMA"
3039 if test "$solaris_aio" = "yes" ; then
3040 output_sym "CONFIG_SOLARISAIO"
3042 if test "$tls_thread" = "yes" ; then
3043 output_sym "CONFIG_TLS_THREAD"
3045 if test "$rusage_thread" = "yes" ; then
3046 output_sym "CONFIG_RUSAGE_THREAD"
3048 if test "$gfio" = "yes" ; then
3049 output_sym "CONFIG_GFIO"
3051 if test "$esx" = "yes" ; then
3052 output_sym "CONFIG_ESX"
3053 output_sym "CONFIG_NO_SHM"
3055 if test "$sched_idle" = "yes" ; then
3056 output_sym "CONFIG_SCHED_IDLE"
3058 if test "$tcp_nodelay" = "yes" ; then
3059 output_sym "CONFIG_TCP_NODELAY"
3061 if test "$window_size" = "yes" ; then
3062 output_sym "CONFIG_NET_WINDOWSIZE"
3064 if test "$mss" = "yes" ; then
3065 output_sym "CONFIG_NET_MSS"
3067 if test "$rlimit_memlock" = "yes" ; then
3068 output_sym "CONFIG_RLIMIT_MEMLOCK"
3070 if test "$pwritev" = "yes" ; then
3071 output_sym "CONFIG_PWRITEV"
3073 if test "$pwritev2" = "yes" ; then
3074 output_sym "CONFIG_PWRITEV2"
3076 if test "$ipv6" = "yes" ; then
3077 output_sym "CONFIG_IPV6"
3079 if test "$http" = "yes" ; then
3080 output_sym "CONFIG_HTTP"
3082 if test "$rados" = "yes" ; then
3083 output_sym "CONFIG_RADOS"
3085 if test "$rbd" = "yes" ; then
3086 output_sym "CONFIG_RBD"
3088 if test "$rbd_poll" = "yes" ; then
3089 output_sym "CONFIG_RBD_POLL"
3091 if test "$rbd_inval" = "yes" ; then
3092 output_sym "CONFIG_RBD_INVAL"
3094 if test "$setvbuf" = "yes" ; then
3095 output_sym "CONFIG_SETVBUF"
3097 if test "$s390_z196_facilities" = "yes" ; then
3098 output_sym "CONFIG_S390_Z196_FACILITIES"
3099 CFLAGS="$CFLAGS -march=z9-109"
3102 if test "$gfapi" = "yes" ; then
3103 output_sym "CONFIG_GFAPI"
3105 if test "$gf_fadvise" = "yes" ; then
3106 output_sym "CONFIG_GF_FADVISE"
3108 if test "$gf_trim" = "yes" ; then
3109 output_sym "CONFIG_GF_TRIM"
3111 if test "$gf_new" = "yes" ; then
3112 output_sym "CONFIG_GF_NEW_API"
3114 if test "$libhdfs" = "yes" ; then
3115 output_sym "CONFIG_LIBHDFS"
3116 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3117 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3118 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3119 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3121 if test "$mtd" = "yes" ; then
3122 output_sym "CONFIG_MTD"
3124 if test "$pmemblk" = "yes" ; then
3125 output_sym "CONFIG_PMEMBLK"
3127 if test "$devdax" = "yes" ; then
3128 output_sym "CONFIG_LINUX_DEVDAX"
3130 if test "$pmem" = "yes" ; then
3131 output_sym "CONFIG_LIBPMEM"
3133 if test "$libime" = "yes" ; then
3134 output_sym "CONFIG_IME"
3136 if test "$arith" = "yes" ; then
3137 output_sym "CONFIG_ARITHMETIC"
3138 if test "$yacc_is_bison" = "yes" ; then
3139 echo "YACC=bison -y" >> $config_host_mak
3141 echo "YACC=yacc" >> $config_host_mak
3143 if test "$lex_use_o" = "yes" ; then
3144 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3147 if test "$getmntent" = "yes" ; then
3148 output_sym "CONFIG_GETMNTENT"
3150 if test "$getmntinfo" = "yes" ; then
3151 output_sym "CONFIG_GETMNTINFO"
3153 if test "$getmntinfo_statvfs" = "yes" ; then
3154 output_sym "CONFIG_GETMNTINFO_STATVFS"
3156 if test "$static_assert" = "yes" ; then
3157 output_sym "CONFIG_STATIC_ASSERT"
3159 if test "$have_bool" = "yes" ; then
3160 output_sym "CONFIG_HAVE_BOOL"
3162 if test "$strndup" = "yes" ; then
3163 output_sym "CONFIG_HAVE_STRNDUP"
3165 if test "$disable_opt" = "yes" ; then
3166 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3168 if test "$valgrind_dev" = "yes"; then
3169 output_sym "CONFIG_VALGRIND_DEV"
3171 if test "$linux_blkzoned" = "yes" ; then
3172 output_sym "CONFIG_HAS_BLKZONED"
3174 if test "$libzbc" = "yes" ; then
3175 output_sym "CONFIG_LIBZBC"
3177 if test "$zlib" = "no" ; then
3178 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3179 if test "$build_static" = "yes"; then
3180 echo "Note that some distros have separate packages for static libraries."
3183 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3184 output_sym "ARCH_HAVE_CRC_CRYPTO"
3186 if test "$cuda" = "yes" ; then
3187 output_sym "CONFIG_CUDA"
3189 if test "$libcufile" = "yes" ; then
3190 output_sym "CONFIG_LIBCUFILE"
3192 if test "$dfs" = "yes" ; then
3193 output_sym "CONFIG_DFS"
3195 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3196 output_sym "CONFIG_BUILD_NATIVE"
3198 if test "$cunit" = "yes" ; then
3199 output_sym "CONFIG_HAVE_CUNIT"
3201 if test "$__kernel_rwf_t" = "yes"; then
3202 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3204 if test "$gettid" = "yes"; then
3205 output_sym "CONFIG_HAVE_GETTID"
3207 if test "$statx" = "yes"; then
3208 output_sym "CONFIG_HAVE_STATX"
3210 if test "$statx_syscall" = "yes"; then
3211 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3213 if test "$timerfd_create" = "yes"; then
3214 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3216 if test "$fallthrough" = "yes"; then
3217 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3219 if test "$thp" = "yes" ; then
3220 output_sym "CONFIG_HAVE_THP"
3222 if test "$libiscsi" = "yes" ; then
3223 output_sym "CONFIG_LIBISCSI"
3224 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3225 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3226 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3228 if test "$libnbd" = "yes" ; then
3229 output_sym "CONFIG_LIBNBD"
3230 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3231 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3232 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3234 if test "$libnfs" = "yes" ; then
3235 output_sym "CONFIG_LIBNFS"
3236 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3237 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3239 if test "$xnvme" = "yes" ; then
3240 output_sym "CONFIG_LIBXNVME"
3241 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3242 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3244 if test "$dynamic_engines" = "yes" ; then
3245 output_sym "CONFIG_DYNAMIC_ENGINES"
3247 if test "$pdb" = yes; then
3248 output_sym "CONFIG_PDB"
3250 if test "$fcntl_sync" = "yes" ; then
3251 output_sym "CONFIG_FCNTL_SYNC"
3253 if test "$asan" = "yes"; then
3254 CFLAGS="$CFLAGS -fsanitize=address"
3255 LDFLAGS="$LDFLAGS -fsanitize=address"
3257 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3259 int main(int argc, char **argv)
3264 if test "$disable_tcmalloc" != "yes"; then
3265 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3267 LIBS="-ltcmalloc $LIBS"
3268 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3270 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3275 print_config "TCMalloc support" "$tcmalloc"
3277 echo "LIBS+=$LIBS" >> $config_host_mak
3278 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3279 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3280 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3281 echo "CC=$cc" >> $config_host_mak
3282 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3283 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3285 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3286 cat > Makefile <<EOF
3287 SRCDIR:=`dirname $0`
3288 include \$(SRCDIR)/Makefile