3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
20 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
21 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
22 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
26 config_host_mak="config-host.mak"
27 config_host_h="config-host.h"
29 rm -rf $config_host_mak
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
40 # Print result for each configuration test
42 printf "%-30s%s\n" "$1" "$2"
46 CFLAGS="-D_GNU_SOURCE -include config-host.h"
49 # Print a helpful header at the top of config.log
50 echo "# FIO configure log $(date)" >> config.log
51 printf "# Configured with:" >> config.log
52 printf " '%s'" "$0" "$@" >> config.log
54 echo "#" >> config.log
56 # Print configure header at the top of $config_host_h
57 echo "/*" > $config_host_h
58 echo " * Automatically generated by configure - do not modify" >> $config_host_h
59 printf " * Configured with:" >> $config_host_h
60 printf " * '%s'" "$0" "$@" >> $config_host_h
61 echo "" >> $config_host_h
62 echo " */" >> $config_host_h
65 # Run the compiler, capturing its output to the log.
66 echo $cc "$@" >> config.log
67 $cc "$@" >> config.log 2>&1 || return $?
68 # Test passed. If this is an --enable-werror build, rerun
69 # the test with -Werror and bail out if it fails. This
70 # makes warning-generating-errors in configure test code
71 # obvious to developers.
72 if test "$werror" != "yes"; then
75 # Don't bother rerunning the compile if we were already using -Werror
81 echo $cc -Werror "$@" >> config.log
82 $cc -Werror "$@" >> config.log 2>&1 && return $?
83 echo "ERROR: configure test passed without -Werror but failed with -Werror."
84 echo "This is probably a bug in the configure script. The failing command"
85 echo "will be at the bottom of config.log."
86 fatal "You can run configure with --disable-werror to bypass this check."
90 do_cc $CFLAGS -c -o $TMPO $TMPC
95 local_ldflags="$2 $LIBS"
96 echo "Compiling test case $3" >> config.log
97 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 feature_not_found() {
105 echo "ERROR: User requested feature $feature"
106 if test ! -z "$packages" ; then
107 echo "ERROR: That feature needs $packages installed"
109 echo "ERROR: configure was not able to find it"
114 type "$1" >/dev/null 2>&1
120 #error $1 not defined
131 echo "$1=y" >> $config_host_mak
132 echo "#define $1" >> $config_host_h
154 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
156 --prefix=*) prefix="$optarg"
158 --cpu=*) cpu="$optarg"
160 # esx is cross compiled and cannot be detect through simple uname calls
166 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
168 --build-32bit-win) build_32bit_win="yes"
170 --target-win-ver=*) target_win_ver="$optarg"
172 --build-static) build_static="yes"
174 --enable-gfio) gfio_check="yes"
176 --disable-numa) disable_numa="yes"
178 --disable-rdma) disable_rdma="yes"
180 --disable-rados) disable_rados="yes"
182 --disable-rbd) disable_rbd="yes"
184 --disable-gfapi) disable_gfapi="yes"
186 --enable-libhdfs) libhdfs="yes"
188 --disable-lex) disable_lex="yes"
190 --enable-lex) disable_lex="no"
192 --disable-shm) no_shm="yes"
194 --disable-optimizations) disable_opt="yes"
196 --disable-pmem) disable_pmem="yes"
198 --enable-cuda) enable_cuda="yes"
200 --disable-native) disable_native="yes"
206 echo "Bad option $opt"
212 if test "$show_help" = "yes" ; then
213 echo "--prefix= Use this directory as installation prefix"
214 echo "--cpu= Specify target CPU if auto-detect fails"
215 echo "--cc= Specify compiler to use"
216 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
217 echo "--build-32bit-win Enable 32-bit build on Windows"
218 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
219 echo "--build-static Build a static fio"
220 echo "--esx Configure build options for esx"
221 echo "--enable-gfio Enable building of gtk gfio"
222 echo "--disable-numa Disable libnuma even if found"
223 echo "--disable-rdma Disable RDMA support even if found"
224 echo "--disable-gfapi Disable gfapi"
225 echo "--enable-libhdfs Enable hdfs support"
226 echo "--disable-lex Disable use of lex/yacc for math"
227 echo "--disable-pmem Disable pmem based engines even if found"
228 echo "--enable-lex Enable use of lex/yacc for math"
229 echo "--disable-shm Disable SHM support"
230 echo "--disable-optimizations Don't enable compiler optimizations"
231 echo "--enable-cuda Enable GPUDirect RDMA support"
232 echo "--disable-native Don't build for native host"
236 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
237 # Preferred compiler (can be overriden later after we know the platform):
239 # ${cross_prefix}gcc (if cross-prefix specified)
242 if test -z "${CC}${cross_prefix}"; then
249 cc="${CC-${cross_prefix}gcc}"
252 if check_define __ANDROID__ ; then
254 elif check_define __linux__ ; then
256 elif check_define __OpenBSD__ ; then
258 elif check_define __NetBSD__ ; then
260 elif check_define __sun__ ; then
262 CFLAGS="$CFLAGS -D_REENTRANT"
263 elif check_define _WIN32 ; then
269 echo "# Automatically generated by configure - do not modify" > $config_host_mak
270 printf "# Configured with:" >> $config_host_mak
271 printf " '%s'" "$0" "$@" >> $config_host_mak
272 echo >> $config_host_mak
273 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
275 if test "$no_shm" = "yes" ; then
276 output_sym "CONFIG_NO_SHM"
279 if test "$disable_opt" = "yes" ; then
280 output_sym "CONFIG_FIO_NO_OPT"
283 # Some host OSes need non-standard checks for which CPU to use.
284 # Note that these checks are broken for cross-compilation: if you're
285 # cross-compiling to one of these OSes then you'll need to specify
286 # the correct CPU with the --cpu option.
289 # Unless explicitly enabled, turn off lex.
290 # OpenBSD will hit syntax error when enabled.
291 if test -z "$disable_lex" ; then
298 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
299 # we can run 64-bit userspace code.
300 # If the user didn't specify a CPU explicitly and the kernel says this is
301 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
303 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
306 # Error at compile time linking of weak/partial symbols if possible...
313 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
314 echo "Disabling weak symbols"
315 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
319 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
320 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
323 LIBS="-lnsl -lsocket"
326 # We still force some options, so keep this message here.
327 echo "Forcing some known good options on Windows"
328 if test -z "${CC}${cross_prefix}"; then
329 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
330 cc="i686-w64-mingw32-gcc"
332 cc="x86_64-w64-mingw32-gcc"
335 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
336 output_sym "CONFIG_32BIT"
338 output_sym "CONFIG_64BIT_LLP64"
340 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
341 if test -z "$target_win_ver"; then
342 # Default Windows API target
345 if test "$target_win_ver" = "XP"; then
346 output_sym "CONFIG_WINDOWS_XP"
347 elif test "$target_win_ver" = "7"; then
348 output_sym "CONFIG_WINDOWS_7"
349 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
351 fatal "Unknown target Windows version"
354 # We need this to be output_sym'd here because this is Windows specific.
355 # The regular configure path never sets this config.
356 output_sym "CONFIG_WINDOWSAIO"
357 # We now take the regular configuration path without having exit 0 here.
358 # Flags below are still necessary mostly for MinGW.
365 clock_gettime="yes" # clock_monotonic probe has dependency on this
366 clock_monotonic="yes"
374 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
378 # Now we know the target platform we can have another guess at the preferred
379 # compiler when it wasn't explictly set
380 if test -z "${CC}${cross_prefix}"; then
381 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
387 if test -z "$cc"; then
388 echo "configure: failed to find compiler"
392 if test ! -z "$cpu" ; then
393 # command line argument
395 elif check_define __i386__ ; then
397 elif check_define __x86_64__ ; then
399 elif check_define __sparc__ ; then
400 if check_define __arch64__ ; then
405 elif check_define _ARCH_PPC ; then
406 if check_define _ARCH_PPC64 ; then
411 elif check_define __mips__ ; then
413 elif check_define __ia64__ ; then
415 elif check_define __s390__ ; then
416 if check_define __s390x__ ; then
421 elif check_define __arm__ ; then
423 elif check_define __aarch64__ ; then
425 elif check_define __hppa__ ; then
431 # Normalise host CPU name and set ARCH.
433 ia64|ppc|ppc64|s390|s390x|sparc64)
436 i386|i486|i586|i686|i86pc|BePC)
448 hppa|parisc|parisc64)
462 ##########################################
463 # check cross compile
465 if test "$cross_compile" != "yes" ; then
474 if compile_prog "" "" "cross"; then
475 $TMPE 2>/dev/null || cross_compile="yes"
477 fatal "compile test failed"
480 ##########################################
482 if test "$bigendian" != "yes" ; then
485 if test "$cross_compile" = "no" ; then
487 #include <inttypes.h>
490 volatile uint32_t i=0x01234567;
491 return (*((uint8_t*)(&i))) == 0x67;
494 if compile_prog "" "" "endian"; then
495 $TMPE && bigendian="yes"
498 # If we're cross compiling, try our best to work it out and rely on the
499 # run-time check to fail if we get it wrong.
504 #if __BYTE_ORDER != __BIG_ENDIAN
505 # error "Unknown endianness"
509 compile_prog "" "" "endian" && bigendian="yes"
510 check_define "__ARMEB__" && bigendian="yes"
511 check_define "__MIPSEB__" && bigendian="yes"
515 print_config "Operating system" "$targetos"
516 print_config "CPU" "$cpu"
517 print_config "Big endian" "$bigendian"
518 if test ! -z "$target_win_ver"; then
519 print_config "Target Windows version" "$target_win_ver"
521 print_config "Compiler" "$cc"
522 print_config "Cross compile" "$cross_compile"
525 ##########################################
526 # See if we need to build a static build
527 if test "$build_static" = "yes" ; then
528 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
529 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
533 print_config "Static build" "$build_static"
535 ##########################################
540 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
543 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
547 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
549 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
552 fatal "Unknown wordsize"
554 print_config "Wordsize" "$wordsize"
556 ##########################################
558 if test "$zlib" != "yes" ; then
566 if (inflateInit(&stream) != Z_OK)
571 if compile_prog "" "-lz" "zlib" ; then
575 print_config "zlib" "$zlib"
577 ##########################################
579 if test "$libaio" != "yes" ; then
582 if test "$esx" != "yes" ; then
592 if compile_prog "" "-laio" "libaio" ; then
596 if test "$libaio" = "yes" ; then
597 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
602 print_config "Linux AIO support" "$libaio"
604 ##########################################
606 if test "$posix_aio" != "yes" ; then
609 if test "$posix_aio_lrt" != "yes" ; then
621 if compile_prog "" "" "posixaio" ; then
623 elif compile_prog "" "-lrt" "posixaio"; then
628 print_config "POSIX AIO support" "$posix_aio"
629 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
631 ##########################################
632 # posix aio fsync probe
633 if test "$posix_aio_fsync" != "yes" ; then
636 if test "$posix_aio" = "yes" ; then
643 return aio_fsync(O_SYNC, &cb);
647 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
651 print_config "POSIX AIO fsync" "$posix_aio_fsync"
653 ##########################################
654 # POSIX pshared attribute probe
655 if test "$posix_pshared" != "yes" ; then
662 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
663 # if defined(__CYGWIN__)
664 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
665 # elif defined(__APPLE__)
666 # include <AvailabilityMacros.h>
667 # include <TargetConditionals.h>
668 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
669 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
673 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
678 if compile_prog "" "$LIBS" "posix_pshared" ; then
681 print_config "POSIX pshared support" "$posix_pshared"
683 ##########################################
685 if test "$solaris_aio" != "yes" ; then
689 #include <sys/types.h>
690 #include <sys/asynch.h>
695 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
699 if compile_prog "" "-laio" "solarisaio" ; then
703 print_config "Solaris AIO support" "$solaris_aio"
705 ##########################################
706 # __sync_fetch_and_add test
707 if test "$sfaa" != "yes" ; then
711 #include <inttypes.h>
712 static int sfaa(uint64_t *ptr)
714 return __sync_fetch_and_add(ptr, 0);
717 int main(int argc, char **argv)
724 if compile_prog "" "" "__sync_fetch_and_add()" ; then
727 print_config "__sync_fetch_and_add" "$sfaa"
729 ##########################################
730 # __sync_synchronize() test
731 if test "$sync_sync" != "yes" ; then
735 #include <inttypes.h>
737 int main(int argc, char **argv)
739 __sync_synchronize();
743 if compile_prog "" "" "__sync_synchronize()" ; then
746 print_config "__sync_synchronize" "$sync_sync"
748 ##########################################
749 # __sync_val_compare_and_swap() test
750 if test "$cmp_swap" != "yes" ; then
754 #include <inttypes.h>
756 int main(int argc, char **argv)
759 return __sync_val_compare_and_swap(&x, 1, 2);
762 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
765 print_config "__sync_val_compare_and_swap" "$cmp_swap"
767 ##########################################
769 if test "$libverbs" != "yes" ; then
773 #include <infiniband/verbs.h>
774 int main(int argc, char **argv)
776 struct ibv_pd *pd = ibv_alloc_pd(NULL);
780 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
782 LIBS="-libverbs $LIBS"
784 print_config "libverbs" "$libverbs"
786 ##########################################
788 if test "$rdmacm" != "yes" ; then
793 #include <rdma/rdma_cma.h>
794 int main(int argc, char **argv)
796 rdma_destroy_qp(NULL);
800 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
802 LIBS="-lrdmacm $LIBS"
804 print_config "rdmacm" "$rdmacm"
806 ##########################################
807 # asprintf() and vasprintf() probes
808 if test "$have_asprintf" != "yes" ; then
814 int main(int argc, char **argv)
816 return asprintf(NULL, "%s", "str") == 0;
819 if compile_prog "" "" "have_asprintf"; then
822 print_config "asprintf()" "$have_asprintf"
824 if test "$have_vasprintf" != "yes" ; then
830 int main(int argc, char **argv)
832 return vasprintf(NULL, "%s", NULL) == 0;
835 if compile_prog "" "" "have_vasprintf"; then
838 print_config "vasprintf()" "$have_vasprintf"
840 ##########################################
841 # Linux fallocate probe
842 if test "$linux_fallocate" != "yes" ; then
848 #include <linux/falloc.h>
849 int main(int argc, char **argv)
851 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
855 if compile_prog "" "" "linux_fallocate"; then
856 linux_fallocate="yes"
858 print_config "Linux fallocate" "$linux_fallocate"
860 ##########################################
861 # POSIX fadvise probe
862 if test "$posix_fadvise" != "yes" ; then
868 int main(int argc, char **argv)
870 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
874 if compile_prog "" "" "posix_fadvise"; then
877 print_config "POSIX fadvise" "$posix_fadvise"
879 ##########################################
880 # POSIX fallocate probe
881 if test "$posix_fallocate" != "yes" ; then
887 int main(int argc, char **argv)
889 int r = posix_fallocate(0, 0, 1024);
893 if compile_prog "" "" "posix_fallocate"; then
894 posix_fallocate="yes"
896 print_config "POSIX fallocate" "$posix_fallocate"
898 ##########################################
899 # sched_set/getaffinity 2 or 3 argument test
900 if test "$linux_2arg_affinity" != "yes" ; then
901 linux_2arg_affinity="no"
903 if test "$linux_3arg_affinity" != "yes" ; then
904 linux_3arg_affinity="no"
908 int main(int argc, char **argv)
911 return sched_setaffinity(0, sizeof(mask), &mask);
914 if compile_prog "" "" "sched_setaffinity(,,)"; then
915 linux_3arg_affinity="yes"
919 int main(int argc, char **argv)
922 return sched_setaffinity(0, &mask);
925 if compile_prog "" "" "sched_setaffinity(,)"; then
926 linux_2arg_affinity="yes"
929 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
930 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
932 ##########################################
933 # clock_gettime probe
934 if test "$clock_gettime" != "yes" ; then
940 int main(int argc, char **argv)
942 return clock_gettime(0, NULL);
945 if compile_prog "" "" "clock_gettime"; then
947 elif compile_prog "" "-lrt" "clock_gettime"; then
951 print_config "clock_gettime" "$clock_gettime"
953 ##########################################
954 # CLOCK_MONOTONIC probe
955 if test "$clock_monotonic" != "yes" ; then
958 if test "$clock_gettime" = "yes" ; then
962 int main(int argc, char **argv)
964 return clock_gettime(CLOCK_MONOTONIC, NULL);
967 if compile_prog "" "$LIBS" "clock monotonic"; then
968 clock_monotonic="yes"
971 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
973 ##########################################
974 # CLOCK_MONOTONIC_RAW probe
975 if test "$clock_monotonic_raw" != "yes" ; then
976 clock_monotonic_raw="no"
978 if test "$clock_gettime" = "yes" ; then
982 int main(int argc, char **argv)
984 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
987 if compile_prog "" "$LIBS" "clock monotonic"; then
988 clock_monotonic_raw="yes"
991 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
993 ##########################################
994 # CLOCK_MONOTONIC_PRECISE probe
995 if test "$clock_monotonic_precise" != "yes" ; then
996 clock_monotonic_precise="no"
998 if test "$clock_gettime" = "yes" ; then
1002 int main(int argc, char **argv)
1004 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
1007 if compile_prog "" "$LIBS" "clock monotonic precise"; then
1008 clock_monotonic_precise="yes"
1011 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1013 ##########################################
1015 if test "$clockid_t" != "yes" ; then
1021 int main(int argc, char **argv)
1023 volatile clockid_t cid;
1024 memset((void*)&cid, 0, sizeof(cid));
1028 if compile_prog "" "$LIBS" "clockid_t"; then
1031 print_config "clockid_t" "$clockid_t"
1033 ##########################################
1034 # gettimeofday() probe
1035 if test "$gettimeofday" != "yes" ; then
1039 #include <sys/time.h>
1041 int main(int argc, char **argv)
1044 return gettimeofday(&tv, NULL);
1047 if compile_prog "" "" "gettimeofday"; then
1050 print_config "gettimeofday" "$gettimeofday"
1052 ##########################################
1054 if test "$fdatasync" != "yes" ; then
1060 int main(int argc, char **argv)
1062 return fdatasync(0);
1065 if compile_prog "" "" "fdatasync"; then
1068 print_config "fdatasync" "$fdatasync"
1070 ##########################################
1071 # sync_file_range() probe
1072 if test "$sync_file_range" != "yes" ; then
1073 sync_file_range="no"
1079 #include <linux/fs.h>
1080 int main(int argc, char **argv)
1082 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1083 SYNC_FILE_RANGE_WAIT_AFTER;
1084 return sync_file_range(0, 0, 0, flags);
1087 if compile_prog "" "" "sync_file_range"; then
1088 sync_file_range="yes"
1090 print_config "sync_file_range" "$sync_file_range"
1092 ##########################################
1093 # ext4 move extent probe
1094 if test "$ext4_me" != "yes" ; then
1099 #include <sys/ioctl.h>
1100 int main(int argc, char **argv)
1102 struct move_extent me;
1103 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1106 if compile_prog "" "" "ext4 move extent" ; then
1108 elif test $targetos = "Linux" ; then
1109 # On Linux, just default to it on and let it error at runtime if we really
1110 # don't have it. None of my updated systems have it defined, but it does
1111 # work. Takes a while to bubble back.
1114 print_config "EXT4 move extent" "$ext4_me"
1116 ##########################################
1118 if test "$linux_splice" != "yes" ; then
1124 int main(int argc, char **argv)
1126 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1129 if compile_prog "" "" "linux splice"; then
1132 print_config "Linux splice(2)" "$linux_splice"
1134 ##########################################
1136 if test "$guasi" != "yes" ; then
1141 #include <guasi_syscalls.h>
1142 int main(int argc, char **argv)
1144 guasi_t ctx = guasi_create(0, 0, 0);
1148 if compile_prog "" "" "guasi"; then
1151 print_config "GUASI" "$guasi"
1153 ##########################################
1155 if test "$fusion_aw" != "yes" ; then
1159 #include <nvm/nvm_primitives.h>
1160 int main(int argc, char **argv)
1162 nvm_version_t ver_info;
1163 nvm_handle_t handle;
1165 handle = nvm_get_handle(0, &ver_info);
1166 return nvm_atomic_write(handle, 0, 0, 0);
1169 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1170 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1173 print_config "Fusion-io atomic engine" "$fusion_aw"
1175 ##########################################
1177 if test "$libnuma" != "yes" ; then
1182 int main(int argc, char **argv)
1184 return numa_available();
1187 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1191 print_config "libnuma" "$libnuma"
1193 ##########################################
1194 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1195 if test "$libnuma" = "yes" ; then
1199 int main(int argc, char **argv)
1201 struct bitmask *mask = numa_parse_nodestring(NULL);
1202 return mask->size == 0;
1205 if compile_prog "" "" "libnuma api"; then
1208 print_config "libnuma v2" "$libnuma_v2"
1211 ##########################################
1213 if test "$strsep" != "yes" ; then
1218 int main(int argc, char **argv)
1220 static char *string = "This is a string";
1221 strsep(&string, "needle");
1225 if compile_prog "" "" "strsep"; then
1228 print_config "strsep" "$strsep"
1230 ##########################################
1231 # strcasestr() probe
1232 if test "$strcasestr" != "yes" ; then
1237 int main(int argc, char **argv)
1239 return strcasestr(argv[0], argv[1]) != NULL;
1242 if compile_prog "" "" "strcasestr"; then
1245 print_config "strcasestr" "$strcasestr"
1247 ##########################################
1249 if test "$strlcat" != "yes" ; then
1254 int main(int argc, char **argv)
1256 static char dst[64];
1257 static char *string = "This is a string";
1258 memset(dst, 0, sizeof(dst));
1259 strlcat(dst, string, sizeof(dst));
1263 if compile_prog "" "" "strlcat"; then
1266 print_config "strlcat" "$strlcat"
1268 ##########################################
1269 # getopt_long_only() probe
1270 if test "$getopt_long_only" != "yes" ; then
1271 getopt_long_only="no"
1277 int main(int argc, char **argv)
1279 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1283 if compile_prog "" "" "getopt_long_only"; then
1284 getopt_long_only="yes"
1286 print_config "getopt_long_only()" "$getopt_long_only"
1288 ##########################################
1290 if test "$inet_aton" != "yes" ; then
1294 #include <sys/socket.h>
1295 #include <arpa/inet.h>
1297 int main(int argc, char **argv)
1300 return inet_aton(NULL, &in);
1303 if compile_prog "" "" "inet_aton"; then
1306 print_config "inet_aton" "$inet_aton"
1308 ##########################################
1310 if test "$socklen_t" != "yes" ; then
1314 #include <sys/socket.h>
1315 int main(int argc, char **argv)
1321 if compile_prog "" "" "socklen_t"; then
1324 print_config "socklen_t" "$socklen_t"
1326 ##########################################
1327 # Whether or not __thread is supported for TLS
1328 if test "$tls_thread" != "yes" ; then
1333 static __thread int ret;
1334 int main(int argc, char **argv)
1339 if compile_prog "" "" "__thread"; then
1342 print_config "__thread" "$tls_thread"
1344 ##########################################
1345 # Check if we have required gtk/glib support for gfio
1346 if test "$gfio" != "yes" ; then
1349 if test "$gfio_check" = "yes" ; then
1353 #include <gtk/gtk.h>
1356 gdk_threads_enter();
1357 gdk_threads_leave();
1359 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1362 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1363 ORG_LDFLAGS=$LDFLAGS
1364 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1365 if test "$?" != "0" ; then
1366 echo "configure: gtk and gthread not found"
1369 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1370 if test "$?" != "0" ; then
1371 echo "configure: gtk and gthread not found"
1374 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1376 if test "$?" = "0" ; then
1378 GFIO_LIBS="$LIBS $GTK_LIBS"
1379 CFLAGS="$CFLAGS $GTK_CFLAGS"
1381 echo "GTK found, but need version 2.18 or higher"
1385 echo "Please install gtk and gdk libraries"
1388 LDFLAGS=$ORG_LDFLAGS
1391 if test "$gfio_check" = "yes" ; then
1392 print_config "gtk 2.18 or higher" "$gfio"
1395 ##########################################
1396 # Check whether we have getrusage(RUSAGE_THREAD)
1397 if test "$rusage_thread" != "yes" ; then
1401 #include <sys/time.h>
1402 #include <sys/resource.h>
1403 int main(int argc, char **argv)
1406 getrusage(RUSAGE_THREAD, &ru);
1410 if compile_prog "" "" "RUSAGE_THREAD"; then
1413 print_config "RUSAGE_THREAD" "$rusage_thread"
1415 ##########################################
1416 # Check whether we have SCHED_IDLE
1417 if test "$sched_idle" != "yes" ; then
1422 int main(int argc, char **argv)
1424 struct sched_param p;
1425 return sched_setscheduler(0, SCHED_IDLE, &p);
1428 if compile_prog "" "" "SCHED_IDLE"; then
1431 print_config "SCHED_IDLE" "$sched_idle"
1433 ##########################################
1434 # Check whether we have TCP_NODELAY
1435 if test "$tcp_nodelay" != "yes" ; then
1440 #include <sys/types.h>
1441 #include <sys/socket.h>
1442 #include <netinet/tcp.h>
1443 int main(int argc, char **argv)
1445 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1448 if compile_prog "" "" "TCP_NODELAY"; then
1451 print_config "TCP_NODELAY" "$tcp_nodelay"
1453 ##########################################
1454 # Check whether we have SO_SNDBUF
1455 if test "$window_size" != "yes" ; then
1460 #include <sys/types.h>
1461 #include <sys/socket.h>
1462 #include <netinet/tcp.h>
1463 int main(int argc, char **argv)
1465 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1466 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1469 if compile_prog "" "" "SO_SNDBUF"; then
1472 print_config "Net engine window_size" "$window_size"
1474 ##########################################
1475 # Check whether we have TCP_MAXSEG
1476 if test "$mss" != "yes" ; then
1481 #include <sys/types.h>
1482 #include <sys/socket.h>
1483 #include <netinet/tcp.h>
1484 #include <arpa/inet.h>
1485 #include <netinet/in.h>
1486 int main(int argc, char **argv)
1488 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1491 if compile_prog "" "" "TCP_MAXSEG"; then
1494 print_config "TCP_MAXSEG" "$mss"
1496 ##########################################
1497 # Check whether we have RLIMIT_MEMLOCK
1498 if test "$rlimit_memlock" != "yes" ; then
1502 #include <sys/time.h>
1503 #include <sys/resource.h>
1504 int main(int argc, char **argv)
1507 return getrlimit(RLIMIT_MEMLOCK, &rl);
1510 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1511 rlimit_memlock="yes"
1513 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1515 ##########################################
1516 # Check whether we have pwritev/preadv
1517 if test "$pwritev" != "yes" ; then
1522 #include <sys/uio.h>
1523 int main(int argc, char **argv)
1525 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1528 if compile_prog "" "" "pwritev"; then
1531 print_config "pwritev/preadv" "$pwritev"
1533 ##########################################
1534 # Check whether we have pwritev2/preadv2
1535 if test "$pwritev2" != "yes" ; then
1540 #include <sys/uio.h>
1541 int main(int argc, char **argv)
1543 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1546 if compile_prog "" "" "pwritev2"; then
1549 print_config "pwritev2/preadv2" "$pwritev2"
1551 ##########################################
1552 # Check whether we have the required functions for ipv6
1553 if test "$ipv6" != "yes" ; then
1557 #include <sys/types.h>
1558 #include <sys/socket.h>
1559 #include <netinet/in.h>
1562 int main(int argc, char **argv)
1564 struct addrinfo hints;
1565 struct in6_addr addr;
1568 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1570 printf("%s\n", gai_strerror(ret));
1575 if compile_prog "" "" "ipv6"; then
1578 print_config "IPv6 helpers" "$ipv6"
1580 ##########################################
1582 if test "$rados" != "yes" ; then
1586 #include <rados/librados.h>
1588 int main(int argc, char **argv)
1591 rados_ioctx_t io_ctx;
1592 const char cluster_name[] = "ceph";
1593 const char user_name[] = "client.admin";
1594 const char pool[] = "rados";
1596 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1597 rados_create2(&cluster, cluster_name, user_name, 0);
1598 rados_ioctx_create(cluster, pool, &io_ctx);
1603 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1604 LIBS="-lrados $LIBS"
1607 print_config "Rados engine" "$rados"
1609 ##########################################
1611 if test "$rbd" != "yes" ; then
1615 #include <rbd/librbd.h>
1617 int main(int argc, char **argv)
1620 rados_ioctx_t io_ctx;
1621 const char cluster_name[] = "ceph";
1622 const char user_name[] = "client.admin";
1623 const char pool[] = "rbd";
1624 int major, minor, extra;
1626 rbd_version(&major, &minor, &extra);
1627 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1628 rados_create2(&cluster, cluster_name, user_name, 0);
1629 rados_ioctx_create(cluster, pool, &io_ctx);
1634 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1635 LIBS="-lrbd -lrados $LIBS"
1638 print_config "Rados Block Device engine" "$rbd"
1640 ##########################################
1641 # check for rbd_poll
1642 if test "$rbd_poll" != "yes" ; then
1645 if test "$rbd" = "yes"; then
1647 #include <rbd/librbd.h>
1648 #include <sys/eventfd.h>
1650 int main(int argc, char **argv)
1653 rbd_completion_t comp;
1655 int fd = eventfd(0, EFD_NONBLOCK);
1656 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1657 rbd_poll_io_events(image, comp, 1);
1662 if compile_prog "" "-lrbd -lrados" "rbd"; then
1665 print_config "rbd_poll" "$rbd_poll"
1668 ##########################################
1669 # check for rbd_invalidate_cache()
1670 if test "$rbd_inval" != "yes" ; then
1673 if test "$rbd" = "yes"; then
1675 #include <rbd/librbd.h>
1677 int main(int argc, char **argv)
1681 return rbd_invalidate_cache(image);
1684 if compile_prog "" "-lrbd -lrados" "rbd"; then
1687 print_config "rbd_invalidate_cache" "$rbd_inval"
1690 ##########################################
1691 # Check whether we have setvbuf
1692 if test "$setvbuf" != "yes" ; then
1697 int main(int argc, char **argv)
1701 setvbuf(f, buf, _IOFBF, sizeof(buf));
1705 if compile_prog "" "" "setvbuf"; then
1708 print_config "setvbuf" "$setvbuf"
1710 ##########################################
1712 if test "$gfapi" != "yes" ; then
1716 #include <glusterfs/api/glfs.h>
1718 int main(int argc, char **argv)
1720 glfs_t *g = glfs_new("foo");
1725 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1726 LIBS="-lgfapi -lglusterfs $LIBS"
1729 print_config "Gluster API engine" "$gfapi"
1731 ##########################################
1732 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1733 if test "$gfapi" = "yes" ; then
1736 #include <glusterfs/api/glfs.h>
1738 int main(int argc, char **argv)
1741 int ret = glfs_fadvise(fd, 0, 0, 1);
1746 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1749 print_config "Gluster API use fadvise" "$gf_fadvise"
1752 ##########################################
1753 # check for gfapi trim support
1754 if test "$gf_trim" != "yes" ; then
1757 if test "$gfapi" = "yes" ; then
1759 #include <glusterfs/api/glfs.h>
1761 int main(int argc, char **argv)
1763 return glfs_discard_async(NULL, 0, 0);
1766 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1769 print_config "Gluster API trim support" "$gf_trim"
1772 ##########################################
1773 # Check if we support stckf on s390
1774 if test "$s390_z196_facilities" != "yes" ; then
1775 s390_z196_facilities="no"
1778 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1779 int main(int argc, char **argv)
1781 /* We want just 1 double word to be returned. */
1782 register unsigned long reg0 asm("0") = 0;
1783 unsigned long stfle_bits;
1784 asm volatile(".machine push" "\n\t"
1785 ".machine \"z9-109\"" "\n\t"
1788 : "=QS" (stfle_bits), "+d" (reg0)
1791 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1797 if compile_prog "" "" "s390_z196_facilities"; then
1799 if [ $? -eq 0 ]; then
1800 s390_z196_facilities="yes"
1803 print_config "s390_z196_facilities" "$s390_z196_facilities"
1805 ##########################################
1806 # Check if we have required environment variables configured for libhdfs
1807 if test "$libhdfs" = "yes" ; then
1809 if test "$JAVA_HOME" = "" ; then
1810 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1813 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1814 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1817 if test "$FIO_LIBHDFS_LIB" = "" ; then
1818 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1821 if test "$hdfs_conf_error" = "1" ; then
1825 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1826 FIO_HDFS_CPU="amd64"
1829 print_config "HDFS engine" "$libhdfs"
1831 ##########################################
1832 # Check whether we have MTD
1833 if test "$mtd" != "yes" ; then
1838 #include <mtd/mtd-user.h>
1839 #include <sys/ioctl.h>
1840 int main(int argc, char **argv)
1842 struct mtd_write_req ops;
1843 struct mtd_info_user info;
1844 memset(&ops, 0, sizeof(ops));
1845 info.type = MTD_MLCNANDFLASH;
1846 return ioctl(0, MEMGETINFO, &info);
1849 if compile_prog "" "" "mtd"; then
1852 print_config "MTD" "$mtd"
1854 ##########################################
1855 # Check whether we have libpmem
1856 if test "$libpmem" != "yes" ; then
1860 #include <libpmem.h>
1861 int main(int argc, char **argv)
1864 rc = pmem_is_pmem(0, 0);
1868 if compile_prog "" "-lpmem" "libpmem"; then
1872 print_config "libpmem" "$libpmem"
1874 ##########################################
1875 # Check whether we have libpmemblk
1876 # libpmem is a prerequisite
1877 if test "$libpmemblk" != "yes" ; then
1880 if test "$libpmem" = "yes"; then
1882 #include <libpmemblk.h>
1883 int main(int argc, char **argv)
1886 pbp = pmemblk_open("", 0);
1890 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1892 LIBS="-lpmemblk $LIBS"
1895 print_config "libpmemblk" "$libpmemblk"
1897 # Choose the ioengines
1898 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1901 if test "$libpmemblk" = "yes"; then
1906 ##########################################
1907 # Report whether pmemblk engine is enabled
1908 print_config "NVML pmemblk engine" "$pmemblk"
1910 ##########################################
1911 # Report whether dev-dax engine is enabled
1912 print_config "NVML dev-dax engine" "$devdax"
1914 ##########################################
1915 # Report whether libpmem engine is enabled
1916 print_config "NVML libpmem engine" "$pmem"
1918 ##########################################
1919 # Check if we have lex/yacc available
1924 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1925 if test "$targetos" != "SunOS" ; then
1926 LEX=$(which lex 2> /dev/null)
1927 if test -x "$LEX" ; then
1930 YACC=$(which bison 2> /dev/null)
1931 if test -x "$YACC" ; then
1935 YACC=$(which yacc 2> /dev/null)
1936 if test -x "$YACC" ; then
1940 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1944 if test "$arith" = "yes" ; then
1946 extern int yywrap(void);
1948 int main(int argc, char **argv)
1954 if compile_prog "" "-ll" "lex"; then
1963 # Check if lex fails using -o
1964 if test "$arith" = "yes" ; then
1965 if test "$force_no_lex_o" = "yes" ; then
1968 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1969 if test "$?" = "0" ; then
1977 print_config "lex/yacc for arithmetic" "$arith"
1979 ##########################################
1980 # Check whether we have setmntent/getmntent
1981 if test "$getmntent" != "yes" ; then
1987 int main(int argc, char **argv)
1989 FILE *mtab = setmntent(NULL, "r");
1990 struct mntent *mnt = getmntent(mtab);
1995 if compile_prog "" "" "getmntent"; then
1998 print_config "getmntent" "$getmntent"
2000 ##########################################
2001 # Check whether we have getmntinfo
2002 # These are originally added for BSDs, but may also work
2003 # on other operating systems with getmntinfo(3).
2005 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2006 # Note that NetBSD needs -Werror to catch warning as error.
2007 if test "$getmntinfo" != "yes" ; then
2012 #include <sys/param.h>
2013 #include <sys/mount.h>
2014 int main(int argc, char **argv)
2017 return getmntinfo(&st, MNT_NOWAIT);
2020 if compile_prog "-Werror" "" "getmntinfo"; then
2023 print_config "getmntinfo" "$getmntinfo"
2025 # getmntinfo(3) for NetBSD.
2026 if test "$getmntinfo_statvfs" != "yes" ; then
2027 getmntinfo_statvfs="no"
2031 #include <sys/statvfs.h>
2032 int main(int argc, char **argv)
2035 return getmntinfo(&st, MNT_NOWAIT);
2038 # Skip the test if the one with statfs arg is detected.
2039 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2040 getmntinfo_statvfs="yes"
2041 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2044 ##########################################
2045 # Check whether we have _Static_assert
2046 if test "$static_assert" != "yes" ; then
2058 int main(int argc, char **argv)
2060 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2064 if compile_prog "" "" "static_assert"; then
2067 print_config "Static Assert" "$static_assert"
2069 ##########################################
2070 # Check whether we have bool / stdbool.h
2071 if test "$have_bool" != "yes" ; then
2075 #include <stdbool.h>
2076 int main(int argc, char **argv)
2079 return var != false;
2082 if compile_prog "" "" "bool"; then
2085 print_config "bool" "$have_bool"
2087 ##########################################
2088 # Check whether we have strndup()
2093 int main(int argc, char **argv)
2095 char *res = strndup("test string", 8);
2101 if compile_prog "" "" "strndup"; then
2104 print_config "strndup" "$strndup"
2106 ##########################################
2107 # <valgrind/drd.h> probe
2108 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2109 # also available but not the other way around.
2110 if test "$valgrind_dev" != "yes" ; then
2114 #include <valgrind/drd.h>
2115 int main(int argc, char **argv)
2120 if compile_prog "" "" "valgrind_dev"; then
2123 print_config "Valgrind headers" "$valgrind_dev"
2125 # check march=armv8-a+crc+crypto
2126 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2127 march_armv8_a_crc_crypto="no"
2129 if test "$cpu" = "arm64" ; then
2131 #include <sys/auxv.h>
2132 #include <arm_acle.h>
2133 #include <arm_neon.h>
2140 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2141 march_armv8_a_crc_crypto="yes"
2142 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2146 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2148 ##########################################
2150 if test "$cuda" != "yes" ; then
2155 int main(int argc, char **argv)
2160 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2164 print_config "cuda" "$cuda"
2166 ##########################################
2167 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2170 #include <sys/stat.h>
2171 #include <sys/types.h>
2172 int main(int argc, char **argv)
2174 return mkdir("/tmp/bla", 0600);
2177 if compile_prog "" "" "mkdir(a, b)"; then
2180 print_config "mkdir(a, b)" "$mkdir_two"
2182 ##########################################
2183 # check for cc -march=native
2186 int main(int argc, char **argv)
2191 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2192 compile_prog "-march=native" "" "march=native"; then
2195 print_config "Build march=native" "$build_native"
2197 #############################################################################
2199 if test "$wordsize" = "64" ; then
2200 output_sym "CONFIG_64BIT"
2201 elif test "$wordsize" = "32" ; then
2202 output_sym "CONFIG_32BIT"
2204 fatal "Unknown wordsize!"
2206 if test "$bigendian" = "yes" ; then
2207 output_sym "CONFIG_BIG_ENDIAN"
2209 output_sym "CONFIG_LITTLE_ENDIAN"
2211 if test "$zlib" = "yes" ; then
2212 output_sym "CONFIG_ZLIB"
2214 if test "$libaio" = "yes" ; then
2215 output_sym "CONFIG_LIBAIO"
2217 if test "$posix_aio" = "yes" ; then
2218 output_sym "CONFIG_POSIXAIO"
2220 if test "$posix_aio_fsync" = "yes" ; then
2221 output_sym "CONFIG_POSIXAIO_FSYNC"
2223 if test "$posix_pshared" = "yes" ; then
2224 output_sym "CONFIG_PSHARED"
2226 if test "$have_asprintf" = "yes" ; then
2227 output_sym "HAVE_ASPRINTF"
2229 if test "$have_vasprintf" = "yes" ; then
2230 output_sym "HAVE_VASPRINTF"
2232 if test "$linux_fallocate" = "yes" ; then
2233 output_sym "CONFIG_LINUX_FALLOCATE"
2235 if test "$posix_fallocate" = "yes" ; then
2236 output_sym "CONFIG_POSIX_FALLOCATE"
2238 if test "$fdatasync" = "yes" ; then
2239 output_sym "CONFIG_FDATASYNC"
2241 if test "$sync_file_range" = "yes" ; then
2242 output_sym "CONFIG_SYNC_FILE_RANGE"
2244 if test "$sfaa" = "yes" ; then
2245 output_sym "CONFIG_SFAA"
2247 if test "$sync_sync" = "yes" ; then
2248 output_sym "CONFIG_SYNC_SYNC"
2250 if test "$cmp_swap" = "yes" ; then
2251 output_sym "CONFIG_CMP_SWAP"
2253 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2254 output_sym "CONFIG_RDMA"
2256 if test "$clock_gettime" = "yes" ; then
2257 output_sym "CONFIG_CLOCK_GETTIME"
2259 if test "$clock_monotonic" = "yes" ; then
2260 output_sym "CONFIG_CLOCK_MONOTONIC"
2262 if test "$clock_monotonic_raw" = "yes" ; then
2263 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2265 if test "$clock_monotonic_precise" = "yes" ; then
2266 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2268 if test "$clockid_t" = "yes"; then
2269 output_sym "CONFIG_CLOCKID_T"
2271 if test "$gettimeofday" = "yes" ; then
2272 output_sym "CONFIG_GETTIMEOFDAY"
2274 if test "$posix_fadvise" = "yes" ; then
2275 output_sym "CONFIG_POSIX_FADVISE"
2277 if test "$linux_3arg_affinity" = "yes" ; then
2278 output_sym "CONFIG_3ARG_AFFINITY"
2279 elif test "$linux_2arg_affinity" = "yes" ; then
2280 output_sym "CONFIG_2ARG_AFFINITY"
2282 if test "$strsep" = "yes" ; then
2283 output_sym "CONFIG_STRSEP"
2285 if test "$strcasestr" = "yes" ; then
2286 output_sym "CONFIG_STRCASESTR"
2288 if test "$strlcat" = "yes" ; then
2289 output_sym "CONFIG_STRLCAT"
2291 if test "$getopt_long_only" = "yes" ; then
2292 output_sym "CONFIG_GETOPT_LONG_ONLY"
2294 if test "$inet_aton" = "yes" ; then
2295 output_sym "CONFIG_INET_ATON"
2297 if test "$socklen_t" = "yes" ; then
2298 output_sym "CONFIG_SOCKLEN_T"
2300 if test "$ext4_me" = "yes" ; then
2301 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2303 if test "$linux_splice" = "yes" ; then
2304 output_sym "CONFIG_LINUX_SPLICE"
2306 if test "$guasi" = "yes" ; then
2307 output_sym "CONFIG_GUASI"
2309 if test "$fusion_aw" = "yes" ; then
2310 output_sym "CONFIG_FUSION_AW"
2312 if test "$libnuma_v2" = "yes" ; then
2313 output_sym "CONFIG_LIBNUMA"
2315 if test "$solaris_aio" = "yes" ; then
2316 output_sym "CONFIG_SOLARISAIO"
2318 if test "$tls_thread" = "yes" ; then
2319 output_sym "CONFIG_TLS_THREAD"
2321 if test "$rusage_thread" = "yes" ; then
2322 output_sym "CONFIG_RUSAGE_THREAD"
2324 if test "$gfio" = "yes" ; then
2325 output_sym "CONFIG_GFIO"
2327 if test "$esx" = "yes" ; then
2328 output_sym "CONFIG_ESX"
2329 output_sym "CONFIG_NO_SHM"
2331 if test "$sched_idle" = "yes" ; then
2332 output_sym "CONFIG_SCHED_IDLE"
2334 if test "$tcp_nodelay" = "yes" ; then
2335 output_sym "CONFIG_TCP_NODELAY"
2337 if test "$window_size" = "yes" ; then
2338 output_sym "CONFIG_NET_WINDOWSIZE"
2340 if test "$mss" = "yes" ; then
2341 output_sym "CONFIG_NET_MSS"
2343 if test "$rlimit_memlock" = "yes" ; then
2344 output_sym "CONFIG_RLIMIT_MEMLOCK"
2346 if test "$pwritev" = "yes" ; then
2347 output_sym "CONFIG_PWRITEV"
2349 if test "$pwritev2" = "yes" ; then
2350 output_sym "CONFIG_PWRITEV2"
2352 if test "$ipv6" = "yes" ; then
2353 output_sym "CONFIG_IPV6"
2355 if test "$rados" = "yes" ; then
2356 output_sym "CONFIG_RADOS"
2358 if test "$rbd" = "yes" ; then
2359 output_sym "CONFIG_RBD"
2361 if test "$rbd_poll" = "yes" ; then
2362 output_sym "CONFIG_RBD_POLL"
2364 if test "$rbd_inval" = "yes" ; then
2365 output_sym "CONFIG_RBD_INVAL"
2367 if test "$setvbuf" = "yes" ; then
2368 output_sym "CONFIG_SETVBUF"
2370 if test "$s390_z196_facilities" = "yes" ; then
2371 output_sym "CONFIG_S390_Z196_FACILITIES"
2372 CFLAGS="$CFLAGS -march=z9-109"
2375 if test "$gfapi" = "yes" ; then
2376 output_sym "CONFIG_GFAPI"
2378 if test "$gf_fadvise" = "yes" ; then
2379 output_sym "CONFIG_GF_FADVISE"
2381 if test "$gf_trim" = "yes" ; then
2382 output_sym "CONFIG_GF_TRIM"
2384 if test "$libhdfs" = "yes" ; then
2385 output_sym "CONFIG_LIBHDFS"
2386 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2387 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2388 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2389 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2391 if test "$mtd" = "yes" ; then
2392 output_sym "CONFIG_MTD"
2394 if test "$pmemblk" = "yes" ; then
2395 output_sym "CONFIG_PMEMBLK"
2397 if test "$devdax" = "yes" ; then
2398 output_sym "CONFIG_LINUX_DEVDAX"
2400 if test "$pmem" = "yes" ; then
2401 output_sym "CONFIG_LIBPMEM"
2403 if test "$arith" = "yes" ; then
2404 output_sym "CONFIG_ARITHMETIC"
2405 if test "$yacc_is_bison" = "yes" ; then
2406 echo "YACC=$YACC -y" >> $config_host_mak
2408 echo "YACC=$YACC" >> $config_host_mak
2410 if test "$lex_use_o" = "yes" ; then
2411 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2414 if test "$getmntent" = "yes" ; then
2415 output_sym "CONFIG_GETMNTENT"
2417 if test "$getmntinfo" = "yes" ; then
2418 output_sym "CONFIG_GETMNTINFO"
2420 if test "$getmntinfo_statvfs" = "yes" ; then
2421 output_sym "CONFIG_GETMNTINFO_STATVFS"
2423 if test "$static_assert" = "yes" ; then
2424 output_sym "CONFIG_STATIC_ASSERT"
2426 if test "$have_bool" = "yes" ; then
2427 output_sym "CONFIG_HAVE_BOOL"
2429 if test "$strndup" = "yes" ; then
2430 output_sym "CONFIG_HAVE_STRNDUP"
2432 if test "$disable_opt" = "yes" ; then
2433 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2435 if test "$valgrind_dev" = "yes"; then
2436 output_sym "CONFIG_VALGRIND_DEV"
2438 if test "$zlib" = "no" ; then
2439 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2440 if test "$build_static" = "yes"; then
2441 echo "Note that some distros have separate packages for static libraries."
2444 if test "$cuda" = "yes" ; then
2445 output_sym "CONFIG_CUDA"
2447 if test "$mkdir_two" = "yes" ; then
2448 output_sym "CONFIG_HAVE_MKDIR_TWO"
2450 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2451 output_sym "CONFIG_BUILD_NATIVE"
2454 echo "LIBS+=$LIBS" >> $config_host_mak
2455 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2456 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2457 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2458 echo "CC=$cc" >> $config_host_mak
2459 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2460 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2462 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2463 cat > Makefile <<EOF
2464 SRCDIR:=`dirname $0`
2465 include \$(SRCDIR)/Makefile