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 --enable-xnvme) xnvme="yes"
246 --disable-tcmalloc) disable_tcmalloc="yes"
248 --disable-nfs) disable_nfs="yes"
250 --dynamic-libengines) dynamic_engines="yes"
252 --disable-dfs) dfs="no"
254 --enable-asan) asan="yes"
260 echo "Bad option $opt"
266 if test "$show_help" = "yes" ; then
267 echo "--prefix= Use this directory as installation prefix"
268 echo "--cpu= Specify target CPU if auto-detect fails"
269 echo "--cc= Specify compiler to use"
270 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
271 echo "--build-32bit-win Enable 32-bit build on Windows"
272 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
273 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
274 echo "--build-static Build a static fio"
275 echo "--esx Configure build options for esx"
276 echo "--enable-gfio Enable building of gtk gfio"
277 echo "--disable-numa Disable libnuma even if found"
278 echo "--disable-rdma Disable RDMA support even if found"
279 echo "--disable-rados Disable Rados support even if found"
280 echo "--disable-rbd Disable Rados Block Device even if found"
281 echo "--disable-http Disable HTTP support even if found"
282 echo "--disable-nfs Disable userspace NFS support even if found"
283 echo "--disable-gfapi Disable gfapi"
284 echo "--enable-libhdfs Enable hdfs support"
285 echo "--enable-libnfs Enable nfs support"
286 echo "--disable-lex Disable use of lex/yacc for math"
287 echo "--disable-pmem Disable pmem based engines even if found"
288 echo "--enable-lex Enable use of lex/yacc for math"
289 echo "--disable-shm Disable SHM support"
290 echo "--disable-optimizations Don't enable compiler optimizations"
291 echo "--enable-cuda Enable GPUDirect RDMA support"
292 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
293 echo "--disable-native Don't build for native host"
294 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
295 echo "--enable-libiscsi Enable iscsi support"
296 echo "--enable-libnbd Enable libnbd (NBD engine) support"
297 echo "--enable-xnvme Enable xnvme support"
298 echo "--disable-libzbc Disable libzbc even if found"
299 echo "--disable-tcmalloc Disable tcmalloc support"
300 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
301 echo "--disable-dfs Disable DAOS File System support even if found"
302 echo "--enable-asan Enable address sanitizer"
306 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
307 # Preferred compiler (can be overriden later after we know the platform):
309 # ${cross_prefix}gcc (if cross-prefix specified)
312 if test -z "${CC}${cross_prefix}"; then
319 cc="${CC-${cross_prefix}gcc}"
322 if check_define __ANDROID__ ; then
324 elif check_define __linux__ ; then
326 elif check_define __OpenBSD__ ; then
328 elif check_define __NetBSD__ ; then
330 elif check_define __sun__ ; then
332 CFLAGS="$CFLAGS -D_REENTRANT"
333 elif check_define _WIN32 ; then
339 echo "# Automatically generated by configure - do not modify" > $config_host_mak
340 printf "# Configured with:" >> $config_host_mak
341 printf " '%s'" "$0" "$@" >> $config_host_mak
342 echo >> $config_host_mak
343 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
345 if test "$no_shm" = "yes" ; then
346 output_sym "CONFIG_NO_SHM"
349 if test "$disable_opt" = "yes" ; then
350 output_sym "CONFIG_FIO_NO_OPT"
353 # Some host OSes need non-standard checks for which CPU to use.
354 # Note that these checks are broken for cross-compilation: if you're
355 # cross-compiling to one of these OSes then you'll need to specify
356 # the correct CPU with the --cpu option.
359 # Unless explicitly enabled, turn off lex.
360 # OpenBSD will hit syntax error when enabled.
361 if test -z "$disable_lex" ; then
368 CFLAGS="$CFLAGS -I/usr/local/include"
369 LDFLAGS="$LDFLAGS -L/usr/local/lib"
372 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
373 # we can run 64-bit userspace code.
374 # If the user didn't specify a CPU explicitly and the kernel says this is
375 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
377 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
380 # Avoid configure feature detection of features provided by weak symbols
387 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
388 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
392 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
393 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
396 LIBS="-lnsl -lsocket"
399 # We still force some options, so keep this message here.
400 echo "Forcing some known good options on Windows"
401 if test -z "${CC}${cross_prefix}"; then
402 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
403 cc="i686-w64-mingw32-gcc"
405 cc="x86_64-w64-mingw32-gcc"
409 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
410 if test -z "$target_win_ver"; then
411 # Default Windows API target
414 if test "$target_win_ver" = "7"; then
415 output_sym "CONFIG_WINDOWS_7"
416 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
418 fatal "Unknown target Windows version"
421 # We need this to be output_sym'd here because this is Windows specific.
422 # The regular configure path never sets this config.
423 output_sym "CONFIG_WINDOWSAIO"
424 # We now take the regular configuration path without having exit 0 here.
425 # Flags below are still necessary mostly for MinGW.
429 clock_gettime="yes" # clock_monotonic probe has dependency on this
430 clock_monotonic="yes"
432 pthread_condattr_setclock="no"
433 pthread_affinity="no"
437 # Now we know the target platform we can have another guess at the preferred
438 # compiler when it wasn't explictly set
439 if test -z "${CC}${cross_prefix}"; then
440 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
446 if test -z "$cc"; then
447 echo "configure: failed to find compiler"
451 if test ! -z "$cpu" ; then
452 # command line argument
454 elif check_define __i386__ ; then
456 elif check_define __x86_64__ ; then
458 elif check_define __sparc__ ; then
459 if check_define __arch64__ ; then
464 elif check_define _ARCH_PPC ; then
465 if check_define _ARCH_PPC64 ; then
470 elif check_define __mips__ ; then
472 elif check_define __ia64__ ; then
474 elif check_define __s390__ ; then
475 if check_define __s390x__ ; then
480 elif check_define __arm__ ; then
482 elif check_define __aarch64__ ; then
484 elif check_define __hppa__ ; then
490 # Normalise host CPU name and set ARCH.
492 ia64|ppc|ppc64|s390|s390x|sparc64)
495 i386|i486|i586|i686|i86pc|BePC)
507 hppa|parisc|parisc64)
521 ##########################################
522 # check cross compile
524 if test "$cross_compile" != "yes" ; then
533 if compile_prog "" "" "cross"; then
534 $TMPE 2>/dev/null || cross_compile="yes"
536 fatal "compile test failed"
539 ##########################################
541 if test "$bigendian" != "yes" ; then
544 if test "$cross_compile" = "no" ; then
546 #include <inttypes.h>
549 volatile uint32_t i=0x01234567;
550 return (*((uint8_t*)(&i))) == 0x67;
553 if compile_prog "" "" "endian"; then
554 $TMPE && bigendian="yes"
557 # If we're cross compiling, try our best to work it out and rely on the
558 # run-time check to fail if we get it wrong.
563 #if __BYTE_ORDER != __BIG_ENDIAN
564 # error "Unknown endianness"
568 compile_prog "" "" "endian" && bigendian="yes"
569 check_define "__ARMEB__" && bigendian="yes"
570 check_define "__MIPSEB__" && bigendian="yes"
574 print_config "Operating system" "$targetos"
575 print_config "CPU" "$cpu"
576 print_config "Big endian" "$bigendian"
577 if test ! -z "$target_win_ver"; then
578 print_config "Target Windows version" "$target_win_ver"
580 print_config "Compiler" "$cc"
581 print_config "Cross compile" "$cross_compile"
584 ##########################################
585 # See if we need to build a static build
586 if test "$build_static" = "yes" ; then
587 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
588 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
592 print_config "Static build" "$build_static"
594 ##########################################
595 # check for C11 atomics support
597 #include <stdatomic.h>
605 if ! compile_prog "" "" "C11 atomics"; then
607 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
608 echo "minimum versions with it - perhaps your compiler is too old?"
609 fatal "C11 atomics support not found"
613 ##########################################
618 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
621 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
625 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
627 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
630 fatal "Unknown wordsize"
632 print_config "Wordsize" "$wordsize"
634 ##########################################
636 if test "$zlib" != "yes" ; then
644 if (inflateInit(&stream) != Z_OK)
649 if compile_prog "" "-lz" "zlib" ; then
653 print_config "zlib" "$zlib"
655 ##########################################
656 # fcntl(F_FULLFSYNC) support
657 if test "$fcntl_sync" != "yes" ; then
664 int main(int argc, char **argv)
666 return fcntl(0, F_FULLFSYNC);
669 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
672 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
674 ##########################################
676 if test "$libaio" != "yes" ; then
679 if test "$esx" != "yes" ; then
689 if compile_prog "" "-laio" "libaio" ; then
692 if test "$libaio" = "yes" ; then
693 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
703 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
704 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
708 if compile_prog "" "" "libaio rw flags" ; then
714 print_config "Linux AIO support" "$libaio"
715 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
717 ##########################################
719 if test "$posix_aio" != "yes" ; then
722 if test "$posix_aio_lrt" != "yes" ; then
734 if compile_prog "" "" "posixaio" ; then
736 elif compile_prog "" "-lrt" "posixaio -lrt"; then
741 print_config "POSIX AIO support" "$posix_aio"
742 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
744 ##########################################
745 # posix aio fsync probe
746 if test "$posix_aio_fsync" != "yes" ; then
749 if test "$posix_aio" = "yes" ; then
756 return aio_fsync(O_SYNC, &cb);
760 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
764 print_config "POSIX AIO fsync" "$posix_aio_fsync"
766 ##########################################
767 # POSIX pshared attribute probe
768 if test "$posix_pshared" != "yes" ; then
775 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
776 # if defined(__CYGWIN__)
777 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
778 # elif defined(__APPLE__)
779 # include <AvailabilityMacros.h>
780 # include <TargetConditionals.h>
781 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
782 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
786 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
791 if compile_prog "" "$LIBS" "posix_pshared" ; then
794 print_config "POSIX pshared support" "$posix_pshared"
796 ##########################################
797 # POSIX pthread_condattr_setclock() probe
798 if test "$pthread_condattr_setclock" != "no" ; then
803 pthread_condattr_t condattr;
804 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
808 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
809 pthread_condattr_setclock=yes
810 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
811 pthread_condattr_setclock=yes
812 LIBS="$LIBS -lpthread"
815 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
817 ##########################################
818 # pthread_sigmask() probe
819 if test "$pthread_sigmask" != "yes" ; then
823 #include <stddef.h> /* NULL */
824 #include <signal.h> /* pthread_sigmask() */
827 return pthread_sigmask(0, NULL, NULL);
830 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
832 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
834 LIBS="$LIBS -lpthread"
836 print_config "pthread_sigmask()" "$pthread_sigmask"
838 ##########################################
839 # pthread_getaffinity_np() probe
840 if test "$pthread_getaffinity" != "yes" ; then
841 pthread_getaffinity="no"
844 #include <stddef.h> /* NULL */
845 #include <signal.h> /* pthread_sigmask() */
850 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
853 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
854 pthread_getaffinity="yes"
855 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
856 pthread_getaffinity="yes"
857 LIBS="$LIBS -lpthread"
859 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
861 ##########################################
863 if test "$solaris_aio" != "yes" ; then
867 #include <sys/types.h>
868 #include <sys/asynch.h>
873 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
877 if compile_prog "" "-laio" "solarisaio" ; then
881 print_config "Solaris AIO support" "$solaris_aio"
883 ##########################################
884 # __sync_fetch_and_add test
885 if test "$sfaa" != "yes" ; then
889 #include <inttypes.h>
890 static int sfaa(uint64_t *ptr)
892 return __sync_fetch_and_add(ptr, 0);
895 int main(int argc, char **argv)
902 if compile_prog "" "" "__sync_fetch_and_add()" ; then
905 print_config "__sync_fetch_and_add" "$sfaa"
907 ##########################################
908 # __sync_synchronize() test
909 if test "$sync_sync" != "yes" ; then
913 #include <inttypes.h>
915 int main(int argc, char **argv)
917 __sync_synchronize();
921 if compile_prog "" "" "__sync_synchronize()" ; then
924 print_config "__sync_synchronize" "$sync_sync"
926 ##########################################
927 # __sync_val_compare_and_swap() test
928 if test "$cmp_swap" != "yes" ; then
932 #include <inttypes.h>
934 int main(int argc, char **argv)
937 return __sync_val_compare_and_swap(&x, 1, 2);
940 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
943 print_config "__sync_val_compare_and_swap" "$cmp_swap"
945 ##########################################
947 if test "$libverbs" != "yes" ; then
951 #include <infiniband/verbs.h>
952 int main(int argc, char **argv)
954 struct ibv_pd *pd = ibv_alloc_pd(NULL);
958 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
961 print_config "libverbs" "$libverbs"
963 ##########################################
965 if test "$rdmacm" != "yes" ; then
970 #include <rdma/rdma_cma.h>
971 int main(int argc, char **argv)
973 rdma_destroy_qp(NULL);
977 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
980 print_config "rdmacm" "$rdmacm"
982 ##########################################
984 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
985 if test "$librpma" != "yes" ; then
992 void *ptr = rpma_cq_get_wc;
993 (void) ptr; /* unused */
997 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1000 print_config "librpma" "$librpma"
1002 ##########################################
1003 # libprotobuf-c probe
1004 if test "$libprotobuf_c" != "yes" ; then
1009 #include <protobuf-c/protobuf-c.h>
1010 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1011 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1013 int main(int argc, char **argv)
1015 (void)protobuf_c_message_check(NULL);
1019 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1022 print_config "libprotobuf_c" "$libprotobuf_c"
1024 ##########################################
1025 # asprintf() and vasprintf() probes
1026 if test "$have_asprintf" != "yes" ; then
1032 int main(int argc, char **argv)
1035 return asprintf(&buf, "%s", "str") == 0;
1038 if compile_prog "" "" "have_asprintf"; then
1041 print_config "asprintf()" "$have_asprintf"
1043 if test "$have_vasprintf" != "yes" ; then
1049 int main(int argc, char **argv)
1053 return vasprintf(&buf, "%s", ap) == 0;
1056 if compile_prog "" "" "have_vasprintf"; then
1057 have_vasprintf="yes"
1059 print_config "vasprintf()" "$have_vasprintf"
1061 ##########################################
1062 # Linux fallocate probe
1063 if test "$linux_fallocate" != "yes" ; then
1064 linux_fallocate="no"
1069 #include <linux/falloc.h>
1070 int main(int argc, char **argv)
1072 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1076 if compile_prog "" "" "linux_fallocate"; then
1077 linux_fallocate="yes"
1079 print_config "Linux fallocate" "$linux_fallocate"
1081 ##########################################
1082 # POSIX fadvise probe
1083 if test "$posix_fadvise" != "yes" ; then
1089 int main(int argc, char **argv)
1091 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1095 if compile_prog "" "" "posix_fadvise"; then
1098 print_config "POSIX fadvise" "$posix_fadvise"
1100 ##########################################
1101 # POSIX fallocate probe
1102 if test "$posix_fallocate" != "yes" ; then
1103 posix_fallocate="no"
1108 int main(int argc, char **argv)
1110 int r = posix_fallocate(0, 0, 1024);
1114 if compile_prog "" "" "posix_fallocate"; then
1115 posix_fallocate="yes"
1117 print_config "POSIX fallocate" "$posix_fallocate"
1119 ##########################################
1120 # sched_set/getaffinity 2 or 3 argument test
1121 if test "$linux_2arg_affinity" != "yes" ; then
1122 linux_2arg_affinity="no"
1124 if test "$linux_3arg_affinity" != "yes" ; then
1125 linux_3arg_affinity="no"
1129 int main(int argc, char **argv)
1131 cpu_set_t mask = { };
1133 return sched_setaffinity(0, sizeof(mask), &mask);
1136 if compile_prog "" "" "sched_setaffinity(,,)"; then
1137 linux_3arg_affinity="yes"
1141 int main(int argc, char **argv)
1143 cpu_set_t mask = { };
1145 return sched_setaffinity(0, &mask);
1148 if compile_prog "" "" "sched_setaffinity(,)"; then
1149 linux_2arg_affinity="yes"
1152 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1153 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1155 ##########################################
1156 # clock_gettime probe
1157 if test "$clock_gettime" != "yes" ; then
1163 int main(int argc, char **argv)
1165 return clock_gettime(0, NULL);
1168 if compile_prog "" "" "clock_gettime"; then
1170 elif compile_prog "" "-lrt" "clock_gettime"; then
1174 print_config "clock_gettime" "$clock_gettime"
1176 ##########################################
1177 # CLOCK_MONOTONIC probe
1178 if test "$clock_monotonic" != "yes" ; then
1179 clock_monotonic="no"
1181 if test "$clock_gettime" = "yes" ; then
1185 int main(int argc, char **argv)
1187 return clock_gettime(CLOCK_MONOTONIC, NULL);
1190 if compile_prog "" "$LIBS" "clock monotonic"; then
1191 clock_monotonic="yes"
1194 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1196 ##########################################
1198 if test "$clockid_t" != "yes" ; then
1204 int main(int argc, char **argv)
1206 volatile clockid_t cid;
1207 memset((void*)&cid, 0, sizeof(cid));
1211 if compile_prog "" "$LIBS" "clockid_t"; then
1214 print_config "clockid_t" "$clockid_t"
1216 ##########################################
1217 # gettimeofday() probe
1218 if test "$gettimeofday" != "yes" ; then
1222 #include <sys/time.h>
1224 int main(int argc, char **argv)
1227 return gettimeofday(&tv, NULL);
1230 if compile_prog "" "" "gettimeofday"; then
1233 print_config "gettimeofday" "$gettimeofday"
1235 ##########################################
1237 if test "$fdatasync" != "yes" ; then
1243 int main(int argc, char **argv)
1245 return fdatasync(0);
1248 if compile_prog "" "" "fdatasync"; then
1251 print_config "fdatasync" "$fdatasync"
1253 ##########################################
1255 if test "$pipe" != "yes" ; then
1260 int main(int argc, char **argv)
1266 if compile_prog "" "" "pipe"; then
1269 print_config "pipe()" "$pipe"
1271 ##########################################
1273 if test "$pipe2" != "yes" ; then
1278 int main(int argc, char **argv)
1281 return pipe2(fd, 0);
1284 if compile_prog "" "" "pipe2"; then
1287 print_config "pipe2()" "$pipe2"
1289 ##########################################
1291 if test "$pread" != "yes" ; then
1296 int main(int argc, char **argv)
1298 return pread(0, NULL, 0, 0);
1301 if compile_prog "" "" "pread"; then
1304 print_config "pread()" "$pread"
1306 ##########################################
1307 # sync_file_range() probe
1308 if test "$sync_file_range" != "yes" ; then
1309 sync_file_range="no"
1315 #include <linux/fs.h>
1316 int main(int argc, char **argv)
1318 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1319 SYNC_FILE_RANGE_WAIT_AFTER;
1320 return sync_file_range(0, 0, 0, flags);
1323 if compile_prog "" "" "sync_file_range"; then
1324 sync_file_range="yes"
1326 print_config "sync_file_range" "$sync_file_range"
1328 ##########################################
1329 # ext4 move extent probe
1330 if test "$ext4_me" != "yes" ; then
1335 #include <sys/ioctl.h>
1336 int main(int argc, char **argv)
1338 struct move_extent me;
1339 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1342 if compile_prog "" "" "ext4 move extent" ; then
1344 elif test $targetos = "Linux" ; then
1345 # On Linux, just default to it on and let it error at runtime if we really
1346 # don't have it. None of my updated systems have it defined, but it does
1347 # work. Takes a while to bubble back.
1350 print_config "EXT4 move extent" "$ext4_me"
1352 ##########################################
1354 if test "$linux_splice" != "yes" ; then
1360 int main(int argc, char **argv)
1362 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1365 if compile_prog "" "" "linux splice"; then
1368 print_config "Linux splice(2)" "$linux_splice"
1370 ##########################################
1372 if test "$libnuma" != "yes" ; then
1377 int main(int argc, char **argv)
1379 return numa_available();
1382 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1386 print_config "libnuma" "$libnuma"
1388 ##########################################
1389 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1390 if test "$libnuma" = "yes" ; then
1394 int main(int argc, char **argv)
1396 struct bitmask *mask = numa_parse_nodestring(NULL);
1397 return mask->size == 0;
1400 if compile_prog "" "" "libnuma api"; then
1403 print_config "libnuma v2" "$libnuma_v2"
1406 ##########################################
1408 if test "$strsep" != "yes" ; then
1413 int main(int argc, char **argv)
1415 static char *string = "This is a string";
1416 strsep(&string, "needle");
1420 if compile_prog "" "" "strsep"; then
1423 print_config "strsep" "$strsep"
1425 ##########################################
1426 # strcasestr() probe
1427 if test "$strcasestr" != "yes" ; then
1432 int main(int argc, char **argv)
1434 return strcasestr(argv[0], argv[1]) != NULL;
1437 if compile_prog "" "" "strcasestr"; then
1440 print_config "strcasestr" "$strcasestr"
1442 ##########################################
1444 if test "$strlcat" != "yes" ; then
1449 int main(int argc, char **argv)
1451 static char dst[64];
1452 static char *string = "This is a string";
1453 memset(dst, 0, sizeof(dst));
1454 strlcat(dst, string, sizeof(dst));
1458 if compile_prog "" "" "strlcat"; then
1461 print_config "strlcat" "$strlcat"
1463 ##########################################
1464 # getopt_long_only() probe
1465 if test "$getopt_long_only" != "yes" ; then
1466 getopt_long_only="no"
1472 int main(int argc, char **argv)
1474 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1478 if compile_prog "" "" "getopt_long_only"; then
1479 getopt_long_only="yes"
1481 print_config "getopt_long_only()" "$getopt_long_only"
1483 ##########################################
1485 if test "$inet_aton" != "yes" ; then
1490 #include <winsock2.h>
1492 #include <sys/socket.h>
1493 #include <arpa/inet.h>
1496 int main(int argc, char **argv)
1499 return inet_aton(NULL, &in);
1502 if compile_prog "" "" "inet_aton"; then
1505 print_config "inet_aton" "$inet_aton"
1507 ##########################################
1509 if test "$socklen_t" != "yes" ; then
1514 #include <winsock2.h>
1515 #include <ws2tcpip.h>
1517 #include <sys/socket.h>
1519 int main(int argc, char **argv)
1525 if compile_prog "" "" "socklen_t"; then
1528 print_config "socklen_t" "$socklen_t"
1530 ##########################################
1531 # Whether or not __thread is supported for TLS
1532 if test "$tls_thread" != "yes" ; then
1537 static __thread int ret;
1538 int main(int argc, char **argv)
1543 if compile_prog "" "" "__thread"; then
1546 print_config "__thread" "$tls_thread"
1548 ##########################################
1549 # Check if we have required gtk/glib support for gfio
1550 if test "$gfio" != "yes" ; then
1553 if test "$gfio_check" = "yes" ; then
1557 #include <gtk/gtk.h>
1560 gdk_threads_enter();
1561 gdk_threads_leave();
1563 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1566 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1567 ORG_LDFLAGS=$LDFLAGS
1568 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1569 if test "$?" != "0" ; then
1570 echo "configure: gtk and gthread not found"
1573 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1574 if test "$?" != "0" ; then
1575 echo "configure: gtk and gthread not found"
1579 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1580 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1581 GFIO_LIBS="$LIBS $GTK_LIBS"
1582 CFLAGS="$CFLAGS $GTK_CFLAGS"
1584 echo "Please install gtk and gdk libraries"
1590 LDFLAGS=$ORG_LDFLAGS
1593 if test "$gfio_check" = "yes" ; then
1594 print_config "gtk 2.18 or higher" "$gfio"
1597 ##########################################
1598 # Check whether we have getrusage(RUSAGE_THREAD)
1599 if test "$rusage_thread" != "yes" ; then
1603 #include <sys/time.h>
1604 #include <sys/resource.h>
1605 int main(int argc, char **argv)
1608 getrusage(RUSAGE_THREAD, &ru);
1612 if compile_prog "" "" "RUSAGE_THREAD"; then
1615 print_config "RUSAGE_THREAD" "$rusage_thread"
1617 ##########################################
1618 # Check whether we have SCHED_IDLE
1619 if test "$sched_idle" != "yes" ; then
1624 int main(int argc, char **argv)
1626 struct sched_param p = { };
1628 return sched_setscheduler(0, SCHED_IDLE, &p);
1631 if compile_prog "" "" "SCHED_IDLE"; then
1634 print_config "SCHED_IDLE" "$sched_idle"
1636 ##########################################
1637 # Check whether we have TCP_NODELAY
1638 if test "$tcp_nodelay" != "yes" ; then
1643 #include <winsock2.h>
1646 #include <sys/types.h>
1647 #include <sys/socket.h>
1648 #include <netinet/tcp.h>
1650 int main(int argc, char **argv)
1652 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1655 if compile_prog "" "" "TCP_NODELAY"; then
1657 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1659 LIBS="$LIBS -lws2_32"
1661 print_config "TCP_NODELAY" "$tcp_nodelay"
1663 ##########################################
1664 # Check whether we have SO_SNDBUF
1665 if test "$window_size" != "yes" ; then
1670 #include <winsock2.h>
1673 #include <sys/types.h>
1674 #include <sys/socket.h>
1675 #include <netinet/tcp.h>
1677 int main(int argc, char **argv)
1679 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1680 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1683 if compile_prog "" "" "SO_SNDBUF"; then
1685 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1687 LIBS="$LIBS -lws2_32"
1689 print_config "Net engine window_size" "$window_size"
1691 ##########################################
1692 # Check whether we have TCP_MAXSEG
1693 if test "$mss" != "yes" ; then
1698 #include <winsock2.h>
1701 #include <sys/types.h>
1702 #include <sys/socket.h>
1703 #include <netinet/tcp.h>
1704 #include <arpa/inet.h>
1705 #include <netinet/in.h>
1707 int main(int argc, char **argv)
1709 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1712 if compile_prog "" "" "TCP_MAXSEG"; then
1714 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1716 LIBS="$LIBS -lws2_32"
1718 print_config "TCP_MAXSEG" "$mss"
1720 ##########################################
1721 # Check whether we have RLIMIT_MEMLOCK
1722 if test "$rlimit_memlock" != "yes" ; then
1726 #include <sys/time.h>
1727 #include <sys/resource.h>
1728 int main(int argc, char **argv)
1731 return getrlimit(RLIMIT_MEMLOCK, &rl);
1734 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1735 rlimit_memlock="yes"
1737 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1739 ##########################################
1740 # Check whether we have pwritev/preadv
1741 if test "$pwritev" != "yes" ; then
1746 #include <sys/uio.h>
1747 int main(int argc, char **argv)
1749 struct iovec iov[1] = { };
1751 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1754 if compile_prog "" "" "pwritev"; then
1757 print_config "pwritev/preadv" "$pwritev"
1759 ##########################################
1760 # Check whether we have pwritev2/preadv2
1761 if test "$pwritev2" != "yes" ; then
1766 #include <sys/uio.h>
1767 int main(int argc, char **argv)
1769 struct iovec iov[1] = { };
1771 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1774 if compile_prog "" "" "pwritev2"; then
1777 print_config "pwritev2/preadv2" "$pwritev2"
1779 ##########################################
1780 # Check whether we have the required functions for ipv6
1781 if test "$ipv6" != "yes" ; then
1786 #include <winsock2.h>
1787 #include <ws2tcpip.h>
1789 #include <sys/types.h>
1790 #include <sys/socket.h>
1791 #include <netinet/in.h>
1795 int main(int argc, char **argv)
1797 struct addrinfo hints = { };
1798 struct in6_addr addr = in6addr_any;
1801 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1803 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1808 if compile_prog "" "" "ipv6"; then
1811 print_config "IPv6 helpers" "$ipv6"
1813 ##########################################
1815 if test "$http" != "yes" ; then
1818 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1820 #include <curl/curl.h>
1821 #include <openssl/hmac.h>
1823 int main(int argc, char **argv)
1828 curl = curl_easy_init();
1829 curl_easy_cleanup(curl);
1831 ctx = HMAC_CTX_new();
1832 HMAC_CTX_reset(ctx);
1837 # openssl < 1.1.0 uses the HMAC_CTX type directly
1839 #include <curl/curl.h>
1840 #include <openssl/hmac.h>
1842 int main(int argc, char **argv)
1847 curl = curl_easy_init();
1848 curl_easy_cleanup(curl);
1850 HMAC_CTX_init(&ctx);
1851 HMAC_CTX_cleanup(&ctx);
1855 if test "$disable_http" != "yes"; then
1856 HTTP_LIBS="-lcurl -lssl -lcrypto"
1857 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1858 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1860 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1864 print_config "http engine" "$http"
1866 ##########################################
1868 if test "$rados" != "yes" ; then
1872 #include <rados/librados.h>
1874 int main(int argc, char **argv)
1877 rados_ioctx_t io_ctx;
1878 const char cluster_name[] = "ceph";
1879 const char user_name[] = "client.admin";
1880 const char pool[] = "rados";
1882 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1883 rados_create2(&cluster, cluster_name, user_name, 0);
1884 rados_ioctx_create(cluster, pool, &io_ctx);
1889 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1892 print_config "Rados engine" "$rados"
1894 ##########################################
1896 if test "$rbd" != "yes" ; then
1900 #include <rbd/librbd.h>
1902 int main(int argc, char **argv)
1905 rados_ioctx_t io_ctx;
1906 const char cluster_name[] = "ceph";
1907 const char user_name[] = "client.admin";
1908 const char pool[] = "rbd";
1909 int major, minor, extra;
1911 rbd_version(&major, &minor, &extra);
1912 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1913 rados_create2(&cluster, cluster_name, user_name, 0);
1914 rados_ioctx_create(cluster, pool, &io_ctx);
1919 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1922 print_config "Rados Block Device engine" "$rbd"
1924 ##########################################
1925 # check for rbd_poll
1926 if test "$rbd_poll" != "yes" ; then
1929 if test "$rbd" = "yes"; then
1931 #include <rbd/librbd.h>
1932 #include <sys/eventfd.h>
1934 int main(int argc, char **argv)
1937 rbd_completion_t comp;
1939 int fd = eventfd(0, EFD_NONBLOCK);
1940 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1941 rbd_poll_io_events(image, comp, 1);
1946 if compile_prog "" "-lrbd -lrados" "rbd"; then
1949 print_config "rbd_poll" "$rbd_poll"
1952 ##########################################
1953 # check for rbd_invalidate_cache()
1954 if test "$rbd_inval" != "yes" ; then
1957 if test "$rbd" = "yes"; then
1959 #include <rbd/librbd.h>
1961 int main(int argc, char **argv)
1965 return rbd_invalidate_cache(image);
1968 if compile_prog "" "-lrbd -lrados" "rbd"; then
1971 print_config "rbd_invalidate_cache" "$rbd_inval"
1974 ##########################################
1975 # Check whether we have setvbuf
1976 if test "$setvbuf" != "yes" ; then
1981 int main(int argc, char **argv)
1985 setvbuf(f, buf, _IOFBF, sizeof(buf));
1989 if compile_prog "" "" "setvbuf"; then
1992 print_config "setvbuf" "$setvbuf"
1994 ##########################################
1996 if test "$gfapi" != "yes" ; then
2000 #include <glusterfs/api/glfs.h>
2002 int main(int argc, char **argv)
2004 glfs_t *g = glfs_new("foo");
2009 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2012 print_config "Gluster API engine" "$gfapi"
2014 ##########################################
2015 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2016 if test "$gfapi" = "yes" ; then
2019 #include <glusterfs/api/glfs.h>
2021 int main(int argc, char **argv)
2024 int ret = glfs_fadvise(fd, 0, 0, 1);
2029 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2032 print_config "Gluster API use fadvise" "$gf_fadvise"
2035 ##########################################
2036 # check for newer gfapi
2037 if test "$gfapi" = "yes" ; then
2040 #include <glusterfs/api/glfs.h>
2042 int main(int argc, char **argv)
2044 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2047 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2050 print_config "Gluster new API" "$gf_new"
2053 ##########################################
2054 # check for gfapi trim support
2055 if test "$gf_trim" != "yes" ; then
2058 if test "$gfapi" = "yes" ; then
2060 #include <glusterfs/api/glfs.h>
2062 int main(int argc, char **argv)
2064 return glfs_discard_async(NULL, 0, 0);
2067 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2070 print_config "Gluster API trim support" "$gf_trim"
2073 ##########################################
2074 # Check if we support stckf on s390
2075 if test "$s390_z196_facilities" != "yes" ; then
2076 s390_z196_facilities="no"
2079 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2080 int main(int argc, char **argv)
2082 /* We want just 1 double word to be returned. */
2083 register unsigned long reg0 asm("0") = 0;
2084 unsigned long stfle_bits;
2085 asm volatile(".machine push" "\n\t"
2086 ".machine \"z9-109\"" "\n\t"
2089 : "=QS" (stfle_bits), "+d" (reg0)
2092 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2098 if compile_prog "" "" "s390_z196_facilities"; then
2100 if [ $? -eq 0 ]; then
2101 s390_z196_facilities="yes"
2104 print_config "s390_z196_facilities" "$s390_z196_facilities"
2106 ##########################################
2107 # Check if we have required environment variables configured for libhdfs
2108 if test "$libhdfs" = "yes" ; then
2110 if test "$JAVA_HOME" = "" ; then
2111 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2114 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2115 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2118 if test "$FIO_LIBHDFS_LIB" = "" ; then
2119 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2122 if test "$hdfs_conf_error" = "1" ; then
2123 feature_not_found "libhdfs" ""
2126 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2127 FIO_HDFS_CPU="amd64"
2130 print_config "HDFS engine" "$libhdfs"
2132 ##########################################
2133 # Check whether we have MTD
2134 if test "$mtd" != "yes" ; then
2139 #include <mtd/mtd-user.h>
2140 #include <sys/ioctl.h>
2141 int main(int argc, char **argv)
2143 struct mtd_write_req ops;
2144 struct mtd_info_user info;
2145 memset(&ops, 0, sizeof(ops));
2146 info.type = MTD_MLCNANDFLASH;
2147 return ioctl(0, MEMGETINFO, &info);
2150 if compile_prog "" "" "mtd"; then
2153 print_config "MTD" "$mtd"
2155 ##########################################
2156 # Check whether we have libpmem
2157 if test "$libpmem" != "yes" ; then
2161 #include <libpmem.h>
2163 int main(int argc, char **argv)
2165 return pmem_is_pmem(NULL, 0);
2168 if compile_prog "" "-lpmem" "libpmem"; then
2171 print_config "libpmem" "$libpmem"
2173 ##########################################
2174 # Check whether libpmem's version >= 1.5
2175 if test "$libpmem1_5" != "yes" ; then
2178 if test "$libpmem" = "yes"; then
2180 #include <libpmem.h>
2182 int main(int argc, char **argv)
2184 pmem_memcpy(NULL, NULL, 0, 0);
2188 if compile_prog "" "-lpmem" "libpmem1_5"; then
2192 print_config "libpmem1_5" "$libpmem1_5"
2194 ##########################################
2195 # Check whether we have libpmemblk
2196 # libpmem is a prerequisite
2197 if test "$libpmemblk" != "yes" ; then
2200 if test "$libpmem" = "yes"; then
2202 #include <libpmemblk.h>
2203 int main(int argc, char **argv)
2206 pbp = pmemblk_open("", 0);
2210 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2214 print_config "libpmemblk" "$libpmemblk"
2216 # Choose libpmem-based ioengines
2217 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2219 if test "$libpmem1_5" = "yes"; then
2222 if test "$libpmemblk" = "yes"; then
2227 ##########################################
2228 # Report whether pmemblk engine is enabled
2229 print_config "PMDK pmemblk engine" "$pmemblk"
2231 ##########################################
2232 # Report whether dev-dax engine is enabled
2233 print_config "PMDK dev-dax engine" "$devdax"
2235 ##########################################
2236 # Report whether libpmem engine is enabled
2237 print_config "PMDK libpmem engine" "$pmem"
2239 ##########################################
2240 # Check whether we support DDN's IME
2241 if test "$libime" != "yes" ; then
2245 #include <ime_native.h>
2246 int main(int argc, char **argv)
2250 rc = ime_native_finalize();
2254 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2256 CFLAGS="-I${ime_path}/include $CFLAGS"
2257 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2258 LIBS="-lim_client $LIBS"
2260 print_config "DDN's Infinite Memory Engine" "$libime"
2262 ##########################################
2263 # Check if we have libiscsi
2264 if test "$libiscsi" != "no" ; then
2265 if check_min_lib_version libiscsi 1.9.0; then
2267 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2268 libiscsi_libs=$(pkg-config --libs libiscsi)
2273 print_config "iscsi engine" "$libiscsi"
2275 ##########################################
2276 # Check if we have libnbd (for NBD support)
2277 if test "$libnbd" != "no" ; then
2278 if check_min_lib_version libnbd 0.9.8; then
2280 libnbd_cflags=$(pkg-config --cflags libnbd)
2281 libnbd_libs=$(pkg-config --libs libnbd)
2286 print_config "NBD engine" "$libnbd"
2288 ##########################################
2289 # check for dfs (DAOS File System)
2290 if test "$dfs" != "no" ; then
2294 #include <daos_fs.h>
2296 int main(int argc, char **argv)
2302 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2307 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2313 print_config "DAOS File System (dfs) Engine" "$dfs"
2315 ##########################################
2316 # Check if we have libnfs (for userspace nfs support).
2317 if test "$disable_nfs" != "yes"; then
2318 if $(pkg-config libnfs > /dev/null 2>&1); then
2320 libnfs_cflags=$(pkg-config --cflags libnfs)
2321 libnfs_libs=$(pkg-config --libs libnfs)
2323 if test "$libnfs" = "yes" ; then
2324 echo "libnfs" "Install libnfs"
2328 print_config "NFS engine" "$libnfs"
2330 ##########################################
2331 # Check if we have lex/yacc available
2336 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2337 if test "$targetos" != "SunOS" ; then
2347 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2351 if test "$arith" = "yes" ; then
2353 extern int yywrap(void);
2355 int main(int argc, char **argv)
2361 if compile_prog "" "-lfl" "flex"; then
2363 elif compile_prog "" "-ll" "lex"; then
2372 # Check if lex fails using -o
2373 if test "$arith" = "yes" ; then
2374 if test "$force_no_lex_o" = "yes" ; then
2377 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2385 print_config "lex/yacc for arithmetic" "$arith"
2387 ##########################################
2388 # Check whether we have setmntent/getmntent
2389 if test "$getmntent" != "yes" ; then
2395 int main(int argc, char **argv)
2397 FILE *mtab = setmntent(NULL, "r");
2398 struct mntent *mnt = getmntent(mtab);
2403 if compile_prog "" "" "getmntent"; then
2406 print_config "getmntent" "$getmntent"
2408 ##########################################
2409 # Check whether we have getmntinfo
2410 # These are originally added for BSDs, but may also work
2411 # on other operating systems with getmntinfo(3).
2413 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2414 # Note that NetBSD needs -Werror to catch warning as error.
2415 if test "$getmntinfo" != "yes" ; then
2420 #include <sys/param.h>
2421 #include <sys/mount.h>
2422 int main(int argc, char **argv)
2425 return getmntinfo(&st, MNT_NOWAIT);
2428 if compile_prog "-Werror" "" "getmntinfo"; then
2431 print_config "getmntinfo" "$getmntinfo"
2433 # getmntinfo(3) for NetBSD.
2434 if test "$getmntinfo_statvfs" != "yes" ; then
2435 getmntinfo_statvfs="no"
2439 #include <sys/statvfs.h>
2440 int main(int argc, char **argv)
2443 return getmntinfo(&st, MNT_NOWAIT);
2446 # Skip the test if the one with statfs arg is detected.
2447 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2448 getmntinfo_statvfs="yes"
2449 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2452 ##########################################
2453 # Check whether we have _Static_assert
2454 if test "$static_assert" != "yes" ; then
2466 int main(int argc, char **argv)
2468 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2472 if compile_prog "" "" "static_assert"; then
2475 print_config "Static Assert" "$static_assert"
2477 ##########################################
2478 # Check whether we have bool / stdbool.h
2479 if test "$have_bool" != "yes" ; then
2483 #include <stdbool.h>
2484 int main(int argc, char **argv)
2487 return var != false;
2490 if compile_prog "" "" "bool"; then
2493 print_config "bool" "$have_bool"
2495 ##########################################
2496 # Check whether we have strndup()
2501 int main(int argc, char **argv)
2503 char *res = strndup("test string", 8);
2509 if compile_prog "" "" "strndup"; then
2512 print_config "strndup" "$strndup"
2514 ##########################################
2515 # <valgrind/drd.h> probe
2516 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2517 # also available but not the other way around.
2518 if test "$valgrind_dev" != "yes" ; then
2522 #include <valgrind/drd.h>
2523 int main(int argc, char **argv)
2528 if compile_prog "" "" "valgrind_dev"; then
2531 print_config "Valgrind headers" "$valgrind_dev"
2533 if test "$targetos" = "Linux" ; then
2534 ##########################################
2535 # <linux/blkzoned.h> probe
2536 if test "$linux_blkzoned" != "yes" ; then
2540 #include <linux/blkzoned.h>
2541 int main(int argc, char **argv)
2546 if compile_prog "" "" "linux_blkzoned"; then
2547 linux_blkzoned="yes"
2549 print_config "Zoned block device support" "$linux_blkzoned"
2551 ##########################################
2552 # Check BLK_ZONE_REP_CAPACITY
2554 #include <linux/blkzoned.h>
2557 return BLK_ZONE_REP_CAPACITY;
2560 if compile_prog "" "" "blkzoned report capacity"; then
2561 output_sym "CONFIG_HAVE_REP_CAPACITY"
2566 print_config "Zoned block device capacity" "$rep_capacity"
2569 ##########################################
2572 #include <libzbc/zbc.h>
2573 int main(int argc, char **argv)
2575 struct zbc_device *dev = NULL;
2577 return zbc_open("foo=bar", O_RDONLY, &dev);
2580 if test "$libzbc" != "no" ; then
2581 if [ -e /usr/include/libzbc/libzbc ]; then
2583 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2585 if compile_prog "" "-lzbc" "libzbc"; then
2587 if ! check_min_lib_version libzbc 5; then
2591 if test "$libzbc" = "yes" ; then
2592 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2597 print_config "libzbc engine" "$libzbc"
2599 if test "$targetos" = "Linux" ; then
2600 ##########################################
2601 # Check NVME_URING_CMD support
2603 #include <linux/nvme_ioctl.h>
2606 struct nvme_uring_cmd *cmd;
2608 return sizeof(struct nvme_uring_cmd);
2611 if compile_prog "" "" "nvme uring cmd"; then
2612 output_sym "CONFIG_NVME_URING_CMD"
2613 nvme_uring_cmd="yes"
2617 print_config "NVMe uring command support" "$nvme_uring_cmd"
2620 ##########################################
2621 # Check if we have xnvme
2622 if test "$xnvme" != "yes" ; then
2623 if check_min_lib_version xnvme 0.2.0; then
2625 xnvme_cflags=$(pkg-config --cflags xnvme)
2626 xnvme_libs=$(pkg-config --libs xnvme)
2631 print_config "xnvme engine" "$xnvme"
2633 ##########################################
2634 # check march=armv8-a+crc+crypto
2635 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2636 march_armv8_a_crc_crypto="no"
2638 if test "$cpu" = "arm64" ; then
2640 #include <arm_acle.h>
2641 #include <arm_neon.h>
2642 #include <sys/auxv.h>
2646 /* Can we also do a runtime probe? */
2648 return getauxval(AT_HWCAP);
2650 # error "Don't know how to do runtime probe for ARM CRC32c"
2654 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2655 march_armv8_a_crc_crypto="yes"
2656 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2660 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2662 ##########################################
2664 if test "$cuda" != "no" ; then
2667 int main(int argc, char **argv)
2672 if compile_prog "" "-lcuda" "cuda"; then
2676 if test "$cuda" = "yes" ; then
2677 feature_not_found "cuda" ""
2682 print_config "cuda" "$cuda"
2684 ##########################################
2686 if test "$libcufile" != "no" ; then
2690 int main(int argc, char* argv[]) {
2695 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2697 LIBS="-lcuda -lcudart -lcufile $LIBS"
2699 if test "$libcufile" = "yes" ; then
2700 feature_not_found "libcufile" ""
2705 print_config "libcufile" "$libcufile"
2707 ##########################################
2708 # check for cc -march=native
2711 int main(int argc, char **argv)
2716 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2717 compile_prog "-march=native" "" "march=native"; then
2720 print_config "Build march=native" "$build_native"
2722 ##########################################
2724 if test "$cunit" != "yes" ; then
2728 #include <CUnit/CUnit.h>
2729 #include <CUnit/Basic.h>
2732 if (CU_initialize_registry() != CUE_SUCCESS)
2733 return CU_get_error();
2734 CU_basic_set_mode(CU_BRM_VERBOSE);
2735 CU_basic_run_tests();
2736 CU_cleanup_registry();
2737 return CU_get_error();
2740 if compile_prog "" "-lcunit" "CUnit"; then
2743 print_config "CUnit" "$cunit"
2745 ##########################################
2746 # check for __kernel_rwf_t
2749 #include <linux/fs.h>
2750 int main(int argc, char **argv)
2757 if compile_prog "" "" "__kernel_rwf_t"; then
2758 __kernel_rwf_t="yes"
2760 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2762 ##########################################
2763 # check if gcc has -Wimplicit-fallthrough=2
2766 int main(int argc, char **argv)
2771 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2774 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2776 ##########################################
2777 # check for MADV_HUGEPAGE support
2778 if test "$thp" != "yes" ; then
2781 if test "$esx" != "yes" ; then
2783 #include <sys/mman.h>
2786 return madvise(0, 0x1000, MADV_HUGEPAGE);
2789 if compile_prog "" "" "thp" ; then
2792 if test "$thp" = "yes" ; then
2793 feature_not_found "Transparent Huge Page" ""
2798 print_config "MADV_HUGEPAGE" "$thp"
2800 ##########################################
2801 # check for gettid()
2805 int main(int argc, char **argv)
2810 if compile_prog "" "" "gettid"; then
2813 print_config "gettid" "$gettid"
2815 ##########################################
2816 # check for statx(2) support by libc
2820 #include <sys/stat.h>
2822 int main(int argc, char **argv)
2825 return statx(-1, *argv, 0, 0, &st);
2828 if compile_prog "" "" "statx"; then
2831 print_config "statx(2)/libc" "$statx"
2833 ##########################################
2834 # check for statx(2) support by kernel
2838 #include <linux/stat.h>
2839 #include <sys/stat.h>
2840 #include <sys/syscall.h>
2842 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2843 struct statx *buffer)
2845 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2848 int main(int argc, char **argv)
2851 return _statx(-1, *argv, 0, 0, &st);
2854 if compile_prog "" "" "statx_syscall"; then
2857 print_config "statx(2)/syscall" "$statx_syscall"
2859 ##########################################
2860 # check for Windows PDB generation support
2861 if test "pdb" != "no" ; then
2868 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2871 if test "$pdb" = "yes"; then
2872 feature_not_found "PDB" "clang and lld"
2879 print_config "Windows PDB generation" "$pdb"
2881 ##########################################
2882 # check for timerfd support
2884 if test "$esx" != "yes" ; then
2886 #include <sys/time.h>
2887 #include <sys/timerfd.h>
2889 int main(int argc, char **argv)
2891 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2894 if compile_prog "" "" "timerfd_create"; then
2895 timerfd_create="yes"
2898 print_config "timerfd_create" "$timerfd_create"
2900 #############################################################################
2902 if test "$wordsize" = "64" ; then
2903 output_sym "CONFIG_64BIT"
2904 elif test "$wordsize" = "32" ; then
2905 output_sym "CONFIG_32BIT"
2907 fatal "Unknown wordsize!"
2909 if test "$bigendian" = "yes" ; then
2910 output_sym "CONFIG_BIG_ENDIAN"
2912 output_sym "CONFIG_LITTLE_ENDIAN"
2914 if test "$zlib" = "yes" ; then
2915 output_sym "CONFIG_ZLIB"
2917 if test "$libaio" = "yes" ; then
2918 output_sym "CONFIG_LIBAIO"
2919 if test "$libaio_rw_flags" = "yes" ; then
2920 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2923 if test "$posix_aio" = "yes" ; then
2924 output_sym "CONFIG_POSIXAIO"
2926 if test "$posix_aio_fsync" = "yes" ; then
2927 output_sym "CONFIG_POSIXAIO_FSYNC"
2929 if test "$posix_pshared" = "yes" ; then
2930 output_sym "CONFIG_PSHARED"
2932 if test "$pthread_condattr_setclock" = "yes" ; then
2933 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2935 if test "$pthread_sigmask" = "yes" ; then
2936 output_sym "CONFIG_PTHREAD_SIGMASK"
2938 if test "$pthread_getaffinity" = "yes" ; then
2939 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2941 if test "$have_asprintf" = "yes" ; then
2942 output_sym "CONFIG_HAVE_ASPRINTF"
2944 if test "$have_vasprintf" = "yes" ; then
2945 output_sym "CONFIG_HAVE_VASPRINTF"
2947 if test "$linux_fallocate" = "yes" ; then
2948 output_sym "CONFIG_LINUX_FALLOCATE"
2950 if test "$posix_fallocate" = "yes" ; then
2951 output_sym "CONFIG_POSIX_FALLOCATE"
2953 if test "$fdatasync" = "yes" ; then
2954 output_sym "CONFIG_FDATASYNC"
2956 if test "$pipe" = "yes" ; then
2957 output_sym "CONFIG_PIPE"
2959 if test "$pipe2" = "yes" ; then
2960 output_sym "CONFIG_PIPE2"
2962 if test "$pread" = "yes" ; then
2963 output_sym "CONFIG_PREAD"
2965 if test "$sync_file_range" = "yes" ; then
2966 output_sym "CONFIG_SYNC_FILE_RANGE"
2968 if test "$sfaa" = "yes" ; then
2969 output_sym "CONFIG_SFAA"
2971 if test "$sync_sync" = "yes" ; then
2972 output_sym "CONFIG_SYNC_SYNC"
2974 if test "$cmp_swap" = "yes" ; then
2975 output_sym "CONFIG_CMP_SWAP"
2977 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2978 output_sym "CONFIG_RDMA"
2980 # librpma is supported on the 'x86_64' architecture for now
2981 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2982 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2983 output_sym "CONFIG_LIBRPMA_APM"
2985 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2986 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2987 output_sym "CONFIG_LIBRPMA_GPSPM"
2989 if test "$clock_gettime" = "yes" ; then
2990 output_sym "CONFIG_CLOCK_GETTIME"
2992 if test "$clock_monotonic" = "yes" ; then
2993 output_sym "CONFIG_CLOCK_MONOTONIC"
2995 if test "$clockid_t" = "yes"; then
2996 output_sym "CONFIG_CLOCKID_T"
2998 if test "$gettimeofday" = "yes" ; then
2999 output_sym "CONFIG_GETTIMEOFDAY"
3001 if test "$posix_fadvise" = "yes" ; then
3002 output_sym "CONFIG_POSIX_FADVISE"
3004 if test "$linux_3arg_affinity" = "yes" ; then
3005 output_sym "CONFIG_3ARG_AFFINITY"
3006 elif test "$linux_2arg_affinity" = "yes" ; then
3007 output_sym "CONFIG_2ARG_AFFINITY"
3009 if test "$strsep" = "yes" ; then
3010 output_sym "CONFIG_STRSEP"
3012 if test "$strcasestr" = "yes" ; then
3013 output_sym "CONFIG_STRCASESTR"
3015 if test "$strlcat" = "yes" ; then
3016 output_sym "CONFIG_STRLCAT"
3018 if test "$getopt_long_only" = "yes" ; then
3019 output_sym "CONFIG_GETOPT_LONG_ONLY"
3021 if test "$inet_aton" = "yes" ; then
3022 output_sym "CONFIG_INET_ATON"
3024 if test "$socklen_t" = "yes" ; then
3025 output_sym "CONFIG_SOCKLEN_T"
3027 if test "$ext4_me" = "yes" ; then
3028 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3030 if test "$linux_splice" = "yes" ; then
3031 output_sym "CONFIG_LINUX_SPLICE"
3033 if test "$libnuma_v2" = "yes" ; then
3034 output_sym "CONFIG_LIBNUMA"
3036 if test "$solaris_aio" = "yes" ; then
3037 output_sym "CONFIG_SOLARISAIO"
3039 if test "$tls_thread" = "yes" ; then
3040 output_sym "CONFIG_TLS_THREAD"
3042 if test "$rusage_thread" = "yes" ; then
3043 output_sym "CONFIG_RUSAGE_THREAD"
3045 if test "$gfio" = "yes" ; then
3046 output_sym "CONFIG_GFIO"
3048 if test "$esx" = "yes" ; then
3049 output_sym "CONFIG_ESX"
3050 output_sym "CONFIG_NO_SHM"
3052 if test "$sched_idle" = "yes" ; then
3053 output_sym "CONFIG_SCHED_IDLE"
3055 if test "$tcp_nodelay" = "yes" ; then
3056 output_sym "CONFIG_TCP_NODELAY"
3058 if test "$window_size" = "yes" ; then
3059 output_sym "CONFIG_NET_WINDOWSIZE"
3061 if test "$mss" = "yes" ; then
3062 output_sym "CONFIG_NET_MSS"
3064 if test "$rlimit_memlock" = "yes" ; then
3065 output_sym "CONFIG_RLIMIT_MEMLOCK"
3067 if test "$pwritev" = "yes" ; then
3068 output_sym "CONFIG_PWRITEV"
3070 if test "$pwritev2" = "yes" ; then
3071 output_sym "CONFIG_PWRITEV2"
3073 if test "$ipv6" = "yes" ; then
3074 output_sym "CONFIG_IPV6"
3076 if test "$http" = "yes" ; then
3077 output_sym "CONFIG_HTTP"
3079 if test "$rados" = "yes" ; then
3080 output_sym "CONFIG_RADOS"
3082 if test "$rbd" = "yes" ; then
3083 output_sym "CONFIG_RBD"
3085 if test "$rbd_poll" = "yes" ; then
3086 output_sym "CONFIG_RBD_POLL"
3088 if test "$rbd_inval" = "yes" ; then
3089 output_sym "CONFIG_RBD_INVAL"
3091 if test "$setvbuf" = "yes" ; then
3092 output_sym "CONFIG_SETVBUF"
3094 if test "$s390_z196_facilities" = "yes" ; then
3095 output_sym "CONFIG_S390_Z196_FACILITIES"
3096 CFLAGS="$CFLAGS -march=z9-109"
3099 if test "$gfapi" = "yes" ; then
3100 output_sym "CONFIG_GFAPI"
3102 if test "$gf_fadvise" = "yes" ; then
3103 output_sym "CONFIG_GF_FADVISE"
3105 if test "$gf_trim" = "yes" ; then
3106 output_sym "CONFIG_GF_TRIM"
3108 if test "$gf_new" = "yes" ; then
3109 output_sym "CONFIG_GF_NEW_API"
3111 if test "$libhdfs" = "yes" ; then
3112 output_sym "CONFIG_LIBHDFS"
3113 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3114 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3115 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3116 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3118 if test "$mtd" = "yes" ; then
3119 output_sym "CONFIG_MTD"
3121 if test "$pmemblk" = "yes" ; then
3122 output_sym "CONFIG_PMEMBLK"
3124 if test "$devdax" = "yes" ; then
3125 output_sym "CONFIG_LINUX_DEVDAX"
3127 if test "$pmem" = "yes" ; then
3128 output_sym "CONFIG_LIBPMEM"
3130 if test "$libime" = "yes" ; then
3131 output_sym "CONFIG_IME"
3133 if test "$arith" = "yes" ; then
3134 output_sym "CONFIG_ARITHMETIC"
3135 if test "$yacc_is_bison" = "yes" ; then
3136 echo "YACC=bison -y" >> $config_host_mak
3138 echo "YACC=yacc" >> $config_host_mak
3140 if test "$lex_use_o" = "yes" ; then
3141 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3144 if test "$getmntent" = "yes" ; then
3145 output_sym "CONFIG_GETMNTENT"
3147 if test "$getmntinfo" = "yes" ; then
3148 output_sym "CONFIG_GETMNTINFO"
3150 if test "$getmntinfo_statvfs" = "yes" ; then
3151 output_sym "CONFIG_GETMNTINFO_STATVFS"
3153 if test "$static_assert" = "yes" ; then
3154 output_sym "CONFIG_STATIC_ASSERT"
3156 if test "$have_bool" = "yes" ; then
3157 output_sym "CONFIG_HAVE_BOOL"
3159 if test "$strndup" = "yes" ; then
3160 output_sym "CONFIG_HAVE_STRNDUP"
3162 if test "$disable_opt" = "yes" ; then
3163 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3165 if test "$valgrind_dev" = "yes"; then
3166 output_sym "CONFIG_VALGRIND_DEV"
3168 if test "$linux_blkzoned" = "yes" ; then
3169 output_sym "CONFIG_HAS_BLKZONED"
3171 if test "$libzbc" = "yes" ; then
3172 output_sym "CONFIG_LIBZBC"
3174 if test "$zlib" = "no" ; then
3175 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3176 if test "$build_static" = "yes"; then
3177 echo "Note that some distros have separate packages for static libraries."
3180 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3181 output_sym "ARCH_HAVE_CRC_CRYPTO"
3183 if test "$cuda" = "yes" ; then
3184 output_sym "CONFIG_CUDA"
3186 if test "$libcufile" = "yes" ; then
3187 output_sym "CONFIG_LIBCUFILE"
3189 if test "$dfs" = "yes" ; then
3190 output_sym "CONFIG_DFS"
3192 if test "$libnfs" = "yes" ; then
3193 output_sym "CONFIG_NFS"
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 "CONFIG_LIBNFS=m" >> $config_host_mak
3237 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3238 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3240 if test "$xnvme" = "yes" ; then
3241 output_sym "CONFIG_LIBXNVME"
3242 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3243 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3245 if test "$dynamic_engines" = "yes" ; then
3246 output_sym "CONFIG_DYNAMIC_ENGINES"
3248 if test "$pdb" = yes; then
3249 output_sym "CONFIG_PDB"
3251 if test "$fcntl_sync" = "yes" ; then
3252 output_sym "CONFIG_FCNTL_SYNC"
3254 if test "$asan" = "yes"; then
3255 CFLAGS="$CFLAGS -fsanitize=address"
3256 LDFLAGS="$LDFLAGS -fsanitize=address"
3258 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3260 int main(int argc, char **argv)
3265 if test "$disable_tcmalloc" != "yes"; then
3266 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3268 LIBS="-ltcmalloc $LIBS"
3269 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3271 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3276 print_config "TCMalloc support" "$tcmalloc"
3278 echo "LIBS+=$LIBS" >> $config_host_mak
3279 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3280 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3281 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3282 echo "CC=$cc" >> $config_host_mak
3283 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3284 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3286 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3287 cat > Makefile <<EOF
3288 SRCDIR:=`dirname $0`
3289 include \$(SRCDIR)/Makefile