3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h"
50 # Print a helpful header at the top of config.log
51 echo "# FIO configure log $(date)" >> config.log
52 printf "# Configured with:" >> config.log
53 printf " '%s'" "$0" "$@" >> config.log
55 echo "#" >> config.log
57 # Print configure header at the top of $config_host_h
58 echo "/*" > $config_host_h
59 echo " * Automatically generated by configure - do not modify" >> $config_host_h
60 printf " * Configured with:" >> $config_host_h
61 printf " * '%s'" "$0" "$@" >> $config_host_h
62 echo "" >> $config_host_h
63 echo " */" >> $config_host_h
66 # Run the compiler, capturing its output to the log.
67 echo $cc "$@" >> config.log
68 $cc "$@" >> config.log 2>&1 || return $?
69 # Test passed. If this is an --enable-werror build, rerun
70 # the test with -Werror and bail out if it fails. This
71 # makes warning-generating-errors in configure test code
72 # obvious to developers.
73 if test "$werror" != "yes"; then
76 # Don't bother rerunning the compile if we were already using -Werror
82 echo $cc -Werror "$@" >> config.log
83 $cc -Werror "$@" >> config.log 2>&1 && return $?
84 echo "ERROR: configure test passed without -Werror but failed with -Werror."
85 echo "This is probably a bug in the configure script. The failing command"
86 echo "will be at the bottom of config.log."
87 fatal "You can run configure with --disable-werror to bypass this check."
91 do_cc $CFLAGS -c -o $TMPO $TMPC
96 local_ldflags="$2 $LIBS"
97 echo "Compiling test case $3" >> config.log
98 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
101 feature_not_found() {
106 echo "ERROR: User requested feature $feature"
107 if test ! -z "$packages" ; then
108 echo "ERROR: That feature needs $packages installed"
110 echo "ERROR: configure was not able to find it"
115 type "$1" >/dev/null 2>&1
121 #error $1 not defined
132 echo "$1=y" >> $config_host_mak
133 echo "#define $1" >> $config_host_h
155 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
157 --prefix=*) prefix="$optarg"
159 --cpu=*) cpu="$optarg"
161 # esx is cross compiled and cannot be detect through simple uname calls
167 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
169 --build-32bit-win) build_32bit_win="yes"
171 --target-win-ver=*) target_win_ver="$optarg"
173 --build-static) build_static="yes"
175 --enable-gfio) gfio_check="yes"
177 --disable-numa) disable_numa="yes"
179 --disable-rdma) disable_rdma="yes"
181 --disable-rados) disable_rados="yes"
183 --disable-rbd) disable_rbd="yes"
185 --disable-http) disable_http="yes"
187 --disable-gfapi) disable_gfapi="yes"
189 --enable-libhdfs) libhdfs="yes"
191 --disable-lex) disable_lex="yes"
193 --enable-lex) disable_lex="no"
195 --disable-shm) no_shm="yes"
197 --disable-optimizations) disable_opt="yes"
199 --disable-pmem) disable_pmem="yes"
201 --enable-cuda) enable_cuda="yes"
203 --disable-native) disable_native="yes"
209 echo "Bad option $opt"
215 if test "$show_help" = "yes" ; then
216 echo "--prefix= Use this directory as installation prefix"
217 echo "--cpu= Specify target CPU if auto-detect fails"
218 echo "--cc= Specify compiler to use"
219 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
220 echo "--build-32bit-win Enable 32-bit build on Windows"
221 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
222 echo "--build-static Build a static fio"
223 echo "--esx Configure build options for esx"
224 echo "--enable-gfio Enable building of gtk gfio"
225 echo "--disable-numa Disable libnuma even if found"
226 echo "--disable-rdma Disable RDMA support even if found"
227 echo "--disable-gfapi Disable gfapi"
228 echo "--enable-libhdfs Enable hdfs support"
229 echo "--disable-lex Disable use of lex/yacc for math"
230 echo "--disable-pmem Disable pmem based engines even if found"
231 echo "--enable-lex Enable use of lex/yacc for math"
232 echo "--disable-shm Disable SHM support"
233 echo "--disable-optimizations Don't enable compiler optimizations"
234 echo "--enable-cuda Enable GPUDirect RDMA support"
235 echo "--disable-native Don't build for native host"
239 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
240 # Preferred compiler (can be overriden later after we know the platform):
242 # ${cross_prefix}gcc (if cross-prefix specified)
245 if test -z "${CC}${cross_prefix}"; then
252 cc="${CC-${cross_prefix}gcc}"
255 if check_define __ANDROID__ ; then
257 elif check_define __linux__ ; then
259 elif check_define __OpenBSD__ ; then
261 elif check_define __NetBSD__ ; then
263 elif check_define __sun__ ; then
265 CFLAGS="$CFLAGS -D_REENTRANT"
266 elif check_define _WIN32 ; then
272 echo "# Automatically generated by configure - do not modify" > $config_host_mak
273 printf "# Configured with:" >> $config_host_mak
274 printf " '%s'" "$0" "$@" >> $config_host_mak
275 echo >> $config_host_mak
276 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
278 if test "$no_shm" = "yes" ; then
279 output_sym "CONFIG_NO_SHM"
282 if test "$disable_opt" = "yes" ; then
283 output_sym "CONFIG_FIO_NO_OPT"
286 # Some host OSes need non-standard checks for which CPU to use.
287 # Note that these checks are broken for cross-compilation: if you're
288 # cross-compiling to one of these OSes then you'll need to specify
289 # the correct CPU with the --cpu option.
292 # Unless explicitly enabled, turn off lex.
293 # OpenBSD will hit syntax error when enabled.
294 if test -z "$disable_lex" ; then
301 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
302 # we can run 64-bit userspace code.
303 # If the user didn't specify a CPU explicitly and the kernel says this is
304 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
306 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
309 # Error at compile time linking of weak/partial symbols if possible...
316 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
317 echo "Disabling weak symbols"
318 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
322 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
323 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
326 LIBS="-lnsl -lsocket"
329 # We still force some options, so keep this message here.
330 echo "Forcing some known good options on Windows"
331 if test -z "${CC}${cross_prefix}"; then
332 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
333 cc="i686-w64-mingw32-gcc"
335 cc="x86_64-w64-mingw32-gcc"
339 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
340 if test -z "$target_win_ver"; then
341 # Default Windows API target
344 if test "$target_win_ver" = "XP"; then
345 output_sym "CONFIG_WINDOWS_XP"
346 elif test "$target_win_ver" = "7"; then
347 output_sym "CONFIG_WINDOWS_7"
348 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
350 fatal "Unknown target Windows version"
353 # We need this to be output_sym'd here because this is Windows specific.
354 # The regular configure path never sets this config.
355 output_sym "CONFIG_WINDOWSAIO"
356 # We now take the regular configuration path without having exit 0 here.
357 # Flags below are still necessary mostly for MinGW.
361 clock_gettime="yes" # clock_monotonic probe has dependency on this
362 clock_monotonic="yes"
370 # Now we know the target platform we can have another guess at the preferred
371 # compiler when it wasn't explictly set
372 if test -z "${CC}${cross_prefix}"; then
373 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
379 if test -z "$cc"; then
380 echo "configure: failed to find compiler"
384 if test ! -z "$cpu" ; then
385 # command line argument
387 elif check_define __i386__ ; then
389 elif check_define __x86_64__ ; then
391 elif check_define __sparc__ ; then
392 if check_define __arch64__ ; then
397 elif check_define _ARCH_PPC ; then
398 if check_define _ARCH_PPC64 ; then
403 elif check_define __mips__ ; then
405 elif check_define __ia64__ ; then
407 elif check_define __s390__ ; then
408 if check_define __s390x__ ; then
413 elif check_define __arm__ ; then
415 elif check_define __aarch64__ ; then
417 elif check_define __hppa__ ; then
423 # Normalise host CPU name and set ARCH.
425 ia64|ppc|ppc64|s390|s390x|sparc64)
428 i386|i486|i586|i686|i86pc|BePC)
440 hppa|parisc|parisc64)
454 ##########################################
455 # check cross compile
457 if test "$cross_compile" != "yes" ; then
466 if compile_prog "" "" "cross"; then
467 $TMPE 2>/dev/null || cross_compile="yes"
469 fatal "compile test failed"
472 ##########################################
474 if test "$bigendian" != "yes" ; then
477 if test "$cross_compile" = "no" ; then
479 #include <inttypes.h>
482 volatile uint32_t i=0x01234567;
483 return (*((uint8_t*)(&i))) == 0x67;
486 if compile_prog "" "" "endian"; then
487 $TMPE && bigendian="yes"
490 # If we're cross compiling, try our best to work it out and rely on the
491 # run-time check to fail if we get it wrong.
496 #if __BYTE_ORDER != __BIG_ENDIAN
497 # error "Unknown endianness"
501 compile_prog "" "" "endian" && bigendian="yes"
502 check_define "__ARMEB__" && bigendian="yes"
503 check_define "__MIPSEB__" && bigendian="yes"
507 print_config "Operating system" "$targetos"
508 print_config "CPU" "$cpu"
509 print_config "Big endian" "$bigendian"
510 if test ! -z "$target_win_ver"; then
511 print_config "Target Windows version" "$target_win_ver"
513 print_config "Compiler" "$cc"
514 print_config "Cross compile" "$cross_compile"
517 ##########################################
518 # See if we need to build a static build
519 if test "$build_static" = "yes" ; then
520 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
521 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
525 print_config "Static build" "$build_static"
527 ##########################################
532 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
535 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
539 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
541 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
544 fatal "Unknown wordsize"
546 print_config "Wordsize" "$wordsize"
548 ##########################################
550 if test "$zlib" != "yes" ; then
558 if (inflateInit(&stream) != Z_OK)
563 if compile_prog "" "-lz" "zlib" ; then
567 print_config "zlib" "$zlib"
569 ##########################################
571 if test "$libaio" != "yes" ; then
574 if test "$esx" != "yes" ; then
584 if compile_prog "" "-laio" "libaio" ; then
588 if test "$libaio" = "yes" ; then
589 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
594 print_config "Linux AIO support" "$libaio"
596 ##########################################
598 if test "$posix_aio" != "yes" ; then
601 if test "$posix_aio_lrt" != "yes" ; then
613 if compile_prog "" "" "posixaio" ; then
615 elif compile_prog "" "-lrt" "posixaio -lrt"; then
620 print_config "POSIX AIO support" "$posix_aio"
621 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
623 ##########################################
624 # posix aio fsync probe
625 if test "$posix_aio_fsync" != "yes" ; then
628 if test "$posix_aio" = "yes" ; then
635 return aio_fsync(O_SYNC, &cb);
639 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
643 print_config "POSIX AIO fsync" "$posix_aio_fsync"
645 ##########################################
646 # POSIX pshared attribute probe
647 if test "$posix_pshared" != "yes" ; then
654 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
655 # if defined(__CYGWIN__)
656 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
657 # elif defined(__APPLE__)
658 # include <AvailabilityMacros.h>
659 # include <TargetConditionals.h>
660 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
661 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
665 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
670 if compile_prog "" "$LIBS" "posix_pshared" ; then
673 print_config "POSIX pshared support" "$posix_pshared"
675 ##########################################
677 if test "$solaris_aio" != "yes" ; then
681 #include <sys/types.h>
682 #include <sys/asynch.h>
687 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
691 if compile_prog "" "-laio" "solarisaio" ; then
695 print_config "Solaris AIO support" "$solaris_aio"
697 ##########################################
698 # __sync_fetch_and_add test
699 if test "$sfaa" != "yes" ; then
703 #include <inttypes.h>
704 static int sfaa(uint64_t *ptr)
706 return __sync_fetch_and_add(ptr, 0);
709 int main(int argc, char **argv)
716 if compile_prog "" "" "__sync_fetch_and_add()" ; then
719 print_config "__sync_fetch_and_add" "$sfaa"
721 ##########################################
722 # __sync_synchronize() test
723 if test "$sync_sync" != "yes" ; then
727 #include <inttypes.h>
729 int main(int argc, char **argv)
731 __sync_synchronize();
735 if compile_prog "" "" "__sync_synchronize()" ; then
738 print_config "__sync_synchronize" "$sync_sync"
740 ##########################################
741 # __sync_val_compare_and_swap() test
742 if test "$cmp_swap" != "yes" ; then
746 #include <inttypes.h>
748 int main(int argc, char **argv)
751 return __sync_val_compare_and_swap(&x, 1, 2);
754 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
757 print_config "__sync_val_compare_and_swap" "$cmp_swap"
759 ##########################################
761 if test "$libverbs" != "yes" ; then
765 #include <infiniband/verbs.h>
766 int main(int argc, char **argv)
768 struct ibv_pd *pd = ibv_alloc_pd(NULL);
772 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
774 LIBS="-libverbs $LIBS"
776 print_config "libverbs" "$libverbs"
778 ##########################################
780 if test "$rdmacm" != "yes" ; then
785 #include <rdma/rdma_cma.h>
786 int main(int argc, char **argv)
788 rdma_destroy_qp(NULL);
792 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
794 LIBS="-lrdmacm $LIBS"
796 print_config "rdmacm" "$rdmacm"
798 ##########################################
799 # asprintf() and vasprintf() probes
800 if test "$have_asprintf" != "yes" ; then
806 int main(int argc, char **argv)
808 return asprintf(NULL, "%s", "str") == 0;
811 if compile_prog "" "" "have_asprintf"; then
814 print_config "asprintf()" "$have_asprintf"
816 if test "$have_vasprintf" != "yes" ; then
822 int main(int argc, char **argv)
824 return vasprintf(NULL, "%s", NULL) == 0;
827 if compile_prog "" "" "have_vasprintf"; then
830 print_config "vasprintf()" "$have_vasprintf"
832 ##########################################
833 # Linux fallocate probe
834 if test "$linux_fallocate" != "yes" ; then
840 #include <linux/falloc.h>
841 int main(int argc, char **argv)
843 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
847 if compile_prog "" "" "linux_fallocate"; then
848 linux_fallocate="yes"
850 print_config "Linux fallocate" "$linux_fallocate"
852 ##########################################
853 # POSIX fadvise probe
854 if test "$posix_fadvise" != "yes" ; then
860 int main(int argc, char **argv)
862 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
866 if compile_prog "" "" "posix_fadvise"; then
869 print_config "POSIX fadvise" "$posix_fadvise"
871 ##########################################
872 # POSIX fallocate probe
873 if test "$posix_fallocate" != "yes" ; then
879 int main(int argc, char **argv)
881 int r = posix_fallocate(0, 0, 1024);
885 if compile_prog "" "" "posix_fallocate"; then
886 posix_fallocate="yes"
888 print_config "POSIX fallocate" "$posix_fallocate"
890 ##########################################
891 # sched_set/getaffinity 2 or 3 argument test
892 if test "$linux_2arg_affinity" != "yes" ; then
893 linux_2arg_affinity="no"
895 if test "$linux_3arg_affinity" != "yes" ; then
896 linux_3arg_affinity="no"
900 int main(int argc, char **argv)
903 return sched_setaffinity(0, sizeof(mask), &mask);
906 if compile_prog "" "" "sched_setaffinity(,,)"; then
907 linux_3arg_affinity="yes"
911 int main(int argc, char **argv)
914 return sched_setaffinity(0, &mask);
917 if compile_prog "" "" "sched_setaffinity(,)"; then
918 linux_2arg_affinity="yes"
921 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
922 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
924 ##########################################
925 # clock_gettime probe
926 if test "$clock_gettime" != "yes" ; then
932 int main(int argc, char **argv)
934 return clock_gettime(0, NULL);
937 if compile_prog "" "" "clock_gettime"; then
939 elif compile_prog "" "-lrt" "clock_gettime"; then
943 print_config "clock_gettime" "$clock_gettime"
945 ##########################################
946 # CLOCK_MONOTONIC probe
947 if test "$clock_monotonic" != "yes" ; then
950 if test "$clock_gettime" = "yes" ; then
954 int main(int argc, char **argv)
956 return clock_gettime(CLOCK_MONOTONIC, NULL);
959 if compile_prog "" "$LIBS" "clock monotonic"; then
960 clock_monotonic="yes"
963 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
965 ##########################################
966 # CLOCK_MONOTONIC_RAW probe
967 if test "$clock_monotonic_raw" != "yes" ; then
968 clock_monotonic_raw="no"
970 if test "$clock_gettime" = "yes" ; then
974 int main(int argc, char **argv)
976 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
979 if compile_prog "" "$LIBS" "clock monotonic"; then
980 clock_monotonic_raw="yes"
983 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
985 ##########################################
986 # CLOCK_MONOTONIC_PRECISE probe
987 if test "$clock_monotonic_precise" != "yes" ; then
988 clock_monotonic_precise="no"
990 if test "$clock_gettime" = "yes" ; then
994 int main(int argc, char **argv)
996 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
999 if compile_prog "" "$LIBS" "clock monotonic precise"; then
1000 clock_monotonic_precise="yes"
1003 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1005 ##########################################
1007 if test "$clockid_t" != "yes" ; then
1013 int main(int argc, char **argv)
1015 volatile clockid_t cid;
1016 memset((void*)&cid, 0, sizeof(cid));
1020 if compile_prog "" "$LIBS" "clockid_t"; then
1023 print_config "clockid_t" "$clockid_t"
1025 ##########################################
1026 # gettimeofday() probe
1027 if test "$gettimeofday" != "yes" ; then
1031 #include <sys/time.h>
1033 int main(int argc, char **argv)
1036 return gettimeofday(&tv, NULL);
1039 if compile_prog "" "" "gettimeofday"; then
1042 print_config "gettimeofday" "$gettimeofday"
1044 ##########################################
1046 if test "$fdatasync" != "yes" ; then
1052 int main(int argc, char **argv)
1054 return fdatasync(0);
1057 if compile_prog "" "" "fdatasync"; then
1060 print_config "fdatasync" "$fdatasync"
1062 ##########################################
1063 # sync_file_range() probe
1064 if test "$sync_file_range" != "yes" ; then
1065 sync_file_range="no"
1071 #include <linux/fs.h>
1072 int main(int argc, char **argv)
1074 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1075 SYNC_FILE_RANGE_WAIT_AFTER;
1076 return sync_file_range(0, 0, 0, flags);
1079 if compile_prog "" "" "sync_file_range"; then
1080 sync_file_range="yes"
1082 print_config "sync_file_range" "$sync_file_range"
1084 ##########################################
1085 # ext4 move extent probe
1086 if test "$ext4_me" != "yes" ; then
1091 #include <sys/ioctl.h>
1092 int main(int argc, char **argv)
1094 struct move_extent me;
1095 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1098 if compile_prog "" "" "ext4 move extent" ; then
1100 elif test $targetos = "Linux" ; then
1101 # On Linux, just default to it on and let it error at runtime if we really
1102 # don't have it. None of my updated systems have it defined, but it does
1103 # work. Takes a while to bubble back.
1106 print_config "EXT4 move extent" "$ext4_me"
1108 ##########################################
1110 if test "$linux_splice" != "yes" ; then
1116 int main(int argc, char **argv)
1118 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1121 if compile_prog "" "" "linux splice"; then
1124 print_config "Linux splice(2)" "$linux_splice"
1126 ##########################################
1128 if test "$guasi" != "yes" ; then
1133 #include <guasi_syscalls.h>
1134 int main(int argc, char **argv)
1136 guasi_t ctx = guasi_create(0, 0, 0);
1140 if compile_prog "" "" "guasi"; then
1143 print_config "GUASI" "$guasi"
1145 ##########################################
1147 if test "$fusion_aw" != "yes" ; then
1151 #include <nvm/nvm_primitives.h>
1152 int main(int argc, char **argv)
1154 nvm_version_t ver_info;
1155 nvm_handle_t handle;
1157 handle = nvm_get_handle(0, &ver_info);
1158 return nvm_atomic_write(handle, 0, 0, 0);
1161 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1162 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1165 print_config "Fusion-io atomic engine" "$fusion_aw"
1167 ##########################################
1169 if test "$libnuma" != "yes" ; then
1174 int main(int argc, char **argv)
1176 return numa_available();
1179 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1183 print_config "libnuma" "$libnuma"
1185 ##########################################
1186 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1187 if test "$libnuma" = "yes" ; then
1191 int main(int argc, char **argv)
1193 struct bitmask *mask = numa_parse_nodestring(NULL);
1194 return mask->size == 0;
1197 if compile_prog "" "" "libnuma api"; then
1200 print_config "libnuma v2" "$libnuma_v2"
1203 ##########################################
1205 if test "$strsep" != "yes" ; then
1210 int main(int argc, char **argv)
1212 static char *string = "This is a string";
1213 strsep(&string, "needle");
1217 if compile_prog "" "" "strsep"; then
1220 print_config "strsep" "$strsep"
1222 ##########################################
1223 # strcasestr() probe
1224 if test "$strcasestr" != "yes" ; then
1229 int main(int argc, char **argv)
1231 return strcasestr(argv[0], argv[1]) != NULL;
1234 if compile_prog "" "" "strcasestr"; then
1237 print_config "strcasestr" "$strcasestr"
1239 ##########################################
1241 if test "$strlcat" != "yes" ; then
1246 int main(int argc, char **argv)
1248 static char dst[64];
1249 static char *string = "This is a string";
1250 memset(dst, 0, sizeof(dst));
1251 strlcat(dst, string, sizeof(dst));
1255 if compile_prog "" "" "strlcat"; then
1258 print_config "strlcat" "$strlcat"
1260 ##########################################
1261 # getopt_long_only() probe
1262 if test "$getopt_long_only" != "yes" ; then
1263 getopt_long_only="no"
1269 int main(int argc, char **argv)
1271 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1275 if compile_prog "" "" "getopt_long_only"; then
1276 getopt_long_only="yes"
1278 print_config "getopt_long_only()" "$getopt_long_only"
1280 ##########################################
1282 if test "$inet_aton" != "yes" ; then
1286 #include <sys/socket.h>
1287 #include <arpa/inet.h>
1289 int main(int argc, char **argv)
1292 return inet_aton(NULL, &in);
1295 if compile_prog "" "" "inet_aton"; then
1298 print_config "inet_aton" "$inet_aton"
1300 ##########################################
1302 if test "$socklen_t" != "yes" ; then
1306 #include <sys/socket.h>
1307 int main(int argc, char **argv)
1313 if compile_prog "" "" "socklen_t"; then
1316 print_config "socklen_t" "$socklen_t"
1318 ##########################################
1319 # Whether or not __thread is supported for TLS
1320 if test "$tls_thread" != "yes" ; then
1325 static __thread int ret;
1326 int main(int argc, char **argv)
1331 if compile_prog "" "" "__thread"; then
1334 print_config "__thread" "$tls_thread"
1336 ##########################################
1337 # Check if we have required gtk/glib support for gfio
1338 if test "$gfio" != "yes" ; then
1341 if test "$gfio_check" = "yes" ; then
1345 #include <gtk/gtk.h>
1348 gdk_threads_enter();
1349 gdk_threads_leave();
1351 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1354 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1355 ORG_LDFLAGS=$LDFLAGS
1356 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1357 if test "$?" != "0" ; then
1358 echo "configure: gtk and gthread not found"
1361 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1362 if test "$?" != "0" ; then
1363 echo "configure: gtk and gthread not found"
1366 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1368 if test "$?" = "0" ; then
1370 GFIO_LIBS="$LIBS $GTK_LIBS"
1371 CFLAGS="$CFLAGS $GTK_CFLAGS"
1373 echo "GTK found, but need version 2.18 or higher"
1377 echo "Please install gtk and gdk libraries"
1380 LDFLAGS=$ORG_LDFLAGS
1383 if test "$gfio_check" = "yes" ; then
1384 print_config "gtk 2.18 or higher" "$gfio"
1387 ##########################################
1388 # Check whether we have getrusage(RUSAGE_THREAD)
1389 if test "$rusage_thread" != "yes" ; then
1393 #include <sys/time.h>
1394 #include <sys/resource.h>
1395 int main(int argc, char **argv)
1398 getrusage(RUSAGE_THREAD, &ru);
1402 if compile_prog "" "" "RUSAGE_THREAD"; then
1405 print_config "RUSAGE_THREAD" "$rusage_thread"
1407 ##########################################
1408 # Check whether we have SCHED_IDLE
1409 if test "$sched_idle" != "yes" ; then
1414 int main(int argc, char **argv)
1416 struct sched_param p;
1417 return sched_setscheduler(0, SCHED_IDLE, &p);
1420 if compile_prog "" "" "SCHED_IDLE"; then
1423 print_config "SCHED_IDLE" "$sched_idle"
1425 ##########################################
1426 # Check whether we have TCP_NODELAY
1427 if test "$tcp_nodelay" != "yes" ; then
1432 #include <sys/types.h>
1433 #include <sys/socket.h>
1434 #include <netinet/tcp.h>
1435 int main(int argc, char **argv)
1437 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1440 if compile_prog "" "" "TCP_NODELAY"; then
1443 print_config "TCP_NODELAY" "$tcp_nodelay"
1445 ##########################################
1446 # Check whether we have SO_SNDBUF
1447 if test "$window_size" != "yes" ; then
1452 #include <sys/types.h>
1453 #include <sys/socket.h>
1454 #include <netinet/tcp.h>
1455 int main(int argc, char **argv)
1457 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1458 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1461 if compile_prog "" "" "SO_SNDBUF"; then
1464 print_config "Net engine window_size" "$window_size"
1466 ##########################################
1467 # Check whether we have TCP_MAXSEG
1468 if test "$mss" != "yes" ; then
1473 #include <sys/types.h>
1474 #include <sys/socket.h>
1475 #include <netinet/tcp.h>
1476 #include <arpa/inet.h>
1477 #include <netinet/in.h>
1478 int main(int argc, char **argv)
1480 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1483 if compile_prog "" "" "TCP_MAXSEG"; then
1486 print_config "TCP_MAXSEG" "$mss"
1488 ##########################################
1489 # Check whether we have RLIMIT_MEMLOCK
1490 if test "$rlimit_memlock" != "yes" ; then
1494 #include <sys/time.h>
1495 #include <sys/resource.h>
1496 int main(int argc, char **argv)
1499 return getrlimit(RLIMIT_MEMLOCK, &rl);
1502 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1503 rlimit_memlock="yes"
1505 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1507 ##########################################
1508 # Check whether we have pwritev/preadv
1509 if test "$pwritev" != "yes" ; then
1514 #include <sys/uio.h>
1515 int main(int argc, char **argv)
1517 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1520 if compile_prog "" "" "pwritev"; then
1523 print_config "pwritev/preadv" "$pwritev"
1525 ##########################################
1526 # Check whether we have pwritev2/preadv2
1527 if test "$pwritev2" != "yes" ; then
1532 #include <sys/uio.h>
1533 int main(int argc, char **argv)
1535 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1538 if compile_prog "" "" "pwritev2"; then
1541 print_config "pwritev2/preadv2" "$pwritev2"
1543 ##########################################
1544 # Check whether we have the required functions for ipv6
1545 if test "$ipv6" != "yes" ; then
1549 #include <sys/types.h>
1550 #include <sys/socket.h>
1551 #include <netinet/in.h>
1554 int main(int argc, char **argv)
1556 struct addrinfo hints;
1557 struct in6_addr addr;
1560 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1562 printf("%s\n", gai_strerror(ret));
1567 if compile_prog "" "" "ipv6"; then
1570 print_config "IPv6 helpers" "$ipv6"
1572 ##########################################
1574 if test "$http" != "yes" ; then
1577 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1579 #include <curl/curl.h>
1580 #include <openssl/hmac.h>
1582 int main(int argc, char **argv)
1587 curl = curl_easy_init();
1588 curl_easy_cleanup(curl);
1590 ctx = HMAC_CTX_new();
1591 HMAC_CTX_reset(ctx);
1596 # openssl < 1.1.0 uses the HMAC_CTX type directly
1598 #include <curl/curl.h>
1599 #include <openssl/hmac.h>
1601 int main(int argc, char **argv)
1606 curl = curl_easy_init();
1607 curl_easy_cleanup(curl);
1609 HMAC_CTX_init(&ctx);
1610 HMAC_CTX_cleanup(&ctx);
1614 if test "$disable_http" != "yes"; then
1615 HTTP_LIBS="-lcurl -lssl -lcrypto"
1616 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1617 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1619 LIBS="$HTTP_LIBS $LIBS"
1620 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1622 LIBS="$HTTP_LIBS $LIBS"
1625 print_config "http engine" "$http"
1627 ##########################################
1629 if test "$rados" != "yes" ; then
1633 #include <rados/librados.h>
1635 int main(int argc, char **argv)
1638 rados_ioctx_t io_ctx;
1639 const char cluster_name[] = "ceph";
1640 const char user_name[] = "client.admin";
1641 const char pool[] = "rados";
1643 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1644 rados_create2(&cluster, cluster_name, user_name, 0);
1645 rados_ioctx_create(cluster, pool, &io_ctx);
1650 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1651 LIBS="-lrados $LIBS"
1654 print_config "Rados engine" "$rados"
1656 ##########################################
1658 if test "$rbd" != "yes" ; then
1662 #include <rbd/librbd.h>
1664 int main(int argc, char **argv)
1667 rados_ioctx_t io_ctx;
1668 const char cluster_name[] = "ceph";
1669 const char user_name[] = "client.admin";
1670 const char pool[] = "rbd";
1671 int major, minor, extra;
1673 rbd_version(&major, &minor, &extra);
1674 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1675 rados_create2(&cluster, cluster_name, user_name, 0);
1676 rados_ioctx_create(cluster, pool, &io_ctx);
1681 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1682 LIBS="-lrbd -lrados $LIBS"
1685 print_config "Rados Block Device engine" "$rbd"
1687 ##########################################
1688 # check for rbd_poll
1689 if test "$rbd_poll" != "yes" ; then
1692 if test "$rbd" = "yes"; then
1694 #include <rbd/librbd.h>
1695 #include <sys/eventfd.h>
1697 int main(int argc, char **argv)
1700 rbd_completion_t comp;
1702 int fd = eventfd(0, EFD_NONBLOCK);
1703 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1704 rbd_poll_io_events(image, comp, 1);
1709 if compile_prog "" "-lrbd -lrados" "rbd"; then
1712 print_config "rbd_poll" "$rbd_poll"
1715 ##########################################
1716 # check for rbd_invalidate_cache()
1717 if test "$rbd_inval" != "yes" ; then
1720 if test "$rbd" = "yes"; then
1722 #include <rbd/librbd.h>
1724 int main(int argc, char **argv)
1728 return rbd_invalidate_cache(image);
1731 if compile_prog "" "-lrbd -lrados" "rbd"; then
1734 print_config "rbd_invalidate_cache" "$rbd_inval"
1737 ##########################################
1738 # Check whether we have setvbuf
1739 if test "$setvbuf" != "yes" ; then
1744 int main(int argc, char **argv)
1748 setvbuf(f, buf, _IOFBF, sizeof(buf));
1752 if compile_prog "" "" "setvbuf"; then
1755 print_config "setvbuf" "$setvbuf"
1757 ##########################################
1759 if test "$gfapi" != "yes" ; then
1763 #include <glusterfs/api/glfs.h>
1765 int main(int argc, char **argv)
1767 glfs_t *g = glfs_new("foo");
1772 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1773 LIBS="-lgfapi -lglusterfs $LIBS"
1776 print_config "Gluster API engine" "$gfapi"
1778 ##########################################
1779 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1780 if test "$gfapi" = "yes" ; then
1783 #include <glusterfs/api/glfs.h>
1785 int main(int argc, char **argv)
1788 int ret = glfs_fadvise(fd, 0, 0, 1);
1793 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1796 print_config "Gluster API use fadvise" "$gf_fadvise"
1799 ##########################################
1800 # check for gfapi trim support
1801 if test "$gf_trim" != "yes" ; then
1804 if test "$gfapi" = "yes" ; then
1806 #include <glusterfs/api/glfs.h>
1808 int main(int argc, char **argv)
1810 return glfs_discard_async(NULL, 0, 0);
1813 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1816 print_config "Gluster API trim support" "$gf_trim"
1819 ##########################################
1820 # Check if we support stckf on s390
1821 if test "$s390_z196_facilities" != "yes" ; then
1822 s390_z196_facilities="no"
1825 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1826 int main(int argc, char **argv)
1828 /* We want just 1 double word to be returned. */
1829 register unsigned long reg0 asm("0") = 0;
1830 unsigned long stfle_bits;
1831 asm volatile(".machine push" "\n\t"
1832 ".machine \"z9-109\"" "\n\t"
1835 : "=QS" (stfle_bits), "+d" (reg0)
1838 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1844 if compile_prog "" "" "s390_z196_facilities"; then
1846 if [ $? -eq 0 ]; then
1847 s390_z196_facilities="yes"
1850 print_config "s390_z196_facilities" "$s390_z196_facilities"
1852 ##########################################
1853 # Check if we have required environment variables configured for libhdfs
1854 if test "$libhdfs" = "yes" ; then
1856 if test "$JAVA_HOME" = "" ; then
1857 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1860 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1861 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1864 if test "$FIO_LIBHDFS_LIB" = "" ; then
1865 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1868 if test "$hdfs_conf_error" = "1" ; then
1872 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1873 FIO_HDFS_CPU="amd64"
1876 print_config "HDFS engine" "$libhdfs"
1878 ##########################################
1879 # Check whether we have MTD
1880 if test "$mtd" != "yes" ; then
1885 #include <mtd/mtd-user.h>
1886 #include <sys/ioctl.h>
1887 int main(int argc, char **argv)
1889 struct mtd_write_req ops;
1890 struct mtd_info_user info;
1891 memset(&ops, 0, sizeof(ops));
1892 info.type = MTD_MLCNANDFLASH;
1893 return ioctl(0, MEMGETINFO, &info);
1896 if compile_prog "" "" "mtd"; then
1899 print_config "MTD" "$mtd"
1901 ##########################################
1902 # Check whether we have libpmem
1903 if test "$libpmem" != "yes" ; then
1907 #include <libpmem.h>
1908 int main(int argc, char **argv)
1911 rc = pmem_is_pmem(0, 0);
1915 if compile_prog "" "-lpmem" "libpmem"; then
1919 print_config "libpmem" "$libpmem"
1921 ##########################################
1922 # Check whether we have libpmemblk
1923 # libpmem is a prerequisite
1924 if test "$libpmemblk" != "yes" ; then
1927 if test "$libpmem" = "yes"; then
1929 #include <libpmemblk.h>
1930 int main(int argc, char **argv)
1933 pbp = pmemblk_open("", 0);
1937 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1939 LIBS="-lpmemblk $LIBS"
1942 print_config "libpmemblk" "$libpmemblk"
1944 # Choose the ioengines
1945 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1948 if test "$libpmemblk" = "yes"; then
1953 ##########################################
1954 # Report whether pmemblk engine is enabled
1955 print_config "PMDK pmemblk engine" "$pmemblk"
1957 ##########################################
1958 # Report whether dev-dax engine is enabled
1959 print_config "PMDK dev-dax engine" "$devdax"
1961 ##########################################
1962 # Report whether libpmem engine is enabled
1963 print_config "PMDK libpmem engine" "$pmem"
1965 ##########################################
1966 # Check if we have lex/yacc available
1971 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1972 if test "$targetos" != "SunOS" ; then
1973 LEX=$(which lex 2> /dev/null)
1974 if test -x "$LEX" ; then
1977 YACC=$(which bison 2> /dev/null)
1978 if test -x "$YACC" ; then
1982 YACC=$(which yacc 2> /dev/null)
1983 if test -x "$YACC" ; then
1987 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1991 if test "$arith" = "yes" ; then
1993 extern int yywrap(void);
1995 int main(int argc, char **argv)
2001 if compile_prog "" "-ll" "lex"; then
2010 # Check if lex fails using -o
2011 if test "$arith" = "yes" ; then
2012 if test "$force_no_lex_o" = "yes" ; then
2015 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
2016 if test "$?" = "0" ; then
2024 print_config "lex/yacc for arithmetic" "$arith"
2026 ##########################################
2027 # Check whether we have setmntent/getmntent
2028 if test "$getmntent" != "yes" ; then
2034 int main(int argc, char **argv)
2036 FILE *mtab = setmntent(NULL, "r");
2037 struct mntent *mnt = getmntent(mtab);
2042 if compile_prog "" "" "getmntent"; then
2045 print_config "getmntent" "$getmntent"
2047 ##########################################
2048 # Check whether we have getmntinfo
2049 # These are originally added for BSDs, but may also work
2050 # on other operating systems with getmntinfo(3).
2052 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2053 # Note that NetBSD needs -Werror to catch warning as error.
2054 if test "$getmntinfo" != "yes" ; then
2059 #include <sys/param.h>
2060 #include <sys/mount.h>
2061 int main(int argc, char **argv)
2064 return getmntinfo(&st, MNT_NOWAIT);
2067 if compile_prog "-Werror" "" "getmntinfo"; then
2070 print_config "getmntinfo" "$getmntinfo"
2072 # getmntinfo(3) for NetBSD.
2073 if test "$getmntinfo_statvfs" != "yes" ; then
2074 getmntinfo_statvfs="no"
2078 #include <sys/statvfs.h>
2079 int main(int argc, char **argv)
2082 return getmntinfo(&st, MNT_NOWAIT);
2085 # Skip the test if the one with statfs arg is detected.
2086 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2087 getmntinfo_statvfs="yes"
2088 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2091 ##########################################
2092 # Check whether we have _Static_assert
2093 if test "$static_assert" != "yes" ; then
2105 int main(int argc, char **argv)
2107 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2111 if compile_prog "" "" "static_assert"; then
2114 print_config "Static Assert" "$static_assert"
2116 ##########################################
2117 # Check whether we have bool / stdbool.h
2118 if test "$have_bool" != "yes" ; then
2122 #include <stdbool.h>
2123 int main(int argc, char **argv)
2126 return var != false;
2129 if compile_prog "" "" "bool"; then
2132 print_config "bool" "$have_bool"
2134 ##########################################
2135 # Check whether we have strndup()
2140 int main(int argc, char **argv)
2142 char *res = strndup("test string", 8);
2148 if compile_prog "" "" "strndup"; then
2151 print_config "strndup" "$strndup"
2153 ##########################################
2154 # <valgrind/drd.h> probe
2155 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2156 # also available but not the other way around.
2157 if test "$valgrind_dev" != "yes" ; then
2161 #include <valgrind/drd.h>
2162 int main(int argc, char **argv)
2167 if compile_prog "" "" "valgrind_dev"; then
2170 print_config "Valgrind headers" "$valgrind_dev"
2172 # check march=armv8-a+crc+crypto
2173 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2174 march_armv8_a_crc_crypto="no"
2176 if test "$cpu" = "arm64" ; then
2178 #include <arm_acle.h>
2179 #include <arm_neon.h>
2180 #include <sys/auxv.h>
2184 /* Can we also do a runtime probe? */
2186 return getauxval(AT_HWCAP);
2188 # error "Don't know how to do runtime probe for ARM CRC32c"
2192 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2193 march_armv8_a_crc_crypto="yes"
2194 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2198 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2200 ##########################################
2202 if test "$cuda" != "yes" ; then
2207 int main(int argc, char **argv)
2212 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2216 print_config "cuda" "$cuda"
2218 ##########################################
2219 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2222 #include <sys/stat.h>
2223 #include <sys/types.h>
2224 int main(int argc, char **argv)
2226 return mkdir("/tmp/bla", 0600);
2229 if compile_prog "" "" "mkdir(a, b)"; then
2232 print_config "mkdir(a, b)" "$mkdir_two"
2234 ##########################################
2235 # check for cc -march=native
2238 int main(int argc, char **argv)
2243 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2244 compile_prog "-march=native" "" "march=native"; then
2247 print_config "Build march=native" "$build_native"
2249 #############################################################################
2251 if test "$wordsize" = "64" ; then
2252 output_sym "CONFIG_64BIT"
2253 elif test "$wordsize" = "32" ; then
2254 output_sym "CONFIG_32BIT"
2256 fatal "Unknown wordsize!"
2258 if test "$bigendian" = "yes" ; then
2259 output_sym "CONFIG_BIG_ENDIAN"
2261 output_sym "CONFIG_LITTLE_ENDIAN"
2263 if test "$zlib" = "yes" ; then
2264 output_sym "CONFIG_ZLIB"
2266 if test "$libaio" = "yes" ; then
2267 output_sym "CONFIG_LIBAIO"
2269 if test "$posix_aio" = "yes" ; then
2270 output_sym "CONFIG_POSIXAIO"
2272 if test "$posix_aio_fsync" = "yes" ; then
2273 output_sym "CONFIG_POSIXAIO_FSYNC"
2275 if test "$posix_pshared" = "yes" ; then
2276 output_sym "CONFIG_PSHARED"
2278 if test "$have_asprintf" = "yes" ; then
2279 output_sym "CONFIG_HAVE_ASPRINTF"
2281 if test "$have_vasprintf" = "yes" ; then
2282 output_sym "CONFIG_HAVE_VASPRINTF"
2284 if test "$linux_fallocate" = "yes" ; then
2285 output_sym "CONFIG_LINUX_FALLOCATE"
2287 if test "$posix_fallocate" = "yes" ; then
2288 output_sym "CONFIG_POSIX_FALLOCATE"
2290 if test "$fdatasync" = "yes" ; then
2291 output_sym "CONFIG_FDATASYNC"
2293 if test "$sync_file_range" = "yes" ; then
2294 output_sym "CONFIG_SYNC_FILE_RANGE"
2296 if test "$sfaa" = "yes" ; then
2297 output_sym "CONFIG_SFAA"
2299 if test "$sync_sync" = "yes" ; then
2300 output_sym "CONFIG_SYNC_SYNC"
2302 if test "$cmp_swap" = "yes" ; then
2303 output_sym "CONFIG_CMP_SWAP"
2305 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2306 output_sym "CONFIG_RDMA"
2308 if test "$clock_gettime" = "yes" ; then
2309 output_sym "CONFIG_CLOCK_GETTIME"
2311 if test "$clock_monotonic" = "yes" ; then
2312 output_sym "CONFIG_CLOCK_MONOTONIC"
2314 if test "$clock_monotonic_raw" = "yes" ; then
2315 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2317 if test "$clock_monotonic_precise" = "yes" ; then
2318 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2320 if test "$clockid_t" = "yes"; then
2321 output_sym "CONFIG_CLOCKID_T"
2323 if test "$gettimeofday" = "yes" ; then
2324 output_sym "CONFIG_GETTIMEOFDAY"
2326 if test "$posix_fadvise" = "yes" ; then
2327 output_sym "CONFIG_POSIX_FADVISE"
2329 if test "$linux_3arg_affinity" = "yes" ; then
2330 output_sym "CONFIG_3ARG_AFFINITY"
2331 elif test "$linux_2arg_affinity" = "yes" ; then
2332 output_sym "CONFIG_2ARG_AFFINITY"
2334 if test "$strsep" = "yes" ; then
2335 output_sym "CONFIG_STRSEP"
2337 if test "$strcasestr" = "yes" ; then
2338 output_sym "CONFIG_STRCASESTR"
2340 if test "$strlcat" = "yes" ; then
2341 output_sym "CONFIG_STRLCAT"
2343 if test "$getopt_long_only" = "yes" ; then
2344 output_sym "CONFIG_GETOPT_LONG_ONLY"
2346 if test "$inet_aton" = "yes" ; then
2347 output_sym "CONFIG_INET_ATON"
2349 if test "$socklen_t" = "yes" ; then
2350 output_sym "CONFIG_SOCKLEN_T"
2352 if test "$ext4_me" = "yes" ; then
2353 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2355 if test "$linux_splice" = "yes" ; then
2356 output_sym "CONFIG_LINUX_SPLICE"
2358 if test "$guasi" = "yes" ; then
2359 output_sym "CONFIG_GUASI"
2361 if test "$fusion_aw" = "yes" ; then
2362 output_sym "CONFIG_FUSION_AW"
2364 if test "$libnuma_v2" = "yes" ; then
2365 output_sym "CONFIG_LIBNUMA"
2367 if test "$solaris_aio" = "yes" ; then
2368 output_sym "CONFIG_SOLARISAIO"
2370 if test "$tls_thread" = "yes" ; then
2371 output_sym "CONFIG_TLS_THREAD"
2373 if test "$rusage_thread" = "yes" ; then
2374 output_sym "CONFIG_RUSAGE_THREAD"
2376 if test "$gfio" = "yes" ; then
2377 output_sym "CONFIG_GFIO"
2379 if test "$esx" = "yes" ; then
2380 output_sym "CONFIG_ESX"
2381 output_sym "CONFIG_NO_SHM"
2383 if test "$sched_idle" = "yes" ; then
2384 output_sym "CONFIG_SCHED_IDLE"
2386 if test "$tcp_nodelay" = "yes" ; then
2387 output_sym "CONFIG_TCP_NODELAY"
2389 if test "$window_size" = "yes" ; then
2390 output_sym "CONFIG_NET_WINDOWSIZE"
2392 if test "$mss" = "yes" ; then
2393 output_sym "CONFIG_NET_MSS"
2395 if test "$rlimit_memlock" = "yes" ; then
2396 output_sym "CONFIG_RLIMIT_MEMLOCK"
2398 if test "$pwritev" = "yes" ; then
2399 output_sym "CONFIG_PWRITEV"
2401 if test "$pwritev2" = "yes" ; then
2402 output_sym "CONFIG_PWRITEV2"
2404 if test "$ipv6" = "yes" ; then
2405 output_sym "CONFIG_IPV6"
2407 if test "$http" = "yes" ; then
2408 output_sym "CONFIG_HTTP"
2410 if test "$rados" = "yes" ; then
2411 output_sym "CONFIG_RADOS"
2413 if test "$rbd" = "yes" ; then
2414 output_sym "CONFIG_RBD"
2416 if test "$rbd_poll" = "yes" ; then
2417 output_sym "CONFIG_RBD_POLL"
2419 if test "$rbd_inval" = "yes" ; then
2420 output_sym "CONFIG_RBD_INVAL"
2422 if test "$setvbuf" = "yes" ; then
2423 output_sym "CONFIG_SETVBUF"
2425 if test "$s390_z196_facilities" = "yes" ; then
2426 output_sym "CONFIG_S390_Z196_FACILITIES"
2427 CFLAGS="$CFLAGS -march=z9-109"
2430 if test "$gfapi" = "yes" ; then
2431 output_sym "CONFIG_GFAPI"
2433 if test "$gf_fadvise" = "yes" ; then
2434 output_sym "CONFIG_GF_FADVISE"
2436 if test "$gf_trim" = "yes" ; then
2437 output_sym "CONFIG_GF_TRIM"
2439 if test "$libhdfs" = "yes" ; then
2440 output_sym "CONFIG_LIBHDFS"
2441 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2442 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2443 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2444 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2446 if test "$mtd" = "yes" ; then
2447 output_sym "CONFIG_MTD"
2449 if test "$pmemblk" = "yes" ; then
2450 output_sym "CONFIG_PMEMBLK"
2452 if test "$devdax" = "yes" ; then
2453 output_sym "CONFIG_LINUX_DEVDAX"
2455 if test "$pmem" = "yes" ; then
2456 output_sym "CONFIG_LIBPMEM"
2458 if test "$arith" = "yes" ; then
2459 output_sym "CONFIG_ARITHMETIC"
2460 if test "$yacc_is_bison" = "yes" ; then
2461 echo "YACC=$YACC -y" >> $config_host_mak
2463 echo "YACC=$YACC" >> $config_host_mak
2465 if test "$lex_use_o" = "yes" ; then
2466 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2469 if test "$getmntent" = "yes" ; then
2470 output_sym "CONFIG_GETMNTENT"
2472 if test "$getmntinfo" = "yes" ; then
2473 output_sym "CONFIG_GETMNTINFO"
2475 if test "$getmntinfo_statvfs" = "yes" ; then
2476 output_sym "CONFIG_GETMNTINFO_STATVFS"
2478 if test "$static_assert" = "yes" ; then
2479 output_sym "CONFIG_STATIC_ASSERT"
2481 if test "$have_bool" = "yes" ; then
2482 output_sym "CONFIG_HAVE_BOOL"
2484 if test "$strndup" = "yes" ; then
2485 output_sym "CONFIG_HAVE_STRNDUP"
2487 if test "$disable_opt" = "yes" ; then
2488 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2490 if test "$valgrind_dev" = "yes"; then
2491 output_sym "CONFIG_VALGRIND_DEV"
2493 if test "$zlib" = "no" ; then
2494 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2495 if test "$build_static" = "yes"; then
2496 echo "Note that some distros have separate packages for static libraries."
2499 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2500 output_sym "ARCH_HAVE_CRC_CRYPTO"
2502 if test "$cuda" = "yes" ; then
2503 output_sym "CONFIG_CUDA"
2505 if test "$mkdir_two" = "yes" ; then
2506 output_sym "CONFIG_HAVE_MKDIR_TWO"
2508 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2509 output_sym "CONFIG_BUILD_NATIVE"
2512 echo "LIBS+=$LIBS" >> $config_host_mak
2513 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2514 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2515 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2516 echo "CC=$cc" >> $config_host_mak
2517 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2518 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2520 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2521 cat > Makefile <<EOF
2522 SRCDIR:=`dirname $0`
2523 include \$(SRCDIR)/Makefile