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"
180 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
182 --prefix=*) prefix="$optarg"
184 --cpu=*) cpu="$optarg"
186 # esx is cross compiled and cannot be detect through simple uname calls
192 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
194 --build-32bit-win) build_32bit_win="yes"
196 --target-win-ver=*) target_win_ver="$optarg"
198 --enable-pdb) pdb="yes"
200 --build-static) build_static="yes"
202 --enable-gfio) gfio_check="yes"
204 --disable-numa) disable_numa="yes"
206 --disable-rdma) disable_rdma="yes"
208 --disable-rados) disable_rados="yes"
210 --disable-rbd) disable_rbd="yes"
212 --disable-http) disable_http="yes"
214 --disable-gfapi) disable_gfapi="yes"
216 --enable-libhdfs) libhdfs="yes"
218 --disable-lex) disable_lex="yes"
220 --enable-lex) disable_lex="no"
222 --disable-shm) no_shm="yes"
224 --disable-optimizations) disable_opt="yes"
226 --disable-pmem) disable_pmem="yes"
228 --enable-cuda) cuda="yes"
230 --enable-libcufile) libcufile="yes"
232 --disable-native) disable_native="yes"
234 --with-ime=*) ime_path="$optarg"
236 --enable-libiscsi) libiscsi="yes"
238 --enable-libnbd) libnbd="yes"
240 --disable-libzbc) libzbc="no"
242 --disable-tcmalloc) disable_tcmalloc="yes"
244 --dynamic-libengines) dynamic_engines="yes"
246 --disable-dfs) dfs="no"
252 echo "Bad option $opt"
258 if test "$show_help" = "yes" ; then
259 echo "--prefix= Use this directory as installation prefix"
260 echo "--cpu= Specify target CPU if auto-detect fails"
261 echo "--cc= Specify compiler to use"
262 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
263 echo "--build-32bit-win Enable 32-bit build on Windows"
264 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
265 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
266 echo "--build-static Build a static fio"
267 echo "--esx Configure build options for esx"
268 echo "--enable-gfio Enable building of gtk gfio"
269 echo "--disable-numa Disable libnuma even if found"
270 echo "--disable-rdma Disable RDMA support even if found"
271 echo "--disable-rados Disable Rados support even if found"
272 echo "--disable-rbd Disable Rados Block Device even if found"
273 echo "--disable-http Disable HTTP support even if found"
274 echo "--disable-gfapi Disable gfapi"
275 echo "--enable-libhdfs Enable hdfs support"
276 echo "--disable-lex Disable use of lex/yacc for math"
277 echo "--disable-pmem Disable pmem based engines even if found"
278 echo "--enable-lex Enable use of lex/yacc for math"
279 echo "--disable-shm Disable SHM support"
280 echo "--disable-optimizations Don't enable compiler optimizations"
281 echo "--enable-cuda Enable GPUDirect RDMA support"
282 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
283 echo "--disable-native Don't build for native host"
284 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
285 echo "--enable-libiscsi Enable iscsi support"
286 echo "--enable-libnbd Enable libnbd (NBD engine) support"
287 echo "--disable-libzbc Disable libzbc even if found"
288 echo "--disable-tcmalloc Disable tcmalloc support"
289 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
290 echo "--disable-dfs Disable DAOS File System support even if found"
294 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
295 # Preferred compiler (can be overriden later after we know the platform):
297 # ${cross_prefix}gcc (if cross-prefix specified)
300 if test -z "${CC}${cross_prefix}"; then
307 cc="${CC-${cross_prefix}gcc}"
310 if check_define __ANDROID__ ; then
312 elif check_define __linux__ ; then
314 elif check_define __OpenBSD__ ; then
316 elif check_define __NetBSD__ ; then
318 elif check_define __sun__ ; then
320 CFLAGS="$CFLAGS -D_REENTRANT"
321 elif check_define _WIN32 ; then
327 echo "# Automatically generated by configure - do not modify" > $config_host_mak
328 printf "# Configured with:" >> $config_host_mak
329 printf " '%s'" "$0" "$@" >> $config_host_mak
330 echo >> $config_host_mak
331 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
333 if test "$no_shm" = "yes" ; then
334 output_sym "CONFIG_NO_SHM"
337 if test "$disable_opt" = "yes" ; then
338 output_sym "CONFIG_FIO_NO_OPT"
341 # Some host OSes need non-standard checks for which CPU to use.
342 # Note that these checks are broken for cross-compilation: if you're
343 # cross-compiling to one of these OSes then you'll need to specify
344 # the correct CPU with the --cpu option.
347 # Unless explicitly enabled, turn off lex.
348 # OpenBSD will hit syntax error when enabled.
349 if test -z "$disable_lex" ; then
356 CFLAGS="$CFLAGS -I/usr/local/include"
357 LDFLAGS="$LDFLAGS -L/usr/local/lib"
360 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
361 # we can run 64-bit userspace code.
362 # If the user didn't specify a CPU explicitly and the kernel says this is
363 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
365 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
368 # Avoid configure feature detection of features provided by weak symbols
375 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
376 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
380 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
381 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
384 LIBS="-lnsl -lsocket"
387 # We still force some options, so keep this message here.
388 echo "Forcing some known good options on Windows"
389 if test -z "${CC}${cross_prefix}"; then
390 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
391 cc="i686-w64-mingw32-gcc"
393 cc="x86_64-w64-mingw32-gcc"
397 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
398 if test -z "$target_win_ver"; then
399 # Default Windows API target
402 if test "$target_win_ver" = "7"; then
403 output_sym "CONFIG_WINDOWS_7"
404 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
406 fatal "Unknown target Windows version"
409 # We need this to be output_sym'd here because this is Windows specific.
410 # The regular configure path never sets this config.
411 output_sym "CONFIG_WINDOWSAIO"
412 # We now take the regular configuration path without having exit 0 here.
413 # Flags below are still necessary mostly for MinGW.
417 clock_gettime="yes" # clock_monotonic probe has dependency on this
418 clock_monotonic="yes"
420 pthread_condattr_setclock="no"
421 pthread_affinity="no"
425 # Now we know the target platform we can have another guess at the preferred
426 # compiler when it wasn't explictly set
427 if test -z "${CC}${cross_prefix}"; then
428 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
434 if test -z "$cc"; then
435 echo "configure: failed to find compiler"
439 if test ! -z "$cpu" ; then
440 # command line argument
442 elif check_define __i386__ ; then
444 elif check_define __x86_64__ ; then
446 elif check_define __sparc__ ; then
447 if check_define __arch64__ ; then
452 elif check_define _ARCH_PPC ; then
453 if check_define _ARCH_PPC64 ; then
458 elif check_define __mips__ ; then
460 elif check_define __ia64__ ; then
462 elif check_define __s390__ ; then
463 if check_define __s390x__ ; then
468 elif check_define __arm__ ; then
470 elif check_define __aarch64__ ; then
472 elif check_define __hppa__ ; then
478 # Normalise host CPU name and set ARCH.
480 ia64|ppc|ppc64|s390|s390x|sparc64)
483 i386|i486|i586|i686|i86pc|BePC)
495 hppa|parisc|parisc64)
509 ##########################################
510 # check cross compile
512 if test "$cross_compile" != "yes" ; then
521 if compile_prog "" "" "cross"; then
522 $TMPE 2>/dev/null || cross_compile="yes"
524 fatal "compile test failed"
527 ##########################################
529 if test "$bigendian" != "yes" ; then
532 if test "$cross_compile" = "no" ; then
534 #include <inttypes.h>
537 volatile uint32_t i=0x01234567;
538 return (*((uint8_t*)(&i))) == 0x67;
541 if compile_prog "" "" "endian"; then
542 $TMPE && bigendian="yes"
545 # If we're cross compiling, try our best to work it out and rely on the
546 # run-time check to fail if we get it wrong.
551 #if __BYTE_ORDER != __BIG_ENDIAN
552 # error "Unknown endianness"
556 compile_prog "" "" "endian" && bigendian="yes"
557 check_define "__ARMEB__" && bigendian="yes"
558 check_define "__MIPSEB__" && bigendian="yes"
562 print_config "Operating system" "$targetos"
563 print_config "CPU" "$cpu"
564 print_config "Big endian" "$bigendian"
565 if test ! -z "$target_win_ver"; then
566 print_config "Target Windows version" "$target_win_ver"
568 print_config "Compiler" "$cc"
569 print_config "Cross compile" "$cross_compile"
572 ##########################################
573 # See if we need to build a static build
574 if test "$build_static" = "yes" ; then
575 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
576 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
580 print_config "Static build" "$build_static"
582 ##########################################
583 # check for C11 atomics support
585 #include <stdatomic.h>
593 if ! compile_prog "" "" "C11 atomics"; then
595 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
596 echo "minimum versions with it - perhaps your compiler is too old?"
597 fatal "C11 atomics support not found"
601 ##########################################
606 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
609 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
613 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
615 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
618 fatal "Unknown wordsize"
620 print_config "Wordsize" "$wordsize"
622 ##########################################
624 if test "$zlib" != "yes" ; then
632 if (inflateInit(&stream) != Z_OK)
637 if compile_prog "" "-lz" "zlib" ; then
641 print_config "zlib" "$zlib"
643 ##########################################
645 if test "$libaio" != "yes" ; then
648 if test "$esx" != "yes" ; then
658 if compile_prog "" "-laio" "libaio" ; then
661 if test "$libaio" = "yes" ; then
662 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
672 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
673 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
677 if compile_prog "" "" "libaio rw flags" ; then
683 print_config "Linux AIO support" "$libaio"
684 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
686 ##########################################
688 if test "$posix_aio" != "yes" ; then
691 if test "$posix_aio_lrt" != "yes" ; then
703 if compile_prog "" "" "posixaio" ; then
705 elif compile_prog "" "-lrt" "posixaio -lrt"; then
710 print_config "POSIX AIO support" "$posix_aio"
711 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
713 ##########################################
714 # posix aio fsync probe
715 if test "$posix_aio_fsync" != "yes" ; then
718 if test "$posix_aio" = "yes" ; then
725 return aio_fsync(O_SYNC, &cb);
729 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
733 print_config "POSIX AIO fsync" "$posix_aio_fsync"
735 ##########################################
736 # POSIX pshared attribute probe
737 if test "$posix_pshared" != "yes" ; then
744 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
745 # if defined(__CYGWIN__)
746 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
747 # elif defined(__APPLE__)
748 # include <AvailabilityMacros.h>
749 # include <TargetConditionals.h>
750 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
751 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
755 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
760 if compile_prog "" "$LIBS" "posix_pshared" ; then
763 print_config "POSIX pshared support" "$posix_pshared"
765 ##########################################
766 # POSIX pthread_condattr_setclock() probe
767 if test "$pthread_condattr_setclock" != "no" ; then
772 pthread_condattr_t condattr;
773 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
777 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
778 pthread_condattr_setclock=yes
779 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
780 pthread_condattr_setclock=yes
781 LIBS="$LIBS -lpthread"
784 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
786 ##########################################
787 # pthread_sigmask() probe
788 if test "$pthread_sigmask" != "yes" ; then
792 #include <stddef.h> /* NULL */
793 #include <signal.h> /* pthread_sigmask() */
796 return pthread_sigmask(0, NULL, NULL);
799 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
801 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
803 LIBS="$LIBS -lpthread"
805 print_config "pthread_sigmask()" "$pthread_sigmask"
807 ##########################################
808 # pthread_getaffinity_np() probe
809 if test "$pthread_getaffinity" != "yes" ; then
810 pthread_getaffinity="no"
813 #include <stddef.h> /* NULL */
814 #include <signal.h> /* pthread_sigmask() */
819 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
822 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
823 pthread_getaffinity="yes"
824 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
825 pthread_getaffinity="yes"
826 LIBS="$LIBS -lpthread"
828 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
830 ##########################################
832 if test "$solaris_aio" != "yes" ; then
836 #include <sys/types.h>
837 #include <sys/asynch.h>
842 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
846 if compile_prog "" "-laio" "solarisaio" ; then
850 print_config "Solaris AIO support" "$solaris_aio"
852 ##########################################
853 # __sync_fetch_and_add test
854 if test "$sfaa" != "yes" ; then
858 #include <inttypes.h>
859 static int sfaa(uint64_t *ptr)
861 return __sync_fetch_and_add(ptr, 0);
864 int main(int argc, char **argv)
871 if compile_prog "" "" "__sync_fetch_and_add()" ; then
874 print_config "__sync_fetch_and_add" "$sfaa"
876 ##########################################
877 # __sync_synchronize() test
878 if test "$sync_sync" != "yes" ; then
882 #include <inttypes.h>
884 int main(int argc, char **argv)
886 __sync_synchronize();
890 if compile_prog "" "" "__sync_synchronize()" ; then
893 print_config "__sync_synchronize" "$sync_sync"
895 ##########################################
896 # __sync_val_compare_and_swap() test
897 if test "$cmp_swap" != "yes" ; then
901 #include <inttypes.h>
903 int main(int argc, char **argv)
906 return __sync_val_compare_and_swap(&x, 1, 2);
909 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
912 print_config "__sync_val_compare_and_swap" "$cmp_swap"
914 ##########################################
916 if test "$libverbs" != "yes" ; then
920 #include <infiniband/verbs.h>
921 int main(int argc, char **argv)
923 struct ibv_pd *pd = ibv_alloc_pd(NULL);
927 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
930 print_config "libverbs" "$libverbs"
932 ##########################################
934 if test "$rdmacm" != "yes" ; then
939 #include <rdma/rdma_cma.h>
940 int main(int argc, char **argv)
942 rdma_destroy_qp(NULL);
946 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
949 print_config "rdmacm" "$rdmacm"
951 ##########################################
953 if test "$librpma" != "yes" ; then
959 int main(int argc, char **argv)
961 enum rpma_conn_event event = RPMA_CONN_REJECTED;
962 (void) event; /* unused */
963 rpma_log_set_threshold(RPMA_LOG_THRESHOLD, RPMA_LOG_LEVEL_INFO);
967 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
970 print_config "librpma" "$librpma"
972 ##########################################
973 # libprotobuf-c probe
974 if test "$libprotobuf_c" != "yes" ; then
979 #include <protobuf-c/protobuf-c.h>
980 #if !defined(PROTOBUF_C_VERSION_NUMBER)
981 # error PROTOBUF_C_VERSION_NUMBER is not defined!
983 int main(int argc, char **argv)
985 (void)protobuf_c_message_check(NULL);
989 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
992 print_config "libprotobuf_c" "$libprotobuf_c"
994 ##########################################
995 # asprintf() and vasprintf() probes
996 if test "$have_asprintf" != "yes" ; then
1002 int main(int argc, char **argv)
1005 return asprintf(&buf, "%s", "str") == 0;
1008 if compile_prog "" "" "have_asprintf"; then
1011 print_config "asprintf()" "$have_asprintf"
1013 if test "$have_vasprintf" != "yes" ; then
1019 int main(int argc, char **argv)
1023 return vasprintf(&buf, "%s", ap) == 0;
1026 if compile_prog "" "" "have_vasprintf"; then
1027 have_vasprintf="yes"
1029 print_config "vasprintf()" "$have_vasprintf"
1031 ##########################################
1032 # Linux fallocate probe
1033 if test "$linux_fallocate" != "yes" ; then
1034 linux_fallocate="no"
1039 #include <linux/falloc.h>
1040 int main(int argc, char **argv)
1042 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1046 if compile_prog "" "" "linux_fallocate"; then
1047 linux_fallocate="yes"
1049 print_config "Linux fallocate" "$linux_fallocate"
1051 ##########################################
1052 # POSIX fadvise probe
1053 if test "$posix_fadvise" != "yes" ; then
1059 int main(int argc, char **argv)
1061 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1065 if compile_prog "" "" "posix_fadvise"; then
1068 print_config "POSIX fadvise" "$posix_fadvise"
1070 ##########################################
1071 # POSIX fallocate probe
1072 if test "$posix_fallocate" != "yes" ; then
1073 posix_fallocate="no"
1078 int main(int argc, char **argv)
1080 int r = posix_fallocate(0, 0, 1024);
1084 if compile_prog "" "" "posix_fallocate"; then
1085 posix_fallocate="yes"
1087 print_config "POSIX fallocate" "$posix_fallocate"
1089 ##########################################
1090 # sched_set/getaffinity 2 or 3 argument test
1091 if test "$linux_2arg_affinity" != "yes" ; then
1092 linux_2arg_affinity="no"
1094 if test "$linux_3arg_affinity" != "yes" ; then
1095 linux_3arg_affinity="no"
1099 int main(int argc, char **argv)
1102 return sched_setaffinity(0, sizeof(mask), &mask);
1105 if compile_prog "" "" "sched_setaffinity(,,)"; then
1106 linux_3arg_affinity="yes"
1110 int main(int argc, char **argv)
1113 return sched_setaffinity(0, &mask);
1116 if compile_prog "" "" "sched_setaffinity(,)"; then
1117 linux_2arg_affinity="yes"
1120 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1121 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1123 ##########################################
1124 # clock_gettime probe
1125 if test "$clock_gettime" != "yes" ; then
1131 int main(int argc, char **argv)
1133 return clock_gettime(0, NULL);
1136 if compile_prog "" "" "clock_gettime"; then
1138 elif compile_prog "" "-lrt" "clock_gettime"; then
1142 print_config "clock_gettime" "$clock_gettime"
1144 ##########################################
1145 # CLOCK_MONOTONIC probe
1146 if test "$clock_monotonic" != "yes" ; then
1147 clock_monotonic="no"
1149 if test "$clock_gettime" = "yes" ; then
1153 int main(int argc, char **argv)
1155 return clock_gettime(CLOCK_MONOTONIC, NULL);
1158 if compile_prog "" "$LIBS" "clock monotonic"; then
1159 clock_monotonic="yes"
1162 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1164 ##########################################
1166 if test "$clockid_t" != "yes" ; then
1172 int main(int argc, char **argv)
1174 volatile clockid_t cid;
1175 memset((void*)&cid, 0, sizeof(cid));
1179 if compile_prog "" "$LIBS" "clockid_t"; then
1182 print_config "clockid_t" "$clockid_t"
1184 ##########################################
1185 # gettimeofday() probe
1186 if test "$gettimeofday" != "yes" ; then
1190 #include <sys/time.h>
1192 int main(int argc, char **argv)
1195 return gettimeofday(&tv, NULL);
1198 if compile_prog "" "" "gettimeofday"; then
1201 print_config "gettimeofday" "$gettimeofday"
1203 ##########################################
1205 if test "$fdatasync" != "yes" ; then
1211 int main(int argc, char **argv)
1213 return fdatasync(0);
1216 if compile_prog "" "" "fdatasync"; then
1219 print_config "fdatasync" "$fdatasync"
1221 ##########################################
1223 if test "$pipe" != "yes" ; then
1228 int main(int argc, char **argv)
1234 if compile_prog "" "" "pipe"; then
1237 print_config "pipe()" "$pipe"
1239 ##########################################
1241 if test "$pipe2" != "yes" ; then
1246 int main(int argc, char **argv)
1249 return pipe2(fd, 0);
1252 if compile_prog "" "" "pipe2"; then
1255 print_config "pipe2()" "$pipe2"
1257 ##########################################
1259 if test "$pread" != "yes" ; then
1264 int main(int argc, char **argv)
1266 return pread(0, NULL, 0, 0);
1269 if compile_prog "" "" "pread"; then
1272 print_config "pread()" "$pread"
1274 ##########################################
1275 # sync_file_range() probe
1276 if test "$sync_file_range" != "yes" ; then
1277 sync_file_range="no"
1283 #include <linux/fs.h>
1284 int main(int argc, char **argv)
1286 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1287 SYNC_FILE_RANGE_WAIT_AFTER;
1288 return sync_file_range(0, 0, 0, flags);
1291 if compile_prog "" "" "sync_file_range"; then
1292 sync_file_range="yes"
1294 print_config "sync_file_range" "$sync_file_range"
1296 ##########################################
1297 # ext4 move extent probe
1298 if test "$ext4_me" != "yes" ; then
1303 #include <sys/ioctl.h>
1304 int main(int argc, char **argv)
1306 struct move_extent me;
1307 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1310 if compile_prog "" "" "ext4 move extent" ; then
1312 elif test $targetos = "Linux" ; then
1313 # On Linux, just default to it on and let it error at runtime if we really
1314 # don't have it. None of my updated systems have it defined, but it does
1315 # work. Takes a while to bubble back.
1318 print_config "EXT4 move extent" "$ext4_me"
1320 ##########################################
1322 if test "$linux_splice" != "yes" ; then
1328 int main(int argc, char **argv)
1330 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1333 if compile_prog "" "" "linux splice"; then
1336 print_config "Linux splice(2)" "$linux_splice"
1338 ##########################################
1340 if test "$libnuma" != "yes" ; then
1345 int main(int argc, char **argv)
1347 return numa_available();
1350 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1354 print_config "libnuma" "$libnuma"
1356 ##########################################
1357 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1358 if test "$libnuma" = "yes" ; then
1362 int main(int argc, char **argv)
1364 struct bitmask *mask = numa_parse_nodestring(NULL);
1365 return mask->size == 0;
1368 if compile_prog "" "" "libnuma api"; then
1371 print_config "libnuma v2" "$libnuma_v2"
1374 ##########################################
1376 if test "$strsep" != "yes" ; then
1381 int main(int argc, char **argv)
1383 static char *string = "This is a string";
1384 strsep(&string, "needle");
1388 if compile_prog "" "" "strsep"; then
1391 print_config "strsep" "$strsep"
1393 ##########################################
1394 # strcasestr() probe
1395 if test "$strcasestr" != "yes" ; then
1400 int main(int argc, char **argv)
1402 return strcasestr(argv[0], argv[1]) != NULL;
1405 if compile_prog "" "" "strcasestr"; then
1408 print_config "strcasestr" "$strcasestr"
1410 ##########################################
1412 if test "$strlcat" != "yes" ; then
1417 int main(int argc, char **argv)
1419 static char dst[64];
1420 static char *string = "This is a string";
1421 memset(dst, 0, sizeof(dst));
1422 strlcat(dst, string, sizeof(dst));
1426 if compile_prog "" "" "strlcat"; then
1429 print_config "strlcat" "$strlcat"
1431 ##########################################
1432 # getopt_long_only() probe
1433 if test "$getopt_long_only" != "yes" ; then
1434 getopt_long_only="no"
1440 int main(int argc, char **argv)
1442 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1446 if compile_prog "" "" "getopt_long_only"; then
1447 getopt_long_only="yes"
1449 print_config "getopt_long_only()" "$getopt_long_only"
1451 ##########################################
1453 if test "$inet_aton" != "yes" ; then
1458 #include <winsock2.h>
1460 #include <sys/socket.h>
1461 #include <arpa/inet.h>
1464 int main(int argc, char **argv)
1467 return inet_aton(NULL, &in);
1470 if compile_prog "" "" "inet_aton"; then
1473 print_config "inet_aton" "$inet_aton"
1475 ##########################################
1477 if test "$socklen_t" != "yes" ; then
1482 #include <winsock2.h>
1483 #include <ws2tcpip.h>
1485 #include <sys/socket.h>
1487 int main(int argc, char **argv)
1493 if compile_prog "" "" "socklen_t"; then
1496 print_config "socklen_t" "$socklen_t"
1498 ##########################################
1499 # Whether or not __thread is supported for TLS
1500 if test "$tls_thread" != "yes" ; then
1505 static __thread int ret;
1506 int main(int argc, char **argv)
1511 if compile_prog "" "" "__thread"; then
1514 print_config "__thread" "$tls_thread"
1516 ##########################################
1517 # Check if we have required gtk/glib support for gfio
1518 if test "$gfio" != "yes" ; then
1521 if test "$gfio_check" = "yes" ; then
1525 #include <gtk/gtk.h>
1528 gdk_threads_enter();
1529 gdk_threads_leave();
1531 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1534 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1535 ORG_LDFLAGS=$LDFLAGS
1536 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1537 if test "$?" != "0" ; then
1538 echo "configure: gtk and gthread not found"
1541 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1542 if test "$?" != "0" ; then
1543 echo "configure: gtk and gthread not found"
1547 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1548 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1549 GFIO_LIBS="$LIBS $GTK_LIBS"
1550 CFLAGS="$CFLAGS $GTK_CFLAGS"
1552 echo "Please install gtk and gdk libraries"
1558 LDFLAGS=$ORG_LDFLAGS
1561 if test "$gfio_check" = "yes" ; then
1562 print_config "gtk 2.18 or higher" "$gfio"
1565 ##########################################
1566 # Check whether we have getrusage(RUSAGE_THREAD)
1567 if test "$rusage_thread" != "yes" ; then
1571 #include <sys/time.h>
1572 #include <sys/resource.h>
1573 int main(int argc, char **argv)
1576 getrusage(RUSAGE_THREAD, &ru);
1580 if compile_prog "" "" "RUSAGE_THREAD"; then
1583 print_config "RUSAGE_THREAD" "$rusage_thread"
1585 ##########################################
1586 # Check whether we have SCHED_IDLE
1587 if test "$sched_idle" != "yes" ; then
1592 int main(int argc, char **argv)
1594 struct sched_param p;
1595 return sched_setscheduler(0, SCHED_IDLE, &p);
1598 if compile_prog "" "" "SCHED_IDLE"; then
1601 print_config "SCHED_IDLE" "$sched_idle"
1603 ##########################################
1604 # Check whether we have TCP_NODELAY
1605 if test "$tcp_nodelay" != "yes" ; then
1610 #include <winsock2.h>
1613 #include <sys/types.h>
1614 #include <sys/socket.h>
1615 #include <netinet/tcp.h>
1617 int main(int argc, char **argv)
1619 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1622 if compile_prog "" "" "TCP_NODELAY"; then
1624 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1626 LIBS="$LIBS -lws2_32"
1628 print_config "TCP_NODELAY" "$tcp_nodelay"
1630 ##########################################
1631 # Check whether we have SO_SNDBUF
1632 if test "$window_size" != "yes" ; then
1637 #include <winsock2.h>
1640 #include <sys/types.h>
1641 #include <sys/socket.h>
1642 #include <netinet/tcp.h>
1644 int main(int argc, char **argv)
1646 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1647 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1650 if compile_prog "" "" "SO_SNDBUF"; then
1652 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1654 LIBS="$LIBS -lws2_32"
1656 print_config "Net engine window_size" "$window_size"
1658 ##########################################
1659 # Check whether we have TCP_MAXSEG
1660 if test "$mss" != "yes" ; then
1665 #include <winsock2.h>
1668 #include <sys/types.h>
1669 #include <sys/socket.h>
1670 #include <netinet/tcp.h>
1671 #include <arpa/inet.h>
1672 #include <netinet/in.h>
1674 int main(int argc, char **argv)
1676 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1679 if compile_prog "" "" "TCP_MAXSEG"; then
1681 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1683 LIBS="$LIBS -lws2_32"
1685 print_config "TCP_MAXSEG" "$mss"
1687 ##########################################
1688 # Check whether we have RLIMIT_MEMLOCK
1689 if test "$rlimit_memlock" != "yes" ; then
1693 #include <sys/time.h>
1694 #include <sys/resource.h>
1695 int main(int argc, char **argv)
1698 return getrlimit(RLIMIT_MEMLOCK, &rl);
1701 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1702 rlimit_memlock="yes"
1704 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1706 ##########################################
1707 # Check whether we have pwritev/preadv
1708 if test "$pwritev" != "yes" ; then
1713 #include <sys/uio.h>
1714 int main(int argc, char **argv)
1716 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1719 if compile_prog "" "" "pwritev"; then
1722 print_config "pwritev/preadv" "$pwritev"
1724 ##########################################
1725 # Check whether we have pwritev2/preadv2
1726 if test "$pwritev2" != "yes" ; then
1731 #include <sys/uio.h>
1732 int main(int argc, char **argv)
1734 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1737 if compile_prog "" "" "pwritev2"; then
1740 print_config "pwritev2/preadv2" "$pwritev2"
1742 ##########################################
1743 # Check whether we have the required functions for ipv6
1744 if test "$ipv6" != "yes" ; then
1749 #include <winsock2.h>
1750 #include <ws2tcpip.h>
1752 #include <sys/types.h>
1753 #include <sys/socket.h>
1754 #include <netinet/in.h>
1758 int main(int argc, char **argv)
1760 struct addrinfo hints;
1761 struct in6_addr addr;
1764 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1766 printf("%s\n", gai_strerror(ret));
1771 if compile_prog "" "" "ipv6"; then
1774 print_config "IPv6 helpers" "$ipv6"
1776 ##########################################
1778 if test "$http" != "yes" ; then
1781 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1783 #include <curl/curl.h>
1784 #include <openssl/hmac.h>
1786 int main(int argc, char **argv)
1791 curl = curl_easy_init();
1792 curl_easy_cleanup(curl);
1794 ctx = HMAC_CTX_new();
1795 HMAC_CTX_reset(ctx);
1800 # openssl < 1.1.0 uses the HMAC_CTX type directly
1802 #include <curl/curl.h>
1803 #include <openssl/hmac.h>
1805 int main(int argc, char **argv)
1810 curl = curl_easy_init();
1811 curl_easy_cleanup(curl);
1813 HMAC_CTX_init(&ctx);
1814 HMAC_CTX_cleanup(&ctx);
1818 if test "$disable_http" != "yes"; then
1819 HTTP_LIBS="-lcurl -lssl -lcrypto"
1820 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1821 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1823 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1827 print_config "http engine" "$http"
1829 ##########################################
1831 if test "$rados" != "yes" ; then
1835 #include <rados/librados.h>
1837 int main(int argc, char **argv)
1840 rados_ioctx_t io_ctx;
1841 const char cluster_name[] = "ceph";
1842 const char user_name[] = "client.admin";
1843 const char pool[] = "rados";
1845 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1846 rados_create2(&cluster, cluster_name, user_name, 0);
1847 rados_ioctx_create(cluster, pool, &io_ctx);
1852 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1855 print_config "Rados engine" "$rados"
1857 ##########################################
1859 if test "$rbd" != "yes" ; then
1863 #include <rbd/librbd.h>
1865 int main(int argc, char **argv)
1868 rados_ioctx_t io_ctx;
1869 const char cluster_name[] = "ceph";
1870 const char user_name[] = "client.admin";
1871 const char pool[] = "rbd";
1872 int major, minor, extra;
1874 rbd_version(&major, &minor, &extra);
1875 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1876 rados_create2(&cluster, cluster_name, user_name, 0);
1877 rados_ioctx_create(cluster, pool, &io_ctx);
1882 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1885 print_config "Rados Block Device engine" "$rbd"
1887 ##########################################
1888 # check for rbd_poll
1889 if test "$rbd_poll" != "yes" ; then
1892 if test "$rbd" = "yes"; then
1894 #include <rbd/librbd.h>
1895 #include <sys/eventfd.h>
1897 int main(int argc, char **argv)
1900 rbd_completion_t comp;
1902 int fd = eventfd(0, EFD_NONBLOCK);
1903 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1904 rbd_poll_io_events(image, comp, 1);
1909 if compile_prog "" "-lrbd -lrados" "rbd"; then
1912 print_config "rbd_poll" "$rbd_poll"
1915 ##########################################
1916 # check for rbd_invalidate_cache()
1917 if test "$rbd_inval" != "yes" ; then
1920 if test "$rbd" = "yes"; then
1922 #include <rbd/librbd.h>
1924 int main(int argc, char **argv)
1928 return rbd_invalidate_cache(image);
1931 if compile_prog "" "-lrbd -lrados" "rbd"; then
1934 print_config "rbd_invalidate_cache" "$rbd_inval"
1937 ##########################################
1938 # Check whether we have setvbuf
1939 if test "$setvbuf" != "yes" ; then
1944 int main(int argc, char **argv)
1948 setvbuf(f, buf, _IOFBF, sizeof(buf));
1952 if compile_prog "" "" "setvbuf"; then
1955 print_config "setvbuf" "$setvbuf"
1957 ##########################################
1959 if test "$gfapi" != "yes" ; then
1963 #include <glusterfs/api/glfs.h>
1965 int main(int argc, char **argv)
1967 glfs_t *g = glfs_new("foo");
1972 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1975 print_config "Gluster API engine" "$gfapi"
1977 ##########################################
1978 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1979 if test "$gfapi" = "yes" ; then
1982 #include <glusterfs/api/glfs.h>
1984 int main(int argc, char **argv)
1987 int ret = glfs_fadvise(fd, 0, 0, 1);
1992 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1995 print_config "Gluster API use fadvise" "$gf_fadvise"
1998 ##########################################
1999 # check for newer gfapi
2000 if test "$gfapi" = "yes" ; then
2003 #include <glusterfs/api/glfs.h>
2005 int main(int argc, char **argv)
2007 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2010 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2013 print_config "Gluster new API" "$gf_new"
2016 ##########################################
2017 # check for gfapi trim support
2018 if test "$gf_trim" != "yes" ; then
2021 if test "$gfapi" = "yes" ; then
2023 #include <glusterfs/api/glfs.h>
2025 int main(int argc, char **argv)
2027 return glfs_discard_async(NULL, 0, 0);
2030 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2033 print_config "Gluster API trim support" "$gf_trim"
2036 ##########################################
2037 # Check if we support stckf on s390
2038 if test "$s390_z196_facilities" != "yes" ; then
2039 s390_z196_facilities="no"
2042 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2043 int main(int argc, char **argv)
2045 /* We want just 1 double word to be returned. */
2046 register unsigned long reg0 asm("0") = 0;
2047 unsigned long stfle_bits;
2048 asm volatile(".machine push" "\n\t"
2049 ".machine \"z9-109\"" "\n\t"
2052 : "=QS" (stfle_bits), "+d" (reg0)
2055 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2061 if compile_prog "" "" "s390_z196_facilities"; then
2063 if [ $? -eq 0 ]; then
2064 s390_z196_facilities="yes"
2067 print_config "s390_z196_facilities" "$s390_z196_facilities"
2069 ##########################################
2070 # Check if we have required environment variables configured for libhdfs
2071 if test "$libhdfs" = "yes" ; then
2073 if test "$JAVA_HOME" = "" ; then
2074 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2077 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2078 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
2081 if test "$FIO_LIBHDFS_LIB" = "" ; then
2082 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2085 if test "$hdfs_conf_error" = "1" ; then
2086 feature_not_found "libhdfs" ""
2089 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2090 FIO_HDFS_CPU="amd64"
2093 print_config "HDFS engine" "$libhdfs"
2095 ##########################################
2096 # Check whether we have MTD
2097 if test "$mtd" != "yes" ; then
2102 #include <mtd/mtd-user.h>
2103 #include <sys/ioctl.h>
2104 int main(int argc, char **argv)
2106 struct mtd_write_req ops;
2107 struct mtd_info_user info;
2108 memset(&ops, 0, sizeof(ops));
2109 info.type = MTD_MLCNANDFLASH;
2110 return ioctl(0, MEMGETINFO, &info);
2113 if compile_prog "" "" "mtd"; then
2116 print_config "MTD" "$mtd"
2118 ##########################################
2119 # Check whether we have libpmem
2120 if test "$libpmem" != "yes" ; then
2124 #include <libpmem.h>
2126 int main(int argc, char **argv)
2129 rc = pmem_is_pmem(NULL, 0);
2133 if compile_prog "" "-lpmem" "libpmem"; then
2136 print_config "libpmem" "$libpmem"
2138 ##########################################
2139 # Check whether libpmem's version >= 1.5
2140 if test "$libpmem1_5" != "yes" ; then
2143 if test "$libpmem" = "yes"; then
2145 #include <libpmem.h>
2147 int main(int argc, char **argv)
2149 pmem_memcpy(NULL, NULL, NULL, NULL);
2153 if compile_prog "" "-lpmem" "libpmem1_5"; then
2157 print_config "libpmem1_5" "$libpmem1_5"
2159 ##########################################
2160 # Check whether we have libpmemblk
2161 # libpmem is a prerequisite
2162 if test "$libpmemblk" != "yes" ; then
2165 if test "$libpmem" = "yes"; then
2167 #include <libpmemblk.h>
2168 int main(int argc, char **argv)
2171 pbp = pmemblk_open("", 0);
2175 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2179 print_config "libpmemblk" "$libpmemblk"
2181 # Choose libpmem-based ioengines
2182 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2184 if test "$libpmem1_5" = "yes"; then
2187 if test "$libpmemblk" = "yes"; then
2192 ##########################################
2193 # Report whether pmemblk engine is enabled
2194 print_config "PMDK pmemblk engine" "$pmemblk"
2196 ##########################################
2197 # Report whether dev-dax engine is enabled
2198 print_config "PMDK dev-dax engine" "$devdax"
2200 ##########################################
2201 # Report whether libpmem engine is enabled
2202 print_config "PMDK libpmem engine" "$pmem"
2204 ##########################################
2205 # Check whether we support DDN's IME
2206 if test "$libime" != "yes" ; then
2210 #include <ime_native.h>
2211 int main(int argc, char **argv)
2215 rc = ime_native_finalize();
2219 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2221 CFLAGS="-I${ime_path}/include $CFLAGS"
2222 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2223 LIBS="-lim_client $LIBS"
2225 print_config "DDN's Infinite Memory Engine" "$libime"
2227 ##########################################
2228 # Check if we have libiscsi
2229 if test "$libiscsi" != "no" ; then
2230 if check_min_lib_version libiscsi 1.9.0; then
2232 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2233 libiscsi_libs=$(pkg-config --libs libiscsi)
2238 print_config "iscsi engine" "$libiscsi"
2240 ##########################################
2241 # Check if we have libnbd (for NBD support)
2242 if test "$libnbd" != "no" ; then
2243 if check_min_lib_version libnbd 0.9.8; then
2245 libnbd_cflags=$(pkg-config --cflags libnbd)
2246 libnbd_libs=$(pkg-config --libs libnbd)
2251 print_config "NBD engine" "$libnbd"
2253 ##########################################
2254 # check for dfs (DAOS File System)
2255 if test "$dfs" != "no" ; then
2259 #include <daos_fs.h>
2261 int main(int argc, char **argv)
2267 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2272 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2278 print_config "DAOS File System (dfs) Engine" "$dfs"
2280 ##########################################
2281 # Check if we have lex/yacc available
2286 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2287 if test "$targetos" != "SunOS" ; then
2297 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2301 if test "$arith" = "yes" ; then
2303 extern int yywrap(void);
2305 int main(int argc, char **argv)
2311 if compile_prog "" "-lfl" "flex"; then
2313 elif compile_prog "" "-ll" "lex"; then
2322 # Check if lex fails using -o
2323 if test "$arith" = "yes" ; then
2324 if test "$force_no_lex_o" = "yes" ; then
2327 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2335 print_config "lex/yacc for arithmetic" "$arith"
2337 ##########################################
2338 # Check whether we have setmntent/getmntent
2339 if test "$getmntent" != "yes" ; then
2345 int main(int argc, char **argv)
2347 FILE *mtab = setmntent(NULL, "r");
2348 struct mntent *mnt = getmntent(mtab);
2353 if compile_prog "" "" "getmntent"; then
2356 print_config "getmntent" "$getmntent"
2358 ##########################################
2359 # Check whether we have getmntinfo
2360 # These are originally added for BSDs, but may also work
2361 # on other operating systems with getmntinfo(3).
2363 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2364 # Note that NetBSD needs -Werror to catch warning as error.
2365 if test "$getmntinfo" != "yes" ; then
2370 #include <sys/param.h>
2371 #include <sys/mount.h>
2372 int main(int argc, char **argv)
2375 return getmntinfo(&st, MNT_NOWAIT);
2378 if compile_prog "-Werror" "" "getmntinfo"; then
2381 print_config "getmntinfo" "$getmntinfo"
2383 # getmntinfo(3) for NetBSD.
2384 if test "$getmntinfo_statvfs" != "yes" ; then
2385 getmntinfo_statvfs="no"
2389 #include <sys/statvfs.h>
2390 int main(int argc, char **argv)
2393 return getmntinfo(&st, MNT_NOWAIT);
2396 # Skip the test if the one with statfs arg is detected.
2397 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2398 getmntinfo_statvfs="yes"
2399 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2402 ##########################################
2403 # Check whether we have _Static_assert
2404 if test "$static_assert" != "yes" ; then
2416 int main(int argc, char **argv)
2418 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2422 if compile_prog "" "" "static_assert"; then
2425 print_config "Static Assert" "$static_assert"
2427 ##########################################
2428 # Check whether we have bool / stdbool.h
2429 if test "$have_bool" != "yes" ; then
2433 #include <stdbool.h>
2434 int main(int argc, char **argv)
2437 return var != false;
2440 if compile_prog "" "" "bool"; then
2443 print_config "bool" "$have_bool"
2445 ##########################################
2446 # Check whether we have strndup()
2451 int main(int argc, char **argv)
2453 char *res = strndup("test string", 8);
2459 if compile_prog "" "" "strndup"; then
2462 print_config "strndup" "$strndup"
2464 ##########################################
2465 # <valgrind/drd.h> probe
2466 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2467 # also available but not the other way around.
2468 if test "$valgrind_dev" != "yes" ; then
2472 #include <valgrind/drd.h>
2473 int main(int argc, char **argv)
2478 if compile_prog "" "" "valgrind_dev"; then
2481 print_config "Valgrind headers" "$valgrind_dev"
2483 if test "$targetos" = "Linux" ; then
2484 ##########################################
2485 # <linux/blkzoned.h> probe
2486 if test "$linux_blkzoned" != "yes" ; then
2490 #include <linux/blkzoned.h>
2491 int main(int argc, char **argv)
2496 if compile_prog "" "" "linux_blkzoned"; then
2497 linux_blkzoned="yes"
2499 print_config "Zoned block device support" "$linux_blkzoned"
2501 ##########################################
2502 # Check BLK_ZONE_REP_CAPACITY
2504 #include <linux/blkzoned.h>
2507 return BLK_ZONE_REP_CAPACITY;
2510 if compile_prog "" "" "blkzoned report capacity"; then
2511 output_sym "CONFIG_HAVE_REP_CAPACITY"
2516 print_config "Zoned block device capacity" "$rep_capacity"
2519 ##########################################
2522 #include <libzbc/zbc.h>
2523 int main(int argc, char **argv)
2525 struct zbc_device *dev = NULL;
2527 return zbc_open("foo=bar", O_RDONLY, &dev);
2530 if test "$libzbc" != "no" ; then
2531 if compile_prog "" "-lzbc" "libzbc"; then
2533 if ! check_min_lib_version libzbc 5; then
2537 if test "$libzbc" = "yes" ; then
2538 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2543 print_config "libzbc engine" "$libzbc"
2545 ##########################################
2546 # check march=armv8-a+crc+crypto
2547 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2548 march_armv8_a_crc_crypto="no"
2550 if test "$cpu" = "arm64" ; then
2552 #include <arm_acle.h>
2553 #include <arm_neon.h>
2554 #include <sys/auxv.h>
2558 /* Can we also do a runtime probe? */
2560 return getauxval(AT_HWCAP);
2562 # error "Don't know how to do runtime probe for ARM CRC32c"
2566 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2567 march_armv8_a_crc_crypto="yes"
2568 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2572 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2574 ##########################################
2576 if test "$cuda" != "no" ; then
2579 int main(int argc, char **argv)
2584 if compile_prog "" "-lcuda" "cuda"; then
2588 if test "$cuda" = "yes" ; then
2589 feature_not_found "cuda" ""
2594 print_config "cuda" "$cuda"
2596 ##########################################
2598 if test "$libcufile" != "no" ; then
2602 int main(int argc, char* argv[]) {
2607 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2609 LIBS="-lcuda -lcudart -lcufile $LIBS"
2611 if test "$libcufile" = "yes" ; then
2612 feature_not_found "libcufile" ""
2617 print_config "libcufile" "$libcufile"
2619 ##########################################
2620 # check for cc -march=native
2623 int main(int argc, char **argv)
2628 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2629 compile_prog "-march=native" "" "march=native"; then
2632 print_config "Build march=native" "$build_native"
2634 ##########################################
2636 if test "$cunit" != "yes" ; then
2640 #include <CUnit/CUnit.h>
2641 #include <CUnit/Basic.h>
2644 if (CU_initialize_registry() != CUE_SUCCESS)
2645 return CU_get_error();
2646 CU_basic_set_mode(CU_BRM_VERBOSE);
2647 CU_basic_run_tests();
2648 CU_cleanup_registry();
2649 return CU_get_error();
2652 if compile_prog "" "-lcunit" "CUnit"; then
2655 print_config "CUnit" "$cunit"
2657 ##########################################
2658 # check for __kernel_rwf_t
2661 #include <linux/fs.h>
2662 int main(int argc, char **argv)
2669 if compile_prog "" "" "__kernel_rwf_t"; then
2670 __kernel_rwf_t="yes"
2672 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2674 ##########################################
2675 # check if gcc has -Wimplicit-fallthrough=2
2678 int main(int argc, char **argv)
2683 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2686 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2688 ##########################################
2689 # check for MADV_HUGEPAGE support
2690 if test "$thp" != "yes" ; then
2693 if test "$esx" != "yes" ; then
2695 #include <sys/mman.h>
2698 return madvise(0, 0x1000, MADV_HUGEPAGE);
2701 if compile_prog "" "" "thp" ; then
2704 if test "$thp" = "yes" ; then
2705 feature_not_found "Transparent Huge Page" ""
2710 print_config "MADV_HUGEPAGE" "$thp"
2712 ##########################################
2713 # check for gettid()
2717 int main(int argc, char **argv)
2722 if compile_prog "" "" "gettid"; then
2725 print_config "gettid" "$gettid"
2727 ##########################################
2728 # check for statx(2) support by libc
2732 #include <sys/stat.h>
2734 int main(int argc, char **argv)
2737 return statx(-1, *argv, 0, 0, &st);
2740 if compile_prog "" "" "statx"; then
2743 print_config "statx(2)/libc" "$statx"
2745 ##########################################
2746 # check for statx(2) support by kernel
2750 #include <linux/stat.h>
2751 #include <sys/stat.h>
2752 #include <sys/syscall.h>
2754 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2755 struct statx *buffer)
2757 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2760 int main(int argc, char **argv)
2763 return _statx(-1, *argv, 0, 0, &st);
2766 if compile_prog "" "" "statx_syscall"; then
2769 print_config "statx(2)/syscall" "$statx_syscall"
2771 ##########################################
2772 # check for Windows PDB generation support
2773 if test "pdb" != "no" ; then
2780 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2783 if test "$pdb" = "yes"; then
2784 feature_not_found "PDB" "clang and lld"
2791 print_config "Windows PDB generation" "$pdb"
2793 ##########################################
2794 # check for timerfd support
2796 if test "$esx" != "yes" ; then
2798 #include <sys/time.h>
2799 #include <sys/timerfd.h>
2801 int main(int argc, char **argv)
2803 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2806 if compile_prog "" "" "timerfd_create"; then
2807 timerfd_create="yes"
2810 print_config "timerfd_create" "$timerfd_create"
2812 #############################################################################
2814 if test "$wordsize" = "64" ; then
2815 output_sym "CONFIG_64BIT"
2816 elif test "$wordsize" = "32" ; then
2817 output_sym "CONFIG_32BIT"
2819 fatal "Unknown wordsize!"
2821 if test "$bigendian" = "yes" ; then
2822 output_sym "CONFIG_BIG_ENDIAN"
2824 output_sym "CONFIG_LITTLE_ENDIAN"
2826 if test "$zlib" = "yes" ; then
2827 output_sym "CONFIG_ZLIB"
2829 if test "$libaio" = "yes" ; then
2830 output_sym "CONFIG_LIBAIO"
2831 if test "$libaio_rw_flags" = "yes" ; then
2832 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2835 if test "$posix_aio" = "yes" ; then
2836 output_sym "CONFIG_POSIXAIO"
2838 if test "$posix_aio_fsync" = "yes" ; then
2839 output_sym "CONFIG_POSIXAIO_FSYNC"
2841 if test "$posix_pshared" = "yes" ; then
2842 output_sym "CONFIG_PSHARED"
2844 if test "$pthread_condattr_setclock" = "yes" ; then
2845 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2847 if test "$pthread_sigmask" = "yes" ; then
2848 output_sym "CONFIG_PTHREAD_SIGMASK"
2850 if test "$pthread_getaffinity" = "yes" ; then
2851 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2853 if test "$have_asprintf" = "yes" ; then
2854 output_sym "CONFIG_HAVE_ASPRINTF"
2856 if test "$have_vasprintf" = "yes" ; then
2857 output_sym "CONFIG_HAVE_VASPRINTF"
2859 if test "$linux_fallocate" = "yes" ; then
2860 output_sym "CONFIG_LINUX_FALLOCATE"
2862 if test "$posix_fallocate" = "yes" ; then
2863 output_sym "CONFIG_POSIX_FALLOCATE"
2865 if test "$fdatasync" = "yes" ; then
2866 output_sym "CONFIG_FDATASYNC"
2868 if test "$pipe" = "yes" ; then
2869 output_sym "CONFIG_PIPE"
2871 if test "$pipe2" = "yes" ; then
2872 output_sym "CONFIG_PIPE2"
2874 if test "$pread" = "yes" ; then
2875 output_sym "CONFIG_PREAD"
2877 if test "$sync_file_range" = "yes" ; then
2878 output_sym "CONFIG_SYNC_FILE_RANGE"
2880 if test "$sfaa" = "yes" ; then
2881 output_sym "CONFIG_SFAA"
2883 if test "$sync_sync" = "yes" ; then
2884 output_sym "CONFIG_SYNC_SYNC"
2886 if test "$cmp_swap" = "yes" ; then
2887 output_sym "CONFIG_CMP_SWAP"
2889 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2890 output_sym "CONFIG_RDMA"
2892 # librpma is supported on the 'x86_64' architecture for now
2893 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2894 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2895 output_sym "CONFIG_LIBRPMA_APM"
2897 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2898 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2899 output_sym "CONFIG_LIBRPMA_GPSPM"
2901 if test "$clock_gettime" = "yes" ; then
2902 output_sym "CONFIG_CLOCK_GETTIME"
2904 if test "$clock_monotonic" = "yes" ; then
2905 output_sym "CONFIG_CLOCK_MONOTONIC"
2907 if test "$clockid_t" = "yes"; then
2908 output_sym "CONFIG_CLOCKID_T"
2910 if test "$gettimeofday" = "yes" ; then
2911 output_sym "CONFIG_GETTIMEOFDAY"
2913 if test "$posix_fadvise" = "yes" ; then
2914 output_sym "CONFIG_POSIX_FADVISE"
2916 if test "$linux_3arg_affinity" = "yes" ; then
2917 output_sym "CONFIG_3ARG_AFFINITY"
2918 elif test "$linux_2arg_affinity" = "yes" ; then
2919 output_sym "CONFIG_2ARG_AFFINITY"
2921 if test "$strsep" = "yes" ; then
2922 output_sym "CONFIG_STRSEP"
2924 if test "$strcasestr" = "yes" ; then
2925 output_sym "CONFIG_STRCASESTR"
2927 if test "$strlcat" = "yes" ; then
2928 output_sym "CONFIG_STRLCAT"
2930 if test "$getopt_long_only" = "yes" ; then
2931 output_sym "CONFIG_GETOPT_LONG_ONLY"
2933 if test "$inet_aton" = "yes" ; then
2934 output_sym "CONFIG_INET_ATON"
2936 if test "$socklen_t" = "yes" ; then
2937 output_sym "CONFIG_SOCKLEN_T"
2939 if test "$ext4_me" = "yes" ; then
2940 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2942 if test "$linux_splice" = "yes" ; then
2943 output_sym "CONFIG_LINUX_SPLICE"
2945 if test "$libnuma_v2" = "yes" ; then
2946 output_sym "CONFIG_LIBNUMA"
2948 if test "$solaris_aio" = "yes" ; then
2949 output_sym "CONFIG_SOLARISAIO"
2951 if test "$tls_thread" = "yes" ; then
2952 output_sym "CONFIG_TLS_THREAD"
2954 if test "$rusage_thread" = "yes" ; then
2955 output_sym "CONFIG_RUSAGE_THREAD"
2957 if test "$gfio" = "yes" ; then
2958 output_sym "CONFIG_GFIO"
2960 if test "$esx" = "yes" ; then
2961 output_sym "CONFIG_ESX"
2962 output_sym "CONFIG_NO_SHM"
2964 if test "$sched_idle" = "yes" ; then
2965 output_sym "CONFIG_SCHED_IDLE"
2967 if test "$tcp_nodelay" = "yes" ; then
2968 output_sym "CONFIG_TCP_NODELAY"
2970 if test "$window_size" = "yes" ; then
2971 output_sym "CONFIG_NET_WINDOWSIZE"
2973 if test "$mss" = "yes" ; then
2974 output_sym "CONFIG_NET_MSS"
2976 if test "$rlimit_memlock" = "yes" ; then
2977 output_sym "CONFIG_RLIMIT_MEMLOCK"
2979 if test "$pwritev" = "yes" ; then
2980 output_sym "CONFIG_PWRITEV"
2982 if test "$pwritev2" = "yes" ; then
2983 output_sym "CONFIG_PWRITEV2"
2985 if test "$ipv6" = "yes" ; then
2986 output_sym "CONFIG_IPV6"
2988 if test "$http" = "yes" ; then
2989 output_sym "CONFIG_HTTP"
2991 if test "$rados" = "yes" ; then
2992 output_sym "CONFIG_RADOS"
2994 if test "$rbd" = "yes" ; then
2995 output_sym "CONFIG_RBD"
2997 if test "$rbd_poll" = "yes" ; then
2998 output_sym "CONFIG_RBD_POLL"
3000 if test "$rbd_inval" = "yes" ; then
3001 output_sym "CONFIG_RBD_INVAL"
3003 if test "$setvbuf" = "yes" ; then
3004 output_sym "CONFIG_SETVBUF"
3006 if test "$s390_z196_facilities" = "yes" ; then
3007 output_sym "CONFIG_S390_Z196_FACILITIES"
3008 CFLAGS="$CFLAGS -march=z9-109"
3011 if test "$gfapi" = "yes" ; then
3012 output_sym "CONFIG_GFAPI"
3014 if test "$gf_fadvise" = "yes" ; then
3015 output_sym "CONFIG_GF_FADVISE"
3017 if test "$gf_trim" = "yes" ; then
3018 output_sym "CONFIG_GF_TRIM"
3020 if test "$gf_new" = "yes" ; then
3021 output_sym "CONFIG_GF_NEW_API"
3023 if test "$libhdfs" = "yes" ; then
3024 output_sym "CONFIG_LIBHDFS"
3025 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3026 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3027 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3028 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3030 if test "$mtd" = "yes" ; then
3031 output_sym "CONFIG_MTD"
3033 if test "$pmemblk" = "yes" ; then
3034 output_sym "CONFIG_PMEMBLK"
3036 if test "$devdax" = "yes" ; then
3037 output_sym "CONFIG_LINUX_DEVDAX"
3039 if test "$pmem" = "yes" ; then
3040 output_sym "CONFIG_LIBPMEM"
3042 if test "$libime" = "yes" ; then
3043 output_sym "CONFIG_IME"
3045 if test "$arith" = "yes" ; then
3046 output_sym "CONFIG_ARITHMETIC"
3047 if test "$yacc_is_bison" = "yes" ; then
3048 echo "YACC=bison -y" >> $config_host_mak
3050 echo "YACC=yacc" >> $config_host_mak
3052 if test "$lex_use_o" = "yes" ; then
3053 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3056 if test "$getmntent" = "yes" ; then
3057 output_sym "CONFIG_GETMNTENT"
3059 if test "$getmntinfo" = "yes" ; then
3060 output_sym "CONFIG_GETMNTINFO"
3062 if test "$getmntinfo_statvfs" = "yes" ; then
3063 output_sym "CONFIG_GETMNTINFO_STATVFS"
3065 if test "$static_assert" = "yes" ; then
3066 output_sym "CONFIG_STATIC_ASSERT"
3068 if test "$have_bool" = "yes" ; then
3069 output_sym "CONFIG_HAVE_BOOL"
3071 if test "$strndup" = "yes" ; then
3072 output_sym "CONFIG_HAVE_STRNDUP"
3074 if test "$disable_opt" = "yes" ; then
3075 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3077 if test "$valgrind_dev" = "yes"; then
3078 output_sym "CONFIG_VALGRIND_DEV"
3080 if test "$linux_blkzoned" = "yes" ; then
3081 output_sym "CONFIG_HAS_BLKZONED"
3083 if test "$libzbc" = "yes" ; then
3084 output_sym "CONFIG_LIBZBC"
3086 if test "$zlib" = "no" ; then
3087 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
3088 if test "$build_static" = "yes"; then
3089 echo "Note that some distros have separate packages for static libraries."
3092 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3093 output_sym "ARCH_HAVE_CRC_CRYPTO"
3095 if test "$cuda" = "yes" ; then
3096 output_sym "CONFIG_CUDA"
3098 if test "$libcufile" = "yes" ; then
3099 output_sym "CONFIG_LIBCUFILE"
3101 if test "$dfs" = "yes" ; then
3102 output_sym "CONFIG_DFS"
3104 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3105 output_sym "CONFIG_BUILD_NATIVE"
3107 if test "$cunit" = "yes" ; then
3108 output_sym "CONFIG_HAVE_CUNIT"
3110 if test "$__kernel_rwf_t" = "yes"; then
3111 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3113 if test "$gettid" = "yes"; then
3114 output_sym "CONFIG_HAVE_GETTID"
3116 if test "$statx" = "yes"; then
3117 output_sym "CONFIG_HAVE_STATX"
3119 if test "$statx_syscall" = "yes"; then
3120 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3122 if test "$timerfd_create" = "yes"; then
3123 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3125 if test "$fallthrough" = "yes"; then
3126 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3128 if test "$thp" = "yes" ; then
3129 output_sym "CONFIG_HAVE_THP"
3131 if test "$libiscsi" = "yes" ; then
3132 output_sym "CONFIG_LIBISCSI"
3133 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3134 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3135 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3137 if test "$libnbd" = "yes" ; then
3138 output_sym "CONFIG_LIBNBD"
3139 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3140 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3141 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3143 if test "$dynamic_engines" = "yes" ; then
3144 output_sym "CONFIG_DYNAMIC_ENGINES"
3146 if test "$pdb" = yes; then
3147 output_sym "CONFIG_PDB"
3150 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3152 int main(int argc, char **argv)
3157 if test "$disable_tcmalloc" != "yes"; then
3158 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3160 LIBS="-ltcmalloc $LIBS"
3161 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3163 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3168 print_config "TCMalloc support" "$tcmalloc"
3170 echo "LIBS+=$LIBS" >> $config_host_mak
3171 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3172 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3173 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3174 echo "CC=$cc" >> $config_host_mak
3175 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3176 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3178 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3179 cat > Makefile <<EOF
3180 SRCDIR:=`dirname $0`
3181 include \$(SRCDIR)/Makefile