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-http) disable_http="yes"
186 --disable-gfapi) disable_gfapi="yes"
188 --enable-libhdfs) libhdfs="yes"
190 --disable-lex) disable_lex="yes"
192 --enable-lex) disable_lex="no"
194 --disable-shm) no_shm="yes"
196 --disable-optimizations) disable_opt="yes"
198 --disable-pmem) disable_pmem="yes"
200 --enable-cuda) enable_cuda="yes"
202 --disable-native) disable_native="yes"
208 echo "Bad option $opt"
214 if test "$show_help" = "yes" ; then
215 echo "--prefix= Use this directory as installation prefix"
216 echo "--cpu= Specify target CPU if auto-detect fails"
217 echo "--cc= Specify compiler to use"
218 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
219 echo "--build-32bit-win Enable 32-bit build on Windows"
220 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
221 echo "--build-static Build a static fio"
222 echo "--esx Configure build options for esx"
223 echo "--enable-gfio Enable building of gtk gfio"
224 echo "--disable-numa Disable libnuma even if found"
225 echo "--disable-rdma Disable RDMA support even if found"
226 echo "--disable-gfapi Disable gfapi"
227 echo "--enable-libhdfs Enable hdfs support"
228 echo "--disable-lex Disable use of lex/yacc for math"
229 echo "--disable-pmem Disable pmem based engines even if found"
230 echo "--enable-lex Enable use of lex/yacc for math"
231 echo "--disable-shm Disable SHM support"
232 echo "--disable-optimizations Don't enable compiler optimizations"
233 echo "--enable-cuda Enable GPUDirect RDMA support"
234 echo "--disable-native Don't build for native host"
238 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
239 # Preferred compiler (can be overriden later after we know the platform):
241 # ${cross_prefix}gcc (if cross-prefix specified)
244 if test -z "${CC}${cross_prefix}"; then
251 cc="${CC-${cross_prefix}gcc}"
254 if check_define __ANDROID__ ; then
256 elif check_define __linux__ ; then
258 elif check_define __OpenBSD__ ; then
260 elif check_define __NetBSD__ ; then
262 elif check_define __sun__ ; then
264 CFLAGS="$CFLAGS -D_REENTRANT"
265 elif check_define _WIN32 ; then
271 echo "# Automatically generated by configure - do not modify" > $config_host_mak
272 printf "# Configured with:" >> $config_host_mak
273 printf " '%s'" "$0" "$@" >> $config_host_mak
274 echo >> $config_host_mak
275 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
277 if test "$no_shm" = "yes" ; then
278 output_sym "CONFIG_NO_SHM"
281 if test "$disable_opt" = "yes" ; then
282 output_sym "CONFIG_FIO_NO_OPT"
285 # Some host OSes need non-standard checks for which CPU to use.
286 # Note that these checks are broken for cross-compilation: if you're
287 # cross-compiling to one of these OSes then you'll need to specify
288 # the correct CPU with the --cpu option.
291 # Unless explicitly enabled, turn off lex.
292 # OpenBSD will hit syntax error when enabled.
293 if test -z "$disable_lex" ; then
300 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
301 # we can run 64-bit userspace code.
302 # If the user didn't specify a CPU explicitly and the kernel says this is
303 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
305 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
308 # Error at compile time linking of weak/partial symbols if possible...
315 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
316 echo "Disabling weak symbols"
317 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
321 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
322 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
325 LIBS="-lnsl -lsocket"
328 # We still force some options, so keep this message here.
329 echo "Forcing some known good options on Windows"
330 if test -z "${CC}${cross_prefix}"; then
331 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
332 cc="i686-w64-mingw32-gcc"
334 cc="x86_64-w64-mingw32-gcc"
338 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
339 if test -z "$target_win_ver"; then
340 # Default Windows API target
343 if test "$target_win_ver" = "XP"; then
344 output_sym "CONFIG_WINDOWS_XP"
345 elif test "$target_win_ver" = "7"; then
346 output_sym "CONFIG_WINDOWS_7"
347 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
349 fatal "Unknown target Windows version"
352 # We need this to be output_sym'd here because this is Windows specific.
353 # The regular configure path never sets this config.
354 output_sym "CONFIG_WINDOWSAIO"
355 # We now take the regular configuration path without having exit 0 here.
356 # Flags below are still necessary mostly for MinGW.
360 clock_gettime="yes" # clock_monotonic probe has dependency on this
361 clock_monotonic="yes"
369 # Now we know the target platform we can have another guess at the preferred
370 # compiler when it wasn't explictly set
371 if test -z "${CC}${cross_prefix}"; then
372 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
378 if test -z "$cc"; then
379 echo "configure: failed to find compiler"
383 if test ! -z "$cpu" ; then
384 # command line argument
386 elif check_define __i386__ ; then
388 elif check_define __x86_64__ ; then
390 elif check_define __sparc__ ; then
391 if check_define __arch64__ ; then
396 elif check_define _ARCH_PPC ; then
397 if check_define _ARCH_PPC64 ; then
402 elif check_define __mips__ ; then
404 elif check_define __ia64__ ; then
406 elif check_define __s390__ ; then
407 if check_define __s390x__ ; then
412 elif check_define __arm__ ; then
414 elif check_define __aarch64__ ; then
416 elif check_define __hppa__ ; then
422 # Normalise host CPU name and set ARCH.
424 ia64|ppc|ppc64|s390|s390x|sparc64)
427 i386|i486|i586|i686|i86pc|BePC)
439 hppa|parisc|parisc64)
453 ##########################################
454 # check cross compile
456 if test "$cross_compile" != "yes" ; then
465 if compile_prog "" "" "cross"; then
466 $TMPE 2>/dev/null || cross_compile="yes"
468 fatal "compile test failed"
471 ##########################################
473 if test "$bigendian" != "yes" ; then
476 if test "$cross_compile" = "no" ; then
478 #include <inttypes.h>
481 volatile uint32_t i=0x01234567;
482 return (*((uint8_t*)(&i))) == 0x67;
485 if compile_prog "" "" "endian"; then
486 $TMPE && bigendian="yes"
489 # If we're cross compiling, try our best to work it out and rely on the
490 # run-time check to fail if we get it wrong.
495 #if __BYTE_ORDER != __BIG_ENDIAN
496 # error "Unknown endianness"
500 compile_prog "" "" "endian" && bigendian="yes"
501 check_define "__ARMEB__" && bigendian="yes"
502 check_define "__MIPSEB__" && bigendian="yes"
506 print_config "Operating system" "$targetos"
507 print_config "CPU" "$cpu"
508 print_config "Big endian" "$bigendian"
509 if test ! -z "$target_win_ver"; then
510 print_config "Target Windows version" "$target_win_ver"
512 print_config "Compiler" "$cc"
513 print_config "Cross compile" "$cross_compile"
516 ##########################################
517 # See if we need to build a static build
518 if test "$build_static" = "yes" ; then
519 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
520 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
524 print_config "Static build" "$build_static"
526 ##########################################
531 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
534 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
538 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
540 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
543 fatal "Unknown wordsize"
545 print_config "Wordsize" "$wordsize"
547 ##########################################
549 if test "$zlib" != "yes" ; then
557 if (inflateInit(&stream) != Z_OK)
562 if compile_prog "" "-lz" "zlib" ; then
566 print_config "zlib" "$zlib"
568 ##########################################
570 if test "$libaio" != "yes" ; then
573 if test "$esx" != "yes" ; then
583 if compile_prog "" "-laio" "libaio" ; then
587 if test "$libaio" = "yes" ; then
588 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
593 print_config "Linux AIO support" "$libaio"
595 ##########################################
597 if test "$posix_aio" != "yes" ; then
600 if test "$posix_aio_lrt" != "yes" ; then
612 if compile_prog "" "" "posixaio" ; then
614 elif compile_prog "" "-lrt" "posixaio -lrt"; then
619 print_config "POSIX AIO support" "$posix_aio"
620 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
622 ##########################################
623 # posix aio fsync probe
624 if test "$posix_aio_fsync" != "yes" ; then
627 if test "$posix_aio" = "yes" ; then
634 return aio_fsync(O_SYNC, &cb);
638 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
642 print_config "POSIX AIO fsync" "$posix_aio_fsync"
644 ##########################################
645 # POSIX pshared attribute probe
646 if test "$posix_pshared" != "yes" ; then
653 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
654 # if defined(__CYGWIN__)
655 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
656 # elif defined(__APPLE__)
657 # include <AvailabilityMacros.h>
658 # include <TargetConditionals.h>
659 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
660 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
664 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
669 if compile_prog "" "$LIBS" "posix_pshared" ; then
672 print_config "POSIX pshared support" "$posix_pshared"
674 ##########################################
676 if test "$solaris_aio" != "yes" ; then
680 #include <sys/types.h>
681 #include <sys/asynch.h>
686 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
690 if compile_prog "" "-laio" "solarisaio" ; then
694 print_config "Solaris AIO support" "$solaris_aio"
696 ##########################################
697 # __sync_fetch_and_add test
698 if test "$sfaa" != "yes" ; then
702 #include <inttypes.h>
703 static int sfaa(uint64_t *ptr)
705 return __sync_fetch_and_add(ptr, 0);
708 int main(int argc, char **argv)
715 if compile_prog "" "" "__sync_fetch_and_add()" ; then
718 print_config "__sync_fetch_and_add" "$sfaa"
720 ##########################################
721 # __sync_synchronize() test
722 if test "$sync_sync" != "yes" ; then
726 #include <inttypes.h>
728 int main(int argc, char **argv)
730 __sync_synchronize();
734 if compile_prog "" "" "__sync_synchronize()" ; then
737 print_config "__sync_synchronize" "$sync_sync"
739 ##########################################
740 # __sync_val_compare_and_swap() test
741 if test "$cmp_swap" != "yes" ; then
745 #include <inttypes.h>
747 int main(int argc, char **argv)
750 return __sync_val_compare_and_swap(&x, 1, 2);
753 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
756 print_config "__sync_val_compare_and_swap" "$cmp_swap"
758 ##########################################
760 if test "$libverbs" != "yes" ; then
764 #include <infiniband/verbs.h>
765 int main(int argc, char **argv)
767 struct ibv_pd *pd = ibv_alloc_pd(NULL);
771 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
773 LIBS="-libverbs $LIBS"
775 print_config "libverbs" "$libverbs"
777 ##########################################
779 if test "$rdmacm" != "yes" ; then
784 #include <rdma/rdma_cma.h>
785 int main(int argc, char **argv)
787 rdma_destroy_qp(NULL);
791 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
793 LIBS="-lrdmacm $LIBS"
795 print_config "rdmacm" "$rdmacm"
797 ##########################################
798 # asprintf() and vasprintf() probes
799 if test "$have_asprintf" != "yes" ; then
805 int main(int argc, char **argv)
807 return asprintf(NULL, "%s", "str") == 0;
810 if compile_prog "" "" "have_asprintf"; then
813 print_config "asprintf()" "$have_asprintf"
815 if test "$have_vasprintf" != "yes" ; then
821 int main(int argc, char **argv)
823 return vasprintf(NULL, "%s", NULL) == 0;
826 if compile_prog "" "" "have_vasprintf"; then
829 print_config "vasprintf()" "$have_vasprintf"
831 ##########################################
832 # Linux fallocate probe
833 if test "$linux_fallocate" != "yes" ; then
839 #include <linux/falloc.h>
840 int main(int argc, char **argv)
842 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
846 if compile_prog "" "" "linux_fallocate"; then
847 linux_fallocate="yes"
849 print_config "Linux fallocate" "$linux_fallocate"
851 ##########################################
852 # POSIX fadvise probe
853 if test "$posix_fadvise" != "yes" ; then
859 int main(int argc, char **argv)
861 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
865 if compile_prog "" "" "posix_fadvise"; then
868 print_config "POSIX fadvise" "$posix_fadvise"
870 ##########################################
871 # POSIX fallocate probe
872 if test "$posix_fallocate" != "yes" ; then
878 int main(int argc, char **argv)
880 int r = posix_fallocate(0, 0, 1024);
884 if compile_prog "" "" "posix_fallocate"; then
885 posix_fallocate="yes"
887 print_config "POSIX fallocate" "$posix_fallocate"
889 ##########################################
890 # sched_set/getaffinity 2 or 3 argument test
891 if test "$linux_2arg_affinity" != "yes" ; then
892 linux_2arg_affinity="no"
894 if test "$linux_3arg_affinity" != "yes" ; then
895 linux_3arg_affinity="no"
899 int main(int argc, char **argv)
902 return sched_setaffinity(0, sizeof(mask), &mask);
905 if compile_prog "" "" "sched_setaffinity(,,)"; then
906 linux_3arg_affinity="yes"
910 int main(int argc, char **argv)
913 return sched_setaffinity(0, &mask);
916 if compile_prog "" "" "sched_setaffinity(,)"; then
917 linux_2arg_affinity="yes"
920 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
921 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
923 ##########################################
924 # clock_gettime probe
925 if test "$clock_gettime" != "yes" ; then
931 int main(int argc, char **argv)
933 return clock_gettime(0, NULL);
936 if compile_prog "" "" "clock_gettime"; then
938 elif compile_prog "" "-lrt" "clock_gettime"; then
942 print_config "clock_gettime" "$clock_gettime"
944 ##########################################
945 # CLOCK_MONOTONIC probe
946 if test "$clock_monotonic" != "yes" ; then
949 if test "$clock_gettime" = "yes" ; then
953 int main(int argc, char **argv)
955 return clock_gettime(CLOCK_MONOTONIC, NULL);
958 if compile_prog "" "$LIBS" "clock monotonic"; then
959 clock_monotonic="yes"
962 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
964 ##########################################
965 # CLOCK_MONOTONIC_RAW probe
966 if test "$clock_monotonic_raw" != "yes" ; then
967 clock_monotonic_raw="no"
969 if test "$clock_gettime" = "yes" ; then
973 int main(int argc, char **argv)
975 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
978 if compile_prog "" "$LIBS" "clock monotonic"; then
979 clock_monotonic_raw="yes"
982 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
984 ##########################################
985 # CLOCK_MONOTONIC_PRECISE probe
986 if test "$clock_monotonic_precise" != "yes" ; then
987 clock_monotonic_precise="no"
989 if test "$clock_gettime" = "yes" ; then
993 int main(int argc, char **argv)
995 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
998 if compile_prog "" "$LIBS" "clock monotonic precise"; then
999 clock_monotonic_precise="yes"
1002 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1004 ##########################################
1006 if test "$clockid_t" != "yes" ; then
1012 int main(int argc, char **argv)
1014 volatile clockid_t cid;
1015 memset((void*)&cid, 0, sizeof(cid));
1019 if compile_prog "" "$LIBS" "clockid_t"; then
1022 print_config "clockid_t" "$clockid_t"
1024 ##########################################
1025 # gettimeofday() probe
1026 if test "$gettimeofday" != "yes" ; then
1030 #include <sys/time.h>
1032 int main(int argc, char **argv)
1035 return gettimeofday(&tv, NULL);
1038 if compile_prog "" "" "gettimeofday"; then
1041 print_config "gettimeofday" "$gettimeofday"
1043 ##########################################
1045 if test "$fdatasync" != "yes" ; then
1051 int main(int argc, char **argv)
1053 return fdatasync(0);
1056 if compile_prog "" "" "fdatasync"; then
1059 print_config "fdatasync" "$fdatasync"
1061 ##########################################
1062 # sync_file_range() probe
1063 if test "$sync_file_range" != "yes" ; then
1064 sync_file_range="no"
1070 #include <linux/fs.h>
1071 int main(int argc, char **argv)
1073 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1074 SYNC_FILE_RANGE_WAIT_AFTER;
1075 return sync_file_range(0, 0, 0, flags);
1078 if compile_prog "" "" "sync_file_range"; then
1079 sync_file_range="yes"
1081 print_config "sync_file_range" "$sync_file_range"
1083 ##########################################
1084 # ext4 move extent probe
1085 if test "$ext4_me" != "yes" ; then
1090 #include <sys/ioctl.h>
1091 int main(int argc, char **argv)
1093 struct move_extent me;
1094 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1097 if compile_prog "" "" "ext4 move extent" ; then
1099 elif test $targetos = "Linux" ; then
1100 # On Linux, just default to it on and let it error at runtime if we really
1101 # don't have it. None of my updated systems have it defined, but it does
1102 # work. Takes a while to bubble back.
1105 print_config "EXT4 move extent" "$ext4_me"
1107 ##########################################
1109 if test "$linux_splice" != "yes" ; then
1115 int main(int argc, char **argv)
1117 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1120 if compile_prog "" "" "linux splice"; then
1123 print_config "Linux splice(2)" "$linux_splice"
1125 ##########################################
1127 if test "$guasi" != "yes" ; then
1132 #include <guasi_syscalls.h>
1133 int main(int argc, char **argv)
1135 guasi_t ctx = guasi_create(0, 0, 0);
1139 if compile_prog "" "" "guasi"; then
1142 print_config "GUASI" "$guasi"
1144 ##########################################
1146 if test "$fusion_aw" != "yes" ; then
1150 #include <nvm/nvm_primitives.h>
1151 int main(int argc, char **argv)
1153 nvm_version_t ver_info;
1154 nvm_handle_t handle;
1156 handle = nvm_get_handle(0, &ver_info);
1157 return nvm_atomic_write(handle, 0, 0, 0);
1160 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1161 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1164 print_config "Fusion-io atomic engine" "$fusion_aw"
1166 ##########################################
1168 if test "$libnuma" != "yes" ; then
1173 int main(int argc, char **argv)
1175 return numa_available();
1178 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1182 print_config "libnuma" "$libnuma"
1184 ##########################################
1185 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1186 if test "$libnuma" = "yes" ; then
1190 int main(int argc, char **argv)
1192 struct bitmask *mask = numa_parse_nodestring(NULL);
1193 return mask->size == 0;
1196 if compile_prog "" "" "libnuma api"; then
1199 print_config "libnuma v2" "$libnuma_v2"
1202 ##########################################
1204 if test "$strsep" != "yes" ; then
1209 int main(int argc, char **argv)
1211 static char *string = "This is a string";
1212 strsep(&string, "needle");
1216 if compile_prog "" "" "strsep"; then
1219 print_config "strsep" "$strsep"
1221 ##########################################
1222 # strcasestr() probe
1223 if test "$strcasestr" != "yes" ; then
1228 int main(int argc, char **argv)
1230 return strcasestr(argv[0], argv[1]) != NULL;
1233 if compile_prog "" "" "strcasestr"; then
1236 print_config "strcasestr" "$strcasestr"
1238 ##########################################
1240 if test "$strlcat" != "yes" ; then
1245 int main(int argc, char **argv)
1247 static char dst[64];
1248 static char *string = "This is a string";
1249 memset(dst, 0, sizeof(dst));
1250 strlcat(dst, string, sizeof(dst));
1254 if compile_prog "" "" "strlcat"; then
1257 print_config "strlcat" "$strlcat"
1259 ##########################################
1260 # getopt_long_only() probe
1261 if test "$getopt_long_only" != "yes" ; then
1262 getopt_long_only="no"
1268 int main(int argc, char **argv)
1270 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1274 if compile_prog "" "" "getopt_long_only"; then
1275 getopt_long_only="yes"
1277 print_config "getopt_long_only()" "$getopt_long_only"
1279 ##########################################
1281 if test "$inet_aton" != "yes" ; then
1285 #include <sys/socket.h>
1286 #include <arpa/inet.h>
1288 int main(int argc, char **argv)
1291 return inet_aton(NULL, &in);
1294 if compile_prog "" "" "inet_aton"; then
1297 print_config "inet_aton" "$inet_aton"
1299 ##########################################
1301 if test "$socklen_t" != "yes" ; then
1305 #include <sys/socket.h>
1306 int main(int argc, char **argv)
1312 if compile_prog "" "" "socklen_t"; then
1315 print_config "socklen_t" "$socklen_t"
1317 ##########################################
1318 # Whether or not __thread is supported for TLS
1319 if test "$tls_thread" != "yes" ; then
1324 static __thread int ret;
1325 int main(int argc, char **argv)
1330 if compile_prog "" "" "__thread"; then
1333 print_config "__thread" "$tls_thread"
1335 ##########################################
1336 # Check if we have required gtk/glib support for gfio
1337 if test "$gfio" != "yes" ; then
1340 if test "$gfio_check" = "yes" ; then
1344 #include <gtk/gtk.h>
1347 gdk_threads_enter();
1348 gdk_threads_leave();
1350 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1353 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1354 ORG_LDFLAGS=$LDFLAGS
1355 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1356 if test "$?" != "0" ; then
1357 echo "configure: gtk and gthread not found"
1360 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1361 if test "$?" != "0" ; then
1362 echo "configure: gtk and gthread not found"
1365 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1367 if test "$?" = "0" ; then
1369 GFIO_LIBS="$LIBS $GTK_LIBS"
1370 CFLAGS="$CFLAGS $GTK_CFLAGS"
1372 echo "GTK found, but need version 2.18 or higher"
1376 echo "Please install gtk and gdk libraries"
1379 LDFLAGS=$ORG_LDFLAGS
1382 if test "$gfio_check" = "yes" ; then
1383 print_config "gtk 2.18 or higher" "$gfio"
1386 ##########################################
1387 # Check whether we have getrusage(RUSAGE_THREAD)
1388 if test "$rusage_thread" != "yes" ; then
1392 #include <sys/time.h>
1393 #include <sys/resource.h>
1394 int main(int argc, char **argv)
1397 getrusage(RUSAGE_THREAD, &ru);
1401 if compile_prog "" "" "RUSAGE_THREAD"; then
1404 print_config "RUSAGE_THREAD" "$rusage_thread"
1406 ##########################################
1407 # Check whether we have SCHED_IDLE
1408 if test "$sched_idle" != "yes" ; then
1413 int main(int argc, char **argv)
1415 struct sched_param p;
1416 return sched_setscheduler(0, SCHED_IDLE, &p);
1419 if compile_prog "" "" "SCHED_IDLE"; then
1422 print_config "SCHED_IDLE" "$sched_idle"
1424 ##########################################
1425 # Check whether we have TCP_NODELAY
1426 if test "$tcp_nodelay" != "yes" ; then
1431 #include <sys/types.h>
1432 #include <sys/socket.h>
1433 #include <netinet/tcp.h>
1434 int main(int argc, char **argv)
1436 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1439 if compile_prog "" "" "TCP_NODELAY"; then
1442 print_config "TCP_NODELAY" "$tcp_nodelay"
1444 ##########################################
1445 # Check whether we have SO_SNDBUF
1446 if test "$window_size" != "yes" ; then
1451 #include <sys/types.h>
1452 #include <sys/socket.h>
1453 #include <netinet/tcp.h>
1454 int main(int argc, char **argv)
1456 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1457 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1460 if compile_prog "" "" "SO_SNDBUF"; then
1463 print_config "Net engine window_size" "$window_size"
1465 ##########################################
1466 # Check whether we have TCP_MAXSEG
1467 if test "$mss" != "yes" ; then
1472 #include <sys/types.h>
1473 #include <sys/socket.h>
1474 #include <netinet/tcp.h>
1475 #include <arpa/inet.h>
1476 #include <netinet/in.h>
1477 int main(int argc, char **argv)
1479 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1482 if compile_prog "" "" "TCP_MAXSEG"; then
1485 print_config "TCP_MAXSEG" "$mss"
1487 ##########################################
1488 # Check whether we have RLIMIT_MEMLOCK
1489 if test "$rlimit_memlock" != "yes" ; then
1493 #include <sys/time.h>
1494 #include <sys/resource.h>
1495 int main(int argc, char **argv)
1498 return getrlimit(RLIMIT_MEMLOCK, &rl);
1501 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1502 rlimit_memlock="yes"
1504 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1506 ##########################################
1507 # Check whether we have pwritev/preadv
1508 if test "$pwritev" != "yes" ; then
1513 #include <sys/uio.h>
1514 int main(int argc, char **argv)
1516 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1519 if compile_prog "" "" "pwritev"; then
1522 print_config "pwritev/preadv" "$pwritev"
1524 ##########################################
1525 # Check whether we have pwritev2/preadv2
1526 if test "$pwritev2" != "yes" ; then
1531 #include <sys/uio.h>
1532 int main(int argc, char **argv)
1534 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1537 if compile_prog "" "" "pwritev2"; then
1540 print_config "pwritev2/preadv2" "$pwritev2"
1542 ##########################################
1543 # Check whether we have the required functions for ipv6
1544 if test "$ipv6" != "yes" ; then
1548 #include <sys/types.h>
1549 #include <sys/socket.h>
1550 #include <netinet/in.h>
1553 int main(int argc, char **argv)
1555 struct addrinfo hints;
1556 struct in6_addr addr;
1559 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1561 printf("%s\n", gai_strerror(ret));
1566 if compile_prog "" "" "ipv6"; then
1569 print_config "IPv6 helpers" "$ipv6"
1571 ##########################################
1573 if test "$http" != "yes" ; then
1577 #include <curl/curl.h>
1578 #include <openssl/hmac.h>
1580 int main(int argc, char **argv)
1585 curl = curl_easy_init();
1586 curl_easy_cleanup(curl);
1588 ctx = HMAC_CTX_new();
1589 HMAC_CTX_reset(ctx);
1594 if test "$disable_http" != "yes" && compile_prog "" "-lcurl -lssl -lcrypto" "curl"; then
1595 LIBS="-lcurl -lssl -lcrypto $LIBS"
1598 print_config "http engine" "$http"
1600 ##########################################
1602 if test "$rados" != "yes" ; then
1606 #include <rados/librados.h>
1608 int main(int argc, char **argv)
1611 rados_ioctx_t io_ctx;
1612 const char cluster_name[] = "ceph";
1613 const char user_name[] = "client.admin";
1614 const char pool[] = "rados";
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_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1624 LIBS="-lrados $LIBS"
1627 print_config "Rados engine" "$rados"
1629 ##########################################
1631 if test "$rbd" != "yes" ; then
1635 #include <rbd/librbd.h>
1637 int main(int argc, char **argv)
1640 rados_ioctx_t io_ctx;
1641 const char cluster_name[] = "ceph";
1642 const char user_name[] = "client.admin";
1643 const char pool[] = "rbd";
1644 int major, minor, extra;
1646 rbd_version(&major, &minor, &extra);
1647 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1648 rados_create2(&cluster, cluster_name, user_name, 0);
1649 rados_ioctx_create(cluster, pool, &io_ctx);
1654 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1655 LIBS="-lrbd -lrados $LIBS"
1658 print_config "Rados Block Device engine" "$rbd"
1660 ##########################################
1661 # check for rbd_poll
1662 if test "$rbd_poll" != "yes" ; then
1665 if test "$rbd" = "yes"; then
1667 #include <rbd/librbd.h>
1668 #include <sys/eventfd.h>
1670 int main(int argc, char **argv)
1673 rbd_completion_t comp;
1675 int fd = eventfd(0, EFD_NONBLOCK);
1676 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1677 rbd_poll_io_events(image, comp, 1);
1682 if compile_prog "" "-lrbd -lrados" "rbd"; then
1685 print_config "rbd_poll" "$rbd_poll"
1688 ##########################################
1689 # check for rbd_invalidate_cache()
1690 if test "$rbd_inval" != "yes" ; then
1693 if test "$rbd" = "yes"; then
1695 #include <rbd/librbd.h>
1697 int main(int argc, char **argv)
1701 return rbd_invalidate_cache(image);
1704 if compile_prog "" "-lrbd -lrados" "rbd"; then
1707 print_config "rbd_invalidate_cache" "$rbd_inval"
1710 ##########################################
1711 # Check whether we have setvbuf
1712 if test "$setvbuf" != "yes" ; then
1717 int main(int argc, char **argv)
1721 setvbuf(f, buf, _IOFBF, sizeof(buf));
1725 if compile_prog "" "" "setvbuf"; then
1728 print_config "setvbuf" "$setvbuf"
1730 ##########################################
1732 if test "$gfapi" != "yes" ; then
1736 #include <glusterfs/api/glfs.h>
1738 int main(int argc, char **argv)
1740 glfs_t *g = glfs_new("foo");
1745 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1746 LIBS="-lgfapi -lglusterfs $LIBS"
1749 print_config "Gluster API engine" "$gfapi"
1751 ##########################################
1752 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1753 if test "$gfapi" = "yes" ; then
1756 #include <glusterfs/api/glfs.h>
1758 int main(int argc, char **argv)
1761 int ret = glfs_fadvise(fd, 0, 0, 1);
1766 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1769 print_config "Gluster API use fadvise" "$gf_fadvise"
1772 ##########################################
1773 # check for gfapi trim support
1774 if test "$gf_trim" != "yes" ; then
1777 if test "$gfapi" = "yes" ; then
1779 #include <glusterfs/api/glfs.h>
1781 int main(int argc, char **argv)
1783 return glfs_discard_async(NULL, 0, 0);
1786 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1789 print_config "Gluster API trim support" "$gf_trim"
1792 ##########################################
1793 # Check if we support stckf on s390
1794 if test "$s390_z196_facilities" != "yes" ; then
1795 s390_z196_facilities="no"
1798 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1799 int main(int argc, char **argv)
1801 /* We want just 1 double word to be returned. */
1802 register unsigned long reg0 asm("0") = 0;
1803 unsigned long stfle_bits;
1804 asm volatile(".machine push" "\n\t"
1805 ".machine \"z9-109\"" "\n\t"
1808 : "=QS" (stfle_bits), "+d" (reg0)
1811 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1817 if compile_prog "" "" "s390_z196_facilities"; then
1819 if [ $? -eq 0 ]; then
1820 s390_z196_facilities="yes"
1823 print_config "s390_z196_facilities" "$s390_z196_facilities"
1825 ##########################################
1826 # Check if we have required environment variables configured for libhdfs
1827 if test "$libhdfs" = "yes" ; then
1829 if test "$JAVA_HOME" = "" ; then
1830 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1833 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1834 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1837 if test "$FIO_LIBHDFS_LIB" = "" ; then
1838 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1841 if test "$hdfs_conf_error" = "1" ; then
1845 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1846 FIO_HDFS_CPU="amd64"
1849 print_config "HDFS engine" "$libhdfs"
1851 ##########################################
1852 # Check whether we have MTD
1853 if test "$mtd" != "yes" ; then
1858 #include <mtd/mtd-user.h>
1859 #include <sys/ioctl.h>
1860 int main(int argc, char **argv)
1862 struct mtd_write_req ops;
1863 struct mtd_info_user info;
1864 memset(&ops, 0, sizeof(ops));
1865 info.type = MTD_MLCNANDFLASH;
1866 return ioctl(0, MEMGETINFO, &info);
1869 if compile_prog "" "" "mtd"; then
1872 print_config "MTD" "$mtd"
1874 ##########################################
1875 # Check whether we have libpmem
1876 if test "$libpmem" != "yes" ; then
1880 #include <libpmem.h>
1881 int main(int argc, char **argv)
1884 rc = pmem_is_pmem(0, 0);
1888 if compile_prog "" "-lpmem" "libpmem"; then
1892 print_config "libpmem" "$libpmem"
1894 ##########################################
1895 # Check whether we have libpmemblk
1896 # libpmem is a prerequisite
1897 if test "$libpmemblk" != "yes" ; then
1900 if test "$libpmem" = "yes"; then
1902 #include <libpmemblk.h>
1903 int main(int argc, char **argv)
1906 pbp = pmemblk_open("", 0);
1910 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1912 LIBS="-lpmemblk $LIBS"
1915 print_config "libpmemblk" "$libpmemblk"
1917 # Choose the ioengines
1918 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1921 if test "$libpmemblk" = "yes"; then
1926 ##########################################
1927 # Report whether pmemblk engine is enabled
1928 print_config "PMDK pmemblk engine" "$pmemblk"
1930 ##########################################
1931 # Report whether dev-dax engine is enabled
1932 print_config "PMDK dev-dax engine" "$devdax"
1934 ##########################################
1935 # Report whether libpmem engine is enabled
1936 print_config "PMDK libpmem engine" "$pmem"
1938 ##########################################
1939 # Check if we have lex/yacc available
1944 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1945 if test "$targetos" != "SunOS" ; then
1946 LEX=$(which lex 2> /dev/null)
1947 if test -x "$LEX" ; then
1950 YACC=$(which bison 2> /dev/null)
1951 if test -x "$YACC" ; then
1955 YACC=$(which yacc 2> /dev/null)
1956 if test -x "$YACC" ; then
1960 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1964 if test "$arith" = "yes" ; then
1966 extern int yywrap(void);
1968 int main(int argc, char **argv)
1974 if compile_prog "" "-ll" "lex"; then
1983 # Check if lex fails using -o
1984 if test "$arith" = "yes" ; then
1985 if test "$force_no_lex_o" = "yes" ; then
1988 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1989 if test "$?" = "0" ; then
1997 print_config "lex/yacc for arithmetic" "$arith"
1999 ##########################################
2000 # Check whether we have setmntent/getmntent
2001 if test "$getmntent" != "yes" ; then
2007 int main(int argc, char **argv)
2009 FILE *mtab = setmntent(NULL, "r");
2010 struct mntent *mnt = getmntent(mtab);
2015 if compile_prog "" "" "getmntent"; then
2018 print_config "getmntent" "$getmntent"
2020 ##########################################
2021 # Check whether we have getmntinfo
2022 # These are originally added for BSDs, but may also work
2023 # on other operating systems with getmntinfo(3).
2025 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2026 # Note that NetBSD needs -Werror to catch warning as error.
2027 if test "$getmntinfo" != "yes" ; then
2032 #include <sys/param.h>
2033 #include <sys/mount.h>
2034 int main(int argc, char **argv)
2037 return getmntinfo(&st, MNT_NOWAIT);
2040 if compile_prog "-Werror" "" "getmntinfo"; then
2043 print_config "getmntinfo" "$getmntinfo"
2045 # getmntinfo(3) for NetBSD.
2046 if test "$getmntinfo_statvfs" != "yes" ; then
2047 getmntinfo_statvfs="no"
2051 #include <sys/statvfs.h>
2052 int main(int argc, char **argv)
2055 return getmntinfo(&st, MNT_NOWAIT);
2058 # Skip the test if the one with statfs arg is detected.
2059 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2060 getmntinfo_statvfs="yes"
2061 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2064 ##########################################
2065 # Check whether we have _Static_assert
2066 if test "$static_assert" != "yes" ; then
2078 int main(int argc, char **argv)
2080 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2084 if compile_prog "" "" "static_assert"; then
2087 print_config "Static Assert" "$static_assert"
2089 ##########################################
2090 # Check whether we have bool / stdbool.h
2091 if test "$have_bool" != "yes" ; then
2095 #include <stdbool.h>
2096 int main(int argc, char **argv)
2099 return var != false;
2102 if compile_prog "" "" "bool"; then
2105 print_config "bool" "$have_bool"
2107 ##########################################
2108 # Check whether we have strndup()
2113 int main(int argc, char **argv)
2115 char *res = strndup("test string", 8);
2121 if compile_prog "" "" "strndup"; then
2124 print_config "strndup" "$strndup"
2126 ##########################################
2127 # <valgrind/drd.h> probe
2128 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2129 # also available but not the other way around.
2130 if test "$valgrind_dev" != "yes" ; then
2134 #include <valgrind/drd.h>
2135 int main(int argc, char **argv)
2140 if compile_prog "" "" "valgrind_dev"; then
2143 print_config "Valgrind headers" "$valgrind_dev"
2145 # check march=armv8-a+crc+crypto
2146 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2147 march_armv8_a_crc_crypto="no"
2149 if test "$cpu" = "arm64" ; then
2151 #include <arm_acle.h>
2152 #include <arm_neon.h>
2153 #include <sys/auxv.h>
2157 /* Can we also do a runtime probe? */
2159 return getauxval(AT_HWCAP);
2161 # error "Don't know how to do runtime probe for ARM CRC32c"
2165 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2166 march_armv8_a_crc_crypto="yes"
2167 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2171 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2173 ##########################################
2175 if test "$cuda" != "yes" ; then
2180 int main(int argc, char **argv)
2185 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2189 print_config "cuda" "$cuda"
2191 ##########################################
2192 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2195 #include <sys/stat.h>
2196 #include <sys/types.h>
2197 int main(int argc, char **argv)
2199 return mkdir("/tmp/bla", 0600);
2202 if compile_prog "" "" "mkdir(a, b)"; then
2205 print_config "mkdir(a, b)" "$mkdir_two"
2207 ##########################################
2208 # check for cc -march=native
2211 int main(int argc, char **argv)
2216 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2217 compile_prog "-march=native" "" "march=native"; then
2220 print_config "Build march=native" "$build_native"
2222 #############################################################################
2224 if test "$wordsize" = "64" ; then
2225 output_sym "CONFIG_64BIT"
2226 elif test "$wordsize" = "32" ; then
2227 output_sym "CONFIG_32BIT"
2229 fatal "Unknown wordsize!"
2231 if test "$bigendian" = "yes" ; then
2232 output_sym "CONFIG_BIG_ENDIAN"
2234 output_sym "CONFIG_LITTLE_ENDIAN"
2236 if test "$zlib" = "yes" ; then
2237 output_sym "CONFIG_ZLIB"
2239 if test "$libaio" = "yes" ; then
2240 output_sym "CONFIG_LIBAIO"
2242 if test "$posix_aio" = "yes" ; then
2243 output_sym "CONFIG_POSIXAIO"
2245 if test "$posix_aio_fsync" = "yes" ; then
2246 output_sym "CONFIG_POSIXAIO_FSYNC"
2248 if test "$posix_pshared" = "yes" ; then
2249 output_sym "CONFIG_PSHARED"
2251 if test "$have_asprintf" = "yes" ; then
2252 output_sym "CONFIG_HAVE_ASPRINTF"
2254 if test "$have_vasprintf" = "yes" ; then
2255 output_sym "CONFIG_HAVE_VASPRINTF"
2257 if test "$linux_fallocate" = "yes" ; then
2258 output_sym "CONFIG_LINUX_FALLOCATE"
2260 if test "$posix_fallocate" = "yes" ; then
2261 output_sym "CONFIG_POSIX_FALLOCATE"
2263 if test "$fdatasync" = "yes" ; then
2264 output_sym "CONFIG_FDATASYNC"
2266 if test "$sync_file_range" = "yes" ; then
2267 output_sym "CONFIG_SYNC_FILE_RANGE"
2269 if test "$sfaa" = "yes" ; then
2270 output_sym "CONFIG_SFAA"
2272 if test "$sync_sync" = "yes" ; then
2273 output_sym "CONFIG_SYNC_SYNC"
2275 if test "$cmp_swap" = "yes" ; then
2276 output_sym "CONFIG_CMP_SWAP"
2278 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2279 output_sym "CONFIG_RDMA"
2281 if test "$clock_gettime" = "yes" ; then
2282 output_sym "CONFIG_CLOCK_GETTIME"
2284 if test "$clock_monotonic" = "yes" ; then
2285 output_sym "CONFIG_CLOCK_MONOTONIC"
2287 if test "$clock_monotonic_raw" = "yes" ; then
2288 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2290 if test "$clock_monotonic_precise" = "yes" ; then
2291 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2293 if test "$clockid_t" = "yes"; then
2294 output_sym "CONFIG_CLOCKID_T"
2296 if test "$gettimeofday" = "yes" ; then
2297 output_sym "CONFIG_GETTIMEOFDAY"
2299 if test "$posix_fadvise" = "yes" ; then
2300 output_sym "CONFIG_POSIX_FADVISE"
2302 if test "$linux_3arg_affinity" = "yes" ; then
2303 output_sym "CONFIG_3ARG_AFFINITY"
2304 elif test "$linux_2arg_affinity" = "yes" ; then
2305 output_sym "CONFIG_2ARG_AFFINITY"
2307 if test "$strsep" = "yes" ; then
2308 output_sym "CONFIG_STRSEP"
2310 if test "$strcasestr" = "yes" ; then
2311 output_sym "CONFIG_STRCASESTR"
2313 if test "$strlcat" = "yes" ; then
2314 output_sym "CONFIG_STRLCAT"
2316 if test "$getopt_long_only" = "yes" ; then
2317 output_sym "CONFIG_GETOPT_LONG_ONLY"
2319 if test "$inet_aton" = "yes" ; then
2320 output_sym "CONFIG_INET_ATON"
2322 if test "$socklen_t" = "yes" ; then
2323 output_sym "CONFIG_SOCKLEN_T"
2325 if test "$ext4_me" = "yes" ; then
2326 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2328 if test "$linux_splice" = "yes" ; then
2329 output_sym "CONFIG_LINUX_SPLICE"
2331 if test "$guasi" = "yes" ; then
2332 output_sym "CONFIG_GUASI"
2334 if test "$fusion_aw" = "yes" ; then
2335 output_sym "CONFIG_FUSION_AW"
2337 if test "$libnuma_v2" = "yes" ; then
2338 output_sym "CONFIG_LIBNUMA"
2340 if test "$solaris_aio" = "yes" ; then
2341 output_sym "CONFIG_SOLARISAIO"
2343 if test "$tls_thread" = "yes" ; then
2344 output_sym "CONFIG_TLS_THREAD"
2346 if test "$rusage_thread" = "yes" ; then
2347 output_sym "CONFIG_RUSAGE_THREAD"
2349 if test "$gfio" = "yes" ; then
2350 output_sym "CONFIG_GFIO"
2352 if test "$esx" = "yes" ; then
2353 output_sym "CONFIG_ESX"
2354 output_sym "CONFIG_NO_SHM"
2356 if test "$sched_idle" = "yes" ; then
2357 output_sym "CONFIG_SCHED_IDLE"
2359 if test "$tcp_nodelay" = "yes" ; then
2360 output_sym "CONFIG_TCP_NODELAY"
2362 if test "$window_size" = "yes" ; then
2363 output_sym "CONFIG_NET_WINDOWSIZE"
2365 if test "$mss" = "yes" ; then
2366 output_sym "CONFIG_NET_MSS"
2368 if test "$rlimit_memlock" = "yes" ; then
2369 output_sym "CONFIG_RLIMIT_MEMLOCK"
2371 if test "$pwritev" = "yes" ; then
2372 output_sym "CONFIG_PWRITEV"
2374 if test "$pwritev2" = "yes" ; then
2375 output_sym "CONFIG_PWRITEV2"
2377 if test "$ipv6" = "yes" ; then
2378 output_sym "CONFIG_IPV6"
2380 if test "$http" = "yes" ; then
2381 output_sym "CONFIG_HTTP"
2383 if test "$rados" = "yes" ; then
2384 output_sym "CONFIG_RADOS"
2386 if test "$rbd" = "yes" ; then
2387 output_sym "CONFIG_RBD"
2389 if test "$rbd_poll" = "yes" ; then
2390 output_sym "CONFIG_RBD_POLL"
2392 if test "$rbd_inval" = "yes" ; then
2393 output_sym "CONFIG_RBD_INVAL"
2395 if test "$setvbuf" = "yes" ; then
2396 output_sym "CONFIG_SETVBUF"
2398 if test "$s390_z196_facilities" = "yes" ; then
2399 output_sym "CONFIG_S390_Z196_FACILITIES"
2400 CFLAGS="$CFLAGS -march=z9-109"
2403 if test "$gfapi" = "yes" ; then
2404 output_sym "CONFIG_GFAPI"
2406 if test "$gf_fadvise" = "yes" ; then
2407 output_sym "CONFIG_GF_FADVISE"
2409 if test "$gf_trim" = "yes" ; then
2410 output_sym "CONFIG_GF_TRIM"
2412 if test "$libhdfs" = "yes" ; then
2413 output_sym "CONFIG_LIBHDFS"
2414 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2415 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2416 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2417 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2419 if test "$mtd" = "yes" ; then
2420 output_sym "CONFIG_MTD"
2422 if test "$pmemblk" = "yes" ; then
2423 output_sym "CONFIG_PMEMBLK"
2425 if test "$devdax" = "yes" ; then
2426 output_sym "CONFIG_LINUX_DEVDAX"
2428 if test "$pmem" = "yes" ; then
2429 output_sym "CONFIG_LIBPMEM"
2431 if test "$arith" = "yes" ; then
2432 output_sym "CONFIG_ARITHMETIC"
2433 if test "$yacc_is_bison" = "yes" ; then
2434 echo "YACC=$YACC -y" >> $config_host_mak
2436 echo "YACC=$YACC" >> $config_host_mak
2438 if test "$lex_use_o" = "yes" ; then
2439 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2442 if test "$getmntent" = "yes" ; then
2443 output_sym "CONFIG_GETMNTENT"
2445 if test "$getmntinfo" = "yes" ; then
2446 output_sym "CONFIG_GETMNTINFO"
2448 if test "$getmntinfo_statvfs" = "yes" ; then
2449 output_sym "CONFIG_GETMNTINFO_STATVFS"
2451 if test "$static_assert" = "yes" ; then
2452 output_sym "CONFIG_STATIC_ASSERT"
2454 if test "$have_bool" = "yes" ; then
2455 output_sym "CONFIG_HAVE_BOOL"
2457 if test "$strndup" = "yes" ; then
2458 output_sym "CONFIG_HAVE_STRNDUP"
2460 if test "$disable_opt" = "yes" ; then
2461 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2463 if test "$valgrind_dev" = "yes"; then
2464 output_sym "CONFIG_VALGRIND_DEV"
2466 if test "$zlib" = "no" ; then
2467 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2468 if test "$build_static" = "yes"; then
2469 echo "Note that some distros have separate packages for static libraries."
2472 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2473 output_sym "ARCH_HAVE_CRC_CRYPTO"
2475 if test "$cuda" = "yes" ; then
2476 output_sym "CONFIG_CUDA"
2478 if test "$mkdir_two" = "yes" ; then
2479 output_sym "CONFIG_HAVE_MKDIR_TWO"
2481 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2482 output_sym "CONFIG_BUILD_NATIVE"
2485 echo "LIBS+=$LIBS" >> $config_host_mak
2486 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2487 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2488 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2489 echo "CC=$cc" >> $config_host_mak
2490 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2491 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2493 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2494 cat > Makefile <<EOF
2495 SRCDIR:=`dirname $0`
2496 include \$(SRCDIR)/Makefile