3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h $CFLAGS"
48 CONFIGURE_CFLAGS="-Werror-implicit-function-declaration"
51 # Print a helpful header at the top of config.log
52 echo "# FIO configure log $(date)" >> config.log
53 printf "# Configured with:" >> config.log
54 printf " '%s'" "$0" "$@" >> config.log
56 echo "#" >> config.log
58 # Print configure header at the top of $config_host_h
59 echo "/*" > $config_host_h
60 echo " * Automatically generated by configure - do not modify" >> $config_host_h
61 printf " * Configured with:" >> $config_host_h
62 printf " * '%s'" "$0" "$@" >> $config_host_h
63 echo "" >> $config_host_h
64 echo " */" >> $config_host_h
67 # Run the compiler, capturing its output to the log.
68 echo $cc "$@" >> config.log
69 $cc "$@" >> config.log 2>&1 || return $?
70 # Test passed. If this is an --enable-werror build, rerun
71 # the test with -Werror and bail out if it fails. This
72 # makes warning-generating-errors in configure test code
73 # obvious to developers.
74 if test "$werror" != "yes"; then
77 # Don't bother rerunning the compile if we were already using -Werror
83 echo $cc -Werror "$@" >> config.log
84 $cc -Werror "$@" >> config.log 2>&1 && return $?
85 echo "ERROR: configure test passed without -Werror but failed with -Werror."
86 echo "This is probably a bug in the configure script. The failing command"
87 echo "will be at the bottom of config.log."
88 fatal "You can run configure with --disable-werror to bypass this check."
92 do_cc $CFLAGS $CONFIGURE_CFLAGS -c -o $TMPO $TMPC
97 local_ldflags="$2 $LIBS"
98 echo "Compiling test case $3" >> config.log
99 do_cc $CFLAGS $CONFIGURE_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
102 feature_not_found() {
107 echo "ERROR: User requested feature $feature"
108 if test ! -z "$packages" ; then
109 echo "ERROR: That feature needs $packages installed"
111 echo "ERROR: configure was not able to find it"
116 type "$1" >/dev/null 2>&1
122 #error $1 not defined
133 echo "$1=y" >> $config_host_mak
134 echo "#define $1" >> $config_host_h
137 check_min_lib_version() {
140 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
143 : "${_feature:=${1}}"
144 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
145 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
146 feature_not_found "$_feature" "$1 >= $2"
149 print_config "$1" "missing pkg-config, can't check $_feature version"
181 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
183 --prefix=*) prefix="$optarg"
185 --cpu=*) cpu="$optarg"
187 # esx is cross compiled and cannot be detect through simple uname calls
193 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
195 --build-32bit-win) build_32bit_win="yes"
197 --target-win-ver=*) target_win_ver="$optarg"
199 --enable-pdb) pdb="yes"
201 --build-static) build_static="yes"
203 --enable-gfio) gfio_check="yes"
205 --disable-numa) disable_numa="yes"
207 --disable-rdma) disable_rdma="yes"
209 --disable-rados) disable_rados="yes"
211 --disable-rbd) disable_rbd="yes"
213 --disable-http) disable_http="yes"
215 --disable-gfapi) disable_gfapi="yes"
217 --enable-libhdfs) libhdfs="yes"
219 --disable-lex) disable_lex="yes"
221 --enable-lex) disable_lex="no"
223 --disable-shm) no_shm="yes"
225 --disable-optimizations) disable_opt="yes"
227 --disable-pmem) disable_pmem="yes"
229 --enable-cuda) cuda="yes"
231 --enable-libcufile) libcufile="yes"
233 --disable-native) disable_native="yes"
235 --with-ime=*) ime_path="$optarg"
237 --enable-libiscsi) libiscsi="yes"
239 --enable-libnbd) libnbd="yes"
241 --disable-libzbc) libzbc="no"
243 --disable-tcmalloc) disable_tcmalloc="yes"
245 --disable-nfs) disable_nfs="yes"
247 --dynamic-libengines) dynamic_engines="yes"
249 --disable-dfs) dfs="no"
255 echo "Bad option $opt"
261 if test "$show_help" = "yes" ; then
262 echo "--prefix= Use this directory as installation prefix"
263 echo "--cpu= Specify target CPU if auto-detect fails"
264 echo "--cc= Specify compiler to use"
265 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
266 echo "--build-32bit-win Enable 32-bit build on Windows"
267 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
268 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
269 echo "--build-static Build a static fio"
270 echo "--esx Configure build options for esx"
271 echo "--enable-gfio Enable building of gtk gfio"
272 echo "--disable-numa Disable libnuma even if found"
273 echo "--disable-rdma Disable RDMA support even if found"
274 echo "--disable-rados Disable Rados support even if found"
275 echo "--disable-rbd Disable Rados Block Device even if found"
276 echo "--disable-http Disable HTTP support even if found"
277 echo "--disable-nfs Disable userspace NFS support even if found"
278 echo "--disable-gfapi Disable gfapi"
279 echo "--enable-libhdfs Enable hdfs support"
280 echo "--enable-libnfs Enable nfs support"
281 echo "--disable-lex Disable use of lex/yacc for math"
282 echo "--disable-pmem Disable pmem based engines even if found"
283 echo "--enable-lex Enable use of lex/yacc for math"
284 echo "--disable-shm Disable SHM support"
285 echo "--disable-optimizations Don't enable compiler optimizations"
286 echo "--enable-cuda Enable GPUDirect RDMA support"
287 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
288 echo "--disable-native Don't build for native host"
289 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
290 echo "--enable-libiscsi Enable iscsi support"
291 echo "--enable-libnbd Enable libnbd (NBD engine) support"
292 echo "--disable-libzbc Disable libzbc even if found"
293 echo "--disable-tcmalloc Disable tcmalloc support"
294 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
295 echo "--disable-dfs Disable DAOS File System support even if found"
299 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
300 # Preferred compiler (can be overriden later after we know the platform):
302 # ${cross_prefix}gcc (if cross-prefix specified)
305 if test -z "${CC}${cross_prefix}"; then
312 cc="${CC-${cross_prefix}gcc}"
315 if check_define __ANDROID__ ; then
317 elif check_define __linux__ ; then
319 elif check_define __OpenBSD__ ; then
321 elif check_define __NetBSD__ ; then
323 elif check_define __sun__ ; then
325 CFLAGS="$CFLAGS -D_REENTRANT"
326 elif check_define _WIN32 ; then
332 echo "# Automatically generated by configure - do not modify" > $config_host_mak
333 printf "# Configured with:" >> $config_host_mak
334 printf " '%s'" "$0" "$@" >> $config_host_mak
335 echo >> $config_host_mak
336 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
338 if test "$no_shm" = "yes" ; then
339 output_sym "CONFIG_NO_SHM"
342 if test "$disable_opt" = "yes" ; then
343 output_sym "CONFIG_FIO_NO_OPT"
346 # Some host OSes need non-standard checks for which CPU to use.
347 # Note that these checks are broken for cross-compilation: if you're
348 # cross-compiling to one of these OSes then you'll need to specify
349 # the correct CPU with the --cpu option.
352 # Unless explicitly enabled, turn off lex.
353 # OpenBSD will hit syntax error when enabled.
354 if test -z "$disable_lex" ; then
361 CFLAGS="$CFLAGS -I/usr/local/include"
362 LDFLAGS="$LDFLAGS -L/usr/local/lib"
365 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
366 # we can run 64-bit userspace code.
367 # If the user didn't specify a CPU explicitly and the kernel says this is
368 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
370 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
373 # Avoid configure feature detection of features provided by weak symbols
380 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
381 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
385 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
386 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
389 LIBS="-lnsl -lsocket"
392 # We still force some options, so keep this message here.
393 echo "Forcing some known good options on Windows"
394 if test -z "${CC}${cross_prefix}"; then
395 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
396 cc="i686-w64-mingw32-gcc"
398 cc="x86_64-w64-mingw32-gcc"
402 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
403 if test -z "$target_win_ver"; then
404 # Default Windows API target
407 if test "$target_win_ver" = "7"; then
408 output_sym "CONFIG_WINDOWS_7"
409 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
411 fatal "Unknown target Windows version"
414 # We need this to be output_sym'd here because this is Windows specific.
415 # The regular configure path never sets this config.
416 output_sym "CONFIG_WINDOWSAIO"
417 # We now take the regular configuration path without having exit 0 here.
418 # Flags below are still necessary mostly for MinGW.
422 clock_gettime="yes" # clock_monotonic probe has dependency on this
423 clock_monotonic="yes"
425 pthread_condattr_setclock="no"
426 pthread_affinity="no"
430 # Now we know the target platform we can have another guess at the preferred
431 # compiler when it wasn't explictly set
432 if test -z "${CC}${cross_prefix}"; then
433 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
439 if test -z "$cc"; then
440 echo "configure: failed to find compiler"
444 if test ! -z "$cpu" ; then
445 # command line argument
447 elif check_define __i386__ ; then
449 elif check_define __x86_64__ ; then
451 elif check_define __sparc__ ; then
452 if check_define __arch64__ ; then
457 elif check_define _ARCH_PPC ; then
458 if check_define _ARCH_PPC64 ; then
463 elif check_define __mips__ ; then
465 elif check_define __ia64__ ; then
467 elif check_define __s390__ ; then
468 if check_define __s390x__ ; then
473 elif check_define __arm__ ; then
475 elif check_define __aarch64__ ; then
477 elif check_define __hppa__ ; then
483 # Normalise host CPU name and set ARCH.
485 ia64|ppc|ppc64|s390|s390x|sparc64)
488 i386|i486|i586|i686|i86pc|BePC)
500 hppa|parisc|parisc64)
514 ##########################################
515 # check cross compile
517 if test "$cross_compile" != "yes" ; then
526 if compile_prog "" "" "cross"; then
527 $TMPE 2>/dev/null || cross_compile="yes"
529 fatal "compile test failed"
532 ##########################################
534 if test "$bigendian" != "yes" ; then
537 if test "$cross_compile" = "no" ; then
539 #include <inttypes.h>
542 volatile uint32_t i=0x01234567;
543 return (*((uint8_t*)(&i))) == 0x67;
546 if compile_prog "" "" "endian"; then
547 $TMPE && bigendian="yes"
550 # If we're cross compiling, try our best to work it out and rely on the
551 # run-time check to fail if we get it wrong.
556 #if __BYTE_ORDER != __BIG_ENDIAN
557 # error "Unknown endianness"
561 compile_prog "" "" "endian" && bigendian="yes"
562 check_define "__ARMEB__" && bigendian="yes"
563 check_define "__MIPSEB__" && bigendian="yes"
567 print_config "Operating system" "$targetos"
568 print_config "CPU" "$cpu"
569 print_config "Big endian" "$bigendian"
570 if test ! -z "$target_win_ver"; then
571 print_config "Target Windows version" "$target_win_ver"
573 print_config "Compiler" "$cc"
574 print_config "Cross compile" "$cross_compile"
577 ##########################################
578 # See if we need to build a static build
579 if test "$build_static" = "yes" ; then
580 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
581 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
585 print_config "Static build" "$build_static"
587 ##########################################
588 # check for C11 atomics support
590 #include <stdatomic.h>
598 if ! compile_prog "" "" "C11 atomics"; then
600 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
601 echo "minimum versions with it - perhaps your compiler is too old?"
602 fatal "C11 atomics support not found"
606 ##########################################
611 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
614 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
618 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
620 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
623 fatal "Unknown wordsize"
625 print_config "Wordsize" "$wordsize"
627 ##########################################
629 if test "$zlib" != "yes" ; then
637 if (inflateInit(&stream) != Z_OK)
642 if compile_prog "" "-lz" "zlib" ; then
646 print_config "zlib" "$zlib"
648 ##########################################
649 # fcntl(F_FULLFSYNC) support
650 if test "$fcntl_sync" != "yes" ; then
657 int main(int argc, char **argv)
659 return fcntl(0, F_FULLFSYNC);
662 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
665 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
667 ##########################################
669 if test "$libaio" != "yes" ; then
672 if test "$esx" != "yes" ; then
682 if compile_prog "" "-laio" "libaio" ; then
685 if test "$libaio" = "yes" ; then
686 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
696 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
697 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
701 if compile_prog "" "" "libaio rw flags" ; then
707 print_config "Linux AIO support" "$libaio"
708 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
710 ##########################################
712 if test "$posix_aio" != "yes" ; then
715 if test "$posix_aio_lrt" != "yes" ; then
727 if compile_prog "" "" "posixaio" ; then
729 elif compile_prog "" "-lrt" "posixaio -lrt"; then
734 print_config "POSIX AIO support" "$posix_aio"
735 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
737 ##########################################
738 # posix aio fsync probe
739 if test "$posix_aio_fsync" != "yes" ; then
742 if test "$posix_aio" = "yes" ; then
749 return aio_fsync(O_SYNC, &cb);
753 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
757 print_config "POSIX AIO fsync" "$posix_aio_fsync"
759 ##########################################
760 # POSIX pshared attribute probe
761 if test "$posix_pshared" != "yes" ; then
768 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
769 # if defined(__CYGWIN__)
770 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
771 # elif defined(__APPLE__)
772 # include <AvailabilityMacros.h>
773 # include <TargetConditionals.h>
774 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
775 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
779 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
784 if compile_prog "" "$LIBS" "posix_pshared" ; then
787 print_config "POSIX pshared support" "$posix_pshared"
789 ##########################################
790 # POSIX pthread_condattr_setclock() probe
791 if test "$pthread_condattr_setclock" != "no" ; then
796 pthread_condattr_t condattr;
797 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
801 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
802 pthread_condattr_setclock=yes
803 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
804 pthread_condattr_setclock=yes
805 LIBS="$LIBS -lpthread"
808 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
810 ##########################################
811 # pthread_sigmask() probe
812 if test "$pthread_sigmask" != "yes" ; then
816 #include <stddef.h> /* NULL */
817 #include <signal.h> /* pthread_sigmask() */
820 return pthread_sigmask(0, NULL, NULL);
823 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
825 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
827 LIBS="$LIBS -lpthread"
829 print_config "pthread_sigmask()" "$pthread_sigmask"
831 ##########################################
832 # pthread_getaffinity_np() probe
833 if test "$pthread_getaffinity" != "yes" ; then
834 pthread_getaffinity="no"
837 #include <stddef.h> /* NULL */
838 #include <signal.h> /* pthread_sigmask() */
843 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
846 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
847 pthread_getaffinity="yes"
848 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
849 pthread_getaffinity="yes"
850 LIBS="$LIBS -lpthread"
852 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
854 ##########################################
856 if test "$solaris_aio" != "yes" ; then
860 #include <sys/types.h>
861 #include <sys/asynch.h>
866 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
870 if compile_prog "" "-laio" "solarisaio" ; then
874 print_config "Solaris AIO support" "$solaris_aio"
876 ##########################################
877 # __sync_fetch_and_add test
878 if test "$sfaa" != "yes" ; then
882 #include <inttypes.h>
883 static int sfaa(uint64_t *ptr)
885 return __sync_fetch_and_add(ptr, 0);
888 int main(int argc, char **argv)
895 if compile_prog "" "" "__sync_fetch_and_add()" ; then
898 print_config "__sync_fetch_and_add" "$sfaa"
900 ##########################################
901 # __sync_synchronize() test
902 if test "$sync_sync" != "yes" ; then
906 #include <inttypes.h>
908 int main(int argc, char **argv)
910 __sync_synchronize();
914 if compile_prog "" "" "__sync_synchronize()" ; then
917 print_config "__sync_synchronize" "$sync_sync"
919 ##########################################
920 # __sync_val_compare_and_swap() test
921 if test "$cmp_swap" != "yes" ; then
925 #include <inttypes.h>
927 int main(int argc, char **argv)
930 return __sync_val_compare_and_swap(&x, 1, 2);
933 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
936 print_config "__sync_val_compare_and_swap" "$cmp_swap"
938 ##########################################
940 if test "$libverbs" != "yes" ; then
944 #include <infiniband/verbs.h>
945 int main(int argc, char **argv)
947 struct ibv_pd *pd = ibv_alloc_pd(NULL);
951 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
954 print_config "libverbs" "$libverbs"
956 ##########################################
958 if test "$rdmacm" != "yes" ; then
963 #include <rdma/rdma_cma.h>
964 int main(int argc, char **argv)
966 rdma_destroy_qp(NULL);
970 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
973 print_config "rdmacm" "$rdmacm"
975 ##########################################
977 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
978 if test "$librpma" != "yes" ; then
985 void *ptr = rpma_cq_get_wc;
986 (void) ptr; /* unused */
990 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
993 print_config "librpma" "$librpma"
995 ##########################################
996 # libprotobuf-c probe
997 if test "$libprotobuf_c" != "yes" ; then
1002 #include <protobuf-c/protobuf-c.h>
1003 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1004 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1006 int main(int argc, char **argv)
1008 (void)protobuf_c_message_check(NULL);
1012 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1015 print_config "libprotobuf_c" "$libprotobuf_c"
1017 ##########################################
1018 # asprintf() and vasprintf() probes
1019 if test "$have_asprintf" != "yes" ; then
1025 int main(int argc, char **argv)
1028 return asprintf(&buf, "%s", "str") == 0;
1031 if compile_prog "" "" "have_asprintf"; then
1034 print_config "asprintf()" "$have_asprintf"
1036 if test "$have_vasprintf" != "yes" ; then
1042 int main(int argc, char **argv)
1046 return vasprintf(&buf, "%s", ap) == 0;
1049 if compile_prog "" "" "have_vasprintf"; then
1050 have_vasprintf="yes"
1052 print_config "vasprintf()" "$have_vasprintf"
1054 ##########################################
1055 # Linux fallocate probe
1056 if test "$linux_fallocate" != "yes" ; then
1057 linux_fallocate="no"
1062 #include <linux/falloc.h>
1063 int main(int argc, char **argv)
1065 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1069 if compile_prog "" "" "linux_fallocate"; then
1070 linux_fallocate="yes"
1072 print_config "Linux fallocate" "$linux_fallocate"
1074 ##########################################
1075 # POSIX fadvise probe
1076 if test "$posix_fadvise" != "yes" ; then
1082 int main(int argc, char **argv)
1084 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1088 if compile_prog "" "" "posix_fadvise"; then
1091 print_config "POSIX fadvise" "$posix_fadvise"
1093 ##########################################
1094 # POSIX fallocate probe
1095 if test "$posix_fallocate" != "yes" ; then
1096 posix_fallocate="no"
1101 int main(int argc, char **argv)
1103 int r = posix_fallocate(0, 0, 1024);
1107 if compile_prog "" "" "posix_fallocate"; then
1108 posix_fallocate="yes"
1110 print_config "POSIX fallocate" "$posix_fallocate"
1112 ##########################################
1113 # sched_set/getaffinity 2 or 3 argument test
1114 if test "$linux_2arg_affinity" != "yes" ; then
1115 linux_2arg_affinity="no"
1117 if test "$linux_3arg_affinity" != "yes" ; then
1118 linux_3arg_affinity="no"
1122 int main(int argc, char **argv)
1125 return sched_setaffinity(0, sizeof(mask), &mask);
1128 if compile_prog "" "" "sched_setaffinity(,,)"; then
1129 linux_3arg_affinity="yes"
1133 int main(int argc, char **argv)
1136 return sched_setaffinity(0, &mask);
1139 if compile_prog "" "" "sched_setaffinity(,)"; then
1140 linux_2arg_affinity="yes"
1143 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1144 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1146 ##########################################
1147 # clock_gettime probe
1148 if test "$clock_gettime" != "yes" ; then
1154 int main(int argc, char **argv)
1156 return clock_gettime(0, NULL);
1159 if compile_prog "" "" "clock_gettime"; then
1161 elif compile_prog "" "-lrt" "clock_gettime"; then
1165 print_config "clock_gettime" "$clock_gettime"
1167 ##########################################
1168 # CLOCK_MONOTONIC probe
1169 if test "$clock_monotonic" != "yes" ; then
1170 clock_monotonic="no"
1172 if test "$clock_gettime" = "yes" ; then
1176 int main(int argc, char **argv)
1178 return clock_gettime(CLOCK_MONOTONIC, NULL);
1181 if compile_prog "" "$LIBS" "clock monotonic"; then
1182 clock_monotonic="yes"
1185 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1187 ##########################################
1189 if test "$clockid_t" != "yes" ; then
1195 int main(int argc, char **argv)
1197 volatile clockid_t cid;
1198 memset((void*)&cid, 0, sizeof(cid));
1202 if compile_prog "" "$LIBS" "clockid_t"; then
1205 print_config "clockid_t" "$clockid_t"
1207 ##########################################
1208 # gettimeofday() probe
1209 if test "$gettimeofday" != "yes" ; then
1213 #include <sys/time.h>
1215 int main(int argc, char **argv)
1218 return gettimeofday(&tv, NULL);
1221 if compile_prog "" "" "gettimeofday"; then
1224 print_config "gettimeofday" "$gettimeofday"
1226 ##########################################
1228 if test "$fdatasync" != "yes" ; then
1234 int main(int argc, char **argv)
1236 return fdatasync(0);
1239 if compile_prog "" "" "fdatasync"; then
1242 print_config "fdatasync" "$fdatasync"
1244 ##########################################
1246 if test "$pipe" != "yes" ; then
1251 int main(int argc, char **argv)
1257 if compile_prog "" "" "pipe"; then
1260 print_config "pipe()" "$pipe"
1262 ##########################################
1264 if test "$pipe2" != "yes" ; then
1269 int main(int argc, char **argv)
1272 return pipe2(fd, 0);
1275 if compile_prog "" "" "pipe2"; then
1278 print_config "pipe2()" "$pipe2"
1280 ##########################################
1282 if test "$pread" != "yes" ; then
1287 int main(int argc, char **argv)
1289 return pread(0, NULL, 0, 0);
1292 if compile_prog "" "" "pread"; then
1295 print_config "pread()" "$pread"
1297 ##########################################
1298 # sync_file_range() probe
1299 if test "$sync_file_range" != "yes" ; then
1300 sync_file_range="no"
1306 #include <linux/fs.h>
1307 int main(int argc, char **argv)
1309 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1310 SYNC_FILE_RANGE_WAIT_AFTER;
1311 return sync_file_range(0, 0, 0, flags);
1314 if compile_prog "" "" "sync_file_range"; then
1315 sync_file_range="yes"
1317 print_config "sync_file_range" "$sync_file_range"
1319 ##########################################
1320 # ext4 move extent probe
1321 if test "$ext4_me" != "yes" ; then
1326 #include <sys/ioctl.h>
1327 int main(int argc, char **argv)
1329 struct move_extent me;
1330 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1333 if compile_prog "" "" "ext4 move extent" ; then
1335 elif test $targetos = "Linux" ; then
1336 # On Linux, just default to it on and let it error at runtime if we really
1337 # don't have it. None of my updated systems have it defined, but it does
1338 # work. Takes a while to bubble back.
1341 print_config "EXT4 move extent" "$ext4_me"
1343 ##########################################
1345 if test "$linux_splice" != "yes" ; then
1351 int main(int argc, char **argv)
1353 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1356 if compile_prog "" "" "linux splice"; then
1359 print_config "Linux splice(2)" "$linux_splice"
1361 ##########################################
1363 if test "$libnuma" != "yes" ; then
1368 int main(int argc, char **argv)
1370 return numa_available();
1373 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1377 print_config "libnuma" "$libnuma"
1379 ##########################################
1380 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1381 if test "$libnuma" = "yes" ; then
1385 int main(int argc, char **argv)
1387 struct bitmask *mask = numa_parse_nodestring(NULL);
1388 return mask->size == 0;
1391 if compile_prog "" "" "libnuma api"; then
1394 print_config "libnuma v2" "$libnuma_v2"
1397 ##########################################
1399 if test "$strsep" != "yes" ; then
1404 int main(int argc, char **argv)
1406 static char *string = "This is a string";
1407 strsep(&string, "needle");
1411 if compile_prog "" "" "strsep"; then
1414 print_config "strsep" "$strsep"
1416 ##########################################
1417 # strcasestr() probe
1418 if test "$strcasestr" != "yes" ; then
1423 int main(int argc, char **argv)
1425 return strcasestr(argv[0], argv[1]) != NULL;
1428 if compile_prog "" "" "strcasestr"; then
1431 print_config "strcasestr" "$strcasestr"
1433 ##########################################
1435 if test "$strlcat" != "yes" ; then
1440 int main(int argc, char **argv)
1442 static char dst[64];
1443 static char *string = "This is a string";
1444 memset(dst, 0, sizeof(dst));
1445 strlcat(dst, string, sizeof(dst));
1449 if compile_prog "" "" "strlcat"; then
1452 print_config "strlcat" "$strlcat"
1454 ##########################################
1455 # getopt_long_only() probe
1456 if test "$getopt_long_only" != "yes" ; then
1457 getopt_long_only="no"
1463 int main(int argc, char **argv)
1465 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1469 if compile_prog "" "" "getopt_long_only"; then
1470 getopt_long_only="yes"
1472 print_config "getopt_long_only()" "$getopt_long_only"
1474 ##########################################
1476 if test "$inet_aton" != "yes" ; then
1481 #include <winsock2.h>
1483 #include <sys/socket.h>
1484 #include <arpa/inet.h>
1487 int main(int argc, char **argv)
1490 return inet_aton(NULL, &in);
1493 if compile_prog "" "" "inet_aton"; then
1496 print_config "inet_aton" "$inet_aton"
1498 ##########################################
1500 if test "$socklen_t" != "yes" ; then
1505 #include <winsock2.h>
1506 #include <ws2tcpip.h>
1508 #include <sys/socket.h>
1510 int main(int argc, char **argv)
1516 if compile_prog "" "" "socklen_t"; then
1519 print_config "socklen_t" "$socklen_t"
1521 ##########################################
1522 # Whether or not __thread is supported for TLS
1523 if test "$tls_thread" != "yes" ; then
1528 static __thread int ret;
1529 int main(int argc, char **argv)
1534 if compile_prog "" "" "__thread"; then
1537 print_config "__thread" "$tls_thread"
1539 ##########################################
1540 # Check if we have required gtk/glib support for gfio
1541 if test "$gfio" != "yes" ; then
1544 if test "$gfio_check" = "yes" ; then
1548 #include <gtk/gtk.h>
1551 gdk_threads_enter();
1552 gdk_threads_leave();
1554 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1557 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1558 ORG_LDFLAGS=$LDFLAGS
1559 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1560 if test "$?" != "0" ; then
1561 echo "configure: gtk and gthread not found"
1564 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1565 if test "$?" != "0" ; then
1566 echo "configure: gtk and gthread not found"
1570 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1571 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1572 GFIO_LIBS="$LIBS $GTK_LIBS"
1573 CFLAGS="$CFLAGS $GTK_CFLAGS"
1575 echo "Please install gtk and gdk libraries"
1581 LDFLAGS=$ORG_LDFLAGS
1584 if test "$gfio_check" = "yes" ; then
1585 print_config "gtk 2.18 or higher" "$gfio"
1588 ##########################################
1589 # Check whether we have getrusage(RUSAGE_THREAD)
1590 if test "$rusage_thread" != "yes" ; then
1594 #include <sys/time.h>
1595 #include <sys/resource.h>
1596 int main(int argc, char **argv)
1599 getrusage(RUSAGE_THREAD, &ru);
1603 if compile_prog "" "" "RUSAGE_THREAD"; then
1606 print_config "RUSAGE_THREAD" "$rusage_thread"
1608 ##########################################
1609 # Check whether we have SCHED_IDLE
1610 if test "$sched_idle" != "yes" ; then
1615 int main(int argc, char **argv)
1617 struct sched_param p;
1618 return sched_setscheduler(0, SCHED_IDLE, &p);
1621 if compile_prog "" "" "SCHED_IDLE"; then
1624 print_config "SCHED_IDLE" "$sched_idle"
1626 ##########################################
1627 # Check whether we have TCP_NODELAY
1628 if test "$tcp_nodelay" != "yes" ; then
1633 #include <winsock2.h>
1636 #include <sys/types.h>
1637 #include <sys/socket.h>
1638 #include <netinet/tcp.h>
1640 int main(int argc, char **argv)
1642 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1645 if compile_prog "" "" "TCP_NODELAY"; then
1647 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1649 LIBS="$LIBS -lws2_32"
1651 print_config "TCP_NODELAY" "$tcp_nodelay"
1653 ##########################################
1654 # Check whether we have SO_SNDBUF
1655 if test "$window_size" != "yes" ; then
1660 #include <winsock2.h>
1663 #include <sys/types.h>
1664 #include <sys/socket.h>
1665 #include <netinet/tcp.h>
1667 int main(int argc, char **argv)
1669 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1670 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1673 if compile_prog "" "" "SO_SNDBUF"; then
1675 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1677 LIBS="$LIBS -lws2_32"
1679 print_config "Net engine window_size" "$window_size"
1681 ##########################################
1682 # Check whether we have TCP_MAXSEG
1683 if test "$mss" != "yes" ; then
1688 #include <winsock2.h>
1691 #include <sys/types.h>
1692 #include <sys/socket.h>
1693 #include <netinet/tcp.h>
1694 #include <arpa/inet.h>
1695 #include <netinet/in.h>
1697 int main(int argc, char **argv)
1699 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1702 if compile_prog "" "" "TCP_MAXSEG"; then
1704 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1706 LIBS="$LIBS -lws2_32"
1708 print_config "TCP_MAXSEG" "$mss"
1710 ##########################################
1711 # Check whether we have RLIMIT_MEMLOCK
1712 if test "$rlimit_memlock" != "yes" ; then
1716 #include <sys/time.h>
1717 #include <sys/resource.h>
1718 int main(int argc, char **argv)
1721 return getrlimit(RLIMIT_MEMLOCK, &rl);
1724 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1725 rlimit_memlock="yes"
1727 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1729 ##########################################
1730 # Check whether we have pwritev/preadv
1731 if test "$pwritev" != "yes" ; then
1736 #include <sys/uio.h>
1737 int main(int argc, char **argv)
1739 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1742 if compile_prog "" "" "pwritev"; then
1745 print_config "pwritev/preadv" "$pwritev"
1747 ##########################################
1748 # Check whether we have pwritev2/preadv2
1749 if test "$pwritev2" != "yes" ; then
1754 #include <sys/uio.h>
1755 int main(int argc, char **argv)
1757 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1760 if compile_prog "" "" "pwritev2"; then
1763 print_config "pwritev2/preadv2" "$pwritev2"
1765 ##########################################
1766 # Check whether we have the required functions for ipv6
1767 if test "$ipv6" != "yes" ; then
1772 #include <winsock2.h>
1773 #include <ws2tcpip.h>
1775 #include <sys/types.h>
1776 #include <sys/socket.h>
1777 #include <netinet/in.h>
1781 int main(int argc, char **argv)
1783 struct addrinfo hints;
1784 struct in6_addr addr;
1787 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1789 printf("%s\n", gai_strerror(ret));
1794 if compile_prog "" "" "ipv6"; then
1797 print_config "IPv6 helpers" "$ipv6"
1799 ##########################################
1801 if test "$http" != "yes" ; then
1804 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1806 #include <curl/curl.h>
1807 #include <openssl/hmac.h>
1809 int main(int argc, char **argv)
1814 curl = curl_easy_init();
1815 curl_easy_cleanup(curl);
1817 ctx = HMAC_CTX_new();
1818 HMAC_CTX_reset(ctx);
1823 # openssl < 1.1.0 uses the HMAC_CTX type directly
1825 #include <curl/curl.h>
1826 #include <openssl/hmac.h>
1828 int main(int argc, char **argv)
1833 curl = curl_easy_init();
1834 curl_easy_cleanup(curl);
1836 HMAC_CTX_init(&ctx);
1837 HMAC_CTX_cleanup(&ctx);
1841 if test "$disable_http" != "yes"; then
1842 HTTP_LIBS="-lcurl -lssl -lcrypto"
1843 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1844 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1846 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1850 print_config "http engine" "$http"
1852 ##########################################
1854 if test "$rados" != "yes" ; then
1858 #include <rados/librados.h>
1860 int main(int argc, char **argv)
1863 rados_ioctx_t io_ctx;
1864 const char cluster_name[] = "ceph";
1865 const char user_name[] = "client.admin";
1866 const char pool[] = "rados";
1868 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1869 rados_create2(&cluster, cluster_name, user_name, 0);
1870 rados_ioctx_create(cluster, pool, &io_ctx);
1875 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1878 print_config "Rados engine" "$rados"
1880 ##########################################
1882 if test "$rbd" != "yes" ; then
1886 #include <rbd/librbd.h>
1888 int main(int argc, char **argv)
1891 rados_ioctx_t io_ctx;
1892 const char cluster_name[] = "ceph";
1893 const char user_name[] = "client.admin";
1894 const char pool[] = "rbd";
1895 int major, minor, extra;
1897 rbd_version(&major, &minor, &extra);
1898 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1899 rados_create2(&cluster, cluster_name, user_name, 0);
1900 rados_ioctx_create(cluster, pool, &io_ctx);
1905 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1908 print_config "Rados Block Device engine" "$rbd"
1910 ##########################################
1911 # check for rbd_poll
1912 if test "$rbd_poll" != "yes" ; then
1915 if test "$rbd" = "yes"; then
1917 #include <rbd/librbd.h>
1918 #include <sys/eventfd.h>
1920 int main(int argc, char **argv)
1923 rbd_completion_t comp;
1925 int fd = eventfd(0, EFD_NONBLOCK);
1926 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1927 rbd_poll_io_events(image, comp, 1);
1932 if compile_prog "" "-lrbd -lrados" "rbd"; then
1935 print_config "rbd_poll" "$rbd_poll"
1938 ##########################################
1939 # check for rbd_invalidate_cache()
1940 if test "$rbd_inval" != "yes" ; then
1943 if test "$rbd" = "yes"; then
1945 #include <rbd/librbd.h>
1947 int main(int argc, char **argv)
1951 return rbd_invalidate_cache(image);
1954 if compile_prog "" "-lrbd -lrados" "rbd"; then
1957 print_config "rbd_invalidate_cache" "$rbd_inval"
1960 ##########################################
1961 # Check whether we have setvbuf
1962 if test "$setvbuf" != "yes" ; then
1967 int main(int argc, char **argv)
1971 setvbuf(f, buf, _IOFBF, sizeof(buf));
1975 if compile_prog "" "" "setvbuf"; then
1978 print_config "setvbuf" "$setvbuf"
1980 ##########################################
1982 if test "$gfapi" != "yes" ; then
1986 #include <glusterfs/api/glfs.h>
1988 int main(int argc, char **argv)
1990 glfs_t *g = glfs_new("foo");
1995 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1998 print_config "Gluster API engine" "$gfapi"
2000 ##########################################
2001 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2002 if test "$gfapi" = "yes" ; then
2005 #include <glusterfs/api/glfs.h>
2007 int main(int argc, char **argv)
2010 int ret = glfs_fadvise(fd, 0, 0, 1);
2015 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2018 print_config "Gluster API use fadvise" "$gf_fadvise"
2021 ##########################################
2022 # check for newer gfapi
2023 if test "$gfapi" = "yes" ; then
2026 #include <glusterfs/api/glfs.h>
2028 int main(int argc, char **argv)
2030 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2033 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2036 print_config "Gluster new API" "$gf_new"
2039 ##########################################
2040 # check for gfapi trim support
2041 if test "$gf_trim" != "yes" ; then
2044 if test "$gfapi" = "yes" ; then
2046 #include <glusterfs/api/glfs.h>
2048 int main(int argc, char **argv)
2050 return glfs_discard_async(NULL, 0, 0);
2053 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2056 print_config "Gluster API trim support" "$gf_trim"
2059 ##########################################
2060 # Check if we support stckf on s390
2061 if test "$s390_z196_facilities" != "yes" ; then
2062 s390_z196_facilities="no"
2065 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2066 int main(int argc, char **argv)
2068 /* We want just 1 double word to be returned. */
2069 register unsigned long reg0 asm("0") = 0;
2070 unsigned long stfle_bits;
2071 asm volatile(".machine push" "\n\t"
2072 ".machine \"z9-109\"" "\n\t"
2075 : "=QS" (stfle_bits), "+d" (reg0)
2078 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2084 if compile_prog "" "" "s390_z196_facilities"; then
2086 if [ $? -eq 0 ]; then
2087 s390_z196_facilities="yes"
2090 print_config "s390_z196_facilities" "$s390_z196_facilities"
2092 ##########################################
2093 # Check if we have required environment variables configured for libhdfs
2094 if test "$libhdfs" = "yes" ; then
2096 if test "$JAVA_HOME" = "" ; then
2097 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2100 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2101 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
2104 if test "$FIO_LIBHDFS_LIB" = "" ; then
2105 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2108 if test "$hdfs_conf_error" = "1" ; then
2109 feature_not_found "libhdfs" ""
2112 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2113 FIO_HDFS_CPU="amd64"
2116 print_config "HDFS engine" "$libhdfs"
2118 ##########################################
2119 # Check whether we have MTD
2120 if test "$mtd" != "yes" ; then
2125 #include <mtd/mtd-user.h>
2126 #include <sys/ioctl.h>
2127 int main(int argc, char **argv)
2129 struct mtd_write_req ops;
2130 struct mtd_info_user info;
2131 memset(&ops, 0, sizeof(ops));
2132 info.type = MTD_MLCNANDFLASH;
2133 return ioctl(0, MEMGETINFO, &info);
2136 if compile_prog "" "" "mtd"; then
2139 print_config "MTD" "$mtd"
2141 ##########################################
2142 # Check whether we have libpmem
2143 if test "$libpmem" != "yes" ; then
2147 #include <libpmem.h>
2149 int main(int argc, char **argv)
2152 rc = pmem_is_pmem(NULL, 0);
2156 if compile_prog "" "-lpmem" "libpmem"; then
2159 print_config "libpmem" "$libpmem"
2161 ##########################################
2162 # Check whether libpmem's version >= 1.5
2163 if test "$libpmem1_5" != "yes" ; then
2166 if test "$libpmem" = "yes"; then
2168 #include <libpmem.h>
2170 int main(int argc, char **argv)
2172 pmem_memcpy(NULL, NULL, NULL, NULL);
2176 if compile_prog "" "-lpmem" "libpmem1_5"; then
2180 print_config "libpmem1_5" "$libpmem1_5"
2182 ##########################################
2183 # Check whether we have libpmemblk
2184 # libpmem is a prerequisite
2185 if test "$libpmemblk" != "yes" ; then
2188 if test "$libpmem" = "yes"; then
2190 #include <libpmemblk.h>
2191 int main(int argc, char **argv)
2194 pbp = pmemblk_open("", 0);
2198 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2202 print_config "libpmemblk" "$libpmemblk"
2204 # Choose libpmem-based ioengines
2205 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2207 if test "$libpmem1_5" = "yes"; then
2210 if test "$libpmemblk" = "yes"; then
2215 ##########################################
2216 # Report whether pmemblk engine is enabled
2217 print_config "PMDK pmemblk engine" "$pmemblk"
2219 ##########################################
2220 # Report whether dev-dax engine is enabled
2221 print_config "PMDK dev-dax engine" "$devdax"
2223 ##########################################
2224 # Report whether libpmem engine is enabled
2225 print_config "PMDK libpmem engine" "$pmem"
2227 ##########################################
2228 # Check whether we support DDN's IME
2229 if test "$libime" != "yes" ; then
2233 #include <ime_native.h>
2234 int main(int argc, char **argv)
2238 rc = ime_native_finalize();
2242 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2244 CFLAGS="-I${ime_path}/include $CFLAGS"
2245 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2246 LIBS="-lim_client $LIBS"
2248 print_config "DDN's Infinite Memory Engine" "$libime"
2250 ##########################################
2251 # Check if we have libiscsi
2252 if test "$libiscsi" != "no" ; then
2253 if check_min_lib_version libiscsi 1.9.0; then
2255 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2256 libiscsi_libs=$(pkg-config --libs libiscsi)
2261 print_config "iscsi engine" "$libiscsi"
2263 ##########################################
2264 # Check if we have libnbd (for NBD support)
2265 if test "$libnbd" != "no" ; then
2266 if check_min_lib_version libnbd 0.9.8; then
2268 libnbd_cflags=$(pkg-config --cflags libnbd)
2269 libnbd_libs=$(pkg-config --libs libnbd)
2274 print_config "NBD engine" "$libnbd"
2276 ##########################################
2277 # check for dfs (DAOS File System)
2278 if test "$dfs" != "no" ; then
2282 #include <daos_fs.h>
2284 int main(int argc, char **argv)
2290 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2295 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2301 print_config "DAOS File System (dfs) Engine" "$dfs"
2303 ##########################################
2304 # Check if we have libnfs (for userspace nfs support).
2305 if test "$disable_nfs" != "yes"; then
2306 if $(pkg-config libnfs > /dev/null 2>&1); then
2308 libnfs_cflags=$(pkg-config --cflags libnfs)
2309 libnfs_libs=$(pkg-config --libs libnfs)
2311 if test "$libnfs" = "yes" ; then
2312 echo "libnfs" "Install libnfs"
2316 print_config "NFS engine" "$libnfs"
2318 ##########################################
2319 # Check if we have lex/yacc available
2324 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2325 if test "$targetos" != "SunOS" ; then
2335 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2339 if test "$arith" = "yes" ; then
2341 extern int yywrap(void);
2343 int main(int argc, char **argv)
2349 if compile_prog "" "-lfl" "flex"; then
2351 elif compile_prog "" "-ll" "lex"; then
2360 # Check if lex fails using -o
2361 if test "$arith" = "yes" ; then
2362 if test "$force_no_lex_o" = "yes" ; then
2365 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2373 print_config "lex/yacc for arithmetic" "$arith"
2375 ##########################################
2376 # Check whether we have setmntent/getmntent
2377 if test "$getmntent" != "yes" ; then
2383 int main(int argc, char **argv)
2385 FILE *mtab = setmntent(NULL, "r");
2386 struct mntent *mnt = getmntent(mtab);
2391 if compile_prog "" "" "getmntent"; then
2394 print_config "getmntent" "$getmntent"
2396 ##########################################
2397 # Check whether we have getmntinfo
2398 # These are originally added for BSDs, but may also work
2399 # on other operating systems with getmntinfo(3).
2401 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2402 # Note that NetBSD needs -Werror to catch warning as error.
2403 if test "$getmntinfo" != "yes" ; then
2408 #include <sys/param.h>
2409 #include <sys/mount.h>
2410 int main(int argc, char **argv)
2413 return getmntinfo(&st, MNT_NOWAIT);
2416 if compile_prog "-Werror" "" "getmntinfo"; then
2419 print_config "getmntinfo" "$getmntinfo"
2421 # getmntinfo(3) for NetBSD.
2422 if test "$getmntinfo_statvfs" != "yes" ; then
2423 getmntinfo_statvfs="no"
2427 #include <sys/statvfs.h>
2428 int main(int argc, char **argv)
2431 return getmntinfo(&st, MNT_NOWAIT);
2434 # Skip the test if the one with statfs arg is detected.
2435 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2436 getmntinfo_statvfs="yes"
2437 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2440 ##########################################
2441 # Check whether we have _Static_assert
2442 if test "$static_assert" != "yes" ; then
2454 int main(int argc, char **argv)
2456 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2460 if compile_prog "" "" "static_assert"; then
2463 print_config "Static Assert" "$static_assert"
2465 ##########################################
2466 # Check whether we have bool / stdbool.h
2467 if test "$have_bool" != "yes" ; then
2471 #include <stdbool.h>
2472 int main(int argc, char **argv)
2475 return var != false;
2478 if compile_prog "" "" "bool"; then
2481 print_config "bool" "$have_bool"
2483 ##########################################
2484 # Check whether we have strndup()
2489 int main(int argc, char **argv)
2491 char *res = strndup("test string", 8);
2497 if compile_prog "" "" "strndup"; then
2500 print_config "strndup" "$strndup"
2502 ##########################################
2503 # <valgrind/drd.h> probe
2504 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2505 # also available but not the other way around.
2506 if test "$valgrind_dev" != "yes" ; then
2510 #include <valgrind/drd.h>
2511 int main(int argc, char **argv)
2516 if compile_prog "" "" "valgrind_dev"; then
2519 print_config "Valgrind headers" "$valgrind_dev"
2521 if test "$targetos" = "Linux" ; then
2522 ##########################################
2523 # <linux/blkzoned.h> probe
2524 if test "$linux_blkzoned" != "yes" ; then
2528 #include <linux/blkzoned.h>
2529 int main(int argc, char **argv)
2534 if compile_prog "" "" "linux_blkzoned"; then
2535 linux_blkzoned="yes"
2537 print_config "Zoned block device support" "$linux_blkzoned"
2539 ##########################################
2540 # Check BLK_ZONE_REP_CAPACITY
2542 #include <linux/blkzoned.h>
2545 return BLK_ZONE_REP_CAPACITY;
2548 if compile_prog "" "" "blkzoned report capacity"; then
2549 output_sym "CONFIG_HAVE_REP_CAPACITY"
2554 print_config "Zoned block device capacity" "$rep_capacity"
2557 ##########################################
2560 #include <libzbc/zbc.h>
2561 int main(int argc, char **argv)
2563 struct zbc_device *dev = NULL;
2565 return zbc_open("foo=bar", O_RDONLY, &dev);
2568 if test "$libzbc" != "no" ; then
2569 if compile_prog "" "-lzbc" "libzbc"; then
2571 if ! check_min_lib_version libzbc 5; then
2575 if test "$libzbc" = "yes" ; then
2576 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2581 print_config "libzbc engine" "$libzbc"
2583 ##########################################
2584 # check march=armv8-a+crc+crypto
2585 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2586 march_armv8_a_crc_crypto="no"
2588 if test "$cpu" = "arm64" ; then
2590 #include <arm_acle.h>
2591 #include <arm_neon.h>
2592 #include <sys/auxv.h>
2596 /* Can we also do a runtime probe? */
2598 return getauxval(AT_HWCAP);
2600 # error "Don't know how to do runtime probe for ARM CRC32c"
2604 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2605 march_armv8_a_crc_crypto="yes"
2606 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2610 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2612 ##########################################
2614 if test "$cuda" != "no" ; then
2617 int main(int argc, char **argv)
2622 if compile_prog "" "-lcuda" "cuda"; then
2626 if test "$cuda" = "yes" ; then
2627 feature_not_found "cuda" ""
2632 print_config "cuda" "$cuda"
2634 ##########################################
2636 if test "$libcufile" != "no" ; then
2640 int main(int argc, char* argv[]) {
2645 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2647 LIBS="-lcuda -lcudart -lcufile $LIBS"
2649 if test "$libcufile" = "yes" ; then
2650 feature_not_found "libcufile" ""
2655 print_config "libcufile" "$libcufile"
2657 ##########################################
2658 # check for cc -march=native
2661 int main(int argc, char **argv)
2666 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2667 compile_prog "-march=native" "" "march=native"; then
2670 print_config "Build march=native" "$build_native"
2672 ##########################################
2674 if test "$cunit" != "yes" ; then
2678 #include <CUnit/CUnit.h>
2679 #include <CUnit/Basic.h>
2682 if (CU_initialize_registry() != CUE_SUCCESS)
2683 return CU_get_error();
2684 CU_basic_set_mode(CU_BRM_VERBOSE);
2685 CU_basic_run_tests();
2686 CU_cleanup_registry();
2687 return CU_get_error();
2690 if compile_prog "" "-lcunit" "CUnit"; then
2693 print_config "CUnit" "$cunit"
2695 ##########################################
2696 # check for __kernel_rwf_t
2699 #include <linux/fs.h>
2700 int main(int argc, char **argv)
2707 if compile_prog "" "" "__kernel_rwf_t"; then
2708 __kernel_rwf_t="yes"
2710 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2712 ##########################################
2713 # check if gcc has -Wimplicit-fallthrough=2
2716 int main(int argc, char **argv)
2721 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2724 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2726 ##########################################
2727 # check for MADV_HUGEPAGE support
2728 if test "$thp" != "yes" ; then
2731 if test "$esx" != "yes" ; then
2733 #include <sys/mman.h>
2736 return madvise(0, 0x1000, MADV_HUGEPAGE);
2739 if compile_prog "" "" "thp" ; then
2742 if test "$thp" = "yes" ; then
2743 feature_not_found "Transparent Huge Page" ""
2748 print_config "MADV_HUGEPAGE" "$thp"
2750 ##########################################
2751 # check for gettid()
2755 int main(int argc, char **argv)
2760 if compile_prog "" "" "gettid"; then
2763 print_config "gettid" "$gettid"
2765 ##########################################
2766 # check for statx(2) support by libc
2770 #include <sys/stat.h>
2772 int main(int argc, char **argv)
2775 return statx(-1, *argv, 0, 0, &st);
2778 if compile_prog "" "" "statx"; then
2781 print_config "statx(2)/libc" "$statx"
2783 ##########################################
2784 # check for statx(2) support by kernel
2788 #include <linux/stat.h>
2789 #include <sys/stat.h>
2790 #include <sys/syscall.h>
2792 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2793 struct statx *buffer)
2795 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2798 int main(int argc, char **argv)
2801 return _statx(-1, *argv, 0, 0, &st);
2804 if compile_prog "" "" "statx_syscall"; then
2807 print_config "statx(2)/syscall" "$statx_syscall"
2809 ##########################################
2810 # check for Windows PDB generation support
2811 if test "pdb" != "no" ; then
2818 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2821 if test "$pdb" = "yes"; then
2822 feature_not_found "PDB" "clang and lld"
2829 print_config "Windows PDB generation" "$pdb"
2831 ##########################################
2832 # check for timerfd support
2834 if test "$esx" != "yes" ; then
2836 #include <sys/time.h>
2837 #include <sys/timerfd.h>
2839 int main(int argc, char **argv)
2841 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2844 if compile_prog "" "" "timerfd_create"; then
2845 timerfd_create="yes"
2848 print_config "timerfd_create" "$timerfd_create"
2850 #############################################################################
2852 if test "$wordsize" = "64" ; then
2853 output_sym "CONFIG_64BIT"
2854 elif test "$wordsize" = "32" ; then
2855 output_sym "CONFIG_32BIT"
2857 fatal "Unknown wordsize!"
2859 if test "$bigendian" = "yes" ; then
2860 output_sym "CONFIG_BIG_ENDIAN"
2862 output_sym "CONFIG_LITTLE_ENDIAN"
2864 if test "$zlib" = "yes" ; then
2865 output_sym "CONFIG_ZLIB"
2867 if test "$libaio" = "yes" ; then
2868 output_sym "CONFIG_LIBAIO"
2869 if test "$libaio_rw_flags" = "yes" ; then
2870 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2873 if test "$posix_aio" = "yes" ; then
2874 output_sym "CONFIG_POSIXAIO"
2876 if test "$posix_aio_fsync" = "yes" ; then
2877 output_sym "CONFIG_POSIXAIO_FSYNC"
2879 if test "$posix_pshared" = "yes" ; then
2880 output_sym "CONFIG_PSHARED"
2882 if test "$pthread_condattr_setclock" = "yes" ; then
2883 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2885 if test "$pthread_sigmask" = "yes" ; then
2886 output_sym "CONFIG_PTHREAD_SIGMASK"
2888 if test "$pthread_getaffinity" = "yes" ; then
2889 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2891 if test "$have_asprintf" = "yes" ; then
2892 output_sym "CONFIG_HAVE_ASPRINTF"
2894 if test "$have_vasprintf" = "yes" ; then
2895 output_sym "CONFIG_HAVE_VASPRINTF"
2897 if test "$linux_fallocate" = "yes" ; then
2898 output_sym "CONFIG_LINUX_FALLOCATE"
2900 if test "$posix_fallocate" = "yes" ; then
2901 output_sym "CONFIG_POSIX_FALLOCATE"
2903 if test "$fdatasync" = "yes" ; then
2904 output_sym "CONFIG_FDATASYNC"
2906 if test "$pipe" = "yes" ; then
2907 output_sym "CONFIG_PIPE"
2909 if test "$pipe2" = "yes" ; then
2910 output_sym "CONFIG_PIPE2"
2912 if test "$pread" = "yes" ; then
2913 output_sym "CONFIG_PREAD"
2915 if test "$sync_file_range" = "yes" ; then
2916 output_sym "CONFIG_SYNC_FILE_RANGE"
2918 if test "$sfaa" = "yes" ; then
2919 output_sym "CONFIG_SFAA"
2921 if test "$sync_sync" = "yes" ; then
2922 output_sym "CONFIG_SYNC_SYNC"
2924 if test "$cmp_swap" = "yes" ; then
2925 output_sym "CONFIG_CMP_SWAP"
2927 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2928 output_sym "CONFIG_RDMA"
2930 # librpma is supported on the 'x86_64' architecture for now
2931 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2932 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2933 output_sym "CONFIG_LIBRPMA_APM"
2935 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2936 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2937 output_sym "CONFIG_LIBRPMA_GPSPM"
2939 if test "$clock_gettime" = "yes" ; then
2940 output_sym "CONFIG_CLOCK_GETTIME"
2942 if test "$clock_monotonic" = "yes" ; then
2943 output_sym "CONFIG_CLOCK_MONOTONIC"
2945 if test "$clockid_t" = "yes"; then
2946 output_sym "CONFIG_CLOCKID_T"
2948 if test "$gettimeofday" = "yes" ; then
2949 output_sym "CONFIG_GETTIMEOFDAY"
2951 if test "$posix_fadvise" = "yes" ; then
2952 output_sym "CONFIG_POSIX_FADVISE"
2954 if test "$linux_3arg_affinity" = "yes" ; then
2955 output_sym "CONFIG_3ARG_AFFINITY"
2956 elif test "$linux_2arg_affinity" = "yes" ; then
2957 output_sym "CONFIG_2ARG_AFFINITY"
2959 if test "$strsep" = "yes" ; then
2960 output_sym "CONFIG_STRSEP"
2962 if test "$strcasestr" = "yes" ; then
2963 output_sym "CONFIG_STRCASESTR"
2965 if test "$strlcat" = "yes" ; then
2966 output_sym "CONFIG_STRLCAT"
2968 if test "$getopt_long_only" = "yes" ; then
2969 output_sym "CONFIG_GETOPT_LONG_ONLY"
2971 if test "$inet_aton" = "yes" ; then
2972 output_sym "CONFIG_INET_ATON"
2974 if test "$socklen_t" = "yes" ; then
2975 output_sym "CONFIG_SOCKLEN_T"
2977 if test "$ext4_me" = "yes" ; then
2978 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2980 if test "$linux_splice" = "yes" ; then
2981 output_sym "CONFIG_LINUX_SPLICE"
2983 if test "$libnuma_v2" = "yes" ; then
2984 output_sym "CONFIG_LIBNUMA"
2986 if test "$solaris_aio" = "yes" ; then
2987 output_sym "CONFIG_SOLARISAIO"
2989 if test "$tls_thread" = "yes" ; then
2990 output_sym "CONFIG_TLS_THREAD"
2992 if test "$rusage_thread" = "yes" ; then
2993 output_sym "CONFIG_RUSAGE_THREAD"
2995 if test "$gfio" = "yes" ; then
2996 output_sym "CONFIG_GFIO"
2998 if test "$esx" = "yes" ; then
2999 output_sym "CONFIG_ESX"
3000 output_sym "CONFIG_NO_SHM"
3002 if test "$sched_idle" = "yes" ; then
3003 output_sym "CONFIG_SCHED_IDLE"
3005 if test "$tcp_nodelay" = "yes" ; then
3006 output_sym "CONFIG_TCP_NODELAY"
3008 if test "$window_size" = "yes" ; then
3009 output_sym "CONFIG_NET_WINDOWSIZE"
3011 if test "$mss" = "yes" ; then
3012 output_sym "CONFIG_NET_MSS"
3014 if test "$rlimit_memlock" = "yes" ; then
3015 output_sym "CONFIG_RLIMIT_MEMLOCK"
3017 if test "$pwritev" = "yes" ; then
3018 output_sym "CONFIG_PWRITEV"
3020 if test "$pwritev2" = "yes" ; then
3021 output_sym "CONFIG_PWRITEV2"
3023 if test "$ipv6" = "yes" ; then
3024 output_sym "CONFIG_IPV6"
3026 if test "$http" = "yes" ; then
3027 output_sym "CONFIG_HTTP"
3029 if test "$rados" = "yes" ; then
3030 output_sym "CONFIG_RADOS"
3032 if test "$rbd" = "yes" ; then
3033 output_sym "CONFIG_RBD"
3035 if test "$rbd_poll" = "yes" ; then
3036 output_sym "CONFIG_RBD_POLL"
3038 if test "$rbd_inval" = "yes" ; then
3039 output_sym "CONFIG_RBD_INVAL"
3041 if test "$setvbuf" = "yes" ; then
3042 output_sym "CONFIG_SETVBUF"
3044 if test "$s390_z196_facilities" = "yes" ; then
3045 output_sym "CONFIG_S390_Z196_FACILITIES"
3046 CFLAGS="$CFLAGS -march=z9-109"
3049 if test "$gfapi" = "yes" ; then
3050 output_sym "CONFIG_GFAPI"
3052 if test "$gf_fadvise" = "yes" ; then
3053 output_sym "CONFIG_GF_FADVISE"
3055 if test "$gf_trim" = "yes" ; then
3056 output_sym "CONFIG_GF_TRIM"
3058 if test "$gf_new" = "yes" ; then
3059 output_sym "CONFIG_GF_NEW_API"
3061 if test "$libhdfs" = "yes" ; then
3062 output_sym "CONFIG_LIBHDFS"
3063 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3064 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3065 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3066 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3068 if test "$mtd" = "yes" ; then
3069 output_sym "CONFIG_MTD"
3071 if test "$pmemblk" = "yes" ; then
3072 output_sym "CONFIG_PMEMBLK"
3074 if test "$devdax" = "yes" ; then
3075 output_sym "CONFIG_LINUX_DEVDAX"
3077 if test "$pmem" = "yes" ; then
3078 output_sym "CONFIG_LIBPMEM"
3080 if test "$libime" = "yes" ; then
3081 output_sym "CONFIG_IME"
3083 if test "$arith" = "yes" ; then
3084 output_sym "CONFIG_ARITHMETIC"
3085 if test "$yacc_is_bison" = "yes" ; then
3086 echo "YACC=bison -y" >> $config_host_mak
3088 echo "YACC=yacc" >> $config_host_mak
3090 if test "$lex_use_o" = "yes" ; then
3091 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3094 if test "$getmntent" = "yes" ; then
3095 output_sym "CONFIG_GETMNTENT"
3097 if test "$getmntinfo" = "yes" ; then
3098 output_sym "CONFIG_GETMNTINFO"
3100 if test "$getmntinfo_statvfs" = "yes" ; then
3101 output_sym "CONFIG_GETMNTINFO_STATVFS"
3103 if test "$static_assert" = "yes" ; then
3104 output_sym "CONFIG_STATIC_ASSERT"
3106 if test "$have_bool" = "yes" ; then
3107 output_sym "CONFIG_HAVE_BOOL"
3109 if test "$strndup" = "yes" ; then
3110 output_sym "CONFIG_HAVE_STRNDUP"
3112 if test "$disable_opt" = "yes" ; then
3113 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3115 if test "$valgrind_dev" = "yes"; then
3116 output_sym "CONFIG_VALGRIND_DEV"
3118 if test "$linux_blkzoned" = "yes" ; then
3119 output_sym "CONFIG_HAS_BLKZONED"
3121 if test "$libzbc" = "yes" ; then
3122 output_sym "CONFIG_LIBZBC"
3124 if test "$zlib" = "no" ; then
3125 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
3126 if test "$build_static" = "yes"; then
3127 echo "Note that some distros have separate packages for static libraries."
3130 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3131 output_sym "ARCH_HAVE_CRC_CRYPTO"
3133 if test "$cuda" = "yes" ; then
3134 output_sym "CONFIG_CUDA"
3136 if test "$libcufile" = "yes" ; then
3137 output_sym "CONFIG_LIBCUFILE"
3139 if test "$dfs" = "yes" ; then
3140 output_sym "CONFIG_DFS"
3142 if test "$libnfs" = "yes" ; then
3143 output_sym "CONFIG_NFS"
3145 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3146 output_sym "CONFIG_BUILD_NATIVE"
3148 if test "$cunit" = "yes" ; then
3149 output_sym "CONFIG_HAVE_CUNIT"
3151 if test "$__kernel_rwf_t" = "yes"; then
3152 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3154 if test "$gettid" = "yes"; then
3155 output_sym "CONFIG_HAVE_GETTID"
3157 if test "$statx" = "yes"; then
3158 output_sym "CONFIG_HAVE_STATX"
3160 if test "$statx_syscall" = "yes"; then
3161 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3163 if test "$timerfd_create" = "yes"; then
3164 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3166 if test "$fallthrough" = "yes"; then
3167 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3169 if test "$thp" = "yes" ; then
3170 output_sym "CONFIG_HAVE_THP"
3172 if test "$libiscsi" = "yes" ; then
3173 output_sym "CONFIG_LIBISCSI"
3174 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3175 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3176 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3178 if test "$libnbd" = "yes" ; then
3179 output_sym "CONFIG_LIBNBD"
3180 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3181 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3182 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3184 if test "$libnfs" = "yes" ; then
3185 output_sym "CONFIG_LIBNFS"
3186 echo "CONFIG_LIBNFS=m" >> $config_host_mak
3187 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3188 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3190 if test "$dynamic_engines" = "yes" ; then
3191 output_sym "CONFIG_DYNAMIC_ENGINES"
3193 if test "$pdb" = yes; then
3194 output_sym "CONFIG_PDB"
3196 if test "$fcntl_sync" = "yes" ; then
3197 output_sym "CONFIG_FCNTL_SYNC"
3200 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3202 int main(int argc, char **argv)
3207 if test "$disable_tcmalloc" != "yes"; then
3208 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3210 LIBS="-ltcmalloc $LIBS"
3211 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3213 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3218 print_config "TCMalloc support" "$tcmalloc"
3220 echo "LIBS+=$LIBS" >> $config_host_mak
3221 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3222 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3223 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3224 echo "CC=$cc" >> $config_host_mak
3225 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3226 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3228 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3229 cat > Makefile <<EOF
3230 SRCDIR:=`dirname $0`
3231 include \$(SRCDIR)/Makefile