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 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
20 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
21 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
22 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
26 config_host_mak="config-host.mak"
27 config_host_h="config-host.h"
29 rm -rf $config_host_mak
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
40 # Print result for each configuration test
42 printf "%-30s%s\n" "$1" "$2"
46 CFLAGS="-D_GNU_SOURCE -include config-host.h"
49 # Print a helpful header at the top of config.log
50 echo "# FIO configure log $(date)" >> config.log
51 printf "# Configured with:" >> config.log
52 printf " '%s'" "$0" "$@" >> config.log
54 echo "#" >> config.log
56 # Print configure header at the top of $config_host_h
57 echo "/*" > $config_host_h
58 echo " * Automatically generated by configure - do not modify" >> $config_host_h
59 printf " * Configured with:" >> $config_host_h
60 printf " * '%s'" "$0" "$@" >> $config_host_h
61 echo "" >> $config_host_h
62 echo " */" >> $config_host_h
65 # Run the compiler, capturing its output to the log.
66 echo $cc "$@" >> config.log
67 $cc "$@" >> config.log 2>&1 || return $?
68 # Test passed. If this is an --enable-werror build, rerun
69 # the test with -Werror and bail out if it fails. This
70 # makes warning-generating-errors in configure test code
71 # obvious to developers.
72 if test "$werror" != "yes"; then
75 # Don't bother rerunning the compile if we were already using -Werror
81 echo $cc -Werror "$@" >> config.log
82 $cc -Werror "$@" >> config.log 2>&1 && return $?
83 echo "ERROR: configure test passed without -Werror but failed with -Werror."
84 echo "This is probably a bug in the configure script. The failing command"
85 echo "will be at the bottom of config.log."
86 fatal "You can run configure with --disable-werror to bypass this check."
90 do_cc $CFLAGS -c -o $TMPO $TMPC
95 local_ldflags="$2 $LIBS"
96 echo "Compiling test case $3" >> config.log
97 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 feature_not_found() {
105 echo "ERROR: User requested feature $feature"
106 if test ! -z "$packages" ; then
107 echo "ERROR: That feature needs $packages installed"
109 echo "ERROR: configure was not able to find it"
114 type "$1" >/dev/null 2>&1
120 #error $1 not defined
131 echo "$1=y" >> $config_host_mak
132 echo "#define $1" >> $config_host_h
154 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
156 --prefix=*) prefix="$optarg"
158 --cpu=*) cpu="$optarg"
160 # esx is cross compiled and cannot be detect through simple uname calls
166 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
168 --build-32bit-win) build_32bit_win="yes"
170 --target-win-ver=*) target_win_ver="$optarg"
172 --build-static) build_static="yes"
174 --enable-gfio) gfio_check="yes"
176 --disable-numa) disable_numa="yes"
178 --disable-rdma) disable_rdma="yes"
180 --disable-rados) disable_rados="yes"
182 --disable-rbd) disable_rbd="yes"
184 --disable-gfapi) disable_gfapi="yes"
186 --enable-libhdfs) libhdfs="yes"
188 --disable-lex) disable_lex="yes"
190 --enable-lex) disable_lex="no"
192 --disable-shm) no_shm="yes"
194 --disable-optimizations) disable_opt="yes"
196 --disable-pmem) disable_pmem="yes"
198 --enable-cuda) enable_cuda="yes"
200 --disable-native) disable_native="yes"
206 echo "Bad option $opt"
212 if test "$show_help" = "yes" ; then
213 echo "--prefix= Use this directory as installation prefix"
214 echo "--cpu= Specify target CPU if auto-detect fails"
215 echo "--cc= Specify compiler to use"
216 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
217 echo "--build-32bit-win Enable 32-bit build on Windows"
218 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
219 echo "--build-static Build a static fio"
220 echo "--esx Configure build options for esx"
221 echo "--enable-gfio Enable building of gtk gfio"
222 echo "--disable-numa Disable libnuma even if found"
223 echo "--disable-rdma Disable RDMA support even if found"
224 echo "--disable-gfapi Disable gfapi"
225 echo "--enable-libhdfs Enable hdfs support"
226 echo "--disable-lex Disable use of lex/yacc for math"
227 echo "--disable-pmem Disable pmem based engines even if found"
228 echo "--enable-lex Enable use of lex/yacc for math"
229 echo "--disable-shm Disable SHM support"
230 echo "--disable-optimizations Don't enable compiler optimizations"
231 echo "--enable-cuda Enable GPUDirect RDMA support"
232 echo "--disable-native Don't build for native host"
236 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
237 # Preferred compiler (can be overriden later after we know the platform):
239 # ${cross_prefix}gcc (if cross-prefix specified)
242 if test -z "${CC}${cross_prefix}"; then
249 cc="${CC-${cross_prefix}gcc}"
252 if check_define __ANDROID__ ; then
254 elif check_define __linux__ ; then
256 elif check_define __OpenBSD__ ; then
258 elif check_define __NetBSD__ ; then
260 elif check_define __sun__ ; then
262 CFLAGS="$CFLAGS -D_REENTRANT"
263 elif check_define _WIN32 ; then
269 echo "# Automatically generated by configure - do not modify" > $config_host_mak
270 printf "# Configured with:" >> $config_host_mak
271 printf " '%s'" "$0" "$@" >> $config_host_mak
272 echo >> $config_host_mak
273 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
275 if test "$no_shm" = "yes" ; then
276 output_sym "CONFIG_NO_SHM"
279 if test "$disable_opt" = "yes" ; then
280 output_sym "CONFIG_FIO_NO_OPT"
283 # Some host OSes need non-standard checks for which CPU to use.
284 # Note that these checks are broken for cross-compilation: if you're
285 # cross-compiling to one of these OSes then you'll need to specify
286 # the correct CPU with the --cpu option.
289 # Unless explicitly enabled, turn off lex.
290 # OpenBSD will hit syntax error when enabled.
291 if test -z "$disable_lex" ; then
298 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
299 # we can run 64-bit userspace code.
300 # If the user didn't specify a CPU explicitly and the kernel says this is
301 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
303 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
306 # Error at compile time linking of weak/partial symbols if possible...
313 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
314 echo "Disabling weak symbols"
315 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
319 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
320 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
323 LIBS="-lnsl -lsocket"
326 # We still force some options, so keep this message here.
327 echo "Forcing some known good options on Windows"
328 if test -z "${CC}${cross_prefix}"; then
329 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
330 cc="i686-w64-mingw32-gcc"
332 cc="x86_64-w64-mingw32-gcc"
336 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
337 if test -z "$target_win_ver"; then
338 # Default Windows API target
341 if test "$target_win_ver" = "XP"; then
342 output_sym "CONFIG_WINDOWS_XP"
343 elif test "$target_win_ver" = "7"; then
344 output_sym "CONFIG_WINDOWS_7"
345 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
347 fatal "Unknown target Windows version"
350 # We need this to be output_sym'd here because this is Windows specific.
351 # The regular configure path never sets this config.
352 output_sym "CONFIG_WINDOWSAIO"
353 # We now take the regular configuration path without having exit 0 here.
354 # Flags below are still necessary mostly for MinGW.
358 clock_gettime="yes" # clock_monotonic probe has dependency on this
359 clock_monotonic="yes"
367 # Now we know the target platform we can have another guess at the preferred
368 # compiler when it wasn't explictly set
369 if test -z "${CC}${cross_prefix}"; then
370 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
376 if test -z "$cc"; then
377 echo "configure: failed to find compiler"
381 if test ! -z "$cpu" ; then
382 # command line argument
384 elif check_define __i386__ ; then
386 elif check_define __x86_64__ ; then
388 elif check_define __sparc__ ; then
389 if check_define __arch64__ ; then
394 elif check_define _ARCH_PPC ; then
395 if check_define _ARCH_PPC64 ; then
400 elif check_define __mips__ ; then
402 elif check_define __ia64__ ; then
404 elif check_define __s390__ ; then
405 if check_define __s390x__ ; then
410 elif check_define __arm__ ; then
412 elif check_define __aarch64__ ; then
414 elif check_define __hppa__ ; then
420 # Normalise host CPU name and set ARCH.
422 ia64|ppc|ppc64|s390|s390x|sparc64)
425 i386|i486|i586|i686|i86pc|BePC)
437 hppa|parisc|parisc64)
451 ##########################################
452 # check cross compile
454 if test "$cross_compile" != "yes" ; then
463 if compile_prog "" "" "cross"; then
464 $TMPE 2>/dev/null || cross_compile="yes"
466 fatal "compile test failed"
469 ##########################################
471 if test "$bigendian" != "yes" ; then
474 if test "$cross_compile" = "no" ; then
476 #include <inttypes.h>
479 volatile uint32_t i=0x01234567;
480 return (*((uint8_t*)(&i))) == 0x67;
483 if compile_prog "" "" "endian"; then
484 $TMPE && bigendian="yes"
487 # If we're cross compiling, try our best to work it out and rely on the
488 # run-time check to fail if we get it wrong.
493 #if __BYTE_ORDER != __BIG_ENDIAN
494 # error "Unknown endianness"
498 compile_prog "" "" "endian" && bigendian="yes"
499 check_define "__ARMEB__" && bigendian="yes"
500 check_define "__MIPSEB__" && bigendian="yes"
504 print_config "Operating system" "$targetos"
505 print_config "CPU" "$cpu"
506 print_config "Big endian" "$bigendian"
507 if test ! -z "$target_win_ver"; then
508 print_config "Target Windows version" "$target_win_ver"
510 print_config "Compiler" "$cc"
511 print_config "Cross compile" "$cross_compile"
514 ##########################################
515 # See if we need to build a static build
516 if test "$build_static" = "yes" ; then
517 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
518 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
522 print_config "Static build" "$build_static"
524 ##########################################
529 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
532 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
536 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
538 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
541 fatal "Unknown wordsize"
543 print_config "Wordsize" "$wordsize"
545 ##########################################
547 if test "$zlib" != "yes" ; then
555 if (inflateInit(&stream) != Z_OK)
560 if compile_prog "" "-lz" "zlib" ; then
564 print_config "zlib" "$zlib"
566 ##########################################
568 if test "$libaio" != "yes" ; then
571 if test "$esx" != "yes" ; then
581 if compile_prog "" "-laio" "libaio" ; then
585 if test "$libaio" = "yes" ; then
586 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
591 print_config "Linux AIO support" "$libaio"
593 ##########################################
595 if test "$posix_aio" != "yes" ; then
598 if test "$posix_aio_lrt" != "yes" ; then
610 if compile_prog "" "" "posixaio" ; then
612 elif compile_prog "" "-lrt" "posixaio -lrt"; then
617 print_config "POSIX AIO support" "$posix_aio"
618 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
620 ##########################################
621 # posix aio fsync probe
622 if test "$posix_aio_fsync" != "yes" ; then
625 if test "$posix_aio" = "yes" ; then
632 return aio_fsync(O_SYNC, &cb);
636 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
640 print_config "POSIX AIO fsync" "$posix_aio_fsync"
642 ##########################################
643 # POSIX pshared attribute probe
644 if test "$posix_pshared" != "yes" ; then
651 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
652 # if defined(__CYGWIN__)
653 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
654 # elif defined(__APPLE__)
655 # include <AvailabilityMacros.h>
656 # include <TargetConditionals.h>
657 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
658 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
662 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
667 if compile_prog "" "$LIBS" "posix_pshared" ; then
670 print_config "POSIX pshared support" "$posix_pshared"
672 ##########################################
674 if test "$solaris_aio" != "yes" ; then
678 #include <sys/types.h>
679 #include <sys/asynch.h>
684 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
688 if compile_prog "" "-laio" "solarisaio" ; then
692 print_config "Solaris AIO support" "$solaris_aio"
694 ##########################################
695 # __sync_fetch_and_add test
696 if test "$sfaa" != "yes" ; then
700 #include <inttypes.h>
701 static int sfaa(uint64_t *ptr)
703 return __sync_fetch_and_add(ptr, 0);
706 int main(int argc, char **argv)
713 if compile_prog "" "" "__sync_fetch_and_add()" ; then
716 print_config "__sync_fetch_and_add" "$sfaa"
718 ##########################################
719 # __sync_synchronize() test
720 if test "$sync_sync" != "yes" ; then
724 #include <inttypes.h>
726 int main(int argc, char **argv)
728 __sync_synchronize();
732 if compile_prog "" "" "__sync_synchronize()" ; then
735 print_config "__sync_synchronize" "$sync_sync"
737 ##########################################
738 # __sync_val_compare_and_swap() test
739 if test "$cmp_swap" != "yes" ; then
743 #include <inttypes.h>
745 int main(int argc, char **argv)
748 return __sync_val_compare_and_swap(&x, 1, 2);
751 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
754 print_config "__sync_val_compare_and_swap" "$cmp_swap"
756 ##########################################
758 if test "$libverbs" != "yes" ; then
762 #include <infiniband/verbs.h>
763 int main(int argc, char **argv)
765 struct ibv_pd *pd = ibv_alloc_pd(NULL);
769 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
771 LIBS="-libverbs $LIBS"
773 print_config "libverbs" "$libverbs"
775 ##########################################
777 if test "$rdmacm" != "yes" ; then
782 #include <rdma/rdma_cma.h>
783 int main(int argc, char **argv)
785 rdma_destroy_qp(NULL);
789 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
791 LIBS="-lrdmacm $LIBS"
793 print_config "rdmacm" "$rdmacm"
795 ##########################################
796 # asprintf() and vasprintf() probes
797 if test "$have_asprintf" != "yes" ; then
803 int main(int argc, char **argv)
805 return asprintf(NULL, "%s", "str") == 0;
808 if compile_prog "" "" "have_asprintf"; then
811 print_config "asprintf()" "$have_asprintf"
813 if test "$have_vasprintf" != "yes" ; then
819 int main(int argc, char **argv)
821 return vasprintf(NULL, "%s", NULL) == 0;
824 if compile_prog "" "" "have_vasprintf"; then
827 print_config "vasprintf()" "$have_vasprintf"
829 ##########################################
830 # Linux fallocate probe
831 if test "$linux_fallocate" != "yes" ; then
837 #include <linux/falloc.h>
838 int main(int argc, char **argv)
840 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
844 if compile_prog "" "" "linux_fallocate"; then
845 linux_fallocate="yes"
847 print_config "Linux fallocate" "$linux_fallocate"
849 ##########################################
850 # POSIX fadvise probe
851 if test "$posix_fadvise" != "yes" ; then
857 int main(int argc, char **argv)
859 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
863 if compile_prog "" "" "posix_fadvise"; then
866 print_config "POSIX fadvise" "$posix_fadvise"
868 ##########################################
869 # POSIX fallocate probe
870 if test "$posix_fallocate" != "yes" ; then
876 int main(int argc, char **argv)
878 int r = posix_fallocate(0, 0, 1024);
882 if compile_prog "" "" "posix_fallocate"; then
883 posix_fallocate="yes"
885 print_config "POSIX fallocate" "$posix_fallocate"
887 ##########################################
888 # sched_set/getaffinity 2 or 3 argument test
889 if test "$linux_2arg_affinity" != "yes" ; then
890 linux_2arg_affinity="no"
892 if test "$linux_3arg_affinity" != "yes" ; then
893 linux_3arg_affinity="no"
897 int main(int argc, char **argv)
900 return sched_setaffinity(0, sizeof(mask), &mask);
903 if compile_prog "" "" "sched_setaffinity(,,)"; then
904 linux_3arg_affinity="yes"
908 int main(int argc, char **argv)
911 return sched_setaffinity(0, &mask);
914 if compile_prog "" "" "sched_setaffinity(,)"; then
915 linux_2arg_affinity="yes"
918 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
919 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
921 ##########################################
922 # clock_gettime probe
923 if test "$clock_gettime" != "yes" ; then
929 int main(int argc, char **argv)
931 return clock_gettime(0, NULL);
934 if compile_prog "" "" "clock_gettime"; then
936 elif compile_prog "" "-lrt" "clock_gettime"; then
940 print_config "clock_gettime" "$clock_gettime"
942 ##########################################
943 # CLOCK_MONOTONIC probe
944 if test "$clock_monotonic" != "yes" ; then
947 if test "$clock_gettime" = "yes" ; then
951 int main(int argc, char **argv)
953 return clock_gettime(CLOCK_MONOTONIC, NULL);
956 if compile_prog "" "$LIBS" "clock monotonic"; then
957 clock_monotonic="yes"
960 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
962 ##########################################
963 # CLOCK_MONOTONIC_RAW probe
964 if test "$clock_monotonic_raw" != "yes" ; then
965 clock_monotonic_raw="no"
967 if test "$clock_gettime" = "yes" ; then
971 int main(int argc, char **argv)
973 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
976 if compile_prog "" "$LIBS" "clock monotonic"; then
977 clock_monotonic_raw="yes"
980 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
982 ##########################################
983 # CLOCK_MONOTONIC_PRECISE probe
984 if test "$clock_monotonic_precise" != "yes" ; then
985 clock_monotonic_precise="no"
987 if test "$clock_gettime" = "yes" ; then
991 int main(int argc, char **argv)
993 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
996 if compile_prog "" "$LIBS" "clock monotonic precise"; then
997 clock_monotonic_precise="yes"
1000 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1002 ##########################################
1004 if test "$clockid_t" != "yes" ; then
1010 int main(int argc, char **argv)
1012 volatile clockid_t cid;
1013 memset((void*)&cid, 0, sizeof(cid));
1017 if compile_prog "" "$LIBS" "clockid_t"; then
1020 print_config "clockid_t" "$clockid_t"
1022 ##########################################
1023 # gettimeofday() probe
1024 if test "$gettimeofday" != "yes" ; then
1028 #include <sys/time.h>
1030 int main(int argc, char **argv)
1033 return gettimeofday(&tv, NULL);
1036 if compile_prog "" "" "gettimeofday"; then
1039 print_config "gettimeofday" "$gettimeofday"
1041 ##########################################
1043 if test "$fdatasync" != "yes" ; then
1049 int main(int argc, char **argv)
1051 return fdatasync(0);
1054 if compile_prog "" "" "fdatasync"; then
1057 print_config "fdatasync" "$fdatasync"
1059 ##########################################
1060 # sync_file_range() probe
1061 if test "$sync_file_range" != "yes" ; then
1062 sync_file_range="no"
1068 #include <linux/fs.h>
1069 int main(int argc, char **argv)
1071 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1072 SYNC_FILE_RANGE_WAIT_AFTER;
1073 return sync_file_range(0, 0, 0, flags);
1076 if compile_prog "" "" "sync_file_range"; then
1077 sync_file_range="yes"
1079 print_config "sync_file_range" "$sync_file_range"
1081 ##########################################
1082 # ext4 move extent probe
1083 if test "$ext4_me" != "yes" ; then
1088 #include <sys/ioctl.h>
1089 int main(int argc, char **argv)
1091 struct move_extent me;
1092 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1095 if compile_prog "" "" "ext4 move extent" ; then
1097 elif test $targetos = "Linux" ; then
1098 # On Linux, just default to it on and let it error at runtime if we really
1099 # don't have it. None of my updated systems have it defined, but it does
1100 # work. Takes a while to bubble back.
1103 print_config "EXT4 move extent" "$ext4_me"
1105 ##########################################
1107 if test "$linux_splice" != "yes" ; then
1113 int main(int argc, char **argv)
1115 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1118 if compile_prog "" "" "linux splice"; then
1121 print_config "Linux splice(2)" "$linux_splice"
1123 ##########################################
1125 if test "$guasi" != "yes" ; then
1130 #include <guasi_syscalls.h>
1131 int main(int argc, char **argv)
1133 guasi_t ctx = guasi_create(0, 0, 0);
1137 if compile_prog "" "" "guasi"; then
1140 print_config "GUASI" "$guasi"
1142 ##########################################
1144 if test "$fusion_aw" != "yes" ; then
1148 #include <nvm/nvm_primitives.h>
1149 int main(int argc, char **argv)
1151 nvm_version_t ver_info;
1152 nvm_handle_t handle;
1154 handle = nvm_get_handle(0, &ver_info);
1155 return nvm_atomic_write(handle, 0, 0, 0);
1158 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1159 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1162 print_config "Fusion-io atomic engine" "$fusion_aw"
1164 ##########################################
1166 if test "$libnuma" != "yes" ; then
1171 int main(int argc, char **argv)
1173 return numa_available();
1176 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1180 print_config "libnuma" "$libnuma"
1182 ##########################################
1183 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1184 if test "$libnuma" = "yes" ; then
1188 int main(int argc, char **argv)
1190 struct bitmask *mask = numa_parse_nodestring(NULL);
1191 return mask->size == 0;
1194 if compile_prog "" "" "libnuma api"; then
1197 print_config "libnuma v2" "$libnuma_v2"
1200 ##########################################
1202 if test "$strsep" != "yes" ; then
1207 int main(int argc, char **argv)
1209 static char *string = "This is a string";
1210 strsep(&string, "needle");
1214 if compile_prog "" "" "strsep"; then
1217 print_config "strsep" "$strsep"
1219 ##########################################
1220 # strcasestr() probe
1221 if test "$strcasestr" != "yes" ; then
1226 int main(int argc, char **argv)
1228 return strcasestr(argv[0], argv[1]) != NULL;
1231 if compile_prog "" "" "strcasestr"; then
1234 print_config "strcasestr" "$strcasestr"
1236 ##########################################
1238 if test "$strlcat" != "yes" ; then
1243 int main(int argc, char **argv)
1245 static char dst[64];
1246 static char *string = "This is a string";
1247 memset(dst, 0, sizeof(dst));
1248 strlcat(dst, string, sizeof(dst));
1252 if compile_prog "" "" "strlcat"; then
1255 print_config "strlcat" "$strlcat"
1257 ##########################################
1258 # getopt_long_only() probe
1259 if test "$getopt_long_only" != "yes" ; then
1260 getopt_long_only="no"
1266 int main(int argc, char **argv)
1268 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1272 if compile_prog "" "" "getopt_long_only"; then
1273 getopt_long_only="yes"
1275 print_config "getopt_long_only()" "$getopt_long_only"
1277 ##########################################
1279 if test "$inet_aton" != "yes" ; then
1283 #include <sys/socket.h>
1284 #include <arpa/inet.h>
1286 int main(int argc, char **argv)
1289 return inet_aton(NULL, &in);
1292 if compile_prog "" "" "inet_aton"; then
1295 print_config "inet_aton" "$inet_aton"
1297 ##########################################
1299 if test "$socklen_t" != "yes" ; then
1303 #include <sys/socket.h>
1304 int main(int argc, char **argv)
1310 if compile_prog "" "" "socklen_t"; then
1313 print_config "socklen_t" "$socklen_t"
1315 ##########################################
1316 # Whether or not __thread is supported for TLS
1317 if test "$tls_thread" != "yes" ; then
1322 static __thread int ret;
1323 int main(int argc, char **argv)
1328 if compile_prog "" "" "__thread"; then
1331 print_config "__thread" "$tls_thread"
1333 ##########################################
1334 # Check if we have required gtk/glib support for gfio
1335 if test "$gfio" != "yes" ; then
1338 if test "$gfio_check" = "yes" ; then
1342 #include <gtk/gtk.h>
1345 gdk_threads_enter();
1346 gdk_threads_leave();
1348 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1351 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1352 ORG_LDFLAGS=$LDFLAGS
1353 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1354 if test "$?" != "0" ; then
1355 echo "configure: gtk and gthread not found"
1358 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1359 if test "$?" != "0" ; then
1360 echo "configure: gtk and gthread not found"
1363 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1365 if test "$?" = "0" ; then
1367 GFIO_LIBS="$LIBS $GTK_LIBS"
1368 CFLAGS="$CFLAGS $GTK_CFLAGS"
1370 echo "GTK found, but need version 2.18 or higher"
1374 echo "Please install gtk and gdk libraries"
1377 LDFLAGS=$ORG_LDFLAGS
1380 if test "$gfio_check" = "yes" ; then
1381 print_config "gtk 2.18 or higher" "$gfio"
1384 ##########################################
1385 # Check whether we have getrusage(RUSAGE_THREAD)
1386 if test "$rusage_thread" != "yes" ; then
1390 #include <sys/time.h>
1391 #include <sys/resource.h>
1392 int main(int argc, char **argv)
1395 getrusage(RUSAGE_THREAD, &ru);
1399 if compile_prog "" "" "RUSAGE_THREAD"; then
1402 print_config "RUSAGE_THREAD" "$rusage_thread"
1404 ##########################################
1405 # Check whether we have SCHED_IDLE
1406 if test "$sched_idle" != "yes" ; then
1411 int main(int argc, char **argv)
1413 struct sched_param p;
1414 return sched_setscheduler(0, SCHED_IDLE, &p);
1417 if compile_prog "" "" "SCHED_IDLE"; then
1420 print_config "SCHED_IDLE" "$sched_idle"
1422 ##########################################
1423 # Check whether we have TCP_NODELAY
1424 if test "$tcp_nodelay" != "yes" ; then
1429 #include <sys/types.h>
1430 #include <sys/socket.h>
1431 #include <netinet/tcp.h>
1432 int main(int argc, char **argv)
1434 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1437 if compile_prog "" "" "TCP_NODELAY"; then
1440 print_config "TCP_NODELAY" "$tcp_nodelay"
1442 ##########################################
1443 # Check whether we have SO_SNDBUF
1444 if test "$window_size" != "yes" ; then
1449 #include <sys/types.h>
1450 #include <sys/socket.h>
1451 #include <netinet/tcp.h>
1452 int main(int argc, char **argv)
1454 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1455 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1458 if compile_prog "" "" "SO_SNDBUF"; then
1461 print_config "Net engine window_size" "$window_size"
1463 ##########################################
1464 # Check whether we have TCP_MAXSEG
1465 if test "$mss" != "yes" ; then
1470 #include <sys/types.h>
1471 #include <sys/socket.h>
1472 #include <netinet/tcp.h>
1473 #include <arpa/inet.h>
1474 #include <netinet/in.h>
1475 int main(int argc, char **argv)
1477 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1480 if compile_prog "" "" "TCP_MAXSEG"; then
1483 print_config "TCP_MAXSEG" "$mss"
1485 ##########################################
1486 # Check whether we have RLIMIT_MEMLOCK
1487 if test "$rlimit_memlock" != "yes" ; then
1491 #include <sys/time.h>
1492 #include <sys/resource.h>
1493 int main(int argc, char **argv)
1496 return getrlimit(RLIMIT_MEMLOCK, &rl);
1499 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1500 rlimit_memlock="yes"
1502 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1504 ##########################################
1505 # Check whether we have pwritev/preadv
1506 if test "$pwritev" != "yes" ; then
1511 #include <sys/uio.h>
1512 int main(int argc, char **argv)
1514 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1517 if compile_prog "" "" "pwritev"; then
1520 print_config "pwritev/preadv" "$pwritev"
1522 ##########################################
1523 # Check whether we have pwritev2/preadv2
1524 if test "$pwritev2" != "yes" ; then
1529 #include <sys/uio.h>
1530 int main(int argc, char **argv)
1532 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1535 if compile_prog "" "" "pwritev2"; then
1538 print_config "pwritev2/preadv2" "$pwritev2"
1540 ##########################################
1541 # Check whether we have the required functions for ipv6
1542 if test "$ipv6" != "yes" ; then
1546 #include <sys/types.h>
1547 #include <sys/socket.h>
1548 #include <netinet/in.h>
1551 int main(int argc, char **argv)
1553 struct addrinfo hints;
1554 struct in6_addr addr;
1557 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1559 printf("%s\n", gai_strerror(ret));
1564 if compile_prog "" "" "ipv6"; then
1567 print_config "IPv6 helpers" "$ipv6"
1569 ##########################################
1571 if test "$rados" != "yes" ; then
1575 #include <rados/librados.h>
1577 int main(int argc, char **argv)
1580 rados_ioctx_t io_ctx;
1581 const char cluster_name[] = "ceph";
1582 const char user_name[] = "client.admin";
1583 const char pool[] = "rados";
1585 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1586 rados_create2(&cluster, cluster_name, user_name, 0);
1587 rados_ioctx_create(cluster, pool, &io_ctx);
1592 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1593 LIBS="-lrados $LIBS"
1596 print_config "Rados engine" "$rados"
1598 ##########################################
1600 if test "$rbd" != "yes" ; then
1604 #include <rbd/librbd.h>
1606 int main(int argc, char **argv)
1609 rados_ioctx_t io_ctx;
1610 const char cluster_name[] = "ceph";
1611 const char user_name[] = "client.admin";
1612 const char pool[] = "rbd";
1613 int major, minor, extra;
1615 rbd_version(&major, &minor, &extra);
1616 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1617 rados_create2(&cluster, cluster_name, user_name, 0);
1618 rados_ioctx_create(cluster, pool, &io_ctx);
1623 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1624 LIBS="-lrbd -lrados $LIBS"
1627 print_config "Rados Block Device engine" "$rbd"
1629 ##########################################
1630 # check for rbd_poll
1631 if test "$rbd_poll" != "yes" ; then
1634 if test "$rbd" = "yes"; then
1636 #include <rbd/librbd.h>
1637 #include <sys/eventfd.h>
1639 int main(int argc, char **argv)
1642 rbd_completion_t comp;
1644 int fd = eventfd(0, EFD_NONBLOCK);
1645 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1646 rbd_poll_io_events(image, comp, 1);
1651 if compile_prog "" "-lrbd -lrados" "rbd"; then
1654 print_config "rbd_poll" "$rbd_poll"
1657 ##########################################
1658 # check for rbd_invalidate_cache()
1659 if test "$rbd_inval" != "yes" ; then
1662 if test "$rbd" = "yes"; then
1664 #include <rbd/librbd.h>
1666 int main(int argc, char **argv)
1670 return rbd_invalidate_cache(image);
1673 if compile_prog "" "-lrbd -lrados" "rbd"; then
1676 print_config "rbd_invalidate_cache" "$rbd_inval"
1679 ##########################################
1680 # Check whether we have setvbuf
1681 if test "$setvbuf" != "yes" ; then
1686 int main(int argc, char **argv)
1690 setvbuf(f, buf, _IOFBF, sizeof(buf));
1694 if compile_prog "" "" "setvbuf"; then
1697 print_config "setvbuf" "$setvbuf"
1699 ##########################################
1701 if test "$gfapi" != "yes" ; then
1705 #include <glusterfs/api/glfs.h>
1707 int main(int argc, char **argv)
1709 glfs_t *g = glfs_new("foo");
1714 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1715 LIBS="-lgfapi -lglusterfs $LIBS"
1718 print_config "Gluster API engine" "$gfapi"
1720 ##########################################
1721 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1722 if test "$gfapi" = "yes" ; then
1725 #include <glusterfs/api/glfs.h>
1727 int main(int argc, char **argv)
1730 int ret = glfs_fadvise(fd, 0, 0, 1);
1735 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1738 print_config "Gluster API use fadvise" "$gf_fadvise"
1741 ##########################################
1742 # check for gfapi trim support
1743 if test "$gf_trim" != "yes" ; then
1746 if test "$gfapi" = "yes" ; then
1748 #include <glusterfs/api/glfs.h>
1750 int main(int argc, char **argv)
1752 return glfs_discard_async(NULL, 0, 0);
1755 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1758 print_config "Gluster API trim support" "$gf_trim"
1761 ##########################################
1762 # Check if we support stckf on s390
1763 if test "$s390_z196_facilities" != "yes" ; then
1764 s390_z196_facilities="no"
1767 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1768 int main(int argc, char **argv)
1770 /* We want just 1 double word to be returned. */
1771 register unsigned long reg0 asm("0") = 0;
1772 unsigned long stfle_bits;
1773 asm volatile(".machine push" "\n\t"
1774 ".machine \"z9-109\"" "\n\t"
1777 : "=QS" (stfle_bits), "+d" (reg0)
1780 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1786 if compile_prog "" "" "s390_z196_facilities"; then
1788 if [ $? -eq 0 ]; then
1789 s390_z196_facilities="yes"
1792 print_config "s390_z196_facilities" "$s390_z196_facilities"
1794 ##########################################
1795 # Check if we have required environment variables configured for libhdfs
1796 if test "$libhdfs" = "yes" ; then
1798 if test "$JAVA_HOME" = "" ; then
1799 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1802 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1803 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1806 if test "$FIO_LIBHDFS_LIB" = "" ; then
1807 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1810 if test "$hdfs_conf_error" = "1" ; then
1814 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1815 FIO_HDFS_CPU="amd64"
1818 print_config "HDFS engine" "$libhdfs"
1820 ##########################################
1821 # Check whether we have MTD
1822 if test "$mtd" != "yes" ; then
1827 #include <mtd/mtd-user.h>
1828 #include <sys/ioctl.h>
1829 int main(int argc, char **argv)
1831 struct mtd_write_req ops;
1832 struct mtd_info_user info;
1833 memset(&ops, 0, sizeof(ops));
1834 info.type = MTD_MLCNANDFLASH;
1835 return ioctl(0, MEMGETINFO, &info);
1838 if compile_prog "" "" "mtd"; then
1841 print_config "MTD" "$mtd"
1843 ##########################################
1844 # Check whether we have libpmem
1845 if test "$libpmem" != "yes" ; then
1849 #include <libpmem.h>
1850 int main(int argc, char **argv)
1853 rc = pmem_is_pmem(0, 0);
1857 if compile_prog "" "-lpmem" "libpmem"; then
1861 print_config "libpmem" "$libpmem"
1863 ##########################################
1864 # Check whether we have libpmemblk
1865 # libpmem is a prerequisite
1866 if test "$libpmemblk" != "yes" ; then
1869 if test "$libpmem" = "yes"; then
1871 #include <libpmemblk.h>
1872 int main(int argc, char **argv)
1875 pbp = pmemblk_open("", 0);
1879 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1881 LIBS="-lpmemblk $LIBS"
1884 print_config "libpmemblk" "$libpmemblk"
1886 # Choose the ioengines
1887 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1890 if test "$libpmemblk" = "yes"; then
1895 ##########################################
1896 # Report whether pmemblk engine is enabled
1897 print_config "PMDK pmemblk engine" "$pmemblk"
1899 ##########################################
1900 # Report whether dev-dax engine is enabled
1901 print_config "PMDK dev-dax engine" "$devdax"
1903 ##########################################
1904 # Report whether libpmem engine is enabled
1905 print_config "PMDK libpmem engine" "$pmem"
1907 ##########################################
1908 # Check if we have lex/yacc available
1913 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1914 if test "$targetos" != "SunOS" ; then
1915 LEX=$(which lex 2> /dev/null)
1916 if test -x "$LEX" ; then
1919 YACC=$(which bison 2> /dev/null)
1920 if test -x "$YACC" ; then
1924 YACC=$(which yacc 2> /dev/null)
1925 if test -x "$YACC" ; then
1929 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1933 if test "$arith" = "yes" ; then
1935 extern int yywrap(void);
1937 int main(int argc, char **argv)
1943 if compile_prog "" "-ll" "lex"; then
1952 # Check if lex fails using -o
1953 if test "$arith" = "yes" ; then
1954 if test "$force_no_lex_o" = "yes" ; then
1957 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1958 if test "$?" = "0" ; then
1966 print_config "lex/yacc for arithmetic" "$arith"
1968 ##########################################
1969 # Check whether we have setmntent/getmntent
1970 if test "$getmntent" != "yes" ; then
1976 int main(int argc, char **argv)
1978 FILE *mtab = setmntent(NULL, "r");
1979 struct mntent *mnt = getmntent(mtab);
1984 if compile_prog "" "" "getmntent"; then
1987 print_config "getmntent" "$getmntent"
1989 ##########################################
1990 # Check whether we have getmntinfo
1991 # These are originally added for BSDs, but may also work
1992 # on other operating systems with getmntinfo(3).
1994 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1995 # Note that NetBSD needs -Werror to catch warning as error.
1996 if test "$getmntinfo" != "yes" ; then
2001 #include <sys/param.h>
2002 #include <sys/mount.h>
2003 int main(int argc, char **argv)
2006 return getmntinfo(&st, MNT_NOWAIT);
2009 if compile_prog "-Werror" "" "getmntinfo"; then
2012 print_config "getmntinfo" "$getmntinfo"
2014 # getmntinfo(3) for NetBSD.
2015 if test "$getmntinfo_statvfs" != "yes" ; then
2016 getmntinfo_statvfs="no"
2020 #include <sys/statvfs.h>
2021 int main(int argc, char **argv)
2024 return getmntinfo(&st, MNT_NOWAIT);
2027 # Skip the test if the one with statfs arg is detected.
2028 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2029 getmntinfo_statvfs="yes"
2030 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2033 ##########################################
2034 # Check whether we have _Static_assert
2035 if test "$static_assert" != "yes" ; then
2047 int main(int argc, char **argv)
2049 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2053 if compile_prog "" "" "static_assert"; then
2056 print_config "Static Assert" "$static_assert"
2058 ##########################################
2059 # Check whether we have bool / stdbool.h
2060 if test "$have_bool" != "yes" ; then
2064 #include <stdbool.h>
2065 int main(int argc, char **argv)
2068 return var != false;
2071 if compile_prog "" "" "bool"; then
2074 print_config "bool" "$have_bool"
2076 ##########################################
2077 # Check whether we have strndup()
2082 int main(int argc, char **argv)
2084 char *res = strndup("test string", 8);
2090 if compile_prog "" "" "strndup"; then
2093 print_config "strndup" "$strndup"
2095 ##########################################
2096 # <valgrind/drd.h> probe
2097 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2098 # also available but not the other way around.
2099 if test "$valgrind_dev" != "yes" ; then
2103 #include <valgrind/drd.h>
2104 int main(int argc, char **argv)
2109 if compile_prog "" "" "valgrind_dev"; then
2112 print_config "Valgrind headers" "$valgrind_dev"
2114 # check march=armv8-a+crc+crypto
2115 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2116 march_armv8_a_crc_crypto="no"
2118 if test "$cpu" = "arm64" ; then
2120 #include <arm_acle.h>
2121 #include <arm_neon.h>
2122 #include <sys/auxv.h>
2126 /* Can we also do a runtime probe? */
2128 return getauxval(AT_HWCAP);
2130 # error "Don't know how to do runtime probe for ARM CRC32c"
2134 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2135 march_armv8_a_crc_crypto="yes"
2136 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2140 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2142 ##########################################
2144 if test "$cuda" != "yes" ; then
2149 int main(int argc, char **argv)
2154 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2158 print_config "cuda" "$cuda"
2160 ##########################################
2161 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2164 #include <sys/stat.h>
2165 #include <sys/types.h>
2166 int main(int argc, char **argv)
2168 return mkdir("/tmp/bla", 0600);
2171 if compile_prog "" "" "mkdir(a, b)"; then
2174 print_config "mkdir(a, b)" "$mkdir_two"
2176 ##########################################
2177 # check for cc -march=native
2180 int main(int argc, char **argv)
2185 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2186 compile_prog "-march=native" "" "march=native"; then
2189 print_config "Build march=native" "$build_native"
2191 #############################################################################
2193 if test "$wordsize" = "64" ; then
2194 output_sym "CONFIG_64BIT"
2195 elif test "$wordsize" = "32" ; then
2196 output_sym "CONFIG_32BIT"
2198 fatal "Unknown wordsize!"
2200 if test "$bigendian" = "yes" ; then
2201 output_sym "CONFIG_BIG_ENDIAN"
2203 output_sym "CONFIG_LITTLE_ENDIAN"
2205 if test "$zlib" = "yes" ; then
2206 output_sym "CONFIG_ZLIB"
2208 if test "$libaio" = "yes" ; then
2209 output_sym "CONFIG_LIBAIO"
2211 if test "$posix_aio" = "yes" ; then
2212 output_sym "CONFIG_POSIXAIO"
2214 if test "$posix_aio_fsync" = "yes" ; then
2215 output_sym "CONFIG_POSIXAIO_FSYNC"
2217 if test "$posix_pshared" = "yes" ; then
2218 output_sym "CONFIG_PSHARED"
2220 if test "$have_asprintf" = "yes" ; then
2221 output_sym "CONFIG_HAVE_ASPRINTF"
2223 if test "$have_vasprintf" = "yes" ; then
2224 output_sym "CONFIG_HAVE_VASPRINTF"
2226 if test "$linux_fallocate" = "yes" ; then
2227 output_sym "CONFIG_LINUX_FALLOCATE"
2229 if test "$posix_fallocate" = "yes" ; then
2230 output_sym "CONFIG_POSIX_FALLOCATE"
2232 if test "$fdatasync" = "yes" ; then
2233 output_sym "CONFIG_FDATASYNC"
2235 if test "$sync_file_range" = "yes" ; then
2236 output_sym "CONFIG_SYNC_FILE_RANGE"
2238 if test "$sfaa" = "yes" ; then
2239 output_sym "CONFIG_SFAA"
2241 if test "$sync_sync" = "yes" ; then
2242 output_sym "CONFIG_SYNC_SYNC"
2244 if test "$cmp_swap" = "yes" ; then
2245 output_sym "CONFIG_CMP_SWAP"
2247 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2248 output_sym "CONFIG_RDMA"
2250 if test "$clock_gettime" = "yes" ; then
2251 output_sym "CONFIG_CLOCK_GETTIME"
2253 if test "$clock_monotonic" = "yes" ; then
2254 output_sym "CONFIG_CLOCK_MONOTONIC"
2256 if test "$clock_monotonic_raw" = "yes" ; then
2257 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2259 if test "$clock_monotonic_precise" = "yes" ; then
2260 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2262 if test "$clockid_t" = "yes"; then
2263 output_sym "CONFIG_CLOCKID_T"
2265 if test "$gettimeofday" = "yes" ; then
2266 output_sym "CONFIG_GETTIMEOFDAY"
2268 if test "$posix_fadvise" = "yes" ; then
2269 output_sym "CONFIG_POSIX_FADVISE"
2271 if test "$linux_3arg_affinity" = "yes" ; then
2272 output_sym "CONFIG_3ARG_AFFINITY"
2273 elif test "$linux_2arg_affinity" = "yes" ; then
2274 output_sym "CONFIG_2ARG_AFFINITY"
2276 if test "$strsep" = "yes" ; then
2277 output_sym "CONFIG_STRSEP"
2279 if test "$strcasestr" = "yes" ; then
2280 output_sym "CONFIG_STRCASESTR"
2282 if test "$strlcat" = "yes" ; then
2283 output_sym "CONFIG_STRLCAT"
2285 if test "$getopt_long_only" = "yes" ; then
2286 output_sym "CONFIG_GETOPT_LONG_ONLY"
2288 if test "$inet_aton" = "yes" ; then
2289 output_sym "CONFIG_INET_ATON"
2291 if test "$socklen_t" = "yes" ; then
2292 output_sym "CONFIG_SOCKLEN_T"
2294 if test "$ext4_me" = "yes" ; then
2295 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2297 if test "$linux_splice" = "yes" ; then
2298 output_sym "CONFIG_LINUX_SPLICE"
2300 if test "$guasi" = "yes" ; then
2301 output_sym "CONFIG_GUASI"
2303 if test "$fusion_aw" = "yes" ; then
2304 output_sym "CONFIG_FUSION_AW"
2306 if test "$libnuma_v2" = "yes" ; then
2307 output_sym "CONFIG_LIBNUMA"
2309 if test "$solaris_aio" = "yes" ; then
2310 output_sym "CONFIG_SOLARISAIO"
2312 if test "$tls_thread" = "yes" ; then
2313 output_sym "CONFIG_TLS_THREAD"
2315 if test "$rusage_thread" = "yes" ; then
2316 output_sym "CONFIG_RUSAGE_THREAD"
2318 if test "$gfio" = "yes" ; then
2319 output_sym "CONFIG_GFIO"
2321 if test "$esx" = "yes" ; then
2322 output_sym "CONFIG_ESX"
2323 output_sym "CONFIG_NO_SHM"
2325 if test "$sched_idle" = "yes" ; then
2326 output_sym "CONFIG_SCHED_IDLE"
2328 if test "$tcp_nodelay" = "yes" ; then
2329 output_sym "CONFIG_TCP_NODELAY"
2331 if test "$window_size" = "yes" ; then
2332 output_sym "CONFIG_NET_WINDOWSIZE"
2334 if test "$mss" = "yes" ; then
2335 output_sym "CONFIG_NET_MSS"
2337 if test "$rlimit_memlock" = "yes" ; then
2338 output_sym "CONFIG_RLIMIT_MEMLOCK"
2340 if test "$pwritev" = "yes" ; then
2341 output_sym "CONFIG_PWRITEV"
2343 if test "$pwritev2" = "yes" ; then
2344 output_sym "CONFIG_PWRITEV2"
2346 if test "$ipv6" = "yes" ; then
2347 output_sym "CONFIG_IPV6"
2349 if test "$rados" = "yes" ; then
2350 output_sym "CONFIG_RADOS"
2352 if test "$rbd" = "yes" ; then
2353 output_sym "CONFIG_RBD"
2355 if test "$rbd_poll" = "yes" ; then
2356 output_sym "CONFIG_RBD_POLL"
2358 if test "$rbd_inval" = "yes" ; then
2359 output_sym "CONFIG_RBD_INVAL"
2361 if test "$setvbuf" = "yes" ; then
2362 output_sym "CONFIG_SETVBUF"
2364 if test "$s390_z196_facilities" = "yes" ; then
2365 output_sym "CONFIG_S390_Z196_FACILITIES"
2366 CFLAGS="$CFLAGS -march=z9-109"
2369 if test "$gfapi" = "yes" ; then
2370 output_sym "CONFIG_GFAPI"
2372 if test "$gf_fadvise" = "yes" ; then
2373 output_sym "CONFIG_GF_FADVISE"
2375 if test "$gf_trim" = "yes" ; then
2376 output_sym "CONFIG_GF_TRIM"
2378 if test "$libhdfs" = "yes" ; then
2379 output_sym "CONFIG_LIBHDFS"
2380 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2381 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2382 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2383 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2385 if test "$mtd" = "yes" ; then
2386 output_sym "CONFIG_MTD"
2388 if test "$pmemblk" = "yes" ; then
2389 output_sym "CONFIG_PMEMBLK"
2391 if test "$devdax" = "yes" ; then
2392 output_sym "CONFIG_LINUX_DEVDAX"
2394 if test "$pmem" = "yes" ; then
2395 output_sym "CONFIG_LIBPMEM"
2397 if test "$arith" = "yes" ; then
2398 output_sym "CONFIG_ARITHMETIC"
2399 if test "$yacc_is_bison" = "yes" ; then
2400 echo "YACC=$YACC -y" >> $config_host_mak
2402 echo "YACC=$YACC" >> $config_host_mak
2404 if test "$lex_use_o" = "yes" ; then
2405 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2408 if test "$getmntent" = "yes" ; then
2409 output_sym "CONFIG_GETMNTENT"
2411 if test "$getmntinfo" = "yes" ; then
2412 output_sym "CONFIG_GETMNTINFO"
2414 if test "$getmntinfo_statvfs" = "yes" ; then
2415 output_sym "CONFIG_GETMNTINFO_STATVFS"
2417 if test "$static_assert" = "yes" ; then
2418 output_sym "CONFIG_STATIC_ASSERT"
2420 if test "$have_bool" = "yes" ; then
2421 output_sym "CONFIG_HAVE_BOOL"
2423 if test "$strndup" = "yes" ; then
2424 output_sym "CONFIG_HAVE_STRNDUP"
2426 if test "$disable_opt" = "yes" ; then
2427 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2429 if test "$valgrind_dev" = "yes"; then
2430 output_sym "CONFIG_VALGRIND_DEV"
2432 if test "$zlib" = "no" ; then
2433 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2434 if test "$build_static" = "yes"; then
2435 echo "Note that some distros have separate packages for static libraries."
2438 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2439 output_sym "ARCH_HAVE_CRC_CRYPTO"
2441 if test "$cuda" = "yes" ; then
2442 output_sym "CONFIG_CUDA"
2444 if test "$mkdir_two" = "yes" ; then
2445 output_sym "CONFIG_HAVE_MKDIR_TWO"
2447 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2448 output_sym "CONFIG_BUILD_NATIVE"
2451 echo "LIBS+=$LIBS" >> $config_host_mak
2452 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2453 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2454 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2455 echo "CC=$cc" >> $config_host_mak
2456 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2457 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2459 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2460 cat > Makefile <<EOF
2461 SRCDIR:=`dirname $0`
2462 include \$(SRCDIR)/Makefile