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
137 echo "$1=y" >> $config_host_mak
138 echo "#define $1" >> $config_host_h
141 check_min_lib_version() {
144 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
147 : "${_feature:=${1}}"
148 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
149 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
150 feature_not_found "$_feature" "$1 >= $2"
153 print_config "$1" "missing pkg-config, can't check $_feature version"
187 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
189 --prefix=*) prefix="$optarg"
191 --cpu=*) cpu="$optarg"
193 # esx is cross compiled and cannot be detect through simple uname calls
199 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
201 --build-32bit-win) build_32bit_win="yes"
203 --target-win-ver=*) target_win_ver="$optarg"
205 --enable-pdb) pdb="yes"
207 --build-static) build_static="yes"
209 --enable-gfio) gfio_check="yes"
211 --disable-numa) disable_numa="yes"
213 --disable-rdma) disable_rdma="yes"
215 --disable-rados) disable_rados="yes"
217 --disable-rbd) disable_rbd="yes"
219 --disable-http) disable_http="yes"
221 --disable-gfapi) disable_gfapi="yes"
223 --enable-libhdfs) libhdfs="yes"
225 --disable-lex) disable_lex="yes"
227 --enable-lex) disable_lex="no"
229 --disable-shm) no_shm="yes"
231 --disable-optimizations) disable_opt="yes"
233 --disable-pmem) disable_pmem="yes"
235 --enable-cuda) cuda="yes"
237 --enable-libcufile) libcufile="yes"
239 --disable-native) disable_native="yes"
241 --with-ime=*) ime_path="$optarg"
243 --enable-libiscsi) libiscsi="yes"
245 --enable-libnbd) libnbd="yes"
247 --disable-libzbc) libzbc="no"
249 --disable-xnvme) xnvme="no"
251 --disable-libblkio) libblkio="no"
253 --disable-tcmalloc) disable_tcmalloc="yes"
255 --disable-libnfs) libnfs="no"
257 --enable-libnfs) libnfs="yes"
259 --dynamic-libengines) dynamic_engines="yes"
261 --disable-dfs) dfs="no"
263 --enable-asan) asan="yes"
265 --seed-buckets=*) seed_buckets="$optarg"
267 --disable-tls) tls_check="no"
273 echo "Bad option $opt"
279 if test "$show_help" = "yes" ; then
280 echo "--prefix= Use this directory as installation prefix"
281 echo "--cpu= Specify target CPU if auto-detect fails"
282 echo "--cc= Specify compiler to use"
283 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
284 echo "--build-32bit-win Enable 32-bit build on Windows"
285 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
286 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
287 echo "--build-static Build a static fio"
288 echo "--esx Configure build options for esx"
289 echo "--enable-gfio Enable building of gtk gfio"
290 echo "--disable-numa Disable libnuma even if found"
291 echo "--disable-rdma Disable RDMA support even if found"
292 echo "--disable-rados Disable Rados support even if found"
293 echo "--disable-rbd Disable Rados Block Device even if found"
294 echo "--disable-http Disable HTTP support even if found"
295 echo "--disable-gfapi Disable gfapi"
296 echo "--enable-libhdfs Enable hdfs support"
297 echo "--enable-libnfs Enable nfs support"
298 echo "--disable-libnfs Disable nfs support"
299 echo "--disable-lex Disable use of lex/yacc for math"
300 echo "--disable-pmem Disable pmem based engines even if found"
301 echo "--enable-lex Enable use of lex/yacc for math"
302 echo "--disable-shm Disable SHM support"
303 echo "--disable-optimizations Don't enable compiler optimizations"
304 echo "--enable-cuda Enable GPUDirect RDMA support"
305 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
306 echo "--disable-native Don't build for native host"
307 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
308 echo "--enable-libiscsi Enable iscsi support"
309 echo "--enable-libnbd Enable libnbd (NBD engine) support"
310 echo "--disable-xnvme Disable xnvme support even if found"
311 echo "--disable-libblkio Disable libblkio support even if found"
312 echo "--disable-libzbc Disable libzbc even if found"
313 echo "--disable-tcmalloc Disable tcmalloc support"
314 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
315 echo "--disable-dfs Disable DAOS File System support even if found"
316 echo "--enable-asan Enable address sanitizer"
317 echo "--seed-buckets= Number of seed buckets for the refill-buffer"
318 echo "--disable-tls Disable __thread local storage"
322 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
323 # Preferred compiler (can be overriden later after we know the platform):
325 # ${cross_prefix}gcc (if cross-prefix specified)
328 if test -z "${CC}${cross_prefix}"; then
335 cc="${CC-${cross_prefix}gcc}"
338 if check_define __ANDROID__ ; then
340 elif check_define __linux__ ; then
342 elif check_define __OpenBSD__ ; then
344 elif check_define __NetBSD__ ; then
346 elif check_define __sun__ ; then
348 CFLAGS="$CFLAGS -D_REENTRANT"
349 elif check_define _WIN32 ; then
355 echo "# Automatically generated by configure - do not modify" > $config_host_mak
356 printf "# Configured with:" >> $config_host_mak
357 printf " '%s'" "$0" "$@" >> $config_host_mak
358 echo >> $config_host_mak
359 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
361 if test "$no_shm" = "yes" ; then
362 output_sym "CONFIG_NO_SHM"
365 if test "$disable_opt" = "yes" ; then
366 output_sym "CONFIG_FIO_NO_OPT"
369 # Some host OSes need non-standard checks for which CPU to use.
370 # Note that these checks are broken for cross-compilation: if you're
371 # cross-compiling to one of these OSes then you'll need to specify
372 # the correct CPU with the --cpu option.
375 # Unless explicitly enabled, turn off lex.
376 # OpenBSD will hit syntax error when enabled.
377 if test -z "$disable_lex" ; then
384 CFLAGS="$CFLAGS -I/usr/local/include"
385 LDFLAGS="$LDFLAGS -L/usr/local/lib"
388 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
389 # we can run 64-bit userspace code.
390 # If the user didn't specify a CPU explicitly and the kernel says this is
391 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
393 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
396 # Avoid configure feature detection of features provided by weak symbols
403 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
404 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
408 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
409 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
412 LIBS="-lnsl -lsocket"
415 # We still force some options, so keep this message here.
416 echo "Forcing some known good options on Windows"
417 if test -z "${CC}${cross_prefix}"; then
418 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
419 cc="i686-w64-mingw32-gcc"
421 cc="x86_64-w64-mingw32-gcc"
425 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
426 if test -z "$target_win_ver"; then
427 # Default Windows API target
430 if test "$target_win_ver" = "7"; then
431 output_sym "CONFIG_WINDOWS_7"
432 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
434 fatal "Unknown target Windows version"
437 # We need this to be output_sym'd here because this is Windows specific.
438 # The regular configure path never sets this config.
439 output_sym "CONFIG_WINDOWSAIO"
440 # We now take the regular configuration path without having exit 0 here.
441 # Flags below are still necessary mostly for MinGW.
445 clock_gettime="yes" # clock_monotonic probe has dependency on this
446 clock_monotonic="yes"
448 pthread_condattr_setclock="no"
449 pthread_affinity="no"
453 # Now we know the target platform we can have another guess at the preferred
454 # compiler when it wasn't explictly set
455 if test -z "${CC}${cross_prefix}"; then
456 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
462 if test -z "$cc"; then
463 echo "configure: failed to find compiler"
467 if test ! -z "$cpu" ; then
468 # command line argument
470 elif check_define __i386__ ; then
472 elif check_define __x86_64__ ; then
474 elif check_define __sparc__ ; then
475 if check_define __arch64__ ; then
480 elif check_define _ARCH_PPC ; then
481 if check_define _ARCH_PPC64 ; then
486 elif check_define __mips__ ; then
488 elif check_define __ia64__ ; then
490 elif check_define __s390__ ; then
491 if check_define __s390x__ ; then
496 elif check_define __arm__ ; then
498 elif check_define __aarch64__ ; then
500 elif check_define __hppa__ ; then
506 # Normalise host CPU name and set ARCH.
508 ia64|ppc|ppc64|s390|s390x|sparc64)
511 i386|i486|i586|i686|i86pc|BePC)
523 hppa|parisc|parisc64)
537 ##########################################
538 # check cross compile
540 if test "$cross_compile" != "yes" ; then
549 if compile_prog "" "" "cross"; then
550 $TMPE 2>/dev/null || cross_compile="yes"
552 fatal "compile test failed"
555 ##########################################
557 if test "$bigendian" != "yes" ; then
560 if test "$cross_compile" = "no" ; then
562 #include <inttypes.h>
565 volatile uint32_t i=0x01234567;
566 return (*((uint8_t*)(&i))) == 0x67;
569 if compile_prog "" "" "endian"; then
570 $TMPE && bigendian="yes"
573 # If we're cross compiling, try our best to work it out and rely on the
574 # run-time check to fail if we get it wrong.
579 #if __BYTE_ORDER != __BIG_ENDIAN
580 # error "Unknown endianness"
584 compile_prog "" "" "endian" && bigendian="yes"
585 check_define "__ARMEB__" && bigendian="yes"
586 check_define "__MIPSEB__" && bigendian="yes"
590 print_config "Operating system" "$targetos"
591 print_config "CPU" "$cpu"
592 print_config "Big endian" "$bigendian"
593 if test ! -z "$target_win_ver"; then
594 print_config "Target Windows version" "$target_win_ver"
596 print_config "Compiler" "$cc"
597 print_config "Cross compile" "$cross_compile"
600 ##########################################
601 # See if we need to build a static build
602 if test "$build_static" = "yes" ; then
603 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
604 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
608 print_config "Static build" "$build_static"
610 ##########################################
611 # check for C11 atomics support
613 #include <stdatomic.h>
621 if ! compile_prog "" "" "C11 atomics"; then
623 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
624 echo "minimum versions with it - perhaps your compiler is too old?"
625 fatal "C11 atomics support not found"
629 ##########################################
634 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
637 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
641 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
643 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
646 fatal "Unknown wordsize"
648 print_config "Wordsize" "$wordsize"
650 ##########################################
652 if test "$zlib" != "yes" ; then
660 if (inflateInit(&stream) != Z_OK)
665 if compile_prog "" "-lz" "zlib" ; then
669 print_config "zlib" "$zlib"
671 ##########################################
672 # fcntl(F_FULLFSYNC) support
673 if test "$fcntl_sync" != "yes" ; then
680 int main(int argc, char **argv)
682 return fcntl(0, F_FULLFSYNC);
685 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
688 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
690 ##########################################
692 if test "$libaio" != "yes" ; then
695 if test "$esx" != "yes" ; then
705 if compile_prog "" "-laio" "libaio" ; then
708 if test "$libaio" = "yes" ; then
709 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
719 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
720 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
724 if compile_prog "" "" "libaio rw flags" ; then
730 print_config "Linux AIO support" "$libaio"
731 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
733 ##########################################
735 if test "$posix_aio" != "yes" ; then
738 if test "$posix_aio_lrt" != "yes" ; then
750 if compile_prog "" "" "posixaio" ; then
752 elif compile_prog "" "-lrt" "posixaio -lrt"; then
757 print_config "POSIX AIO support" "$posix_aio"
758 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
760 ##########################################
761 # posix aio fsync probe
762 if test "$posix_aio_fsync" != "yes" ; then
765 if test "$posix_aio" = "yes" ; then
772 return aio_fsync(O_SYNC, &cb);
776 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
780 print_config "POSIX AIO fsync" "$posix_aio_fsync"
782 ##########################################
783 # POSIX pshared attribute probe
784 if test "$posix_pshared" != "yes" ; then
791 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
792 # if defined(__CYGWIN__)
793 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
794 # elif defined(__APPLE__)
795 # include <AvailabilityMacros.h>
796 # include <TargetConditionals.h>
797 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
798 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
802 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
807 if compile_prog "" "$LIBS" "posix_pshared" ; then
810 print_config "POSIX pshared support" "$posix_pshared"
812 ##########################################
813 # POSIX pthread_condattr_setclock() probe
814 if test "$pthread_condattr_setclock" != "no" ; then
819 pthread_condattr_t condattr;
820 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
824 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
825 pthread_condattr_setclock=yes
826 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
827 pthread_condattr_setclock=yes
828 LIBS="$LIBS -lpthread"
831 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
833 ##########################################
834 # pthread_sigmask() probe
835 if test "$pthread_sigmask" != "yes" ; then
839 #include <stddef.h> /* NULL */
840 #include <signal.h> /* pthread_sigmask() */
843 return pthread_sigmask(0, NULL, NULL);
846 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
848 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
850 LIBS="$LIBS -lpthread"
852 print_config "pthread_sigmask()" "$pthread_sigmask"
854 ##########################################
855 # pthread_getaffinity_np() probe
856 if test "$pthread_getaffinity" != "yes" ; then
857 pthread_getaffinity="no"
860 #include <stddef.h> /* NULL */
861 #include <signal.h> /* pthread_sigmask() */
866 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
869 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
870 pthread_getaffinity="yes"
871 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
872 pthread_getaffinity="yes"
873 LIBS="$LIBS -lpthread"
875 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
877 ##########################################
879 if test "$solaris_aio" != "yes" ; then
883 #include <sys/types.h>
884 #include <sys/asynch.h>
889 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
893 if compile_prog "" "-laio" "solarisaio" ; then
897 print_config "Solaris AIO support" "$solaris_aio"
899 ##########################################
900 # __sync_fetch_and_add test
901 if test "$sfaa" != "yes" ; then
905 #include <inttypes.h>
906 static int sfaa(uint64_t *ptr)
908 return __sync_fetch_and_add(ptr, 0);
911 int main(int argc, char **argv)
918 if compile_prog "" "" "__sync_fetch_and_add()" ; then
921 print_config "__sync_fetch_and_add" "$sfaa"
923 ##########################################
924 # __sync_synchronize() test
925 if test "$sync_sync" != "yes" ; then
929 #include <inttypes.h>
931 int main(int argc, char **argv)
933 __sync_synchronize();
937 if compile_prog "" "" "__sync_synchronize()" ; then
940 print_config "__sync_synchronize" "$sync_sync"
942 ##########################################
943 # __sync_val_compare_and_swap() test
944 if test "$cmp_swap" != "yes" ; then
948 #include <inttypes.h>
950 int main(int argc, char **argv)
953 return __sync_val_compare_and_swap(&x, 1, 2);
956 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
959 print_config "__sync_val_compare_and_swap" "$cmp_swap"
961 ##########################################
963 if test "$libverbs" != "yes" ; then
967 #include <infiniband/verbs.h>
968 int main(int argc, char **argv)
970 struct ibv_pd *pd = ibv_alloc_pd(NULL);
974 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
977 print_config "libverbs" "$libverbs"
979 ##########################################
981 if test "$rdmacm" != "yes" ; then
986 #include <rdma/rdma_cma.h>
987 int main(int argc, char **argv)
989 rdma_destroy_qp(NULL);
993 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
996 print_config "rdmacm" "$rdmacm"
998 ##########################################
1000 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
1001 if test "$librpma" != "yes" ; then
1005 #include <librpma.h>
1008 void *ptr = rpma_cq_get_wc;
1009 (void) ptr; /* unused */
1013 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1016 print_config "librpma" "$librpma"
1018 ##########################################
1019 # libprotobuf-c probe
1020 if test "$libprotobuf_c" != "yes" ; then
1025 #include <protobuf-c/protobuf-c.h>
1026 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1027 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1029 int main(int argc, char **argv)
1031 (void)protobuf_c_message_check(NULL);
1035 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1038 print_config "libprotobuf_c" "$libprotobuf_c"
1040 ##########################################
1041 # asprintf() and vasprintf() probes
1042 if test "$have_asprintf" != "yes" ; then
1048 int main(int argc, char **argv)
1051 return asprintf(&buf, "%s", "str") == 0;
1054 if compile_prog "" "" "have_asprintf"; then
1057 print_config "asprintf()" "$have_asprintf"
1059 if test "$have_vasprintf" != "yes" ; then
1065 int main(int argc, char **argv)
1069 return vasprintf(&buf, "%s", ap) == 0;
1072 if compile_prog "" "" "have_vasprintf"; then
1073 have_vasprintf="yes"
1075 print_config "vasprintf()" "$have_vasprintf"
1077 ##########################################
1078 # Linux fallocate probe
1079 if test "$linux_fallocate" != "yes" ; then
1080 linux_fallocate="no"
1085 #include <linux/falloc.h>
1086 int main(int argc, char **argv)
1088 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1092 if compile_prog "" "" "linux_fallocate"; then
1093 linux_fallocate="yes"
1095 print_config "Linux fallocate" "$linux_fallocate"
1097 ##########################################
1098 # POSIX fadvise probe
1099 if test "$posix_fadvise" != "yes" ; then
1105 int main(int argc, char **argv)
1107 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1111 if compile_prog "" "" "posix_fadvise"; then
1114 print_config "POSIX fadvise" "$posix_fadvise"
1116 ##########################################
1117 # POSIX fallocate probe
1118 if test "$posix_fallocate" != "yes" ; then
1119 posix_fallocate="no"
1124 int main(int argc, char **argv)
1126 int r = posix_fallocate(0, 0, 1024);
1130 if compile_prog "" "" "posix_fallocate"; then
1131 posix_fallocate="yes"
1133 print_config "POSIX fallocate" "$posix_fallocate"
1135 ##########################################
1136 # sched_set/getaffinity 2 or 3 argument test
1137 if test "$linux_2arg_affinity" != "yes" ; then
1138 linux_2arg_affinity="no"
1140 if test "$linux_3arg_affinity" != "yes" ; then
1141 linux_3arg_affinity="no"
1145 int main(int argc, char **argv)
1147 cpu_set_t mask = { };
1149 return sched_setaffinity(0, sizeof(mask), &mask);
1152 if compile_prog "" "" "sched_setaffinity(,,)"; then
1153 linux_3arg_affinity="yes"
1157 int main(int argc, char **argv)
1159 cpu_set_t mask = { };
1161 return sched_setaffinity(0, &mask);
1164 if compile_prog "" "" "sched_setaffinity(,)"; then
1165 linux_2arg_affinity="yes"
1168 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1169 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1171 ##########################################
1172 # clock_gettime probe
1173 if test "$clock_gettime" != "yes" ; then
1179 int main(int argc, char **argv)
1183 return clock_gettime(0, &ts);
1186 if compile_prog "" "" "clock_gettime"; then
1188 elif compile_prog "" "-lrt" "clock_gettime"; then
1192 print_config "clock_gettime" "$clock_gettime"
1194 ##########################################
1195 # CLOCK_MONOTONIC probe
1196 if test "$clock_monotonic" != "yes" ; then
1197 clock_monotonic="no"
1199 if test "$clock_gettime" = "yes" ; then
1203 int main(int argc, char **argv)
1207 return clock_gettime(CLOCK_MONOTONIC, &ts);
1210 if compile_prog "" "$LIBS" "clock monotonic"; then
1211 clock_monotonic="yes"
1214 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1216 ##########################################
1218 if test "$clockid_t" != "yes" ; then
1224 int main(int argc, char **argv)
1226 volatile clockid_t cid;
1227 memset((void*)&cid, 0, sizeof(cid));
1231 if compile_prog "" "$LIBS" "clockid_t"; then
1234 print_config "clockid_t" "$clockid_t"
1236 ##########################################
1237 # gettimeofday() probe
1238 if test "$gettimeofday" != "yes" ; then
1242 #include <sys/time.h>
1244 int main(int argc, char **argv)
1247 return gettimeofday(&tv, NULL);
1250 if compile_prog "" "" "gettimeofday"; then
1253 print_config "gettimeofday" "$gettimeofday"
1255 ##########################################
1257 if test "$fdatasync" != "yes" ; then
1263 int main(int argc, char **argv)
1265 return fdatasync(0);
1268 if compile_prog "" "" "fdatasync"; then
1271 print_config "fdatasync" "$fdatasync"
1273 ##########################################
1275 if test "$pipe" != "yes" ; then
1280 int main(int argc, char **argv)
1286 if compile_prog "" "" "pipe"; then
1289 print_config "pipe()" "$pipe"
1291 ##########################################
1293 if test "$pipe2" != "yes" ; then
1298 int main(int argc, char **argv)
1301 return pipe2(fd, 0);
1304 if compile_prog "" "" "pipe2"; then
1307 print_config "pipe2()" "$pipe2"
1309 ##########################################
1311 if test "$pread" != "yes" ; then
1316 int main(int argc, char **argv)
1318 return pread(0, NULL, 0, 0);
1321 if compile_prog "" "" "pread"; then
1324 print_config "pread()" "$pread"
1326 ##########################################
1327 # sync_file_range() probe
1328 if test "$sync_file_range" != "yes" ; then
1329 sync_file_range="no"
1335 #include <linux/fs.h>
1336 int main(int argc, char **argv)
1338 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1339 SYNC_FILE_RANGE_WAIT_AFTER;
1340 return sync_file_range(0, 0, 0, flags);
1343 if compile_prog "" "" "sync_file_range"; then
1344 sync_file_range="yes"
1346 print_config "sync_file_range" "$sync_file_range"
1348 ##########################################
1349 # ASharedMemory_create() probe
1350 if test "$ASharedMemory_create" != "yes" ; then
1351 ASharedMemory_create="no"
1354 #include <android/sharedmem.h>
1355 int main(int argc, char **argv)
1357 return ASharedMemory_create("", 0);
1360 if compile_prog "" "" "ASharedMemory_create"; then
1361 ASharedMemory_create="yes"
1363 print_config "ASharedMemory_create" "$ASharedMemory_create"
1365 ##########################################
1366 # ext4 move extent probe
1367 if test "$ext4_me" != "yes" ; then
1372 #include <sys/ioctl.h>
1373 int main(int argc, char **argv)
1375 struct move_extent me;
1376 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1379 if compile_prog "" "" "ext4 move extent" ; then
1381 elif test $targetos = "Linux" ; then
1382 # On Linux, just default to it on and let it error at runtime if we really
1383 # don't have it. None of my updated systems have it defined, but it does
1384 # work. Takes a while to bubble back.
1387 print_config "EXT4 move extent" "$ext4_me"
1389 ##########################################
1391 if test "$linux_splice" != "yes" ; then
1397 int main(int argc, char **argv)
1399 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1402 if compile_prog "" "" "linux splice"; then
1405 print_config "Linux splice(2)" "$linux_splice"
1407 ##########################################
1409 if test "$libnuma" != "yes" ; then
1414 int main(int argc, char **argv)
1416 return numa_available();
1419 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1423 print_config "libnuma" "$libnuma"
1425 ##########################################
1426 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1427 if test "$libnuma" = "yes" ; then
1431 int main(int argc, char **argv)
1433 struct bitmask *mask = numa_parse_nodestring(NULL);
1434 return mask->size == 0;
1437 if compile_prog "" "" "libnuma api"; then
1440 print_config "libnuma v2" "$libnuma_v2"
1443 ##########################################
1445 if test "$strsep" != "yes" ; then
1450 int main(int argc, char **argv)
1452 static char *string = "This is a string";
1453 strsep(&string, "needle");
1457 if compile_prog "" "" "strsep"; then
1460 print_config "strsep" "$strsep"
1462 ##########################################
1463 # strcasestr() probe
1464 if test "$strcasestr" != "yes" ; then
1469 int main(int argc, char **argv)
1471 return strcasestr(argv[0], argv[1]) != NULL;
1474 if compile_prog "" "" "strcasestr"; then
1477 print_config "strcasestr" "$strcasestr"
1479 ##########################################
1481 if test "$strlcat" != "yes" ; then
1486 int main(int argc, char **argv)
1488 static char dst[64];
1489 static char *string = "This is a string";
1490 memset(dst, 0, sizeof(dst));
1491 strlcat(dst, string, sizeof(dst));
1495 if compile_prog "" "" "strlcat"; then
1498 print_config "strlcat" "$strlcat"
1500 ##########################################
1501 # getopt_long_only() probe
1502 if test "$getopt_long_only" != "yes" ; then
1503 getopt_long_only="no"
1509 int main(int argc, char **argv)
1511 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1515 if compile_prog "" "" "getopt_long_only"; then
1516 getopt_long_only="yes"
1518 print_config "getopt_long_only()" "$getopt_long_only"
1520 ##########################################
1522 if test "$inet_aton" != "yes" ; then
1527 #include <winsock2.h>
1529 #include <sys/socket.h>
1530 #include <arpa/inet.h>
1533 int main(int argc, char **argv)
1536 return inet_aton(NULL, &in);
1539 if compile_prog "" "" "inet_aton"; then
1542 print_config "inet_aton" "$inet_aton"
1544 ##########################################
1546 if test "$socklen_t" != "yes" ; then
1551 #include <winsock2.h>
1552 #include <ws2tcpip.h>
1554 #include <sys/socket.h>
1556 int main(int argc, char **argv)
1562 if compile_prog "" "" "socklen_t"; then
1565 print_config "socklen_t" "$socklen_t"
1567 ##########################################
1568 # Whether or not __thread is supported for TLS
1569 if test "$tls_thread" != "yes" ; then
1572 if test "$tls_check" != "no"; then
1575 static __thread int ret;
1576 int main(int argc, char **argv)
1581 if compile_prog "" "" "__thread"; then
1585 print_config "__thread" "$tls_thread"
1587 ##########################################
1588 # Check if we have required gtk/glib support for gfio
1589 if test "$gfio" != "yes" ; then
1592 if test "$gfio_check" = "yes" ; then
1596 #include <gtk/gtk.h>
1599 gdk_threads_enter();
1600 gdk_threads_leave();
1602 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1605 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1606 ORG_LDFLAGS=$LDFLAGS
1607 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1608 if test "$?" != "0" ; then
1609 echo "configure: gtk and gthread not found"
1612 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1613 if test "$?" != "0" ; then
1614 echo "configure: gtk and gthread not found"
1618 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1619 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1620 GFIO_LIBS="$LIBS $GTK_LIBS"
1621 CFLAGS="$CFLAGS $GTK_CFLAGS"
1623 echo "Please install gtk and gdk libraries"
1629 LDFLAGS=$ORG_LDFLAGS
1632 if test "$gfio_check" = "yes" ; then
1633 print_config "gtk 2.18 or higher" "$gfio"
1636 ##########################################
1637 # Check whether we have getrusage(RUSAGE_THREAD)
1638 if test "$rusage_thread" != "yes" ; then
1642 #include <sys/time.h>
1643 #include <sys/resource.h>
1644 int main(int argc, char **argv)
1647 getrusage(RUSAGE_THREAD, &ru);
1651 if compile_prog "" "" "RUSAGE_THREAD"; then
1654 print_config "RUSAGE_THREAD" "$rusage_thread"
1656 ##########################################
1657 # Check whether we have SCHED_IDLE
1658 if test "$sched_idle" != "yes" ; then
1663 int main(int argc, char **argv)
1665 struct sched_param p = { };
1667 return sched_setscheduler(0, SCHED_IDLE, &p);
1670 if compile_prog "" "" "SCHED_IDLE"; then
1673 print_config "SCHED_IDLE" "$sched_idle"
1675 ##########################################
1676 # Check whether we have TCP_NODELAY
1677 if test "$tcp_nodelay" != "yes" ; then
1682 #include <winsock2.h>
1685 #include <sys/types.h>
1686 #include <sys/socket.h>
1687 #include <netinet/tcp.h>
1689 int main(int argc, char **argv)
1691 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1694 if compile_prog "" "" "TCP_NODELAY"; then
1696 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1698 LIBS="$LIBS -lws2_32"
1700 print_config "TCP_NODELAY" "$tcp_nodelay"
1702 ##########################################
1703 # Check whether we have SO_SNDBUF
1704 if test "$window_size" != "yes" ; then
1709 #include <winsock2.h>
1712 #include <sys/types.h>
1713 #include <sys/socket.h>
1714 #include <netinet/tcp.h>
1716 int main(int argc, char **argv)
1718 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1719 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1722 if compile_prog "" "" "SO_SNDBUF"; then
1724 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1726 LIBS="$LIBS -lws2_32"
1728 print_config "Net engine window_size" "$window_size"
1730 ##########################################
1731 # Check whether we have TCP_MAXSEG
1732 if test "$mss" != "yes" ; then
1737 #include <winsock2.h>
1740 #include <sys/types.h>
1741 #include <sys/socket.h>
1742 #include <netinet/tcp.h>
1743 #include <arpa/inet.h>
1744 #include <netinet/in.h>
1746 int main(int argc, char **argv)
1748 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1751 if compile_prog "" "" "TCP_MAXSEG"; then
1753 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1755 LIBS="$LIBS -lws2_32"
1757 print_config "TCP_MAXSEG" "$mss"
1759 ##########################################
1760 # Check whether we have RLIMIT_MEMLOCK
1761 if test "$rlimit_memlock" != "yes" ; then
1765 #include <sys/time.h>
1766 #include <sys/resource.h>
1767 int main(int argc, char **argv)
1770 return getrlimit(RLIMIT_MEMLOCK, &rl);
1773 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1774 rlimit_memlock="yes"
1776 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1778 ##########################################
1779 # Check whether we have pwritev/preadv
1780 if test "$pwritev" != "yes" ; then
1785 #include <sys/uio.h>
1786 int main(int argc, char **argv)
1788 struct iovec iov[1] = { };
1790 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1793 if compile_prog "" "" "pwritev"; then
1796 print_config "pwritev/preadv" "$pwritev"
1798 ##########################################
1799 # Check whether we have pwritev2/preadv2
1800 if test "$pwritev2" != "yes" ; then
1805 #include <sys/uio.h>
1806 int main(int argc, char **argv)
1808 struct iovec iov[1] = { };
1810 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1813 if compile_prog "" "" "pwritev2"; then
1816 print_config "pwritev2/preadv2" "$pwritev2"
1818 ##########################################
1819 # Check whether we have the required functions for ipv6
1820 if test "$ipv6" != "yes" ; then
1825 #include <winsock2.h>
1826 #include <ws2tcpip.h>
1828 #include <sys/types.h>
1829 #include <sys/socket.h>
1830 #include <netinet/in.h>
1834 int main(int argc, char **argv)
1836 struct addrinfo hints = { };
1837 struct in6_addr addr = in6addr_any;
1840 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1842 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1847 if compile_prog "" "" "ipv6"; then
1850 print_config "IPv6 helpers" "$ipv6"
1852 ##########################################
1854 if test "$http" != "yes" ; then
1857 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1859 #include <curl/curl.h>
1860 #include <openssl/hmac.h>
1862 int main(int argc, char **argv)
1867 curl = curl_easy_init();
1868 curl_easy_cleanup(curl);
1870 ctx = HMAC_CTX_new();
1871 HMAC_CTX_reset(ctx);
1876 # openssl < 1.1.0 uses the HMAC_CTX type directly
1878 #include <curl/curl.h>
1879 #include <openssl/hmac.h>
1881 int main(int argc, char **argv)
1886 curl = curl_easy_init();
1887 curl_easy_cleanup(curl);
1889 HMAC_CTX_init(&ctx);
1890 HMAC_CTX_cleanup(&ctx);
1894 if test "$disable_http" != "yes"; then
1895 HTTP_LIBS="-lcurl -lssl -lcrypto"
1896 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1897 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1899 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1903 print_config "http engine" "$http"
1905 ##########################################
1907 if test "$rados" != "yes" ; then
1911 #include <rados/librados.h>
1913 int main(int argc, char **argv)
1916 rados_ioctx_t io_ctx;
1917 const char cluster_name[] = "ceph";
1918 const char user_name[] = "client.admin";
1919 const char pool[] = "rados";
1921 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1922 rados_create2(&cluster, cluster_name, user_name, 0);
1923 rados_ioctx_create(cluster, pool, &io_ctx);
1928 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1931 print_config "Rados engine" "$rados"
1933 ##########################################
1935 if test "$rbd" != "yes" ; then
1939 #include <rbd/librbd.h>
1941 int main(int argc, char **argv)
1944 rados_ioctx_t io_ctx;
1945 const char cluster_name[] = "ceph";
1946 const char user_name[] = "client.admin";
1947 const char pool[] = "rbd";
1948 int major, minor, extra;
1950 rbd_version(&major, &minor, &extra);
1951 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1952 rados_create2(&cluster, cluster_name, user_name, 0);
1953 rados_ioctx_create(cluster, pool, &io_ctx);
1958 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1961 print_config "Rados Block Device engine" "$rbd"
1963 ##########################################
1964 # check for rbd_poll
1965 if test "$rbd_poll" != "yes" ; then
1968 if test "$rbd" = "yes"; then
1970 #include <rbd/librbd.h>
1971 #include <sys/eventfd.h>
1973 int main(int argc, char **argv)
1976 rbd_completion_t comp;
1978 int fd = eventfd(0, EFD_NONBLOCK);
1979 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1980 rbd_poll_io_events(image, comp, 1);
1985 if compile_prog "" "-lrbd -lrados" "rbd"; then
1988 print_config "rbd_poll" "$rbd_poll"
1991 ##########################################
1992 # check for rbd_invalidate_cache()
1993 if test "$rbd_inval" != "yes" ; then
1996 if test "$rbd" = "yes"; then
1998 #include <rbd/librbd.h>
2000 int main(int argc, char **argv)
2004 return rbd_invalidate_cache(image);
2007 if compile_prog "" "-lrbd -lrados" "rbd"; then
2010 print_config "rbd_invalidate_cache" "$rbd_inval"
2013 ##########################################
2014 # Check whether we have setvbuf
2015 if test "$setvbuf" != "yes" ; then
2020 int main(int argc, char **argv)
2024 setvbuf(f, buf, _IOFBF, sizeof(buf));
2028 if compile_prog "" "" "setvbuf"; then
2031 print_config "setvbuf" "$setvbuf"
2033 ##########################################
2035 if test "$gfapi" != "yes" ; then
2039 #include <glusterfs/api/glfs.h>
2041 int main(int argc, char **argv)
2043 glfs_t *g = glfs_new("foo");
2048 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2051 print_config "Gluster API engine" "$gfapi"
2053 ##########################################
2054 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2055 if test "$gfapi" = "yes" ; then
2058 #include <glusterfs/api/glfs.h>
2060 int main(int argc, char **argv)
2063 int ret = glfs_fadvise(fd, 0, 0, 1);
2068 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2071 print_config "Gluster API use fadvise" "$gf_fadvise"
2074 ##########################################
2075 # check for newer gfapi
2076 if test "$gfapi" = "yes" ; then
2079 #include <glusterfs/api/glfs.h>
2081 int main(int argc, char **argv)
2083 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2086 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2089 print_config "Gluster new API" "$gf_new"
2092 ##########################################
2093 # check for gfapi trim support
2094 if test "$gf_trim" != "yes" ; then
2097 if test "$gfapi" = "yes" ; then
2099 #include <glusterfs/api/glfs.h>
2101 int main(int argc, char **argv)
2103 return glfs_discard_async(NULL, 0, 0);
2106 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2109 print_config "Gluster API trim support" "$gf_trim"
2112 ##########################################
2113 # Check if we support stckf on s390
2114 if test "$s390_z196_facilities" != "yes" ; then
2115 s390_z196_facilities="no"
2118 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2119 int main(int argc, char **argv)
2121 /* We want just 1 double word to be returned. */
2122 register unsigned long reg0 asm("0") = 0;
2123 unsigned long stfle_bits;
2124 asm volatile(".machine push" "\n\t"
2125 ".machine \"z9-109\"" "\n\t"
2128 : "=QS" (stfle_bits), "+d" (reg0)
2131 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2137 if compile_prog "" "" "s390_z196_facilities"; then
2139 if [ $? -eq 0 ]; then
2140 s390_z196_facilities="yes"
2143 print_config "s390_z196_facilities" "$s390_z196_facilities"
2145 ##########################################
2146 # Check if we have required environment variables configured for libhdfs
2147 if test "$libhdfs" = "yes" ; then
2149 if test "$JAVA_HOME" = "" ; then
2150 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2153 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2154 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2157 if test "$FIO_LIBHDFS_LIB" = "" ; then
2158 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2161 if test "$hdfs_conf_error" = "1" ; then
2162 feature_not_found "libhdfs" ""
2165 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2166 FIO_HDFS_CPU="amd64"
2169 print_config "HDFS engine" "$libhdfs"
2171 ##########################################
2172 # Check whether we have MTD
2173 if test "$mtd" != "yes" ; then
2178 #include <mtd/mtd-user.h>
2179 #include <sys/ioctl.h>
2180 int main(int argc, char **argv)
2182 struct mtd_write_req ops;
2183 struct mtd_info_user info;
2184 memset(&ops, 0, sizeof(ops));
2185 info.type = MTD_MLCNANDFLASH;
2186 return ioctl(0, MEMGETINFO, &info);
2189 if compile_prog "" "" "mtd"; then
2192 print_config "MTD" "$mtd"
2194 ##########################################
2195 # Check whether we have libpmem
2196 if test "$libpmem" != "yes" ; then
2200 #include <libpmem.h>
2202 int main(int argc, char **argv)
2204 return pmem_is_pmem(NULL, 0);
2207 if compile_prog "" "-lpmem" "libpmem"; then
2210 print_config "libpmem" "$libpmem"
2212 ##########################################
2213 # Check whether libpmem's version >= 1.5
2214 if test "$libpmem1_5" != "yes" ; then
2217 if test "$libpmem" = "yes"; then
2219 #include <libpmem.h>
2221 int main(int argc, char **argv)
2223 pmem_memcpy(NULL, NULL, 0, 0);
2227 if compile_prog "" "-lpmem" "libpmem1_5"; then
2231 print_config "libpmem1_5" "$libpmem1_5"
2233 ##########################################
2234 # Check whether we have libpmem2
2235 if test "$libpmem2" != "yes" ; then
2239 #include <libpmem2.h>
2240 int main(int argc, char **argv)
2242 struct pmem2_config *cfg;
2243 pmem2_config_new(&cfg);
2244 pmem2_config_delete(&cfg);
2248 if compile_prog "" "-lpmem2" "libpmem2"; then
2251 print_config "libpmem2" "$libpmem2"
2253 # Choose libpmem-based ioengines
2254 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2256 if test "$libpmem1_5" = "yes"; then
2261 ##########################################
2262 # Report whether dev-dax engine is enabled
2263 print_config "PMDK dev-dax engine" "$devdax"
2265 ##########################################
2266 # Report whether libpmem engine is enabled
2267 print_config "PMDK libpmem engine" "$pmem"
2269 ##########################################
2270 # Check whether we support DDN's IME
2271 if test "$libime" != "yes" ; then
2275 #include <ime_native.h>
2276 int main(int argc, char **argv)
2280 rc = ime_native_finalize();
2284 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2286 CFLAGS="-I${ime_path}/include $CFLAGS"
2287 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2288 LIBS="-lim_client $LIBS"
2290 print_config "DDN's Infinite Memory Engine" "$libime"
2292 ##########################################
2293 # Check if we have libiscsi
2294 if test "$libiscsi" != "no" ; then
2295 if check_min_lib_version libiscsi 1.9.0; then
2297 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2298 libiscsi_libs=$(pkg-config --libs libiscsi)
2303 print_config "iscsi engine" "$libiscsi"
2305 ##########################################
2306 # Check if we have libnbd (for NBD support)
2307 if test "$libnbd" != "no" ; then
2308 if check_min_lib_version libnbd 0.9.8; then
2310 libnbd_cflags=$(pkg-config --cflags libnbd)
2311 libnbd_libs=$(pkg-config --libs libnbd)
2316 print_config "NBD engine" "$libnbd"
2318 ##########################################
2319 # check for dfs (DAOS File System)
2320 if test "$dfs" != "no" ; then
2324 #include <daos_fs.h>
2326 int main(int argc, char **argv)
2332 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2337 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2343 print_config "DAOS File System (dfs) Engine" "$dfs"
2345 ##########################################
2346 # Check if we have libnfs (for userspace nfs support).
2347 if test "$libnfs" != "no" ; then
2348 if $(pkg-config libnfs > /dev/null 2>&1); then
2350 libnfs_cflags=$(pkg-config --cflags libnfs)
2351 libnfs_libs=$(pkg-config --libs libnfs)
2353 if test "$libnfs" = "yes" ; then
2354 feature_not_found "libnfs" "libnfs"
2359 print_config "NFS engine" "$libnfs"
2361 ##########################################
2362 # Check if we have lex/yacc available
2367 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2368 if test "$targetos" != "SunOS" ; then
2378 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2382 if test "$arith" = "yes" ; then
2384 extern int yywrap(void);
2386 int main(int argc, char **argv)
2392 if compile_prog "" "-lfl" "flex"; then
2394 elif compile_prog "" "-ll" "lex"; then
2403 # Check if lex fails using -o
2404 if test "$arith" = "yes" ; then
2405 if test "$force_no_lex_o" = "yes" ; then
2408 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2416 print_config "lex/yacc for arithmetic" "$arith"
2418 ##########################################
2419 # Check whether we have setmntent/getmntent
2420 if test "$getmntent" != "yes" ; then
2426 int main(int argc, char **argv)
2428 FILE *mtab = setmntent(NULL, "r");
2429 struct mntent *mnt = getmntent(mtab);
2434 if compile_prog "" "" "getmntent"; then
2437 print_config "getmntent" "$getmntent"
2439 ##########################################
2440 # Check whether we have getmntinfo
2441 # These are originally added for BSDs, but may also work
2442 # on other operating systems with getmntinfo(3).
2444 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2445 # Note that NetBSD needs -Werror to catch warning as error.
2446 if test "$getmntinfo" != "yes" ; then
2451 #include <sys/param.h>
2452 #include <sys/mount.h>
2453 int main(int argc, char **argv)
2456 return getmntinfo(&st, MNT_NOWAIT);
2459 if compile_prog "-Werror" "" "getmntinfo"; then
2462 print_config "getmntinfo" "$getmntinfo"
2464 # getmntinfo(3) for NetBSD.
2465 if test "$getmntinfo_statvfs" != "yes" ; then
2466 getmntinfo_statvfs="no"
2470 #include <sys/statvfs.h>
2471 int main(int argc, char **argv)
2474 return getmntinfo(&st, MNT_NOWAIT);
2477 # Skip the test if the one with statfs arg is detected.
2478 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2479 getmntinfo_statvfs="yes"
2480 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2483 ##########################################
2484 # Check whether we have _Static_assert
2485 if test "$static_assert" != "yes" ; then
2497 int main(int argc, char **argv)
2499 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2503 if compile_prog "" "" "static_assert"; then
2506 print_config "Static Assert" "$static_assert"
2508 ##########################################
2509 # Check whether we have bool / stdbool.h
2510 if test "$have_bool" != "yes" ; then
2514 #include <stdbool.h>
2515 int main(int argc, char **argv)
2518 return var != false;
2521 if compile_prog "" "" "bool"; then
2524 print_config "bool" "$have_bool"
2526 ##########################################
2527 # Check whether we have strndup()
2532 int main(int argc, char **argv)
2534 char *res = strndup("test string", 8);
2540 if compile_prog "" "" "strndup"; then
2543 print_config "strndup" "$strndup"
2545 ##########################################
2546 # <valgrind/drd.h> probe
2547 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2548 # also available but not the other way around.
2549 if test "$valgrind_dev" != "yes" ; then
2553 #include <valgrind/drd.h>
2554 int main(int argc, char **argv)
2559 if compile_prog "" "" "valgrind_dev"; then
2562 print_config "Valgrind headers" "$valgrind_dev"
2564 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2565 ##########################################
2566 # <linux/blkzoned.h> probe
2567 if test "$linux_blkzoned" != "yes" ; then
2571 #include <linux/blkzoned.h>
2572 int main(int argc, char **argv)
2577 if compile_prog "" "" "linux_blkzoned"; then
2578 linux_blkzoned="yes"
2580 print_config "Zoned block device support" "$linux_blkzoned"
2582 ##########################################
2583 # Check BLK_ZONE_REP_CAPACITY
2585 #include <linux/blkzoned.h>
2588 return BLK_ZONE_REP_CAPACITY;
2591 if compile_prog "" "" "blkzoned report capacity"; then
2592 output_sym "CONFIG_HAVE_REP_CAPACITY"
2597 print_config "Zoned block device capacity" "$rep_capacity"
2600 ##########################################
2603 #include <libzbc/zbc.h>
2604 int main(int argc, char **argv)
2606 struct zbc_device *dev = NULL;
2608 return zbc_open("foo=bar", O_RDONLY, &dev);
2611 if test "$libzbc" != "no" ; then
2612 if [ -e /usr/include/libzbc/libzbc ]; then
2614 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2616 if compile_prog "" "-lzbc" "libzbc"; then
2618 if ! check_min_lib_version libzbc 5; then
2622 if test "$libzbc" = "yes" ; then
2623 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2628 print_config "libzbc engine" "$libzbc"
2630 if test "$targetos" = "Linux" ; then
2631 ##########################################
2632 # Check NVME_URING_CMD support
2634 #include <linux/nvme_ioctl.h>
2637 return sizeof(struct nvme_uring_cmd);
2640 if compile_prog "" "" "nvme uring cmd"; then
2641 output_sym "CONFIG_NVME_URING_CMD"
2642 nvme_uring_cmd="yes"
2646 print_config "NVMe uring command support" "$nvme_uring_cmd"
2649 ##########################################
2650 # Check if we have xnvme
2651 if test "$xnvme" != "no" ; then
2652 if check_min_lib_version xnvme 0.2.0; then
2654 xnvme_cflags=$(pkg-config --cflags xnvme)
2655 xnvme_libs=$(pkg-config --libs xnvme)
2660 print_config "xnvme engine" "$xnvme"
2662 ##########################################
2663 # Check if we have libblkio
2664 if test "$libblkio" != "no" ; then
2665 if check_min_lib_version blkio 1.0.0; then
2667 libblkio_cflags=$(pkg-config --cflags blkio)
2668 libblkio_libs=$(pkg-config --libs blkio)
2670 if test "$libblkio" = "yes" ; then
2671 feature_not_found "libblkio" "libblkio-dev or libblkio-devel"
2676 print_config "libblkio engine" "$libblkio"
2678 ##########################################
2679 # check march=armv8-a+crc+crypto
2680 march_armv8_a_crc_crypto="no"
2681 if test "$cpu" = "arm64" ; then
2684 #include <arm_acle.h>
2685 #include <arm_neon.h>
2686 #include <sys/auxv.h>
2691 /* Can we also do a runtime probe? */
2693 return getauxval(AT_HWCAP);
2694 #elif defined(__APPLE__)
2697 # error "Don't know how to do runtime probe for ARM CRC32c"
2701 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2702 march_armv8_a_crc_crypto="yes"
2703 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2707 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2709 ##########################################
2711 if test "$cuda" != "no" ; then
2714 int main(int argc, char **argv)
2719 if compile_prog "" "-lcuda" "cuda"; then
2723 if test "$cuda" = "yes" ; then
2724 feature_not_found "cuda" ""
2729 print_config "cuda" "$cuda"
2731 ##########################################
2733 if test "$libcufile" != "no" ; then
2737 int main(int argc, char* argv[]) {
2742 if compile_prog "" "-lcuda -lcudart -lcufile -ldl" "libcufile"; then
2744 LIBS="-lcuda -lcudart -lcufile -ldl $LIBS"
2746 if test "$libcufile" = "yes" ; then
2747 feature_not_found "libcufile" ""
2752 print_config "libcufile" "$libcufile"
2754 ##########################################
2755 # check for cc -march=native
2758 int main(int argc, char **argv)
2763 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2764 compile_prog "-march=native" "" "march=native"; then
2767 print_config "Build march=native" "$build_native"
2769 ##########################################
2771 if test "$cunit" != "yes" ; then
2775 #include <CUnit/CUnit.h>
2776 #include <CUnit/Basic.h>
2779 if (CU_initialize_registry() != CUE_SUCCESS)
2780 return CU_get_error();
2781 CU_basic_set_mode(CU_BRM_VERBOSE);
2782 CU_basic_run_tests();
2783 CU_cleanup_registry();
2784 return CU_get_error();
2787 if compile_prog "" "-lcunit" "CUnit"; then
2790 print_config "CUnit" "$cunit"
2792 ##########################################
2793 # check for __kernel_rwf_t
2796 #include <linux/fs.h>
2797 int main(int argc, char **argv)
2804 if compile_prog "" "" "__kernel_rwf_t"; then
2805 __kernel_rwf_t="yes"
2807 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2809 ##########################################
2810 # check if gcc has -Wimplicit-fallthrough=2
2813 int main(int argc, char **argv)
2818 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2821 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2823 ##########################################
2824 # check if the compiler has -Wno-stringop-concatenation
2829 int main(int argc, char **argv)
2831 return printf("%s\n", argv[0]);
2834 if compile_prog "-Wno-stringop-truncation -Werror" "" "no_stringop"; then
2837 print_config "-Wno-stringop-truncation" "$no_stringop"
2839 ##########################################
2840 # check for MADV_HUGEPAGE support
2841 if test "$thp" != "yes" ; then
2844 if test "$esx" != "yes" ; then
2846 #include <sys/mman.h>
2849 return madvise(0, 0x1000, MADV_HUGEPAGE);
2852 if compile_prog "" "" "thp" ; then
2855 if test "$thp" = "yes" ; then
2856 feature_not_found "Transparent Huge Page" ""
2861 print_config "MADV_HUGEPAGE" "$thp"
2863 ##########################################
2864 # check for gettid()
2868 int main(int argc, char **argv)
2873 if compile_prog "" "" "gettid"; then
2876 print_config "gettid" "$gettid"
2878 ##########################################
2879 # check for statx(2) support by libc
2883 #include <sys/stat.h>
2885 int main(int argc, char **argv)
2888 return statx(-1, *argv, 0, 0, &st);
2891 if compile_prog "" "" "statx"; then
2894 print_config "statx(2)/libc" "$statx"
2896 ##########################################
2897 # check for statx(2) support by kernel
2901 #include <linux/stat.h>
2902 #include <sys/stat.h>
2903 #include <sys/syscall.h>
2905 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2906 struct statx *buffer)
2908 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2911 int main(int argc, char **argv)
2914 return _statx(-1, *argv, 0, 0, &st);
2917 if compile_prog "" "" "statx_syscall"; then
2920 print_config "statx(2)/syscall" "$statx_syscall"
2922 ##########################################
2923 # check for Windows PDB generation support
2924 if test "pdb" != "no" ; then
2931 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2934 if test "$pdb" = "yes"; then
2935 feature_not_found "PDB" "clang and lld"
2942 print_config "Windows PDB generation" "$pdb"
2944 ##########################################
2945 # check for timerfd support
2947 if test "$esx" != "yes" ; then
2949 #include <sys/time.h>
2950 #include <sys/timerfd.h>
2952 int main(int argc, char **argv)
2954 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2957 if compile_prog "" "" "timerfd_create"; then
2958 timerfd_create="yes"
2961 print_config "timerfd_create" "$timerfd_create"
2963 #############################################################################
2965 if test "$wordsize" = "64" ; then
2966 output_sym "CONFIG_64BIT"
2967 elif test "$wordsize" = "32" ; then
2968 output_sym "CONFIG_32BIT"
2970 fatal "Unknown wordsize!"
2972 if test "$bigendian" = "yes" ; then
2973 output_sym "CONFIG_BIG_ENDIAN"
2975 output_sym "CONFIG_LITTLE_ENDIAN"
2977 if test "$zlib" = "yes" ; then
2978 output_sym "CONFIG_ZLIB"
2980 if test "$libaio" = "yes" ; then
2981 output_sym "CONFIG_LIBAIO"
2982 if test "$libaio_rw_flags" = "yes" ; then
2983 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2986 if test "$posix_aio" = "yes" ; then
2987 output_sym "CONFIG_POSIXAIO"
2989 if test "$posix_aio_fsync" = "yes" ; then
2990 output_sym "CONFIG_POSIXAIO_FSYNC"
2992 if test "$posix_pshared" = "yes" ; then
2993 output_sym "CONFIG_PSHARED"
2995 if test "$pthread_condattr_setclock" = "yes" ; then
2996 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2998 if test "$pthread_sigmask" = "yes" ; then
2999 output_sym "CONFIG_PTHREAD_SIGMASK"
3001 if test "$pthread_getaffinity" = "yes" ; then
3002 output_sym "CONFIG_PTHREAD_GETAFFINITY"
3004 if test "$have_asprintf" = "yes" ; then
3005 output_sym "CONFIG_HAVE_ASPRINTF"
3007 if test "$have_vasprintf" = "yes" ; then
3008 output_sym "CONFIG_HAVE_VASPRINTF"
3010 if test "$linux_fallocate" = "yes" ; then
3011 output_sym "CONFIG_LINUX_FALLOCATE"
3013 if test "$posix_fallocate" = "yes" ; then
3014 output_sym "CONFIG_POSIX_FALLOCATE"
3016 if test "$fdatasync" = "yes" ; then
3017 output_sym "CONFIG_FDATASYNC"
3019 if test "$pipe" = "yes" ; then
3020 output_sym "CONFIG_PIPE"
3022 if test "$pipe2" = "yes" ; then
3023 output_sym "CONFIG_PIPE2"
3025 if test "$pread" = "yes" ; then
3026 output_sym "CONFIG_PREAD"
3028 if test "$sync_file_range" = "yes" ; then
3029 output_sym "CONFIG_SYNC_FILE_RANGE"
3031 if test "$ASharedMemory_create" = "yes" ; then
3032 output_sym "CONFIG_ASHAREDMEMORY_CREATE"
3034 if test "$sfaa" = "yes" ; then
3035 output_sym "CONFIG_SFAA"
3037 if test "$sync_sync" = "yes" ; then
3038 output_sym "CONFIG_SYNC_SYNC"
3040 if test "$cmp_swap" = "yes" ; then
3041 output_sym "CONFIG_CMP_SWAP"
3043 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3044 output_sym "CONFIG_RDMA"
3046 # librpma is supported on the 'x86_64' architecture for now
3047 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3048 -a "$librpma" = "yes" \
3049 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3050 output_sym "CONFIG_LIBRPMA_APM"
3052 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3053 -a "$librpma" = "yes" -a "$libprotobuf_c" = "yes" \
3054 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3055 output_sym "CONFIG_LIBRPMA_GPSPM"
3057 if test "$clock_gettime" = "yes" ; then
3058 output_sym "CONFIG_CLOCK_GETTIME"
3060 if test "$clock_monotonic" = "yes" ; then
3061 output_sym "CONFIG_CLOCK_MONOTONIC"
3063 if test "$clockid_t" = "yes"; then
3064 output_sym "CONFIG_CLOCKID_T"
3066 if test "$gettimeofday" = "yes" ; then
3067 output_sym "CONFIG_GETTIMEOFDAY"
3069 if test "$posix_fadvise" = "yes" ; then
3070 output_sym "CONFIG_POSIX_FADVISE"
3072 if test "$linux_3arg_affinity" = "yes" ; then
3073 output_sym "CONFIG_3ARG_AFFINITY"
3074 elif test "$linux_2arg_affinity" = "yes" ; then
3075 output_sym "CONFIG_2ARG_AFFINITY"
3077 if test "$strsep" = "yes" ; then
3078 output_sym "CONFIG_STRSEP"
3080 if test "$strcasestr" = "yes" ; then
3081 output_sym "CONFIG_STRCASESTR"
3083 if test "$strlcat" = "yes" ; then
3084 output_sym "CONFIG_STRLCAT"
3086 if test "$getopt_long_only" = "yes" ; then
3087 output_sym "CONFIG_GETOPT_LONG_ONLY"
3089 if test "$inet_aton" = "yes" ; then
3090 output_sym "CONFIG_INET_ATON"
3092 if test "$socklen_t" = "yes" ; then
3093 output_sym "CONFIG_SOCKLEN_T"
3095 if test "$ext4_me" = "yes" ; then
3096 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3098 if test "$linux_splice" = "yes" ; then
3099 output_sym "CONFIG_LINUX_SPLICE"
3101 if test "$libnuma_v2" = "yes" ; then
3102 output_sym "CONFIG_LIBNUMA"
3104 if test "$solaris_aio" = "yes" ; then
3105 output_sym "CONFIG_SOLARISAIO"
3107 if test "$tls_thread" = "yes" ; then
3108 output_sym "CONFIG_TLS_THREAD"
3110 if test "$rusage_thread" = "yes" ; then
3111 output_sym "CONFIG_RUSAGE_THREAD"
3113 if test "$gfio" = "yes" ; then
3114 output_sym "CONFIG_GFIO"
3116 if test "$esx" = "yes" ; then
3117 output_sym "CONFIG_ESX"
3118 output_sym "CONFIG_NO_SHM"
3120 if test "$sched_idle" = "yes" ; then
3121 output_sym "CONFIG_SCHED_IDLE"
3123 if test "$tcp_nodelay" = "yes" ; then
3124 output_sym "CONFIG_TCP_NODELAY"
3126 if test "$window_size" = "yes" ; then
3127 output_sym "CONFIG_NET_WINDOWSIZE"
3129 if test "$mss" = "yes" ; then
3130 output_sym "CONFIG_NET_MSS"
3132 if test "$rlimit_memlock" = "yes" ; then
3133 output_sym "CONFIG_RLIMIT_MEMLOCK"
3135 if test "$pwritev" = "yes" ; then
3136 output_sym "CONFIG_PWRITEV"
3138 if test "$pwritev2" = "yes" ; then
3139 output_sym "CONFIG_PWRITEV2"
3141 if test "$ipv6" = "yes" ; then
3142 output_sym "CONFIG_IPV6"
3144 if test "$http" = "yes" ; then
3145 output_sym "CONFIG_HTTP"
3147 if test "$rados" = "yes" ; then
3148 output_sym "CONFIG_RADOS"
3150 if test "$rbd" = "yes" ; then
3151 output_sym "CONFIG_RBD"
3153 if test "$rbd_poll" = "yes" ; then
3154 output_sym "CONFIG_RBD_POLL"
3156 if test "$rbd_inval" = "yes" ; then
3157 output_sym "CONFIG_RBD_INVAL"
3159 if test "$setvbuf" = "yes" ; then
3160 output_sym "CONFIG_SETVBUF"
3162 if test "$s390_z196_facilities" = "yes" ; then
3163 output_sym "CONFIG_S390_Z196_FACILITIES"
3164 CFLAGS="$CFLAGS -march=z9-109"
3167 if test "$gfapi" = "yes" ; then
3168 output_sym "CONFIG_GFAPI"
3170 if test "$gf_fadvise" = "yes" ; then
3171 output_sym "CONFIG_GF_FADVISE"
3173 if test "$gf_trim" = "yes" ; then
3174 output_sym "CONFIG_GF_TRIM"
3176 if test "$gf_new" = "yes" ; then
3177 output_sym "CONFIG_GF_NEW_API"
3179 if test "$libhdfs" = "yes" ; then
3180 output_sym "CONFIG_LIBHDFS"
3181 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3182 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3183 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3184 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3186 if test "$mtd" = "yes" ; then
3187 output_sym "CONFIG_MTD"
3189 if test "$devdax" = "yes" ; then
3190 output_sym "CONFIG_LINUX_DEVDAX"
3192 if test "$pmem" = "yes" ; then
3193 output_sym "CONFIG_LIBPMEM"
3195 if test "$libpmem2" = "yes" ; then
3196 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3198 if test "$libime" = "yes" ; then
3199 output_sym "CONFIG_IME"
3201 if test "$arith" = "yes" ; then
3202 output_sym "CONFIG_ARITHMETIC"
3203 if test "$yacc_is_bison" = "yes" ; then
3204 echo "YACC=bison -y" >> $config_host_mak
3206 echo "YACC=yacc" >> $config_host_mak
3208 if test "$lex_use_o" = "yes" ; then
3209 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3212 if test "$getmntent" = "yes" ; then
3213 output_sym "CONFIG_GETMNTENT"
3215 if test "$getmntinfo" = "yes" ; then
3216 output_sym "CONFIG_GETMNTINFO"
3218 if test "$getmntinfo_statvfs" = "yes" ; then
3219 output_sym "CONFIG_GETMNTINFO_STATVFS"
3221 if test "$static_assert" = "yes" ; then
3222 output_sym "CONFIG_STATIC_ASSERT"
3224 if test "$have_bool" = "yes" ; then
3225 output_sym "CONFIG_HAVE_BOOL"
3227 if test "$strndup" = "yes" ; then
3228 output_sym "CONFIG_HAVE_STRNDUP"
3230 if test "$disable_opt" = "yes" ; then
3231 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3233 if test "$valgrind_dev" = "yes"; then
3234 output_sym "CONFIG_VALGRIND_DEV"
3236 if test "$linux_blkzoned" = "yes" ; then
3237 output_sym "CONFIG_HAS_BLKZONED"
3239 if test "$libzbc" = "yes" ; then
3240 output_sym "CONFIG_LIBZBC"
3242 if test "$zlib" = "no" ; then
3243 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3244 if test "$build_static" = "yes"; then
3245 echo "Note that some distros have separate packages for static libraries."
3248 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3249 output_sym "ARCH_HAVE_CRC_CRYPTO"
3251 if test "$cuda" = "yes" ; then
3252 output_sym "CONFIG_CUDA"
3254 if test "$libcufile" = "yes" ; then
3255 output_sym "CONFIG_LIBCUFILE"
3257 if test "$dfs" = "yes" ; then
3258 output_sym "CONFIG_DFS"
3260 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3261 output_sym "CONFIG_BUILD_NATIVE"
3263 if test "$cunit" = "yes" ; then
3264 output_sym "CONFIG_HAVE_CUNIT"
3266 if test "$__kernel_rwf_t" = "yes"; then
3267 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3269 if test "$gettid" = "yes"; then
3270 output_sym "CONFIG_HAVE_GETTID"
3272 if test "$statx" = "yes"; then
3273 output_sym "CONFIG_HAVE_STATX"
3275 if test "$statx_syscall" = "yes"; then
3276 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3278 if test "$timerfd_create" = "yes"; then
3279 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3281 if test "$fallthrough" = "yes"; then
3282 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3284 if test "$no_stringop" = "yes"; then
3285 output_sym "CONFIG_HAVE_NO_STRINGOP"
3287 if test "$thp" = "yes" ; then
3288 output_sym "CONFIG_HAVE_THP"
3290 if test "$libiscsi" = "yes" ; then
3291 output_sym "CONFIG_LIBISCSI"
3292 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3293 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3294 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3296 if test "$libnbd" = "yes" ; then
3297 output_sym "CONFIG_LIBNBD"
3298 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3299 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3300 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3302 if test "$libnfs" = "yes" ; then
3303 output_sym "CONFIG_LIBNFS"
3304 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3305 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3307 if test "$xnvme" = "yes" ; then
3308 output_sym "CONFIG_LIBXNVME"
3309 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3310 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3312 if test "$libblkio" = "yes" ; then
3313 output_sym "CONFIG_LIBBLKIO"
3314 echo "LIBBLKIO_CFLAGS=$libblkio_cflags" >> $config_host_mak
3315 echo "LIBBLKIO_LIBS=$libblkio_libs" >> $config_host_mak
3317 if test "$dynamic_engines" = "yes" ; then
3318 output_sym "CONFIG_DYNAMIC_ENGINES"
3320 if test "$pdb" = yes; then
3321 output_sym "CONFIG_PDB"
3323 if test "$fcntl_sync" = "yes" ; then
3324 output_sym "CONFIG_FCNTL_SYNC"
3326 if test "$asan" = "yes"; then
3327 CFLAGS="$CFLAGS -fsanitize=address"
3328 LDFLAGS="$LDFLAGS -fsanitize=address"
3330 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3332 int main(int argc, char **argv)
3337 if test "$disable_tcmalloc" != "yes"; then
3338 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3340 LIBS="-ltcmalloc $LIBS"
3341 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3343 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3348 print_config "TCMalloc support" "$tcmalloc"
3349 if ! num "$seed_buckets"; then
3351 elif test "$seed_buckets" -lt 2; then
3353 elif test "$seed_buckets" -gt 16; then
3356 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3357 print_config "seed_buckets" "$seed_buckets"
3359 echo "LIBS+=$LIBS" >> $config_host_mak
3360 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3361 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3362 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3363 echo "CC=$cc" >> $config_host_mak
3364 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3365 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3367 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3368 cat > Makefile <<EOF
3369 SRCDIR:=`dirname $0`
3370 include \$(SRCDIR)/Makefile