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
120 echo "$1" | grep -E -q "^[0-9]+$"
126 #error $1 not defined
144 #error $1 is not equal $2
151 echo "$1=y" >> $config_host_mak
152 echo "#define $1" >> $config_host_h
155 check_min_lib_version() {
158 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
161 : "${_feature:=${1}}"
162 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
163 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
164 feature_not_found "$_feature" "$1 >= $2"
167 print_config "$1" "missing pkg-config, can't check $_feature version"
201 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
203 --prefix=*) prefix="$optarg"
205 --cpu=*) cpu="$optarg"
207 # esx is cross compiled and cannot be detect through simple uname calls
213 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
215 --build-32bit-win) build_32bit_win="yes"
217 --target-win-ver=*) target_win_ver="$optarg"
219 --enable-pdb) pdb="yes"
221 --build-static) build_static="yes"
223 --enable-gfio) gfio_check="yes"
225 --disable-numa) disable_numa="yes"
227 --disable-rdma) disable_rdma="yes"
229 --disable-rados) disable_rados="yes"
231 --disable-rbd) disable_rbd="yes"
233 --disable-http) disable_http="yes"
235 --disable-gfapi) disable_gfapi="yes"
237 --enable-libhdfs) libhdfs="yes"
239 --disable-lex) disable_lex="yes"
241 --enable-lex) disable_lex="no"
243 --disable-shm) no_shm="yes"
245 --disable-optimizations) disable_opt="yes"
247 --disable-pmem) disable_pmem="yes"
249 --enable-cuda) cuda="yes"
251 --enable-libcufile) libcufile="yes"
253 --disable-native) disable_native="yes"
255 --with-ime=*) ime_path="$optarg"
257 --enable-libiscsi) libiscsi="yes"
259 --enable-libnbd) libnbd="yes"
261 --disable-libzbc) libzbc="no"
263 --disable-xnvme) xnvme="no"
265 --disable-libblkio) libblkio="no"
267 --disable-tcmalloc) disable_tcmalloc="yes"
269 --disable-libnfs) libnfs="no"
271 --enable-libnfs) libnfs="yes"
273 --dynamic-libengines) dynamic_engines="yes"
275 --disable-dfs) dfs="no"
277 --enable-asan) asan="yes"
279 --seed-buckets=*) seed_buckets="$optarg"
281 --disable-tls) tls_check="no"
287 echo "Bad option $opt"
293 if test "$show_help" = "yes" ; then
294 echo "--prefix= Use this directory as installation prefix"
295 echo "--cpu= Specify target CPU if auto-detect fails"
296 echo "--cc= Specify compiler to use"
297 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
298 echo "--build-32bit-win Enable 32-bit build on Windows"
299 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
300 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
301 echo "--build-static Build a static fio"
302 echo "--esx Configure build options for esx"
303 echo "--enable-gfio Enable building of gtk gfio"
304 echo "--disable-numa Disable libnuma even if found"
305 echo "--disable-rdma Disable RDMA support even if found"
306 echo "--disable-rados Disable Rados support even if found"
307 echo "--disable-rbd Disable Rados Block Device even if found"
308 echo "--disable-http Disable HTTP support even if found"
309 echo "--disable-gfapi Disable gfapi"
310 echo "--enable-libhdfs Enable hdfs support"
311 echo "--enable-libnfs Enable nfs support"
312 echo "--disable-libnfs Disable nfs support"
313 echo "--disable-lex Disable use of lex/yacc for math"
314 echo "--disable-pmem Disable pmem based engines even if found"
315 echo "--enable-lex Enable use of lex/yacc for math"
316 echo "--disable-shm Disable SHM support"
317 echo "--disable-optimizations Don't enable compiler optimizations"
318 echo "--enable-cuda Enable GPUDirect RDMA support"
319 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
320 echo "--disable-native Don't build for native host"
321 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
322 echo "--enable-libiscsi Enable iscsi support"
323 echo "--enable-libnbd Enable libnbd (NBD engine) support"
324 echo "--disable-xnvme Disable xnvme support even if found"
325 echo "--disable-libblkio Disable libblkio support even if found"
326 echo "--disable-libzbc Disable libzbc even if found"
327 echo "--disable-tcmalloc Disable tcmalloc support"
328 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
329 echo "--disable-dfs Disable DAOS File System support even if found"
330 echo "--enable-asan Enable address sanitizer"
331 echo "--seed-buckets= Number of seed buckets for the refill-buffer"
332 echo "--disable-tls Disable __thread local storage"
336 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
337 # Preferred compiler (can be overridden later after we know the platform):
339 # ${cross_prefix}gcc (if cross-prefix specified)
342 if test -z "${CC}${cross_prefix}"; then
349 cc="${CC-${cross_prefix}gcc}"
352 if check_define __ANDROID__ ; then
354 elif check_define __linux__ ; then
356 elif check_define __OpenBSD__ ; then
358 elif check_define __NetBSD__ ; then
360 elif check_define __sun__ ; then
362 CFLAGS="$CFLAGS -D_REENTRANT"
363 elif check_define _WIN32 ; then
369 echo "# Automatically generated by configure - do not modify" > $config_host_mak
370 printf "# Configured with:" >> $config_host_mak
371 printf " '%s'" "$0" "$@" >> $config_host_mak
372 echo >> $config_host_mak
373 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
375 if test "$no_shm" = "yes" ; then
376 output_sym "CONFIG_NO_SHM"
379 if test "$disable_opt" = "yes" ; then
380 output_sym "CONFIG_FIO_NO_OPT"
383 # Some host OSes need non-standard checks for which CPU to use.
384 # Note that these checks are broken for cross-compilation: if you're
385 # cross-compiling to one of these OSes then you'll need to specify
386 # the correct CPU with the --cpu option.
389 # Unless explicitly enabled, turn off lex.
390 # OpenBSD will hit syntax error when enabled.
391 if test -z "$disable_lex" ; then
398 CFLAGS="$CFLAGS -I/usr/local/include"
399 LDFLAGS="$LDFLAGS -L/usr/local/lib"
402 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
403 # we can run 64-bit userspace code.
404 # If the user didn't specify a CPU explicitly and the kernel says this is
405 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
407 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
410 # Avoid configure feature detection of features provided by weak symbols
417 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
418 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
422 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
423 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
426 LIBS="-lnsl -lsocket"
429 # We still force some options, so keep this message here.
430 echo "Forcing some known good options on Windows"
431 if test -z "${CC}${cross_prefix}"; then
432 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
433 cc="i686-w64-mingw32-gcc"
435 cc="x86_64-w64-mingw32-gcc"
439 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
440 if test -z "$target_win_ver"; then
441 # Default Windows API target
444 if test "$target_win_ver" = "7"; then
445 output_sym "CONFIG_WINDOWS_7"
446 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
448 fatal "Unknown target Windows version"
451 # We need this to be output_sym'd here because this is Windows specific.
452 # The regular configure path never sets this config.
453 output_sym "CONFIG_WINDOWSAIO"
454 # We now take the regular configuration path without having exit 0 here.
455 # Flags below are still necessary mostly for MinGW.
459 clock_gettime="yes" # clock_monotonic probe has dependency on this
460 clock_monotonic="yes"
462 pthread_condattr_setclock="no"
463 pthread_affinity="no"
467 # Now we know the target platform we can have another guess at the preferred
468 # compiler when it wasn't explictly set
469 if test -z "${CC}${cross_prefix}"; then
470 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
476 if test -z "$cc"; then
477 echo "configure: failed to find compiler"
481 if test ! -z "$cpu" ; then
482 # command line argument
484 elif check_define __i386__ ; then
486 elif check_define __x86_64__ ; then
488 elif check_define __sparc__ ; then
489 if check_define __arch64__ ; then
494 elif check_define _ARCH_PPC ; then
495 if check_define _ARCH_PPC64 ; then
500 elif check_define __mips__ ; then
502 elif check_define __ia64__ ; then
504 elif check_define __s390__ ; then
505 if check_define __s390x__ ; then
510 elif check_define __arm__ ; then
512 elif check_define __aarch64__ ; then
514 elif check_define __hppa__ ; then
516 elif check_define __loongarch64 ; then
518 elif check_define __riscv ; then
519 if check_val __riscv_xlen 32 ; then
521 elif check_val __riscv_xlen 64 ; then
523 elif check_val __riscv_xlen 128 ; then
530 # Normalise host CPU name and set ARCH.
532 ia64|ppc|ppc64|s390|s390x|sparc64|loongarch64|riscv64)
535 i386|i486|i586|i686|i86pc|BePC)
547 hppa|parisc|parisc64)
561 ##########################################
562 # check cross compile
564 if test "$cross_compile" != "yes" ; then
573 if compile_prog "" "" "cross"; then
574 $TMPE 2>/dev/null || cross_compile="yes"
576 fatal "compile test failed"
579 ##########################################
581 if test "$bigendian" != "yes" ; then
584 if test "$cross_compile" = "no" ; then
586 #include <inttypes.h>
589 volatile uint32_t i=0x01234567;
590 return (*((uint8_t*)(&i))) == 0x67;
593 if compile_prog "" "" "endian"; then
594 $TMPE && bigendian="yes"
597 # If we're cross compiling, try our best to work it out and rely on the
598 # run-time check to fail if we get it wrong.
603 #if __BYTE_ORDER != __BIG_ENDIAN
604 # error "Unknown endianness"
608 compile_prog "" "" "endian" && bigendian="yes"
609 check_define "__ARMEB__" && bigendian="yes"
610 check_define "__MIPSEB__" && bigendian="yes"
614 print_config "Operating system" "$targetos"
615 print_config "CPU" "$cpu"
616 print_config "Big endian" "$bigendian"
617 if test ! -z "$target_win_ver"; then
618 print_config "Target Windows version" "$target_win_ver"
620 print_config "Compiler" "$cc"
621 print_config "Cross compile" "$cross_compile"
624 ##########################################
625 # See if we need to build a static build
626 if test "$build_static" = "yes" ; then
627 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
628 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
632 print_config "Static build" "$build_static"
634 ##########################################
635 # check for C11 atomics support
637 #include <stdatomic.h>
645 if ! compile_prog "" "" "C11 atomics"; then
647 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
648 echo "minimum versions with it - perhaps your compiler is too old?"
649 fatal "C11 atomics support not found"
653 ##########################################
658 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
661 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
665 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
667 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
670 fatal "Unknown wordsize"
672 print_config "Wordsize" "$wordsize"
674 ##########################################
676 if test "$zlib" != "yes" ; then
684 if (inflateInit(&stream) != Z_OK)
689 if compile_prog "" "-lz" "zlib" ; then
693 print_config "zlib" "$zlib"
695 ##########################################
696 # fcntl(F_FULLFSYNC) support
697 if test "$fcntl_sync" != "yes" ; then
704 int main(int argc, char **argv)
706 return fcntl(0, F_FULLFSYNC);
709 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
712 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
714 ##########################################
716 if test "$libaio" != "yes" ; then
719 if test "$esx" != "yes" ; then
729 if compile_prog "" "-laio" "libaio" ; then
732 if test "$libaio" = "yes" ; then
733 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
743 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
744 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
748 if compile_prog "" "" "libaio rw flags" ; then
754 print_config "Linux AIO support" "$libaio"
755 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
757 ##########################################
759 if test "$posix_aio" != "yes" ; then
762 if test "$posix_aio_lrt" != "yes" ; then
774 if compile_prog "" "" "posixaio" ; then
776 elif compile_prog "" "-lrt" "posixaio -lrt"; then
781 print_config "POSIX AIO support" "$posix_aio"
782 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
784 ##########################################
785 # posix aio fsync probe
786 if test "$posix_aio_fsync" != "yes" ; then
789 if test "$posix_aio" = "yes" ; then
796 return aio_fsync(O_SYNC, &cb);
800 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
804 print_config "POSIX AIO fsync" "$posix_aio_fsync"
806 ##########################################
807 # POSIX pshared attribute probe
808 if test "$posix_pshared" != "yes" ; then
815 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
816 # if defined(__CYGWIN__)
817 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
818 # elif defined(__APPLE__)
819 # include <AvailabilityMacros.h>
820 # include <TargetConditionals.h>
821 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
822 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
826 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
831 if compile_prog "" "$LIBS" "posix_pshared" ; then
834 print_config "POSIX pshared support" "$posix_pshared"
836 ##########################################
837 # POSIX pthread_condattr_setclock() probe
838 if test "$pthread_condattr_setclock" != "no" ; then
843 pthread_condattr_t condattr;
844 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
848 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
849 pthread_condattr_setclock=yes
850 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
851 pthread_condattr_setclock=yes
852 LIBS="$LIBS -lpthread"
855 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
857 ##########################################
858 # pthread_sigmask() probe
859 if test "$pthread_sigmask" != "yes" ; then
863 #include <stddef.h> /* NULL */
864 #include <signal.h> /* pthread_sigmask() */
868 return pthread_sigmask(0, NULL, &sigmask);
871 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
873 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
875 LIBS="$LIBS -lpthread"
877 print_config "pthread_sigmask()" "$pthread_sigmask"
879 ##########################################
880 # pthread_getaffinity_np() probe
881 if test "$pthread_getaffinity" != "yes" ; then
882 pthread_getaffinity="no"
885 #include <stddef.h> /* NULL */
886 #include <signal.h> /* pthread_sigmask() */
891 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
894 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
895 pthread_getaffinity="yes"
896 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
897 pthread_getaffinity="yes"
898 LIBS="$LIBS -lpthread"
900 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
902 ##########################################
904 if test "$solaris_aio" != "yes" ; then
908 #include <sys/types.h>
909 #include <sys/asynch.h>
914 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
918 if compile_prog "" "-laio" "solarisaio" ; then
922 print_config "Solaris AIO support" "$solaris_aio"
924 ##########################################
925 # __sync_fetch_and_add test
926 if test "$sfaa" != "yes" ; then
930 #include <inttypes.h>
931 static int sfaa(uint64_t *ptr)
933 return __sync_fetch_and_add(ptr, 0);
936 int main(int argc, char **argv)
943 if compile_prog "" "" "__sync_fetch_and_add()" ; then
946 print_config "__sync_fetch_and_add" "$sfaa"
948 ##########################################
949 # __sync_synchronize() test
950 if test "$sync_sync" != "yes" ; then
954 #include <inttypes.h>
956 int main(int argc, char **argv)
958 __sync_synchronize();
962 if compile_prog "" "" "__sync_synchronize()" ; then
965 print_config "__sync_synchronize" "$sync_sync"
967 ##########################################
968 # __sync_val_compare_and_swap() test
969 if test "$cmp_swap" != "yes" ; then
973 #include <inttypes.h>
975 int main(int argc, char **argv)
978 return __sync_val_compare_and_swap(&x, 1, 2);
981 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
984 print_config "__sync_val_compare_and_swap" "$cmp_swap"
986 ##########################################
988 if test "$libverbs" != "yes" ; then
992 #include <infiniband/verbs.h>
993 int main(int argc, char **argv)
995 struct ibv_pd *pd = ibv_alloc_pd(NULL);
999 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
1002 print_config "libverbs" "$libverbs"
1004 ##########################################
1006 if test "$rdmacm" != "yes" ; then
1011 #include <rdma/rdma_cma.h>
1012 int main(int argc, char **argv)
1014 rdma_destroy_qp(NULL);
1018 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
1021 print_config "rdmacm" "$rdmacm"
1023 ##########################################
1025 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
1026 if test "$librpma" != "yes" ; then
1030 #include <librpma.h>
1033 void *ptr = rpma_cq_get_wc;
1034 (void) ptr; /* unused */
1038 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1041 print_config "librpma" "$librpma"
1043 ##########################################
1044 # libprotobuf-c probe
1045 if test "$libprotobuf_c" != "yes" ; then
1050 #include <protobuf-c/protobuf-c.h>
1051 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1052 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1054 int main(int argc, char **argv)
1056 (void)protobuf_c_message_check(NULL);
1060 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1063 print_config "libprotobuf_c" "$libprotobuf_c"
1065 ##########################################
1066 # asprintf() and vasprintf() probes
1067 if test "$have_asprintf" != "yes" ; then
1073 int main(int argc, char **argv)
1076 return asprintf(&buf, "%s", "str") == 0;
1079 if compile_prog "" "" "have_asprintf"; then
1082 print_config "asprintf()" "$have_asprintf"
1084 if test "$have_vasprintf" != "yes" ; then
1090 int main(int argc, char **argv)
1094 return vasprintf(&buf, "%s", ap) == 0;
1097 if compile_prog "" "" "have_vasprintf"; then
1098 have_vasprintf="yes"
1100 print_config "vasprintf()" "$have_vasprintf"
1102 ##########################################
1103 # Linux fallocate probe
1104 if test "$linux_fallocate" != "yes" ; then
1105 linux_fallocate="no"
1110 #include <linux/falloc.h>
1111 int main(int argc, char **argv)
1113 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1117 if compile_prog "" "" "linux_fallocate"; then
1118 linux_fallocate="yes"
1120 print_config "Linux fallocate" "$linux_fallocate"
1122 ##########################################
1123 # POSIX fadvise probe
1124 if test "$posix_fadvise" != "yes" ; then
1130 int main(int argc, char **argv)
1132 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1136 if compile_prog "" "" "posix_fadvise"; then
1139 print_config "POSIX fadvise" "$posix_fadvise"
1141 ##########################################
1142 # POSIX fallocate probe
1143 if test "$posix_fallocate" != "yes" ; then
1144 posix_fallocate="no"
1149 int main(int argc, char **argv)
1151 int r = posix_fallocate(0, 0, 1024);
1155 if compile_prog "" "" "posix_fallocate"; then
1156 posix_fallocate="yes"
1158 print_config "POSIX fallocate" "$posix_fallocate"
1160 ##########################################
1161 # sched_set/getaffinity 2 or 3 argument test
1162 if test "$linux_2arg_affinity" != "yes" ; then
1163 linux_2arg_affinity="no"
1165 if test "$linux_3arg_affinity" != "yes" ; then
1166 linux_3arg_affinity="no"
1170 int main(int argc, char **argv)
1172 cpu_set_t mask = { };
1174 return sched_setaffinity(0, sizeof(mask), &mask);
1177 if compile_prog "" "" "sched_setaffinity(,,)"; then
1178 linux_3arg_affinity="yes"
1182 int main(int argc, char **argv)
1184 cpu_set_t mask = { };
1186 return sched_setaffinity(0, &mask);
1189 if compile_prog "" "" "sched_setaffinity(,)"; then
1190 linux_2arg_affinity="yes"
1193 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1194 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1196 ##########################################
1197 # clock_gettime probe
1198 if test "$clock_gettime" != "yes" ; then
1204 int main(int argc, char **argv)
1208 return clock_gettime(0, &ts);
1211 if compile_prog "" "" "clock_gettime"; then
1213 elif compile_prog "" "-lrt" "clock_gettime"; then
1217 print_config "clock_gettime" "$clock_gettime"
1219 ##########################################
1220 # CLOCK_MONOTONIC probe
1221 if test "$clock_monotonic" != "yes" ; then
1222 clock_monotonic="no"
1224 if test "$clock_gettime" = "yes" ; then
1228 int main(int argc, char **argv)
1232 return clock_gettime(CLOCK_MONOTONIC, &ts);
1235 if compile_prog "" "$LIBS" "clock monotonic"; then
1236 clock_monotonic="yes"
1239 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1241 ##########################################
1243 if test "$clockid_t" != "yes" ; then
1249 int main(int argc, char **argv)
1251 volatile clockid_t cid;
1252 memset((void*)&cid, 0, sizeof(cid));
1256 if compile_prog "" "$LIBS" "clockid_t"; then
1259 print_config "clockid_t" "$clockid_t"
1261 ##########################################
1262 # gettimeofday() probe
1263 if test "$gettimeofday" != "yes" ; then
1267 #include <sys/time.h>
1269 int main(int argc, char **argv)
1272 return gettimeofday(&tv, NULL);
1275 if compile_prog "" "" "gettimeofday"; then
1278 print_config "gettimeofday" "$gettimeofday"
1280 ##########################################
1282 if test "$fdatasync" != "yes" ; then
1288 int main(int argc, char **argv)
1290 return fdatasync(0);
1293 if compile_prog "" "" "fdatasync"; then
1296 print_config "fdatasync" "$fdatasync"
1298 ##########################################
1300 if test "$pipe" != "yes" ; then
1305 int main(int argc, char **argv)
1311 if compile_prog "" "" "pipe"; then
1314 print_config "pipe()" "$pipe"
1316 ##########################################
1318 if test "$pipe2" != "yes" ; then
1323 int main(int argc, char **argv)
1326 return pipe2(fd, 0);
1329 if compile_prog "" "" "pipe2"; then
1332 print_config "pipe2()" "$pipe2"
1334 ##########################################
1336 if test "$pread" != "yes" ; then
1341 int main(int argc, char **argv)
1343 return pread(0, NULL, 0, 0);
1346 if compile_prog "" "" "pread"; then
1349 print_config "pread()" "$pread"
1351 ##########################################
1352 # sync_file_range() probe
1353 if test "$sync_file_range" != "yes" ; then
1354 sync_file_range="no"
1360 #include <linux/fs.h>
1361 int main(int argc, char **argv)
1363 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1364 SYNC_FILE_RANGE_WAIT_AFTER;
1365 return sync_file_range(0, 0, 0, flags);
1368 if compile_prog "" "" "sync_file_range"; then
1369 sync_file_range="yes"
1371 print_config "sync_file_range" "$sync_file_range"
1373 ##########################################
1374 # ASharedMemory_create() probe
1375 if test "$ASharedMemory_create" != "yes" ; then
1376 ASharedMemory_create="no"
1379 #include <android/sharedmem.h>
1380 int main(int argc, char **argv)
1382 return ASharedMemory_create("", 0);
1385 if compile_prog "" "" "ASharedMemory_create"; then
1386 ASharedMemory_create="yes"
1388 print_config "ASharedMemory_create" "$ASharedMemory_create"
1390 ##########################################
1391 # ext4 move extent probe
1392 if test "$ext4_me" != "yes" ; then
1397 #include <sys/ioctl.h>
1398 int main(int argc, char **argv)
1400 struct move_extent me;
1401 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1404 if compile_prog "" "" "ext4 move extent" ; then
1406 elif test $targetos = "Linux" ; then
1407 # On Linux, just default to it on and let it error at runtime if we really
1408 # don't have it. None of my updated systems have it defined, but it does
1409 # work. Takes a while to bubble back.
1412 print_config "EXT4 move extent" "$ext4_me"
1414 ##########################################
1416 if test "$linux_splice" != "yes" ; then
1422 int main(int argc, char **argv)
1424 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1427 if compile_prog "" "" "linux splice"; then
1430 print_config "Linux splice(2)" "$linux_splice"
1432 ##########################################
1434 if test "$libnuma" != "yes" ; then
1439 int main(int argc, char **argv)
1441 return numa_available();
1444 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1448 print_config "libnuma" "$libnuma"
1450 ##########################################
1451 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1452 if test "$libnuma" = "yes" ; then
1456 int main(int argc, char **argv)
1458 struct bitmask *mask = numa_parse_nodestring(NULL);
1459 return mask->size == 0;
1462 if compile_prog "" "" "libnuma api"; then
1465 print_config "libnuma v2" "$libnuma_v2"
1468 ##########################################
1470 if test "$strsep" != "yes" ; then
1475 int main(int argc, char **argv)
1477 static char *string = "This is a string";
1478 strsep(&string, "needle");
1482 if compile_prog "" "" "strsep"; then
1485 print_config "strsep" "$strsep"
1487 ##########################################
1488 # strcasestr() probe
1489 if test "$strcasestr" != "yes" ; then
1494 int main(int argc, char **argv)
1496 return strcasestr(argv[0], argv[1]) != NULL;
1499 if compile_prog "" "" "strcasestr"; then
1502 print_config "strcasestr" "$strcasestr"
1504 ##########################################
1506 if test "$strlcat" != "yes" ; then
1511 int main(int argc, char **argv)
1513 static char dst[64];
1514 static char *string = "This is a string";
1515 memset(dst, 0, sizeof(dst));
1516 strlcat(dst, string, sizeof(dst));
1520 if compile_prog "" "" "strlcat"; then
1523 print_config "strlcat" "$strlcat"
1525 ##########################################
1526 # getopt_long_only() probe
1527 if test "$getopt_long_only" != "yes" ; then
1528 getopt_long_only="no"
1534 int main(int argc, char **argv)
1536 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1540 if compile_prog "" "" "getopt_long_only"; then
1541 getopt_long_only="yes"
1543 print_config "getopt_long_only()" "$getopt_long_only"
1545 ##########################################
1547 if test "$inet_aton" != "yes" ; then
1552 #include <winsock2.h>
1554 #include <sys/socket.h>
1555 #include <arpa/inet.h>
1558 int main(int argc, char **argv)
1561 return inet_aton(NULL, &in);
1564 if compile_prog "" "" "inet_aton"; then
1567 print_config "inet_aton" "$inet_aton"
1569 ##########################################
1571 if test "$socklen_t" != "yes" ; then
1576 #include <winsock2.h>
1577 #include <ws2tcpip.h>
1579 #include <sys/socket.h>
1581 int main(int argc, char **argv)
1587 if compile_prog "" "" "socklen_t"; then
1590 print_config "socklen_t" "$socklen_t"
1592 ##########################################
1593 # Whether or not __thread is supported for TLS
1594 if test "$tls_thread" != "yes" ; then
1597 if test "$tls_check" != "no"; then
1600 static __thread int ret;
1601 int main(int argc, char **argv)
1606 if compile_prog "" "" "__thread"; then
1610 print_config "__thread" "$tls_thread"
1612 ##########################################
1613 # Check if we have required gtk/glib support for gfio
1614 if test "$gfio" != "yes" ; then
1617 if test "$gfio_check" = "yes" ; then
1621 #include <gtk/gtk.h>
1624 gdk_threads_enter();
1625 gdk_threads_leave();
1627 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1630 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1631 ORG_LDFLAGS=$LDFLAGS
1632 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1633 if test "$?" != "0" ; then
1634 echo "configure: gtk and gthread not found"
1637 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1638 if test "$?" != "0" ; then
1639 echo "configure: gtk and gthread not found"
1643 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1644 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1645 GFIO_LIBS="$LIBS $GTK_LIBS"
1646 CFLAGS="$CFLAGS $GTK_CFLAGS"
1648 echo "Please install gtk and gdk libraries"
1654 LDFLAGS=$ORG_LDFLAGS
1657 if test "$gfio_check" = "yes" ; then
1658 print_config "gtk 2.18 or higher" "$gfio"
1661 ##########################################
1662 # Check whether we have getrusage(RUSAGE_THREAD)
1663 if test "$rusage_thread" != "yes" ; then
1667 #include <sys/time.h>
1668 #include <sys/resource.h>
1669 int main(int argc, char **argv)
1672 getrusage(RUSAGE_THREAD, &ru);
1676 if compile_prog "" "" "RUSAGE_THREAD"; then
1679 print_config "RUSAGE_THREAD" "$rusage_thread"
1681 ##########################################
1682 # Check whether we have SCHED_IDLE
1683 if test "$sched_idle" != "yes" ; then
1688 int main(int argc, char **argv)
1690 struct sched_param p = { };
1692 return sched_setscheduler(0, SCHED_IDLE, &p);
1695 if compile_prog "" "" "SCHED_IDLE"; then
1698 print_config "SCHED_IDLE" "$sched_idle"
1700 ##########################################
1701 # Check whether we have TCP_NODELAY
1702 if test "$tcp_nodelay" != "yes" ; then
1707 #include <winsock2.h>
1710 #include <sys/types.h>
1711 #include <sys/socket.h>
1712 #include <netinet/tcp.h>
1714 int main(int argc, char **argv)
1716 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1719 if compile_prog "" "" "TCP_NODELAY"; then
1721 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1723 LIBS="$LIBS -lws2_32"
1725 print_config "TCP_NODELAY" "$tcp_nodelay"
1727 ##########################################
1728 # Check whether we have SO_SNDBUF
1729 if test "$window_size" != "yes" ; then
1734 #include <winsock2.h>
1737 #include <sys/types.h>
1738 #include <sys/socket.h>
1739 #include <netinet/tcp.h>
1741 int main(int argc, char **argv)
1743 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1744 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1747 if compile_prog "" "" "SO_SNDBUF"; then
1749 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1751 LIBS="$LIBS -lws2_32"
1753 print_config "Net engine window_size" "$window_size"
1755 ##########################################
1756 # Check whether we have TCP_MAXSEG
1757 if test "$mss" != "yes" ; then
1762 #include <winsock2.h>
1765 #include <sys/types.h>
1766 #include <sys/socket.h>
1767 #include <netinet/tcp.h>
1768 #include <arpa/inet.h>
1769 #include <netinet/in.h>
1771 int main(int argc, char **argv)
1773 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1776 if compile_prog "" "" "TCP_MAXSEG"; then
1778 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1780 LIBS="$LIBS -lws2_32"
1782 print_config "TCP_MAXSEG" "$mss"
1784 ##########################################
1785 # Check whether we have RLIMIT_MEMLOCK
1786 if test "$rlimit_memlock" != "yes" ; then
1790 #include <sys/time.h>
1791 #include <sys/resource.h>
1792 int main(int argc, char **argv)
1795 return getrlimit(RLIMIT_MEMLOCK, &rl);
1798 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1799 rlimit_memlock="yes"
1801 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1803 ##########################################
1804 # Check whether we have pwritev/preadv
1805 if test "$pwritev" != "yes" ; then
1810 #include <sys/uio.h>
1811 int main(int argc, char **argv)
1813 struct iovec iov[1] = { };
1815 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1818 if compile_prog "" "" "pwritev"; then
1821 print_config "pwritev/preadv" "$pwritev"
1823 ##########################################
1824 # Check whether we have pwritev2/preadv2
1825 if test "$pwritev2" != "yes" ; then
1830 #include <sys/uio.h>
1831 int main(int argc, char **argv)
1833 struct iovec iov[1] = { };
1835 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1838 if compile_prog "" "" "pwritev2"; then
1841 print_config "pwritev2/preadv2" "$pwritev2"
1843 ##########################################
1844 # Check whether we have the required functions for ipv6
1845 if test "$ipv6" != "yes" ; then
1850 #include <winsock2.h>
1851 #include <ws2tcpip.h>
1853 #include <sys/types.h>
1854 #include <sys/socket.h>
1855 #include <netinet/in.h>
1859 int main(int argc, char **argv)
1861 struct addrinfo hints = { };
1862 struct in6_addr addr = in6addr_any;
1865 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1867 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1872 if compile_prog "" "" "ipv6"; then
1875 print_config "IPv6 helpers" "$ipv6"
1877 ##########################################
1879 if test "$http" != "yes" ; then
1882 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1884 #include <curl/curl.h>
1885 #include <openssl/hmac.h>
1887 int main(int argc, char **argv)
1892 curl = curl_easy_init();
1893 curl_easy_cleanup(curl);
1895 ctx = HMAC_CTX_new();
1896 HMAC_CTX_reset(ctx);
1901 # openssl < 1.1.0 uses the HMAC_CTX type directly
1903 #include <curl/curl.h>
1904 #include <openssl/hmac.h>
1906 int main(int argc, char **argv)
1911 curl = curl_easy_init();
1912 curl_easy_cleanup(curl);
1914 HMAC_CTX_init(&ctx);
1915 HMAC_CTX_cleanup(&ctx);
1919 if test "$disable_http" != "yes"; then
1920 HTTP_LIBS="-lcurl -lssl -lcrypto"
1921 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1922 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1924 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1928 print_config "http engine" "$http"
1930 ##########################################
1932 if test "$rados" != "yes" ; then
1936 #include <rados/librados.h>
1938 int main(int argc, char **argv)
1941 rados_ioctx_t io_ctx;
1942 const char cluster_name[] = "ceph";
1943 const char user_name[] = "client.admin";
1944 const char pool[] = "rados";
1946 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1947 rados_create2(&cluster, cluster_name, user_name, 0);
1948 rados_ioctx_create(cluster, pool, &io_ctx);
1953 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1956 print_config "Rados engine" "$rados"
1958 ##########################################
1960 if test "$rbd" != "yes" ; then
1964 #include <rbd/librbd.h>
1966 int main(int argc, char **argv)
1969 rados_ioctx_t io_ctx;
1970 const char cluster_name[] = "ceph";
1971 const char user_name[] = "client.admin";
1972 const char pool[] = "rbd";
1973 int major, minor, extra;
1975 rbd_version(&major, &minor, &extra);
1976 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1977 rados_create2(&cluster, cluster_name, user_name, 0);
1978 rados_ioctx_create(cluster, pool, &io_ctx);
1983 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1986 print_config "Rados Block Device engine" "$rbd"
1988 ##########################################
1989 # check for rbd_poll
1990 if test "$rbd_poll" != "yes" ; then
1993 if test "$rbd" = "yes"; then
1995 #include <rbd/librbd.h>
1996 #include <sys/eventfd.h>
1998 int main(int argc, char **argv)
2001 rbd_completion_t comp;
2003 int fd = eventfd(0, EFD_NONBLOCK);
2004 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
2005 rbd_poll_io_events(image, comp, 1);
2010 if compile_prog "" "-lrbd -lrados" "rbd"; then
2013 print_config "rbd_poll" "$rbd_poll"
2016 ##########################################
2017 # check for rbd_invalidate_cache()
2018 if test "$rbd_inval" != "yes" ; then
2021 if test "$rbd" = "yes"; then
2023 #include <rbd/librbd.h>
2025 int main(int argc, char **argv)
2029 return rbd_invalidate_cache(image);
2032 if compile_prog "" "-lrbd -lrados" "rbd"; then
2035 print_config "rbd_invalidate_cache" "$rbd_inval"
2038 ##########################################
2039 # Check whether we have setvbuf
2040 if test "$setvbuf" != "yes" ; then
2045 int main(int argc, char **argv)
2049 setvbuf(f, buf, _IOFBF, sizeof(buf));
2053 if compile_prog "" "" "setvbuf"; then
2056 print_config "setvbuf" "$setvbuf"
2058 ##########################################
2060 if test "$gfapi" != "yes" ; then
2064 #include <glusterfs/api/glfs.h>
2066 int main(int argc, char **argv)
2068 glfs_t *g = glfs_new("foo");
2073 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2076 print_config "Gluster API engine" "$gfapi"
2078 ##########################################
2079 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2080 if test "$gfapi" = "yes" ; then
2083 #include <glusterfs/api/glfs.h>
2085 int main(int argc, char **argv)
2088 int ret = glfs_fadvise(fd, 0, 0, 1);
2093 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2096 print_config "Gluster API use fadvise" "$gf_fadvise"
2099 ##########################################
2100 # check for newer gfapi
2101 if test "$gfapi" = "yes" ; then
2104 #include <glusterfs/api/glfs.h>
2106 int main(int argc, char **argv)
2108 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2111 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2114 print_config "Gluster new API" "$gf_new"
2117 ##########################################
2118 # check for gfapi trim support
2119 if test "$gf_trim" != "yes" ; then
2122 if test "$gfapi" = "yes" ; then
2124 #include <glusterfs/api/glfs.h>
2126 int main(int argc, char **argv)
2128 return glfs_discard_async(NULL, 0, 0);
2131 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2134 print_config "Gluster API trim support" "$gf_trim"
2137 ##########################################
2138 # Check if we support stckf on s390
2139 if test "$s390_z196_facilities" != "yes" ; then
2140 s390_z196_facilities="no"
2143 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2144 int main(int argc, char **argv)
2146 /* We want just 1 double word to be returned. */
2147 register unsigned long reg0 asm("0") = 0;
2148 unsigned long stfle_bits;
2149 asm volatile(".machine push" "\n\t"
2150 ".machine \"z9-109\"" "\n\t"
2153 : "=QS" (stfle_bits), "+d" (reg0)
2156 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2162 if compile_prog "" "" "s390_z196_facilities"; then
2164 if [ $? -eq 0 ]; then
2165 s390_z196_facilities="yes"
2168 print_config "s390_z196_facilities" "$s390_z196_facilities"
2170 ##########################################
2171 # Check if we have required environment variables configured for libhdfs
2172 if test "$libhdfs" = "yes" ; then
2174 if test "$JAVA_HOME" = "" ; then
2175 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2178 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2179 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2182 if test "$FIO_LIBHDFS_LIB" = "" ; then
2183 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2186 if test "$hdfs_conf_error" = "1" ; then
2187 feature_not_found "libhdfs" ""
2190 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2191 FIO_HDFS_CPU="amd64"
2194 print_config "HDFS engine" "$libhdfs"
2196 ##########################################
2197 # Check whether we have MTD
2198 if test "$mtd" != "yes" ; then
2203 #include <mtd/mtd-user.h>
2204 #include <sys/ioctl.h>
2205 int main(int argc, char **argv)
2207 struct mtd_write_req ops;
2208 struct mtd_info_user info;
2209 memset(&ops, 0, sizeof(ops));
2210 info.type = MTD_MLCNANDFLASH;
2211 return ioctl(0, MEMGETINFO, &info);
2214 if compile_prog "" "" "mtd"; then
2217 print_config "MTD" "$mtd"
2219 ##########################################
2220 # Check whether we have libpmem
2221 if test "$libpmem" != "yes" ; then
2225 #include <libpmem.h>
2227 int main(int argc, char **argv)
2229 return pmem_is_pmem(NULL, 0);
2232 if compile_prog "" "-lpmem" "libpmem"; then
2235 print_config "libpmem" "$libpmem"
2237 ##########################################
2238 # Check whether libpmem's version >= 1.5
2239 if test "$libpmem1_5" != "yes" ; then
2242 if test "$libpmem" = "yes"; then
2244 #include <libpmem.h>
2246 int main(int argc, char **argv)
2248 pmem_memcpy(NULL, NULL, 0, 0);
2252 if compile_prog "" "-lpmem" "libpmem1_5"; then
2256 print_config "libpmem1_5" "$libpmem1_5"
2258 ##########################################
2259 # Check whether we have libpmem2
2260 if test "$libpmem2" != "yes" ; then
2264 #include <libpmem2.h>
2265 int main(int argc, char **argv)
2267 struct pmem2_config *cfg;
2268 pmem2_config_new(&cfg);
2269 pmem2_config_delete(&cfg);
2273 if compile_prog "" "-lpmem2" "libpmem2"; then
2276 print_config "libpmem2" "$libpmem2"
2278 # Choose libpmem-based ioengines
2279 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2281 if test "$libpmem1_5" = "yes"; then
2286 ##########################################
2287 # Report whether dev-dax engine is enabled
2288 print_config "PMDK dev-dax engine" "$devdax"
2290 ##########################################
2291 # Report whether libpmem engine is enabled
2292 print_config "PMDK libpmem engine" "$pmem"
2294 ##########################################
2295 # Check whether we support DDN's IME
2296 if test "$libime" != "yes" ; then
2300 #include <ime_native.h>
2301 int main(int argc, char **argv)
2305 rc = ime_native_finalize();
2309 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2311 CFLAGS="-I${ime_path}/include $CFLAGS"
2312 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2313 LIBS="-lim_client $LIBS"
2315 print_config "DDN's Infinite Memory Engine" "$libime"
2317 ##########################################
2318 # Check if we have libiscsi
2319 if test "$libiscsi" != "no" ; then
2320 if check_min_lib_version libiscsi 1.9.0; then
2322 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2323 libiscsi_libs=$(pkg-config --libs libiscsi)
2328 print_config "iscsi engine" "$libiscsi"
2330 ##########################################
2331 # Check if we have libnbd (for NBD support)
2332 if test "$libnbd" != "no" ; then
2333 if check_min_lib_version libnbd 0.9.8; then
2335 libnbd_cflags=$(pkg-config --cflags libnbd)
2336 libnbd_libs=$(pkg-config --libs libnbd)
2341 print_config "NBD engine" "$libnbd"
2343 ##########################################
2344 # check for dfs (DAOS File System)
2345 if test "$dfs" != "no" ; then
2349 #include <daos_fs.h>
2351 int main(int argc, char **argv)
2357 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2362 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2368 print_config "DAOS File System (dfs) Engine" "$dfs"
2370 ##########################################
2371 # Check if we have libnfs (for userspace nfs support).
2372 if test "$libnfs" != "no" ; then
2373 if $(pkg-config libnfs > /dev/null 2>&1); then
2375 libnfs_cflags=$(pkg-config --cflags libnfs)
2376 libnfs_libs=$(pkg-config --libs libnfs)
2378 if test "$libnfs" = "yes" ; then
2379 feature_not_found "libnfs" "libnfs"
2384 print_config "NFS engine" "$libnfs"
2386 ##########################################
2387 # Check if we have lex/yacc available
2392 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2393 if test "$targetos" != "SunOS" ; then
2403 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2407 if test "$arith" = "yes" ; then
2409 extern int yywrap(void);
2411 int main(int argc, char **argv)
2417 if compile_prog "" "-lfl" "flex"; then
2419 elif compile_prog "" "-ll" "lex"; then
2428 # Check if lex fails using -o
2429 if test "$arith" = "yes" ; then
2430 if test "$force_no_lex_o" = "yes" ; then
2433 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2441 print_config "lex/yacc for arithmetic" "$arith"
2443 ##########################################
2444 # Check whether we have setmntent/getmntent
2445 if test "$getmntent" != "yes" ; then
2451 int main(int argc, char **argv)
2453 FILE *mtab = setmntent(NULL, "r");
2454 struct mntent *mnt = getmntent(mtab);
2459 if compile_prog "" "" "getmntent"; then
2462 print_config "getmntent" "$getmntent"
2464 ##########################################
2465 # Check whether we have getmntinfo
2466 # These are originally added for BSDs, but may also work
2467 # on other operating systems with getmntinfo(3).
2469 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2470 # Note that NetBSD needs -Werror to catch warning as error.
2471 if test "$getmntinfo" != "yes" ; then
2476 #include <sys/param.h>
2477 #include <sys/mount.h>
2478 int main(int argc, char **argv)
2481 return getmntinfo(&st, MNT_NOWAIT);
2484 if compile_prog "-Werror" "" "getmntinfo"; then
2487 print_config "getmntinfo" "$getmntinfo"
2489 # getmntinfo(3) for NetBSD.
2490 if test "$getmntinfo_statvfs" != "yes" ; then
2491 getmntinfo_statvfs="no"
2495 #include <sys/statvfs.h>
2496 int main(int argc, char **argv)
2499 return getmntinfo(&st, MNT_NOWAIT);
2502 # Skip the test if the one with statfs arg is detected.
2503 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2504 getmntinfo_statvfs="yes"
2505 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2508 ##########################################
2509 # Check whether we have _Static_assert
2510 if test "$static_assert" != "yes" ; then
2522 int main(int argc, char **argv)
2524 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2528 if compile_prog "" "" "static_assert"; then
2531 print_config "Static Assert" "$static_assert"
2533 ##########################################
2534 # Check whether we have bool / stdbool.h
2535 if test "$have_bool" != "yes" ; then
2539 #include <stdbool.h>
2540 int main(int argc, char **argv)
2543 return var != false;
2546 if compile_prog "" "" "bool"; then
2549 print_config "bool" "$have_bool"
2551 ##########################################
2552 # Check whether we have strndup()
2557 int main(int argc, char **argv)
2559 char *res = strndup("test string", 8);
2565 if compile_prog "" "" "strndup"; then
2568 print_config "strndup" "$strndup"
2570 ##########################################
2571 # <valgrind/drd.h> probe
2572 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2573 # also available but not the other way around.
2574 if test "$valgrind_dev" != "yes" ; then
2578 #include <valgrind/drd.h>
2579 int main(int argc, char **argv)
2584 if compile_prog "" "" "valgrind_dev"; then
2587 print_config "Valgrind headers" "$valgrind_dev"
2589 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2590 ##########################################
2591 # <linux/blkzoned.h> probe
2592 if test "$linux_blkzoned" != "yes" ; then
2596 #include <linux/blkzoned.h>
2597 int main(int argc, char **argv)
2602 if compile_prog "" "" "linux_blkzoned"; then
2603 linux_blkzoned="yes"
2605 print_config "Zoned block device support" "$linux_blkzoned"
2607 ##########################################
2608 # Check BLK_ZONE_REP_CAPACITY
2610 #include <linux/blkzoned.h>
2613 return BLK_ZONE_REP_CAPACITY;
2616 if compile_prog "" "" "blkzoned report capacity"; then
2617 output_sym "CONFIG_HAVE_REP_CAPACITY"
2622 print_config "Zoned block device capacity" "$rep_capacity"
2625 ##########################################
2628 #include <libzbc/zbc.h>
2629 int main(int argc, char **argv)
2631 struct zbc_device *dev = NULL;
2633 return zbc_open("foo=bar", O_RDONLY, &dev);
2636 if test "$libzbc" != "no" ; then
2637 if [ -e /usr/include/libzbc/libzbc ]; then
2639 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2641 if compile_prog "" "-lzbc" "libzbc"; then
2643 if ! check_min_lib_version libzbc 5; then
2647 if test "$libzbc" = "yes" ; then
2648 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2653 print_config "libzbc engine" "$libzbc"
2655 if test "$targetos" = "Linux" ; then
2656 ##########################################
2657 # Check NVME_URING_CMD support
2659 #include <linux/nvme_ioctl.h>
2662 return sizeof(struct nvme_uring_cmd);
2665 if compile_prog "" "" "nvme uring cmd"; then
2666 output_sym "CONFIG_NVME_URING_CMD"
2667 nvme_uring_cmd="yes"
2671 print_config "NVMe uring command support" "$nvme_uring_cmd"
2674 ##########################################
2675 # Check if we have xnvme
2676 if test "$xnvme" != "no" ; then
2677 if check_min_lib_version xnvme 0.7.0; then
2679 xnvme_cflags=$(pkg-config --cflags xnvme)
2680 xnvme_libs=$(pkg-config --libs xnvme)
2685 print_config "xnvme engine" "$xnvme"
2687 ##########################################
2688 # Check if we have libblkio
2689 if test "$libblkio" != "no" ; then
2690 if check_min_lib_version blkio 1.0.0; then
2692 libblkio_cflags=$(pkg-config --cflags blkio)
2693 libblkio_libs=$(pkg-config --libs blkio)
2695 if test "$libblkio" = "yes" ; then
2696 feature_not_found "libblkio" "libblkio-dev or libblkio-devel"
2701 print_config "libblkio engine" "$libblkio"
2703 ##########################################
2704 # check march=armv8-a+crc+crypto
2705 march_armv8_a_crc_crypto="no"
2706 if test "$cpu" = "arm64" ; then
2709 #include <arm_acle.h>
2710 #include <arm_neon.h>
2711 #include <sys/auxv.h>
2716 /* Can we also do a runtime probe? */
2718 return getauxval(AT_HWCAP);
2719 #elif defined(__APPLE__)
2722 # error "Don't know how to do runtime probe for ARM CRC32c"
2726 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2727 march_armv8_a_crc_crypto="yes"
2728 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2732 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2734 ##########################################
2736 if test "$cuda" != "no" ; then
2739 int main(int argc, char **argv)
2744 if compile_prog "" "-lcuda" "cuda"; then
2748 if test "$cuda" = "yes" ; then
2749 feature_not_found "cuda" ""
2754 print_config "cuda" "$cuda"
2756 ##########################################
2758 if test "$libcufile" != "no" ; then
2762 int main(int argc, char* argv[]) {
2767 if compile_prog "" "-lcuda -lcudart -lcufile -ldl" "libcufile"; then
2769 LIBS="-lcuda -lcudart -lcufile -ldl $LIBS"
2771 if test "$libcufile" = "yes" ; then
2772 feature_not_found "libcufile" ""
2777 print_config "libcufile" "$libcufile"
2779 ##########################################
2780 # check for cc -march=native
2783 int main(int argc, char **argv)
2788 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2789 compile_prog "-march=native" "" "march=native"; then
2792 print_config "Build march=native" "$build_native"
2794 ##########################################
2796 if test "$cunit" != "yes" ; then
2800 #include <CUnit/CUnit.h>
2801 #include <CUnit/Basic.h>
2804 if (CU_initialize_registry() != CUE_SUCCESS)
2805 return CU_get_error();
2806 CU_basic_set_mode(CU_BRM_VERBOSE);
2807 CU_basic_run_tests();
2808 CU_cleanup_registry();
2809 return CU_get_error();
2812 if compile_prog "" "-lcunit" "CUnit"; then
2815 print_config "CUnit" "$cunit"
2817 ##########################################
2818 # check for __kernel_rwf_t
2821 #include <linux/fs.h>
2822 int main(int argc, char **argv)
2829 if compile_prog "" "" "__kernel_rwf_t"; then
2830 __kernel_rwf_t="yes"
2832 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2834 ##########################################
2835 # check if gcc has -Wimplicit-fallthrough=2
2838 int main(int argc, char **argv)
2843 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2846 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2848 ##########################################
2849 # check if the compiler has -Wno-stringop-concatenation
2854 int main(int argc, char **argv)
2856 return printf("%s\n", argv[0]);
2859 if compile_prog "-Wno-stringop-truncation -Werror" "" "no_stringop"; then
2862 print_config "-Wno-stringop-truncation" "$no_stringop"
2864 ##########################################
2865 # check for MADV_HUGEPAGE support
2866 if test "$thp" != "yes" ; then
2869 if test "$esx" != "yes" ; then
2871 #include <sys/mman.h>
2874 return madvise(0, 0x1000, MADV_HUGEPAGE);
2877 if compile_prog "" "" "thp" ; then
2880 if test "$thp" = "yes" ; then
2881 feature_not_found "Transparent Huge Page" ""
2886 print_config "MADV_HUGEPAGE" "$thp"
2888 ##########################################
2889 # check for gettid()
2893 int main(int argc, char **argv)
2898 if compile_prog "" "" "gettid"; then
2901 print_config "gettid" "$gettid"
2903 ##########################################
2904 # check for statx(2) support by libc
2908 #include <sys/stat.h>
2910 int main(int argc, char **argv)
2913 return statx(-1, *argv, 0, 0, &st);
2916 if compile_prog "" "" "statx"; then
2919 print_config "statx(2)/libc" "$statx"
2921 ##########################################
2922 # check for statx(2) support by kernel
2926 #include <linux/stat.h>
2927 #include <sys/stat.h>
2928 #include <sys/syscall.h>
2930 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2931 struct statx *buffer)
2933 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2936 int main(int argc, char **argv)
2939 return _statx(-1, *argv, 0, 0, &st);
2942 if compile_prog "" "" "statx_syscall"; then
2945 print_config "statx(2)/syscall" "$statx_syscall"
2947 ##########################################
2948 # check for Windows PDB generation support
2949 if test "pdb" != "no" ; then
2956 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2959 if test "$pdb" = "yes"; then
2960 feature_not_found "PDB" "clang and lld"
2967 print_config "Windows PDB generation" "$pdb"
2969 ##########################################
2970 # check for timerfd support
2972 if test "$esx" != "yes" ; then
2974 #include <sys/time.h>
2975 #include <sys/timerfd.h>
2977 int main(int argc, char **argv)
2979 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2982 if compile_prog "" "" "timerfd_create"; then
2983 timerfd_create="yes"
2986 print_config "timerfd_create" "$timerfd_create"
2988 #############################################################################
2990 if test "$wordsize" = "64" ; then
2991 output_sym "CONFIG_64BIT"
2992 elif test "$wordsize" = "32" ; then
2993 output_sym "CONFIG_32BIT"
2995 fatal "Unknown wordsize!"
2997 if test "$bigendian" = "yes" ; then
2998 output_sym "CONFIG_BIG_ENDIAN"
3000 output_sym "CONFIG_LITTLE_ENDIAN"
3002 if test "$zlib" = "yes" ; then
3003 output_sym "CONFIG_ZLIB"
3005 if test "$libaio" = "yes" ; then
3006 output_sym "CONFIG_LIBAIO"
3007 if test "$libaio_rw_flags" = "yes" ; then
3008 output_sym "CONFIG_LIBAIO_RW_FLAGS"
3011 if test "$posix_aio" = "yes" ; then
3012 output_sym "CONFIG_POSIXAIO"
3014 if test "$posix_aio_fsync" = "yes" ; then
3015 output_sym "CONFIG_POSIXAIO_FSYNC"
3017 if test "$posix_pshared" = "yes" ; then
3018 output_sym "CONFIG_PSHARED"
3020 if test "$pthread_condattr_setclock" = "yes" ; then
3021 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
3023 if test "$pthread_sigmask" = "yes" ; then
3024 output_sym "CONFIG_PTHREAD_SIGMASK"
3026 if test "$pthread_getaffinity" = "yes" ; then
3027 output_sym "CONFIG_PTHREAD_GETAFFINITY"
3029 if test "$have_asprintf" = "yes" ; then
3030 output_sym "CONFIG_HAVE_ASPRINTF"
3032 if test "$have_vasprintf" = "yes" ; then
3033 output_sym "CONFIG_HAVE_VASPRINTF"
3035 if test "$linux_fallocate" = "yes" ; then
3036 output_sym "CONFIG_LINUX_FALLOCATE"
3038 if test "$posix_fallocate" = "yes" ; then
3039 output_sym "CONFIG_POSIX_FALLOCATE"
3041 if test "$fdatasync" = "yes" ; then
3042 output_sym "CONFIG_FDATASYNC"
3044 if test "$pipe" = "yes" ; then
3045 output_sym "CONFIG_PIPE"
3047 if test "$pipe2" = "yes" ; then
3048 output_sym "CONFIG_PIPE2"
3050 if test "$pread" = "yes" ; then
3051 output_sym "CONFIG_PREAD"
3053 if test "$sync_file_range" = "yes" ; then
3054 output_sym "CONFIG_SYNC_FILE_RANGE"
3056 if test "$ASharedMemory_create" = "yes" ; then
3057 output_sym "CONFIG_ASHAREDMEMORY_CREATE"
3059 if test "$sfaa" = "yes" ; then
3060 output_sym "CONFIG_SFAA"
3062 if test "$sync_sync" = "yes" ; then
3063 output_sym "CONFIG_SYNC_SYNC"
3065 if test "$cmp_swap" = "yes" ; then
3066 output_sym "CONFIG_CMP_SWAP"
3068 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3069 output_sym "CONFIG_RDMA"
3071 # librpma is supported on the 'x86_64' architecture for now
3072 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3073 -a "$librpma" = "yes" \
3074 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3075 output_sym "CONFIG_LIBRPMA_APM"
3077 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3078 -a "$librpma" = "yes" -a "$libprotobuf_c" = "yes" \
3079 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3080 output_sym "CONFIG_LIBRPMA_GPSPM"
3082 if test "$clock_gettime" = "yes" ; then
3083 output_sym "CONFIG_CLOCK_GETTIME"
3085 if test "$clock_monotonic" = "yes" ; then
3086 output_sym "CONFIG_CLOCK_MONOTONIC"
3088 if test "$clockid_t" = "yes"; then
3089 output_sym "CONFIG_CLOCKID_T"
3091 if test "$gettimeofday" = "yes" ; then
3092 output_sym "CONFIG_GETTIMEOFDAY"
3094 if test "$posix_fadvise" = "yes" ; then
3095 output_sym "CONFIG_POSIX_FADVISE"
3097 if test "$linux_3arg_affinity" = "yes" ; then
3098 output_sym "CONFIG_3ARG_AFFINITY"
3099 elif test "$linux_2arg_affinity" = "yes" ; then
3100 output_sym "CONFIG_2ARG_AFFINITY"
3102 if test "$strsep" = "yes" ; then
3103 output_sym "CONFIG_STRSEP"
3105 if test "$strcasestr" = "yes" ; then
3106 output_sym "CONFIG_STRCASESTR"
3108 if test "$strlcat" = "yes" ; then
3109 output_sym "CONFIG_STRLCAT"
3111 if test "$getopt_long_only" = "yes" ; then
3112 output_sym "CONFIG_GETOPT_LONG_ONLY"
3114 if test "$inet_aton" = "yes" ; then
3115 output_sym "CONFIG_INET_ATON"
3117 if test "$socklen_t" = "yes" ; then
3118 output_sym "CONFIG_SOCKLEN_T"
3120 if test "$ext4_me" = "yes" ; then
3121 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3123 if test "$linux_splice" = "yes" ; then
3124 output_sym "CONFIG_LINUX_SPLICE"
3126 if test "$libnuma_v2" = "yes" ; then
3127 output_sym "CONFIG_LIBNUMA"
3129 if test "$solaris_aio" = "yes" ; then
3130 output_sym "CONFIG_SOLARISAIO"
3132 if test "$tls_thread" = "yes" ; then
3133 output_sym "CONFIG_TLS_THREAD"
3135 if test "$rusage_thread" = "yes" ; then
3136 output_sym "CONFIG_RUSAGE_THREAD"
3138 if test "$gfio" = "yes" ; then
3139 output_sym "CONFIG_GFIO"
3141 if test "$esx" = "yes" ; then
3142 output_sym "CONFIG_ESX"
3143 output_sym "CONFIG_NO_SHM"
3145 if test "$sched_idle" = "yes" ; then
3146 output_sym "CONFIG_SCHED_IDLE"
3148 if test "$tcp_nodelay" = "yes" ; then
3149 output_sym "CONFIG_TCP_NODELAY"
3151 if test "$window_size" = "yes" ; then
3152 output_sym "CONFIG_NET_WINDOWSIZE"
3154 if test "$mss" = "yes" ; then
3155 output_sym "CONFIG_NET_MSS"
3157 if test "$rlimit_memlock" = "yes" ; then
3158 output_sym "CONFIG_RLIMIT_MEMLOCK"
3160 if test "$pwritev" = "yes" ; then
3161 output_sym "CONFIG_PWRITEV"
3163 if test "$pwritev2" = "yes" ; then
3164 output_sym "CONFIG_PWRITEV2"
3166 if test "$ipv6" = "yes" ; then
3167 output_sym "CONFIG_IPV6"
3169 if test "$http" = "yes" ; then
3170 output_sym "CONFIG_HTTP"
3172 if test "$rados" = "yes" ; then
3173 output_sym "CONFIG_RADOS"
3175 if test "$rbd" = "yes" ; then
3176 output_sym "CONFIG_RBD"
3178 if test "$rbd_poll" = "yes" ; then
3179 output_sym "CONFIG_RBD_POLL"
3181 if test "$rbd_inval" = "yes" ; then
3182 output_sym "CONFIG_RBD_INVAL"
3184 if test "$setvbuf" = "yes" ; then
3185 output_sym "CONFIG_SETVBUF"
3187 if test "$s390_z196_facilities" = "yes" ; then
3188 output_sym "CONFIG_S390_Z196_FACILITIES"
3189 CFLAGS="$CFLAGS -march=z9-109"
3192 if test "$gfapi" = "yes" ; then
3193 output_sym "CONFIG_GFAPI"
3195 if test "$gf_fadvise" = "yes" ; then
3196 output_sym "CONFIG_GF_FADVISE"
3198 if test "$gf_trim" = "yes" ; then
3199 output_sym "CONFIG_GF_TRIM"
3201 if test "$gf_new" = "yes" ; then
3202 output_sym "CONFIG_GF_NEW_API"
3204 if test "$libhdfs" = "yes" ; then
3205 output_sym "CONFIG_LIBHDFS"
3206 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3207 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3208 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3209 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3211 if test "$mtd" = "yes" ; then
3212 output_sym "CONFIG_MTD"
3214 if test "$devdax" = "yes" ; then
3215 output_sym "CONFIG_LINUX_DEVDAX"
3217 if test "$pmem" = "yes" ; then
3218 output_sym "CONFIG_LIBPMEM"
3220 if test "$libpmem2" = "yes" ; then
3221 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3223 if test "$libime" = "yes" ; then
3224 output_sym "CONFIG_IME"
3226 if test "$arith" = "yes" ; then
3227 output_sym "CONFIG_ARITHMETIC"
3228 if test "$yacc_is_bison" = "yes" ; then
3229 echo "YACC=bison -y" >> $config_host_mak
3231 echo "YACC=yacc" >> $config_host_mak
3233 if test "$lex_use_o" = "yes" ; then
3234 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3237 if test "$getmntent" = "yes" ; then
3238 output_sym "CONFIG_GETMNTENT"
3240 if test "$getmntinfo" = "yes" ; then
3241 output_sym "CONFIG_GETMNTINFO"
3243 if test "$getmntinfo_statvfs" = "yes" ; then
3244 output_sym "CONFIG_GETMNTINFO_STATVFS"
3246 if test "$static_assert" = "yes" ; then
3247 output_sym "CONFIG_STATIC_ASSERT"
3249 if test "$have_bool" = "yes" ; then
3250 output_sym "CONFIG_HAVE_BOOL"
3252 if test "$strndup" = "yes" ; then
3253 output_sym "CONFIG_HAVE_STRNDUP"
3255 if test "$disable_opt" = "yes" ; then
3256 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3258 if test "$valgrind_dev" = "yes"; then
3259 output_sym "CONFIG_VALGRIND_DEV"
3261 if test "$linux_blkzoned" = "yes" ; then
3262 output_sym "CONFIG_HAS_BLKZONED"
3264 if test "$libzbc" = "yes" ; then
3265 output_sym "CONFIG_LIBZBC"
3267 if test "$zlib" = "no" ; then
3268 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3269 if test "$build_static" = "yes"; then
3270 echo "Note that some distros have separate packages for static libraries."
3273 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3274 output_sym "ARCH_HAVE_CRC_CRYPTO"
3276 if test "$cuda" = "yes" ; then
3277 output_sym "CONFIG_CUDA"
3279 if test "$libcufile" = "yes" ; then
3280 output_sym "CONFIG_LIBCUFILE"
3282 if test "$dfs" = "yes" ; then
3283 output_sym "CONFIG_DFS"
3285 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3286 output_sym "CONFIG_BUILD_NATIVE"
3288 if test "$cunit" = "yes" ; then
3289 output_sym "CONFIG_HAVE_CUNIT"
3291 if test "$__kernel_rwf_t" = "yes"; then
3292 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3294 if test "$gettid" = "yes"; then
3295 output_sym "CONFIG_HAVE_GETTID"
3297 if test "$statx" = "yes"; then
3298 output_sym "CONFIG_HAVE_STATX"
3300 if test "$statx_syscall" = "yes"; then
3301 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3303 if test "$timerfd_create" = "yes"; then
3304 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3306 if test "$fallthrough" = "yes"; then
3307 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3309 if test "$no_stringop" = "yes"; then
3310 output_sym "CONFIG_HAVE_NO_STRINGOP"
3312 if test "$thp" = "yes" ; then
3313 output_sym "CONFIG_HAVE_THP"
3315 if test "$libiscsi" = "yes" ; then
3316 output_sym "CONFIG_LIBISCSI"
3317 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3318 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3319 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3321 if test "$libnbd" = "yes" ; then
3322 output_sym "CONFIG_LIBNBD"
3323 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3324 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3325 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3327 if test "$libnfs" = "yes" ; then
3328 output_sym "CONFIG_LIBNFS"
3329 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3330 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3332 if test "$xnvme" = "yes" ; then
3333 output_sym "CONFIG_LIBXNVME"
3334 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3335 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3337 if test "$libblkio" = "yes" ; then
3338 output_sym "CONFIG_LIBBLKIO"
3339 echo "LIBBLKIO_CFLAGS=$libblkio_cflags" >> $config_host_mak
3340 echo "LIBBLKIO_LIBS=$libblkio_libs" >> $config_host_mak
3342 if test "$dynamic_engines" = "yes" ; then
3343 output_sym "CONFIG_DYNAMIC_ENGINES"
3345 if test "$pdb" = yes; then
3346 output_sym "CONFIG_PDB"
3348 if test "$fcntl_sync" = "yes" ; then
3349 output_sym "CONFIG_FCNTL_SYNC"
3351 if test "$asan" = "yes"; then
3352 CFLAGS="$CFLAGS -fsanitize=address"
3353 LDFLAGS="$LDFLAGS -fsanitize=address"
3355 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3357 int main(int argc, char **argv)
3362 if test "$disable_tcmalloc" != "yes"; then
3363 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3365 LIBS="-ltcmalloc $LIBS"
3366 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3368 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3373 print_config "TCMalloc support" "$tcmalloc"
3374 if ! num "$seed_buckets"; then
3376 elif test "$seed_buckets" -lt 2; then
3378 elif test "$seed_buckets" -gt 16; then
3381 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3382 print_config "seed_buckets" "$seed_buckets"
3384 echo "LIBS+=$LIBS" >> $config_host_mak
3385 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3386 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3387 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3388 echo "CC=$cc" >> $config_host_mak
3389 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3390 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3392 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3393 cat > Makefile <<EOF
3394 SRCDIR:=`dirname $0`
3395 include \$(SRCDIR)/Makefile