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
502 elif check_define __loongarch64 ; then
508 # Normalise host CPU name and set ARCH.
510 ia64|ppc|ppc64|s390|s390x|sparc64|loongarch64)
513 i386|i486|i586|i686|i86pc|BePC)
525 hppa|parisc|parisc64)
539 ##########################################
540 # check cross compile
542 if test "$cross_compile" != "yes" ; then
551 if compile_prog "" "" "cross"; then
552 $TMPE 2>/dev/null || cross_compile="yes"
554 fatal "compile test failed"
557 ##########################################
559 if test "$bigendian" != "yes" ; then
562 if test "$cross_compile" = "no" ; then
564 #include <inttypes.h>
567 volatile uint32_t i=0x01234567;
568 return (*((uint8_t*)(&i))) == 0x67;
571 if compile_prog "" "" "endian"; then
572 $TMPE && bigendian="yes"
575 # If we're cross compiling, try our best to work it out and rely on the
576 # run-time check to fail if we get it wrong.
581 #if __BYTE_ORDER != __BIG_ENDIAN
582 # error "Unknown endianness"
586 compile_prog "" "" "endian" && bigendian="yes"
587 check_define "__ARMEB__" && bigendian="yes"
588 check_define "__MIPSEB__" && bigendian="yes"
592 print_config "Operating system" "$targetos"
593 print_config "CPU" "$cpu"
594 print_config "Big endian" "$bigendian"
595 if test ! -z "$target_win_ver"; then
596 print_config "Target Windows version" "$target_win_ver"
598 print_config "Compiler" "$cc"
599 print_config "Cross compile" "$cross_compile"
602 ##########################################
603 # See if we need to build a static build
604 if test "$build_static" = "yes" ; then
605 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
606 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
610 print_config "Static build" "$build_static"
612 ##########################################
613 # check for C11 atomics support
615 #include <stdatomic.h>
623 if ! compile_prog "" "" "C11 atomics"; then
625 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
626 echo "minimum versions with it - perhaps your compiler is too old?"
627 fatal "C11 atomics support not found"
631 ##########################################
636 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
639 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
643 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
645 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
648 fatal "Unknown wordsize"
650 print_config "Wordsize" "$wordsize"
652 ##########################################
654 if test "$zlib" != "yes" ; then
662 if (inflateInit(&stream) != Z_OK)
667 if compile_prog "" "-lz" "zlib" ; then
671 print_config "zlib" "$zlib"
673 ##########################################
674 # fcntl(F_FULLFSYNC) support
675 if test "$fcntl_sync" != "yes" ; then
682 int main(int argc, char **argv)
684 return fcntl(0, F_FULLFSYNC);
687 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
690 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
692 ##########################################
694 if test "$libaio" != "yes" ; then
697 if test "$esx" != "yes" ; then
707 if compile_prog "" "-laio" "libaio" ; then
710 if test "$libaio" = "yes" ; then
711 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
721 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
722 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
726 if compile_prog "" "" "libaio rw flags" ; then
732 print_config "Linux AIO support" "$libaio"
733 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
735 ##########################################
737 if test "$posix_aio" != "yes" ; then
740 if test "$posix_aio_lrt" != "yes" ; then
752 if compile_prog "" "" "posixaio" ; then
754 elif compile_prog "" "-lrt" "posixaio -lrt"; then
759 print_config "POSIX AIO support" "$posix_aio"
760 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
762 ##########################################
763 # posix aio fsync probe
764 if test "$posix_aio_fsync" != "yes" ; then
767 if test "$posix_aio" = "yes" ; then
774 return aio_fsync(O_SYNC, &cb);
778 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
782 print_config "POSIX AIO fsync" "$posix_aio_fsync"
784 ##########################################
785 # POSIX pshared attribute probe
786 if test "$posix_pshared" != "yes" ; then
793 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
794 # if defined(__CYGWIN__)
795 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
796 # elif defined(__APPLE__)
797 # include <AvailabilityMacros.h>
798 # include <TargetConditionals.h>
799 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
800 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
804 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
809 if compile_prog "" "$LIBS" "posix_pshared" ; then
812 print_config "POSIX pshared support" "$posix_pshared"
814 ##########################################
815 # POSIX pthread_condattr_setclock() probe
816 if test "$pthread_condattr_setclock" != "no" ; then
821 pthread_condattr_t condattr;
822 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
826 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
827 pthread_condattr_setclock=yes
828 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
829 pthread_condattr_setclock=yes
830 LIBS="$LIBS -lpthread"
833 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
835 ##########################################
836 # pthread_sigmask() probe
837 if test "$pthread_sigmask" != "yes" ; then
841 #include <stddef.h> /* NULL */
842 #include <signal.h> /* pthread_sigmask() */
845 return pthread_sigmask(0, NULL, NULL);
848 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
850 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
852 LIBS="$LIBS -lpthread"
854 print_config "pthread_sigmask()" "$pthread_sigmask"
856 ##########################################
857 # pthread_getaffinity_np() probe
858 if test "$pthread_getaffinity" != "yes" ; then
859 pthread_getaffinity="no"
862 #include <stddef.h> /* NULL */
863 #include <signal.h> /* pthread_sigmask() */
868 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
871 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
872 pthread_getaffinity="yes"
873 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
874 pthread_getaffinity="yes"
875 LIBS="$LIBS -lpthread"
877 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
879 ##########################################
881 if test "$solaris_aio" != "yes" ; then
885 #include <sys/types.h>
886 #include <sys/asynch.h>
891 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
895 if compile_prog "" "-laio" "solarisaio" ; then
899 print_config "Solaris AIO support" "$solaris_aio"
901 ##########################################
902 # __sync_fetch_and_add test
903 if test "$sfaa" != "yes" ; then
907 #include <inttypes.h>
908 static int sfaa(uint64_t *ptr)
910 return __sync_fetch_and_add(ptr, 0);
913 int main(int argc, char **argv)
920 if compile_prog "" "" "__sync_fetch_and_add()" ; then
923 print_config "__sync_fetch_and_add" "$sfaa"
925 ##########################################
926 # __sync_synchronize() test
927 if test "$sync_sync" != "yes" ; then
931 #include <inttypes.h>
933 int main(int argc, char **argv)
935 __sync_synchronize();
939 if compile_prog "" "" "__sync_synchronize()" ; then
942 print_config "__sync_synchronize" "$sync_sync"
944 ##########################################
945 # __sync_val_compare_and_swap() test
946 if test "$cmp_swap" != "yes" ; then
950 #include <inttypes.h>
952 int main(int argc, char **argv)
955 return __sync_val_compare_and_swap(&x, 1, 2);
958 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
961 print_config "__sync_val_compare_and_swap" "$cmp_swap"
963 ##########################################
965 if test "$libverbs" != "yes" ; then
969 #include <infiniband/verbs.h>
970 int main(int argc, char **argv)
972 struct ibv_pd *pd = ibv_alloc_pd(NULL);
976 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
979 print_config "libverbs" "$libverbs"
981 ##########################################
983 if test "$rdmacm" != "yes" ; then
988 #include <rdma/rdma_cma.h>
989 int main(int argc, char **argv)
991 rdma_destroy_qp(NULL);
995 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
998 print_config "rdmacm" "$rdmacm"
1000 ##########################################
1002 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
1003 if test "$librpma" != "yes" ; then
1007 #include <librpma.h>
1010 void *ptr = rpma_cq_get_wc;
1011 (void) ptr; /* unused */
1015 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1018 print_config "librpma" "$librpma"
1020 ##########################################
1021 # libprotobuf-c probe
1022 if test "$libprotobuf_c" != "yes" ; then
1027 #include <protobuf-c/protobuf-c.h>
1028 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1029 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1031 int main(int argc, char **argv)
1033 (void)protobuf_c_message_check(NULL);
1037 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1040 print_config "libprotobuf_c" "$libprotobuf_c"
1042 ##########################################
1043 # asprintf() and vasprintf() probes
1044 if test "$have_asprintf" != "yes" ; then
1050 int main(int argc, char **argv)
1053 return asprintf(&buf, "%s", "str") == 0;
1056 if compile_prog "" "" "have_asprintf"; then
1059 print_config "asprintf()" "$have_asprintf"
1061 if test "$have_vasprintf" != "yes" ; then
1067 int main(int argc, char **argv)
1071 return vasprintf(&buf, "%s", ap) == 0;
1074 if compile_prog "" "" "have_vasprintf"; then
1075 have_vasprintf="yes"
1077 print_config "vasprintf()" "$have_vasprintf"
1079 ##########################################
1080 # Linux fallocate probe
1081 if test "$linux_fallocate" != "yes" ; then
1082 linux_fallocate="no"
1087 #include <linux/falloc.h>
1088 int main(int argc, char **argv)
1090 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1094 if compile_prog "" "" "linux_fallocate"; then
1095 linux_fallocate="yes"
1097 print_config "Linux fallocate" "$linux_fallocate"
1099 ##########################################
1100 # POSIX fadvise probe
1101 if test "$posix_fadvise" != "yes" ; then
1107 int main(int argc, char **argv)
1109 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1113 if compile_prog "" "" "posix_fadvise"; then
1116 print_config "POSIX fadvise" "$posix_fadvise"
1118 ##########################################
1119 # POSIX fallocate probe
1120 if test "$posix_fallocate" != "yes" ; then
1121 posix_fallocate="no"
1126 int main(int argc, char **argv)
1128 int r = posix_fallocate(0, 0, 1024);
1132 if compile_prog "" "" "posix_fallocate"; then
1133 posix_fallocate="yes"
1135 print_config "POSIX fallocate" "$posix_fallocate"
1137 ##########################################
1138 # sched_set/getaffinity 2 or 3 argument test
1139 if test "$linux_2arg_affinity" != "yes" ; then
1140 linux_2arg_affinity="no"
1142 if test "$linux_3arg_affinity" != "yes" ; then
1143 linux_3arg_affinity="no"
1147 int main(int argc, char **argv)
1149 cpu_set_t mask = { };
1151 return sched_setaffinity(0, sizeof(mask), &mask);
1154 if compile_prog "" "" "sched_setaffinity(,,)"; then
1155 linux_3arg_affinity="yes"
1159 int main(int argc, char **argv)
1161 cpu_set_t mask = { };
1163 return sched_setaffinity(0, &mask);
1166 if compile_prog "" "" "sched_setaffinity(,)"; then
1167 linux_2arg_affinity="yes"
1170 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1171 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1173 ##########################################
1174 # clock_gettime probe
1175 if test "$clock_gettime" != "yes" ; then
1181 int main(int argc, char **argv)
1185 return clock_gettime(0, &ts);
1188 if compile_prog "" "" "clock_gettime"; then
1190 elif compile_prog "" "-lrt" "clock_gettime"; then
1194 print_config "clock_gettime" "$clock_gettime"
1196 ##########################################
1197 # CLOCK_MONOTONIC probe
1198 if test "$clock_monotonic" != "yes" ; then
1199 clock_monotonic="no"
1201 if test "$clock_gettime" = "yes" ; then
1205 int main(int argc, char **argv)
1209 return clock_gettime(CLOCK_MONOTONIC, &ts);
1212 if compile_prog "" "$LIBS" "clock monotonic"; then
1213 clock_monotonic="yes"
1216 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1218 ##########################################
1220 if test "$clockid_t" != "yes" ; then
1226 int main(int argc, char **argv)
1228 volatile clockid_t cid;
1229 memset((void*)&cid, 0, sizeof(cid));
1233 if compile_prog "" "$LIBS" "clockid_t"; then
1236 print_config "clockid_t" "$clockid_t"
1238 ##########################################
1239 # gettimeofday() probe
1240 if test "$gettimeofday" != "yes" ; then
1244 #include <sys/time.h>
1246 int main(int argc, char **argv)
1249 return gettimeofday(&tv, NULL);
1252 if compile_prog "" "" "gettimeofday"; then
1255 print_config "gettimeofday" "$gettimeofday"
1257 ##########################################
1259 if test "$fdatasync" != "yes" ; then
1265 int main(int argc, char **argv)
1267 return fdatasync(0);
1270 if compile_prog "" "" "fdatasync"; then
1273 print_config "fdatasync" "$fdatasync"
1275 ##########################################
1277 if test "$pipe" != "yes" ; then
1282 int main(int argc, char **argv)
1288 if compile_prog "" "" "pipe"; then
1291 print_config "pipe()" "$pipe"
1293 ##########################################
1295 if test "$pipe2" != "yes" ; then
1300 int main(int argc, char **argv)
1303 return pipe2(fd, 0);
1306 if compile_prog "" "" "pipe2"; then
1309 print_config "pipe2()" "$pipe2"
1311 ##########################################
1313 if test "$pread" != "yes" ; then
1318 int main(int argc, char **argv)
1320 return pread(0, NULL, 0, 0);
1323 if compile_prog "" "" "pread"; then
1326 print_config "pread()" "$pread"
1328 ##########################################
1329 # sync_file_range() probe
1330 if test "$sync_file_range" != "yes" ; then
1331 sync_file_range="no"
1337 #include <linux/fs.h>
1338 int main(int argc, char **argv)
1340 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1341 SYNC_FILE_RANGE_WAIT_AFTER;
1342 return sync_file_range(0, 0, 0, flags);
1345 if compile_prog "" "" "sync_file_range"; then
1346 sync_file_range="yes"
1348 print_config "sync_file_range" "$sync_file_range"
1350 ##########################################
1351 # ASharedMemory_create() probe
1352 if test "$ASharedMemory_create" != "yes" ; then
1353 ASharedMemory_create="no"
1356 #include <android/sharedmem.h>
1357 int main(int argc, char **argv)
1359 return ASharedMemory_create("", 0);
1362 if compile_prog "" "" "ASharedMemory_create"; then
1363 ASharedMemory_create="yes"
1365 print_config "ASharedMemory_create" "$ASharedMemory_create"
1367 ##########################################
1368 # ext4 move extent probe
1369 if test "$ext4_me" != "yes" ; then
1374 #include <sys/ioctl.h>
1375 int main(int argc, char **argv)
1377 struct move_extent me;
1378 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1381 if compile_prog "" "" "ext4 move extent" ; then
1383 elif test $targetos = "Linux" ; then
1384 # On Linux, just default to it on and let it error at runtime if we really
1385 # don't have it. None of my updated systems have it defined, but it does
1386 # work. Takes a while to bubble back.
1389 print_config "EXT4 move extent" "$ext4_me"
1391 ##########################################
1393 if test "$linux_splice" != "yes" ; then
1399 int main(int argc, char **argv)
1401 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1404 if compile_prog "" "" "linux splice"; then
1407 print_config "Linux splice(2)" "$linux_splice"
1409 ##########################################
1411 if test "$libnuma" != "yes" ; then
1416 int main(int argc, char **argv)
1418 return numa_available();
1421 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1425 print_config "libnuma" "$libnuma"
1427 ##########################################
1428 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1429 if test "$libnuma" = "yes" ; then
1433 int main(int argc, char **argv)
1435 struct bitmask *mask = numa_parse_nodestring(NULL);
1436 return mask->size == 0;
1439 if compile_prog "" "" "libnuma api"; then
1442 print_config "libnuma v2" "$libnuma_v2"
1445 ##########################################
1447 if test "$strsep" != "yes" ; then
1452 int main(int argc, char **argv)
1454 static char *string = "This is a string";
1455 strsep(&string, "needle");
1459 if compile_prog "" "" "strsep"; then
1462 print_config "strsep" "$strsep"
1464 ##########################################
1465 # strcasestr() probe
1466 if test "$strcasestr" != "yes" ; then
1471 int main(int argc, char **argv)
1473 return strcasestr(argv[0], argv[1]) != NULL;
1476 if compile_prog "" "" "strcasestr"; then
1479 print_config "strcasestr" "$strcasestr"
1481 ##########################################
1483 if test "$strlcat" != "yes" ; then
1488 int main(int argc, char **argv)
1490 static char dst[64];
1491 static char *string = "This is a string";
1492 memset(dst, 0, sizeof(dst));
1493 strlcat(dst, string, sizeof(dst));
1497 if compile_prog "" "" "strlcat"; then
1500 print_config "strlcat" "$strlcat"
1502 ##########################################
1503 # getopt_long_only() probe
1504 if test "$getopt_long_only" != "yes" ; then
1505 getopt_long_only="no"
1511 int main(int argc, char **argv)
1513 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1517 if compile_prog "" "" "getopt_long_only"; then
1518 getopt_long_only="yes"
1520 print_config "getopt_long_only()" "$getopt_long_only"
1522 ##########################################
1524 if test "$inet_aton" != "yes" ; then
1529 #include <winsock2.h>
1531 #include <sys/socket.h>
1532 #include <arpa/inet.h>
1535 int main(int argc, char **argv)
1538 return inet_aton(NULL, &in);
1541 if compile_prog "" "" "inet_aton"; then
1544 print_config "inet_aton" "$inet_aton"
1546 ##########################################
1548 if test "$socklen_t" != "yes" ; then
1553 #include <winsock2.h>
1554 #include <ws2tcpip.h>
1556 #include <sys/socket.h>
1558 int main(int argc, char **argv)
1564 if compile_prog "" "" "socklen_t"; then
1567 print_config "socklen_t" "$socklen_t"
1569 ##########################################
1570 # Whether or not __thread is supported for TLS
1571 if test "$tls_thread" != "yes" ; then
1574 if test "$tls_check" != "no"; then
1577 static __thread int ret;
1578 int main(int argc, char **argv)
1583 if compile_prog "" "" "__thread"; then
1587 print_config "__thread" "$tls_thread"
1589 ##########################################
1590 # Check if we have required gtk/glib support for gfio
1591 if test "$gfio" != "yes" ; then
1594 if test "$gfio_check" = "yes" ; then
1598 #include <gtk/gtk.h>
1601 gdk_threads_enter();
1602 gdk_threads_leave();
1604 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1607 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1608 ORG_LDFLAGS=$LDFLAGS
1609 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1610 if test "$?" != "0" ; then
1611 echo "configure: gtk and gthread not found"
1614 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1615 if test "$?" != "0" ; then
1616 echo "configure: gtk and gthread not found"
1620 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1621 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1622 GFIO_LIBS="$LIBS $GTK_LIBS"
1623 CFLAGS="$CFLAGS $GTK_CFLAGS"
1625 echo "Please install gtk and gdk libraries"
1631 LDFLAGS=$ORG_LDFLAGS
1634 if test "$gfio_check" = "yes" ; then
1635 print_config "gtk 2.18 or higher" "$gfio"
1638 ##########################################
1639 # Check whether we have getrusage(RUSAGE_THREAD)
1640 if test "$rusage_thread" != "yes" ; then
1644 #include <sys/time.h>
1645 #include <sys/resource.h>
1646 int main(int argc, char **argv)
1649 getrusage(RUSAGE_THREAD, &ru);
1653 if compile_prog "" "" "RUSAGE_THREAD"; then
1656 print_config "RUSAGE_THREAD" "$rusage_thread"
1658 ##########################################
1659 # Check whether we have SCHED_IDLE
1660 if test "$sched_idle" != "yes" ; then
1665 int main(int argc, char **argv)
1667 struct sched_param p = { };
1669 return sched_setscheduler(0, SCHED_IDLE, &p);
1672 if compile_prog "" "" "SCHED_IDLE"; then
1675 print_config "SCHED_IDLE" "$sched_idle"
1677 ##########################################
1678 # Check whether we have TCP_NODELAY
1679 if test "$tcp_nodelay" != "yes" ; then
1684 #include <winsock2.h>
1687 #include <sys/types.h>
1688 #include <sys/socket.h>
1689 #include <netinet/tcp.h>
1691 int main(int argc, char **argv)
1693 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1696 if compile_prog "" "" "TCP_NODELAY"; then
1698 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1700 LIBS="$LIBS -lws2_32"
1702 print_config "TCP_NODELAY" "$tcp_nodelay"
1704 ##########################################
1705 # Check whether we have SO_SNDBUF
1706 if test "$window_size" != "yes" ; then
1711 #include <winsock2.h>
1714 #include <sys/types.h>
1715 #include <sys/socket.h>
1716 #include <netinet/tcp.h>
1718 int main(int argc, char **argv)
1720 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1721 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1724 if compile_prog "" "" "SO_SNDBUF"; then
1726 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1728 LIBS="$LIBS -lws2_32"
1730 print_config "Net engine window_size" "$window_size"
1732 ##########################################
1733 # Check whether we have TCP_MAXSEG
1734 if test "$mss" != "yes" ; then
1739 #include <winsock2.h>
1742 #include <sys/types.h>
1743 #include <sys/socket.h>
1744 #include <netinet/tcp.h>
1745 #include <arpa/inet.h>
1746 #include <netinet/in.h>
1748 int main(int argc, char **argv)
1750 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1753 if compile_prog "" "" "TCP_MAXSEG"; then
1755 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1757 LIBS="$LIBS -lws2_32"
1759 print_config "TCP_MAXSEG" "$mss"
1761 ##########################################
1762 # Check whether we have RLIMIT_MEMLOCK
1763 if test "$rlimit_memlock" != "yes" ; then
1767 #include <sys/time.h>
1768 #include <sys/resource.h>
1769 int main(int argc, char **argv)
1772 return getrlimit(RLIMIT_MEMLOCK, &rl);
1775 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1776 rlimit_memlock="yes"
1778 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1780 ##########################################
1781 # Check whether we have pwritev/preadv
1782 if test "$pwritev" != "yes" ; then
1787 #include <sys/uio.h>
1788 int main(int argc, char **argv)
1790 struct iovec iov[1] = { };
1792 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1795 if compile_prog "" "" "pwritev"; then
1798 print_config "pwritev/preadv" "$pwritev"
1800 ##########################################
1801 # Check whether we have pwritev2/preadv2
1802 if test "$pwritev2" != "yes" ; then
1807 #include <sys/uio.h>
1808 int main(int argc, char **argv)
1810 struct iovec iov[1] = { };
1812 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1815 if compile_prog "" "" "pwritev2"; then
1818 print_config "pwritev2/preadv2" "$pwritev2"
1820 ##########################################
1821 # Check whether we have the required functions for ipv6
1822 if test "$ipv6" != "yes" ; then
1827 #include <winsock2.h>
1828 #include <ws2tcpip.h>
1830 #include <sys/types.h>
1831 #include <sys/socket.h>
1832 #include <netinet/in.h>
1836 int main(int argc, char **argv)
1838 struct addrinfo hints = { };
1839 struct in6_addr addr = in6addr_any;
1842 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1844 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1849 if compile_prog "" "" "ipv6"; then
1852 print_config "IPv6 helpers" "$ipv6"
1854 ##########################################
1856 if test "$http" != "yes" ; then
1859 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1861 #include <curl/curl.h>
1862 #include <openssl/hmac.h>
1864 int main(int argc, char **argv)
1869 curl = curl_easy_init();
1870 curl_easy_cleanup(curl);
1872 ctx = HMAC_CTX_new();
1873 HMAC_CTX_reset(ctx);
1878 # openssl < 1.1.0 uses the HMAC_CTX type directly
1880 #include <curl/curl.h>
1881 #include <openssl/hmac.h>
1883 int main(int argc, char **argv)
1888 curl = curl_easy_init();
1889 curl_easy_cleanup(curl);
1891 HMAC_CTX_init(&ctx);
1892 HMAC_CTX_cleanup(&ctx);
1896 if test "$disable_http" != "yes"; then
1897 HTTP_LIBS="-lcurl -lssl -lcrypto"
1898 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1899 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1901 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1905 print_config "http engine" "$http"
1907 ##########################################
1909 if test "$rados" != "yes" ; then
1913 #include <rados/librados.h>
1915 int main(int argc, char **argv)
1918 rados_ioctx_t io_ctx;
1919 const char cluster_name[] = "ceph";
1920 const char user_name[] = "client.admin";
1921 const char pool[] = "rados";
1923 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1924 rados_create2(&cluster, cluster_name, user_name, 0);
1925 rados_ioctx_create(cluster, pool, &io_ctx);
1930 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1933 print_config "Rados engine" "$rados"
1935 ##########################################
1937 if test "$rbd" != "yes" ; then
1941 #include <rbd/librbd.h>
1943 int main(int argc, char **argv)
1946 rados_ioctx_t io_ctx;
1947 const char cluster_name[] = "ceph";
1948 const char user_name[] = "client.admin";
1949 const char pool[] = "rbd";
1950 int major, minor, extra;
1952 rbd_version(&major, &minor, &extra);
1953 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1954 rados_create2(&cluster, cluster_name, user_name, 0);
1955 rados_ioctx_create(cluster, pool, &io_ctx);
1960 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1963 print_config "Rados Block Device engine" "$rbd"
1965 ##########################################
1966 # check for rbd_poll
1967 if test "$rbd_poll" != "yes" ; then
1970 if test "$rbd" = "yes"; then
1972 #include <rbd/librbd.h>
1973 #include <sys/eventfd.h>
1975 int main(int argc, char **argv)
1978 rbd_completion_t comp;
1980 int fd = eventfd(0, EFD_NONBLOCK);
1981 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1982 rbd_poll_io_events(image, comp, 1);
1987 if compile_prog "" "-lrbd -lrados" "rbd"; then
1990 print_config "rbd_poll" "$rbd_poll"
1993 ##########################################
1994 # check for rbd_invalidate_cache()
1995 if test "$rbd_inval" != "yes" ; then
1998 if test "$rbd" = "yes"; then
2000 #include <rbd/librbd.h>
2002 int main(int argc, char **argv)
2006 return rbd_invalidate_cache(image);
2009 if compile_prog "" "-lrbd -lrados" "rbd"; then
2012 print_config "rbd_invalidate_cache" "$rbd_inval"
2015 ##########################################
2016 # Check whether we have setvbuf
2017 if test "$setvbuf" != "yes" ; then
2022 int main(int argc, char **argv)
2026 setvbuf(f, buf, _IOFBF, sizeof(buf));
2030 if compile_prog "" "" "setvbuf"; then
2033 print_config "setvbuf" "$setvbuf"
2035 ##########################################
2037 if test "$gfapi" != "yes" ; then
2041 #include <glusterfs/api/glfs.h>
2043 int main(int argc, char **argv)
2045 glfs_t *g = glfs_new("foo");
2050 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2053 print_config "Gluster API engine" "$gfapi"
2055 ##########################################
2056 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2057 if test "$gfapi" = "yes" ; then
2060 #include <glusterfs/api/glfs.h>
2062 int main(int argc, char **argv)
2065 int ret = glfs_fadvise(fd, 0, 0, 1);
2070 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2073 print_config "Gluster API use fadvise" "$gf_fadvise"
2076 ##########################################
2077 # check for newer gfapi
2078 if test "$gfapi" = "yes" ; then
2081 #include <glusterfs/api/glfs.h>
2083 int main(int argc, char **argv)
2085 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2088 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2091 print_config "Gluster new API" "$gf_new"
2094 ##########################################
2095 # check for gfapi trim support
2096 if test "$gf_trim" != "yes" ; then
2099 if test "$gfapi" = "yes" ; then
2101 #include <glusterfs/api/glfs.h>
2103 int main(int argc, char **argv)
2105 return glfs_discard_async(NULL, 0, 0);
2108 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2111 print_config "Gluster API trim support" "$gf_trim"
2114 ##########################################
2115 # Check if we support stckf on s390
2116 if test "$s390_z196_facilities" != "yes" ; then
2117 s390_z196_facilities="no"
2120 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2121 int main(int argc, char **argv)
2123 /* We want just 1 double word to be returned. */
2124 register unsigned long reg0 asm("0") = 0;
2125 unsigned long stfle_bits;
2126 asm volatile(".machine push" "\n\t"
2127 ".machine \"z9-109\"" "\n\t"
2130 : "=QS" (stfle_bits), "+d" (reg0)
2133 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2139 if compile_prog "" "" "s390_z196_facilities"; then
2141 if [ $? -eq 0 ]; then
2142 s390_z196_facilities="yes"
2145 print_config "s390_z196_facilities" "$s390_z196_facilities"
2147 ##########################################
2148 # Check if we have required environment variables configured for libhdfs
2149 if test "$libhdfs" = "yes" ; then
2151 if test "$JAVA_HOME" = "" ; then
2152 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2155 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2156 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2159 if test "$FIO_LIBHDFS_LIB" = "" ; then
2160 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2163 if test "$hdfs_conf_error" = "1" ; then
2164 feature_not_found "libhdfs" ""
2167 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2168 FIO_HDFS_CPU="amd64"
2171 print_config "HDFS engine" "$libhdfs"
2173 ##########################################
2174 # Check whether we have MTD
2175 if test "$mtd" != "yes" ; then
2180 #include <mtd/mtd-user.h>
2181 #include <sys/ioctl.h>
2182 int main(int argc, char **argv)
2184 struct mtd_write_req ops;
2185 struct mtd_info_user info;
2186 memset(&ops, 0, sizeof(ops));
2187 info.type = MTD_MLCNANDFLASH;
2188 return ioctl(0, MEMGETINFO, &info);
2191 if compile_prog "" "" "mtd"; then
2194 print_config "MTD" "$mtd"
2196 ##########################################
2197 # Check whether we have libpmem
2198 if test "$libpmem" != "yes" ; then
2202 #include <libpmem.h>
2204 int main(int argc, char **argv)
2206 return pmem_is_pmem(NULL, 0);
2209 if compile_prog "" "-lpmem" "libpmem"; then
2212 print_config "libpmem" "$libpmem"
2214 ##########################################
2215 # Check whether libpmem's version >= 1.5
2216 if test "$libpmem1_5" != "yes" ; then
2219 if test "$libpmem" = "yes"; then
2221 #include <libpmem.h>
2223 int main(int argc, char **argv)
2225 pmem_memcpy(NULL, NULL, 0, 0);
2229 if compile_prog "" "-lpmem" "libpmem1_5"; then
2233 print_config "libpmem1_5" "$libpmem1_5"
2235 ##########################################
2236 # Check whether we have libpmem2
2237 if test "$libpmem2" != "yes" ; then
2241 #include <libpmem2.h>
2242 int main(int argc, char **argv)
2244 struct pmem2_config *cfg;
2245 pmem2_config_new(&cfg);
2246 pmem2_config_delete(&cfg);
2250 if compile_prog "" "-lpmem2" "libpmem2"; then
2253 print_config "libpmem2" "$libpmem2"
2255 # Choose libpmem-based ioengines
2256 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2258 if test "$libpmem1_5" = "yes"; then
2263 ##########################################
2264 # Report whether dev-dax engine is enabled
2265 print_config "PMDK dev-dax engine" "$devdax"
2267 ##########################################
2268 # Report whether libpmem engine is enabled
2269 print_config "PMDK libpmem engine" "$pmem"
2271 ##########################################
2272 # Check whether we support DDN's IME
2273 if test "$libime" != "yes" ; then
2277 #include <ime_native.h>
2278 int main(int argc, char **argv)
2282 rc = ime_native_finalize();
2286 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2288 CFLAGS="-I${ime_path}/include $CFLAGS"
2289 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2290 LIBS="-lim_client $LIBS"
2292 print_config "DDN's Infinite Memory Engine" "$libime"
2294 ##########################################
2295 # Check if we have libiscsi
2296 if test "$libiscsi" != "no" ; then
2297 if check_min_lib_version libiscsi 1.9.0; then
2299 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2300 libiscsi_libs=$(pkg-config --libs libiscsi)
2305 print_config "iscsi engine" "$libiscsi"
2307 ##########################################
2308 # Check if we have libnbd (for NBD support)
2309 if test "$libnbd" != "no" ; then
2310 if check_min_lib_version libnbd 0.9.8; then
2312 libnbd_cflags=$(pkg-config --cflags libnbd)
2313 libnbd_libs=$(pkg-config --libs libnbd)
2318 print_config "NBD engine" "$libnbd"
2320 ##########################################
2321 # check for dfs (DAOS File System)
2322 if test "$dfs" != "no" ; then
2326 #include <daos_fs.h>
2328 int main(int argc, char **argv)
2334 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2339 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2345 print_config "DAOS File System (dfs) Engine" "$dfs"
2347 ##########################################
2348 # Check if we have libnfs (for userspace nfs support).
2349 if test "$libnfs" != "no" ; then
2350 if $(pkg-config libnfs > /dev/null 2>&1); then
2352 libnfs_cflags=$(pkg-config --cflags libnfs)
2353 libnfs_libs=$(pkg-config --libs libnfs)
2355 if test "$libnfs" = "yes" ; then
2356 feature_not_found "libnfs" "libnfs"
2361 print_config "NFS engine" "$libnfs"
2363 ##########################################
2364 # Check if we have lex/yacc available
2369 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2370 if test "$targetos" != "SunOS" ; then
2380 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2384 if test "$arith" = "yes" ; then
2386 extern int yywrap(void);
2388 int main(int argc, char **argv)
2394 if compile_prog "" "-lfl" "flex"; then
2396 elif compile_prog "" "-ll" "lex"; then
2405 # Check if lex fails using -o
2406 if test "$arith" = "yes" ; then
2407 if test "$force_no_lex_o" = "yes" ; then
2410 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2418 print_config "lex/yacc for arithmetic" "$arith"
2420 ##########################################
2421 # Check whether we have setmntent/getmntent
2422 if test "$getmntent" != "yes" ; then
2428 int main(int argc, char **argv)
2430 FILE *mtab = setmntent(NULL, "r");
2431 struct mntent *mnt = getmntent(mtab);
2436 if compile_prog "" "" "getmntent"; then
2439 print_config "getmntent" "$getmntent"
2441 ##########################################
2442 # Check whether we have getmntinfo
2443 # These are originally added for BSDs, but may also work
2444 # on other operating systems with getmntinfo(3).
2446 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2447 # Note that NetBSD needs -Werror to catch warning as error.
2448 if test "$getmntinfo" != "yes" ; then
2453 #include <sys/param.h>
2454 #include <sys/mount.h>
2455 int main(int argc, char **argv)
2458 return getmntinfo(&st, MNT_NOWAIT);
2461 if compile_prog "-Werror" "" "getmntinfo"; then
2464 print_config "getmntinfo" "$getmntinfo"
2466 # getmntinfo(3) for NetBSD.
2467 if test "$getmntinfo_statvfs" != "yes" ; then
2468 getmntinfo_statvfs="no"
2472 #include <sys/statvfs.h>
2473 int main(int argc, char **argv)
2476 return getmntinfo(&st, MNT_NOWAIT);
2479 # Skip the test if the one with statfs arg is detected.
2480 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2481 getmntinfo_statvfs="yes"
2482 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2485 ##########################################
2486 # Check whether we have _Static_assert
2487 if test "$static_assert" != "yes" ; then
2499 int main(int argc, char **argv)
2501 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2505 if compile_prog "" "" "static_assert"; then
2508 print_config "Static Assert" "$static_assert"
2510 ##########################################
2511 # Check whether we have bool / stdbool.h
2512 if test "$have_bool" != "yes" ; then
2516 #include <stdbool.h>
2517 int main(int argc, char **argv)
2520 return var != false;
2523 if compile_prog "" "" "bool"; then
2526 print_config "bool" "$have_bool"
2528 ##########################################
2529 # Check whether we have strndup()
2534 int main(int argc, char **argv)
2536 char *res = strndup("test string", 8);
2542 if compile_prog "" "" "strndup"; then
2545 print_config "strndup" "$strndup"
2547 ##########################################
2548 # <valgrind/drd.h> probe
2549 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2550 # also available but not the other way around.
2551 if test "$valgrind_dev" != "yes" ; then
2555 #include <valgrind/drd.h>
2556 int main(int argc, char **argv)
2561 if compile_prog "" "" "valgrind_dev"; then
2564 print_config "Valgrind headers" "$valgrind_dev"
2566 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2567 ##########################################
2568 # <linux/blkzoned.h> probe
2569 if test "$linux_blkzoned" != "yes" ; then
2573 #include <linux/blkzoned.h>
2574 int main(int argc, char **argv)
2579 if compile_prog "" "" "linux_blkzoned"; then
2580 linux_blkzoned="yes"
2582 print_config "Zoned block device support" "$linux_blkzoned"
2584 ##########################################
2585 # Check BLK_ZONE_REP_CAPACITY
2587 #include <linux/blkzoned.h>
2590 return BLK_ZONE_REP_CAPACITY;
2593 if compile_prog "" "" "blkzoned report capacity"; then
2594 output_sym "CONFIG_HAVE_REP_CAPACITY"
2599 print_config "Zoned block device capacity" "$rep_capacity"
2602 ##########################################
2605 #include <libzbc/zbc.h>
2606 int main(int argc, char **argv)
2608 struct zbc_device *dev = NULL;
2610 return zbc_open("foo=bar", O_RDONLY, &dev);
2613 if test "$libzbc" != "no" ; then
2614 if [ -e /usr/include/libzbc/libzbc ]; then
2616 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2618 if compile_prog "" "-lzbc" "libzbc"; then
2620 if ! check_min_lib_version libzbc 5; then
2624 if test "$libzbc" = "yes" ; then
2625 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2630 print_config "libzbc engine" "$libzbc"
2632 if test "$targetos" = "Linux" ; then
2633 ##########################################
2634 # Check NVME_URING_CMD support
2636 #include <linux/nvme_ioctl.h>
2639 return sizeof(struct nvme_uring_cmd);
2642 if compile_prog "" "" "nvme uring cmd"; then
2643 output_sym "CONFIG_NVME_URING_CMD"
2644 nvme_uring_cmd="yes"
2648 print_config "NVMe uring command support" "$nvme_uring_cmd"
2651 ##########################################
2652 # Check if we have xnvme
2653 if test "$xnvme" != "no" ; then
2654 if check_min_lib_version xnvme 0.2.0; then
2656 xnvme_cflags=$(pkg-config --cflags xnvme)
2657 xnvme_libs=$(pkg-config --libs xnvme)
2662 print_config "xnvme engine" "$xnvme"
2664 ##########################################
2665 # Check if we have libblkio
2666 if test "$libblkio" != "no" ; then
2667 if check_min_lib_version blkio 1.0.0; then
2669 libblkio_cflags=$(pkg-config --cflags blkio)
2670 libblkio_libs=$(pkg-config --libs blkio)
2672 if test "$libblkio" = "yes" ; then
2673 feature_not_found "libblkio" "libblkio-dev or libblkio-devel"
2678 print_config "libblkio engine" "$libblkio"
2680 ##########################################
2681 # check march=armv8-a+crc+crypto
2682 march_armv8_a_crc_crypto="no"
2683 if test "$cpu" = "arm64" ; then
2686 #include <arm_acle.h>
2687 #include <arm_neon.h>
2688 #include <sys/auxv.h>
2693 /* Can we also do a runtime probe? */
2695 return getauxval(AT_HWCAP);
2696 #elif defined(__APPLE__)
2699 # error "Don't know how to do runtime probe for ARM CRC32c"
2703 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2704 march_armv8_a_crc_crypto="yes"
2705 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2709 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2711 ##########################################
2713 if test "$cuda" != "no" ; then
2716 int main(int argc, char **argv)
2721 if compile_prog "" "-lcuda" "cuda"; then
2725 if test "$cuda" = "yes" ; then
2726 feature_not_found "cuda" ""
2731 print_config "cuda" "$cuda"
2733 ##########################################
2735 if test "$libcufile" != "no" ; then
2739 int main(int argc, char* argv[]) {
2744 if compile_prog "" "-lcuda -lcudart -lcufile -ldl" "libcufile"; then
2746 LIBS="-lcuda -lcudart -lcufile -ldl $LIBS"
2748 if test "$libcufile" = "yes" ; then
2749 feature_not_found "libcufile" ""
2754 print_config "libcufile" "$libcufile"
2756 ##########################################
2757 # check for cc -march=native
2760 int main(int argc, char **argv)
2765 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2766 compile_prog "-march=native" "" "march=native"; then
2769 print_config "Build march=native" "$build_native"
2771 ##########################################
2773 if test "$cunit" != "yes" ; then
2777 #include <CUnit/CUnit.h>
2778 #include <CUnit/Basic.h>
2781 if (CU_initialize_registry() != CUE_SUCCESS)
2782 return CU_get_error();
2783 CU_basic_set_mode(CU_BRM_VERBOSE);
2784 CU_basic_run_tests();
2785 CU_cleanup_registry();
2786 return CU_get_error();
2789 if compile_prog "" "-lcunit" "CUnit"; then
2792 print_config "CUnit" "$cunit"
2794 ##########################################
2795 # check for __kernel_rwf_t
2798 #include <linux/fs.h>
2799 int main(int argc, char **argv)
2806 if compile_prog "" "" "__kernel_rwf_t"; then
2807 __kernel_rwf_t="yes"
2809 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2811 ##########################################
2812 # check if gcc has -Wimplicit-fallthrough=2
2815 int main(int argc, char **argv)
2820 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2823 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2825 ##########################################
2826 # check if the compiler has -Wno-stringop-concatenation
2831 int main(int argc, char **argv)
2833 return printf("%s\n", argv[0]);
2836 if compile_prog "-Wno-stringop-truncation -Werror" "" "no_stringop"; then
2839 print_config "-Wno-stringop-truncation" "$no_stringop"
2841 ##########################################
2842 # check for MADV_HUGEPAGE support
2843 if test "$thp" != "yes" ; then
2846 if test "$esx" != "yes" ; then
2848 #include <sys/mman.h>
2851 return madvise(0, 0x1000, MADV_HUGEPAGE);
2854 if compile_prog "" "" "thp" ; then
2857 if test "$thp" = "yes" ; then
2858 feature_not_found "Transparent Huge Page" ""
2863 print_config "MADV_HUGEPAGE" "$thp"
2865 ##########################################
2866 # check for gettid()
2870 int main(int argc, char **argv)
2875 if compile_prog "" "" "gettid"; then
2878 print_config "gettid" "$gettid"
2880 ##########################################
2881 # check for statx(2) support by libc
2885 #include <sys/stat.h>
2887 int main(int argc, char **argv)
2890 return statx(-1, *argv, 0, 0, &st);
2893 if compile_prog "" "" "statx"; then
2896 print_config "statx(2)/libc" "$statx"
2898 ##########################################
2899 # check for statx(2) support by kernel
2903 #include <linux/stat.h>
2904 #include <sys/stat.h>
2905 #include <sys/syscall.h>
2907 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2908 struct statx *buffer)
2910 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2913 int main(int argc, char **argv)
2916 return _statx(-1, *argv, 0, 0, &st);
2919 if compile_prog "" "" "statx_syscall"; then
2922 print_config "statx(2)/syscall" "$statx_syscall"
2924 ##########################################
2925 # check for Windows PDB generation support
2926 if test "pdb" != "no" ; then
2933 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2936 if test "$pdb" = "yes"; then
2937 feature_not_found "PDB" "clang and lld"
2944 print_config "Windows PDB generation" "$pdb"
2946 ##########################################
2947 # check for timerfd support
2949 if test "$esx" != "yes" ; then
2951 #include <sys/time.h>
2952 #include <sys/timerfd.h>
2954 int main(int argc, char **argv)
2956 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2959 if compile_prog "" "" "timerfd_create"; then
2960 timerfd_create="yes"
2963 print_config "timerfd_create" "$timerfd_create"
2965 #############################################################################
2967 if test "$wordsize" = "64" ; then
2968 output_sym "CONFIG_64BIT"
2969 elif test "$wordsize" = "32" ; then
2970 output_sym "CONFIG_32BIT"
2972 fatal "Unknown wordsize!"
2974 if test "$bigendian" = "yes" ; then
2975 output_sym "CONFIG_BIG_ENDIAN"
2977 output_sym "CONFIG_LITTLE_ENDIAN"
2979 if test "$zlib" = "yes" ; then
2980 output_sym "CONFIG_ZLIB"
2982 if test "$libaio" = "yes" ; then
2983 output_sym "CONFIG_LIBAIO"
2984 if test "$libaio_rw_flags" = "yes" ; then
2985 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2988 if test "$posix_aio" = "yes" ; then
2989 output_sym "CONFIG_POSIXAIO"
2991 if test "$posix_aio_fsync" = "yes" ; then
2992 output_sym "CONFIG_POSIXAIO_FSYNC"
2994 if test "$posix_pshared" = "yes" ; then
2995 output_sym "CONFIG_PSHARED"
2997 if test "$pthread_condattr_setclock" = "yes" ; then
2998 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
3000 if test "$pthread_sigmask" = "yes" ; then
3001 output_sym "CONFIG_PTHREAD_SIGMASK"
3003 if test "$pthread_getaffinity" = "yes" ; then
3004 output_sym "CONFIG_PTHREAD_GETAFFINITY"
3006 if test "$have_asprintf" = "yes" ; then
3007 output_sym "CONFIG_HAVE_ASPRINTF"
3009 if test "$have_vasprintf" = "yes" ; then
3010 output_sym "CONFIG_HAVE_VASPRINTF"
3012 if test "$linux_fallocate" = "yes" ; then
3013 output_sym "CONFIG_LINUX_FALLOCATE"
3015 if test "$posix_fallocate" = "yes" ; then
3016 output_sym "CONFIG_POSIX_FALLOCATE"
3018 if test "$fdatasync" = "yes" ; then
3019 output_sym "CONFIG_FDATASYNC"
3021 if test "$pipe" = "yes" ; then
3022 output_sym "CONFIG_PIPE"
3024 if test "$pipe2" = "yes" ; then
3025 output_sym "CONFIG_PIPE2"
3027 if test "$pread" = "yes" ; then
3028 output_sym "CONFIG_PREAD"
3030 if test "$sync_file_range" = "yes" ; then
3031 output_sym "CONFIG_SYNC_FILE_RANGE"
3033 if test "$ASharedMemory_create" = "yes" ; then
3034 output_sym "CONFIG_ASHAREDMEMORY_CREATE"
3036 if test "$sfaa" = "yes" ; then
3037 output_sym "CONFIG_SFAA"
3039 if test "$sync_sync" = "yes" ; then
3040 output_sym "CONFIG_SYNC_SYNC"
3042 if test "$cmp_swap" = "yes" ; then
3043 output_sym "CONFIG_CMP_SWAP"
3045 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3046 output_sym "CONFIG_RDMA"
3048 # librpma is supported on the 'x86_64' architecture for now
3049 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3050 -a "$librpma" = "yes" \
3051 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3052 output_sym "CONFIG_LIBRPMA_APM"
3054 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3055 -a "$librpma" = "yes" -a "$libprotobuf_c" = "yes" \
3056 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3057 output_sym "CONFIG_LIBRPMA_GPSPM"
3059 if test "$clock_gettime" = "yes" ; then
3060 output_sym "CONFIG_CLOCK_GETTIME"
3062 if test "$clock_monotonic" = "yes" ; then
3063 output_sym "CONFIG_CLOCK_MONOTONIC"
3065 if test "$clockid_t" = "yes"; then
3066 output_sym "CONFIG_CLOCKID_T"
3068 if test "$gettimeofday" = "yes" ; then
3069 output_sym "CONFIG_GETTIMEOFDAY"
3071 if test "$posix_fadvise" = "yes" ; then
3072 output_sym "CONFIG_POSIX_FADVISE"
3074 if test "$linux_3arg_affinity" = "yes" ; then
3075 output_sym "CONFIG_3ARG_AFFINITY"
3076 elif test "$linux_2arg_affinity" = "yes" ; then
3077 output_sym "CONFIG_2ARG_AFFINITY"
3079 if test "$strsep" = "yes" ; then
3080 output_sym "CONFIG_STRSEP"
3082 if test "$strcasestr" = "yes" ; then
3083 output_sym "CONFIG_STRCASESTR"
3085 if test "$strlcat" = "yes" ; then
3086 output_sym "CONFIG_STRLCAT"
3088 if test "$getopt_long_only" = "yes" ; then
3089 output_sym "CONFIG_GETOPT_LONG_ONLY"
3091 if test "$inet_aton" = "yes" ; then
3092 output_sym "CONFIG_INET_ATON"
3094 if test "$socklen_t" = "yes" ; then
3095 output_sym "CONFIG_SOCKLEN_T"
3097 if test "$ext4_me" = "yes" ; then
3098 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3100 if test "$linux_splice" = "yes" ; then
3101 output_sym "CONFIG_LINUX_SPLICE"
3103 if test "$libnuma_v2" = "yes" ; then
3104 output_sym "CONFIG_LIBNUMA"
3106 if test "$solaris_aio" = "yes" ; then
3107 output_sym "CONFIG_SOLARISAIO"
3109 if test "$tls_thread" = "yes" ; then
3110 output_sym "CONFIG_TLS_THREAD"
3112 if test "$rusage_thread" = "yes" ; then
3113 output_sym "CONFIG_RUSAGE_THREAD"
3115 if test "$gfio" = "yes" ; then
3116 output_sym "CONFIG_GFIO"
3118 if test "$esx" = "yes" ; then
3119 output_sym "CONFIG_ESX"
3120 output_sym "CONFIG_NO_SHM"
3122 if test "$sched_idle" = "yes" ; then
3123 output_sym "CONFIG_SCHED_IDLE"
3125 if test "$tcp_nodelay" = "yes" ; then
3126 output_sym "CONFIG_TCP_NODELAY"
3128 if test "$window_size" = "yes" ; then
3129 output_sym "CONFIG_NET_WINDOWSIZE"
3131 if test "$mss" = "yes" ; then
3132 output_sym "CONFIG_NET_MSS"
3134 if test "$rlimit_memlock" = "yes" ; then
3135 output_sym "CONFIG_RLIMIT_MEMLOCK"
3137 if test "$pwritev" = "yes" ; then
3138 output_sym "CONFIG_PWRITEV"
3140 if test "$pwritev2" = "yes" ; then
3141 output_sym "CONFIG_PWRITEV2"
3143 if test "$ipv6" = "yes" ; then
3144 output_sym "CONFIG_IPV6"
3146 if test "$http" = "yes" ; then
3147 output_sym "CONFIG_HTTP"
3149 if test "$rados" = "yes" ; then
3150 output_sym "CONFIG_RADOS"
3152 if test "$rbd" = "yes" ; then
3153 output_sym "CONFIG_RBD"
3155 if test "$rbd_poll" = "yes" ; then
3156 output_sym "CONFIG_RBD_POLL"
3158 if test "$rbd_inval" = "yes" ; then
3159 output_sym "CONFIG_RBD_INVAL"
3161 if test "$setvbuf" = "yes" ; then
3162 output_sym "CONFIG_SETVBUF"
3164 if test "$s390_z196_facilities" = "yes" ; then
3165 output_sym "CONFIG_S390_Z196_FACILITIES"
3166 CFLAGS="$CFLAGS -march=z9-109"
3169 if test "$gfapi" = "yes" ; then
3170 output_sym "CONFIG_GFAPI"
3172 if test "$gf_fadvise" = "yes" ; then
3173 output_sym "CONFIG_GF_FADVISE"
3175 if test "$gf_trim" = "yes" ; then
3176 output_sym "CONFIG_GF_TRIM"
3178 if test "$gf_new" = "yes" ; then
3179 output_sym "CONFIG_GF_NEW_API"
3181 if test "$libhdfs" = "yes" ; then
3182 output_sym "CONFIG_LIBHDFS"
3183 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3184 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3185 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3186 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3188 if test "$mtd" = "yes" ; then
3189 output_sym "CONFIG_MTD"
3191 if test "$devdax" = "yes" ; then
3192 output_sym "CONFIG_LINUX_DEVDAX"
3194 if test "$pmem" = "yes" ; then
3195 output_sym "CONFIG_LIBPMEM"
3197 if test "$libpmem2" = "yes" ; then
3198 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3200 if test "$libime" = "yes" ; then
3201 output_sym "CONFIG_IME"
3203 if test "$arith" = "yes" ; then
3204 output_sym "CONFIG_ARITHMETIC"
3205 if test "$yacc_is_bison" = "yes" ; then
3206 echo "YACC=bison -y" >> $config_host_mak
3208 echo "YACC=yacc" >> $config_host_mak
3210 if test "$lex_use_o" = "yes" ; then
3211 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3214 if test "$getmntent" = "yes" ; then
3215 output_sym "CONFIG_GETMNTENT"
3217 if test "$getmntinfo" = "yes" ; then
3218 output_sym "CONFIG_GETMNTINFO"
3220 if test "$getmntinfo_statvfs" = "yes" ; then
3221 output_sym "CONFIG_GETMNTINFO_STATVFS"
3223 if test "$static_assert" = "yes" ; then
3224 output_sym "CONFIG_STATIC_ASSERT"
3226 if test "$have_bool" = "yes" ; then
3227 output_sym "CONFIG_HAVE_BOOL"
3229 if test "$strndup" = "yes" ; then
3230 output_sym "CONFIG_HAVE_STRNDUP"
3232 if test "$disable_opt" = "yes" ; then
3233 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3235 if test "$valgrind_dev" = "yes"; then
3236 output_sym "CONFIG_VALGRIND_DEV"
3238 if test "$linux_blkzoned" = "yes" ; then
3239 output_sym "CONFIG_HAS_BLKZONED"
3241 if test "$libzbc" = "yes" ; then
3242 output_sym "CONFIG_LIBZBC"
3244 if test "$zlib" = "no" ; then
3245 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3246 if test "$build_static" = "yes"; then
3247 echo "Note that some distros have separate packages for static libraries."
3250 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3251 output_sym "ARCH_HAVE_CRC_CRYPTO"
3253 if test "$cuda" = "yes" ; then
3254 output_sym "CONFIG_CUDA"
3256 if test "$libcufile" = "yes" ; then
3257 output_sym "CONFIG_LIBCUFILE"
3259 if test "$dfs" = "yes" ; then
3260 output_sym "CONFIG_DFS"
3262 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3263 output_sym "CONFIG_BUILD_NATIVE"
3265 if test "$cunit" = "yes" ; then
3266 output_sym "CONFIG_HAVE_CUNIT"
3268 if test "$__kernel_rwf_t" = "yes"; then
3269 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3271 if test "$gettid" = "yes"; then
3272 output_sym "CONFIG_HAVE_GETTID"
3274 if test "$statx" = "yes"; then
3275 output_sym "CONFIG_HAVE_STATX"
3277 if test "$statx_syscall" = "yes"; then
3278 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3280 if test "$timerfd_create" = "yes"; then
3281 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3283 if test "$fallthrough" = "yes"; then
3284 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3286 if test "$no_stringop" = "yes"; then
3287 output_sym "CONFIG_HAVE_NO_STRINGOP"
3289 if test "$thp" = "yes" ; then
3290 output_sym "CONFIG_HAVE_THP"
3292 if test "$libiscsi" = "yes" ; then
3293 output_sym "CONFIG_LIBISCSI"
3294 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3295 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3296 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3298 if test "$libnbd" = "yes" ; then
3299 output_sym "CONFIG_LIBNBD"
3300 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3301 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3302 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3304 if test "$libnfs" = "yes" ; then
3305 output_sym "CONFIG_LIBNFS"
3306 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3307 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3309 if test "$xnvme" = "yes" ; then
3310 output_sym "CONFIG_LIBXNVME"
3311 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3312 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3314 if test "$libblkio" = "yes" ; then
3315 output_sym "CONFIG_LIBBLKIO"
3316 echo "LIBBLKIO_CFLAGS=$libblkio_cflags" >> $config_host_mak
3317 echo "LIBBLKIO_LIBS=$libblkio_libs" >> $config_host_mak
3319 if test "$dynamic_engines" = "yes" ; then
3320 output_sym "CONFIG_DYNAMIC_ENGINES"
3322 if test "$pdb" = yes; then
3323 output_sym "CONFIG_PDB"
3325 if test "$fcntl_sync" = "yes" ; then
3326 output_sym "CONFIG_FCNTL_SYNC"
3328 if test "$asan" = "yes"; then
3329 CFLAGS="$CFLAGS -fsanitize=address"
3330 LDFLAGS="$LDFLAGS -fsanitize=address"
3332 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3334 int main(int argc, char **argv)
3339 if test "$disable_tcmalloc" != "yes"; then
3340 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3342 LIBS="-ltcmalloc $LIBS"
3343 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3345 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3350 print_config "TCMalloc support" "$tcmalloc"
3351 if ! num "$seed_buckets"; then
3353 elif test "$seed_buckets" -lt 2; then
3355 elif test "$seed_buckets" -gt 16; then
3358 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3359 print_config "seed_buckets" "$seed_buckets"
3361 echo "LIBS+=$LIBS" >> $config_host_mak
3362 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3363 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3364 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3365 echo "CC=$cc" >> $config_host_mak
3366 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3367 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3369 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3370 cat > Makefile <<EOF
3371 SRCDIR:=`dirname $0`
3372 include \$(SRCDIR)/Makefile