3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this 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
152 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
154 --prefix=*) prefix="$optarg"
156 --cpu=*) cpu="$optarg"
158 # esx is cross compiled and cannot be detect through simple uname calls
164 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
166 --build-32bit-win) build_32bit_win="yes"
168 --build-static) build_static="yes"
170 --enable-gfio) gfio_check="yes"
172 --disable-numa) disable_numa="yes"
174 --disable-rdma) disable_rdma="yes"
176 --disable-rados) disable_rados="yes"
178 --disable-rbd) disable_rbd="yes"
180 --disable-rbd-blkin) disable_rbd_blkin="yes"
182 --disable-gfapi) disable_gfapi="yes"
184 --enable-libhdfs) libhdfs="yes"
186 --disable-lex) disable_lex="yes"
188 --enable-lex) disable_lex="no"
190 --disable-shm) no_shm="yes"
192 --disable-optimizations) disable_opt="yes"
194 --disable-pmem) disable_pmem="yes"
196 --enable-cuda) enable_cuda="yes"
202 echo "Bad option $opt"
208 if test "$show_help" = "yes" ; then
209 echo "--prefix= Use this directory as installation prefix"
210 echo "--cpu= Specify target CPU if auto-detect fails"
211 echo "--cc= Specify compiler to use"
212 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
213 echo "--build-32bit-win Enable 32-bit build on Windows"
214 echo "--build-static Build a static fio"
215 echo "--esx Configure build options for esx"
216 echo "--enable-gfio Enable building of gtk gfio"
217 echo "--disable-numa Disable libnuma even if found"
218 echo "--disable-rdma Disable RDMA support even if found"
219 echo "--disable-gfapi Disable gfapi"
220 echo "--enable-libhdfs Enable hdfs support"
221 echo "--disable-lex Disable use of lex/yacc for math"
222 echo "--disable-pmem Disable pmem based engines even if found"
223 echo "--enable-lex Enable use of lex/yacc for math"
224 echo "--disable-shm Disable SHM support"
225 echo "--disable-optimizations Don't enable compiler optimizations"
226 echo "--enable-cuda Enable GPUDirect RDMA support"
230 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
231 # Preferred compiler (can be overriden later after we know the platform):
233 # ${cross_prefix}gcc (if cross-prefix specified)
236 if test -z "${CC}${cross_prefix}"; then
243 cc="${CC-${cross_prefix}gcc}"
246 if check_define __ANDROID__ ; then
248 elif check_define __linux__ ; then
250 elif check_define __OpenBSD__ ; then
252 elif check_define __sun__ ; then
254 CFLAGS="$CFLAGS -D_REENTRANT"
255 elif check_define _WIN32 ; then
261 echo "# Automatically generated by configure - do not modify" > $config_host_mak
262 printf "# Configured with:" >> $config_host_mak
263 printf " '%s'" "$0" "$@" >> $config_host_mak
264 echo >> $config_host_mak
265 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
267 if test "$no_shm" = "yes" ; then
268 output_sym "CONFIG_NO_SHM"
271 if test "$disable_opt" = "yes" ; then
272 output_sym "CONFIG_FIO_NO_OPT"
275 # Some host OSes need non-standard checks for which CPU to use.
276 # Note that these checks are broken for cross-compilation: if you're
277 # cross-compiling to one of these OSes then you'll need to specify
278 # the correct CPU with the --cpu option.
281 # Unless explicitly enabled, turn off lex.
282 # OpenBSD will hit syntax error when enabled.
283 if test -z "$disable_lex" ; then
290 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
291 # we can run 64-bit userspace code.
292 # If the user didn't specify a CPU explicitly and the kernel says this is
293 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
295 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
298 # Error at compile time linking of weak/partial symbols if possible...
305 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
306 echo "Disabling weak symbols"
307 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
311 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
312 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
315 LIBS="-lnsl -lsocket"
318 # We still force some options, so keep this message here.
319 echo "Forcing some known good options on Windows"
320 if test -z "${CC}${cross_prefix}"; then
321 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
322 cc="i686-w64-mingw32-gcc"
323 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
324 echo "Building with zlib support"
325 output_sym "CONFIG_ZLIB"
326 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
329 cc="x86_64-w64-mingw32-gcc"
330 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
331 echo "Building with zlib support"
332 output_sym "CONFIG_ZLIB"
333 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
337 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
338 output_sym "CONFIG_32BIT"
340 output_sym "CONFIG_64BIT_LLP64"
342 # We need this to be output_sym'd here because this is Windows specific.
343 # The regular configure path never sets this config.
344 output_sym "CONFIG_WINDOWSAIO"
345 # We now take the regular configuration path without having exit 0 here.
346 # Flags below are still necessary mostly for MinGW.
353 clock_gettime="yes" # clock_monotonic probe has dependency on this
354 clock_monotonic="yes"
362 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
366 # Now we know the target platform we can have another guess at the preferred
367 # compiler when it wasn't explictly set
368 if test -z "${CC}${cross_prefix}"; then
369 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
375 if test -z "$cc"; then
376 echo "configure: failed to find compiler"
380 if test ! -z "$cpu" ; then
381 # command line argument
383 elif check_define __i386__ ; then
385 elif check_define __x86_64__ ; then
387 elif check_define __sparc__ ; then
388 if check_define __arch64__ ; then
393 elif check_define _ARCH_PPC ; then
394 if check_define _ARCH_PPC64 ; then
399 elif check_define __mips__ ; then
401 elif check_define __ia64__ ; then
403 elif check_define __s390__ ; then
404 if check_define __s390x__ ; then
409 elif check_define __arm__ ; then
411 elif check_define __aarch64__ ; then
413 elif check_define __hppa__ ; then
419 # Normalise host CPU name and set ARCH.
421 ia64|ppc|ppc64|s390|s390x|sparc64)
424 i386|i486|i586|i686|i86pc|BePC)
436 hppa|parisc|parisc64)
450 ##########################################
451 # check cross compile
453 if test "$cross_compile" != "yes" ; then
462 if compile_prog "" "" "cross"; then
463 $TMPE 2>/dev/null || cross_compile="yes"
465 fatal "compile test failed"
468 ##########################################
470 if test "$bigendian" != "yes" ; then
473 if test "$cross_compile" = "no" ; then
475 #include <inttypes.h>
478 volatile uint32_t i=0x01234567;
479 return (*((uint8_t*)(&i))) == 0x67;
482 if compile_prog "" "" "endian"; then
483 $TMPE && bigendian="yes"
486 # If we're cross compiling, try our best to work it out and rely on the
487 # run-time check to fail if we get it wrong.
492 #if __BYTE_ORDER != __BIG_ENDIAN
493 # error "Unknown endianness"
497 compile_prog "" "" "endian" && bigendian="yes"
498 check_define "__ARMEB__" && bigendian="yes"
499 check_define "__MIPSEB__" && bigendian="yes"
503 print_config "Operating system" "$targetos"
504 print_config "CPU" "$cpu"
505 print_config "Big endian" "$bigendian"
506 print_config "Compiler" "$cc"
507 print_config "Cross compile" "$cross_compile"
510 ##########################################
511 # See if we need to build a static build
512 if test "$build_static" = "yes" ; then
513 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
514 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
518 print_config "Static build" "$build_static"
520 ##########################################
525 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
528 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
532 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
534 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
537 fatal "Unknown wordsize"
539 print_config "Wordsize" "$wordsize"
541 ##########################################
543 if test "$zlib" != "yes" ; then
551 if (inflateInit(&stream) != Z_OK)
556 if compile_prog "" "-lz" "zlib" ; then
560 print_config "zlib" "$zlib"
562 ##########################################
564 if test "$libaio" != "yes" ; then
567 if test "$esx" != "yes" ; then
577 if compile_prog "" "-laio" "libaio" ; then
581 if test "$libaio" = "yes" ; then
582 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
587 print_config "Linux AIO support" "$libaio"
589 ##########################################
591 if test "$posix_aio" != "yes" ; then
594 if test "$posix_aio_lrt" != "yes" ; then
606 if compile_prog "" "" "posixaio" ; then
608 elif compile_prog "" "-lrt" "posixaio"; then
613 print_config "POSIX AIO support" "$posix_aio"
614 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
616 ##########################################
617 # posix aio fsync probe
618 if test "$posix_aio_fsync" != "yes" ; then
621 if test "$posix_aio" = "yes" ; then
628 return aio_fsync(O_SYNC, &cb);
632 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
636 print_config "POSIX AIO fsync" "$posix_aio_fsync"
638 ##########################################
639 # POSIX pshared attribute probe
640 if test "$posix_pshared" != "yes" ; then
647 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
648 # if defined(__CYGWIN__)
649 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
650 # elif defined(__APPLE__)
651 # include <AvailabilityMacros.h>
652 # include <TargetConditionals.h>
653 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
654 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
658 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
663 if compile_prog "" "$LIBS" "posix_pshared" ; then
666 print_config "POSIX pshared support" "$posix_pshared"
668 ##########################################
670 if test "$solaris_aio" != "yes" ; then
674 #include <sys/types.h>
675 #include <sys/asynch.h>
680 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
684 if compile_prog "" "-laio" "solarisaio" ; then
688 print_config "Solaris AIO support" "$solaris_aio"
690 ##########################################
691 # __sync_fetch_and_add test
692 if test "$sfaa" != "yes" ; then
696 #include <inttypes.h>
697 static int sfaa(uint64_t *ptr)
699 return __sync_fetch_and_add(ptr, 0);
702 int main(int argc, char **argv)
709 if compile_prog "" "" "__sync_fetch_and_add()" ; then
712 print_config "__sync_fetch_and_add" "$sfaa"
714 ##########################################
715 # __sync_synchronize() test
716 if test "$sync_sync" != "yes" ; then
720 #include <inttypes.h>
722 int main(int argc, char **argv)
724 __sync_synchronize();
728 if compile_prog "" "" "__sync_synchronize()" ; then
731 print_config "__sync_synchronize" "$sync_sync"
733 ##########################################
734 # __sync_val_compare_and_swap() test
735 if test "$cmp_swap" != "yes" ; then
739 #include <inttypes.h>
741 int main(int argc, char **argv)
744 return __sync_val_compare_and_swap(&x, 1, 2);
747 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
750 print_config "__sync_val_compare_and_swap" "$cmp_swap"
752 ##########################################
754 if test "$libverbs" != "yes" ; then
758 #include <infiniband/verbs.h>
759 int main(int argc, char **argv)
761 struct ibv_pd *pd = ibv_alloc_pd(NULL);
765 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
767 LIBS="-libverbs $LIBS"
769 print_config "libverbs" "$libverbs"
771 ##########################################
773 if test "$rdmacm" != "yes" ; then
778 #include <rdma/rdma_cma.h>
779 int main(int argc, char **argv)
781 rdma_destroy_qp(NULL);
785 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
787 LIBS="-lrdmacm $LIBS"
789 print_config "rdmacm" "$rdmacm"
791 ##########################################
792 # Linux fallocate probe
793 if test "$linux_fallocate" != "yes" ; then
799 #include <linux/falloc.h>
800 int main(int argc, char **argv)
802 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
806 if compile_prog "" "" "linux_fallocate"; then
807 linux_fallocate="yes"
809 print_config "Linux fallocate" "$linux_fallocate"
811 ##########################################
812 # POSIX fadvise probe
813 if test "$posix_fadvise" != "yes" ; then
819 int main(int argc, char **argv)
821 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
825 if compile_prog "" "" "posix_fadvise"; then
828 print_config "POSIX fadvise" "$posix_fadvise"
830 ##########################################
831 # POSIX fallocate probe
832 if test "$posix_fallocate" != "yes" ; then
838 int main(int argc, char **argv)
840 int r = posix_fallocate(0, 0, 1024);
844 if compile_prog "" "" "posix_fallocate"; then
845 posix_fallocate="yes"
847 print_config "POSIX fallocate" "$posix_fallocate"
849 ##########################################
850 # sched_set/getaffinity 2 or 3 argument test
851 if test "$linux_2arg_affinity" != "yes" ; then
852 linux_2arg_affinity="no"
854 if test "$linux_3arg_affinity" != "yes" ; then
855 linux_3arg_affinity="no"
859 int main(int argc, char **argv)
862 return sched_setaffinity(0, sizeof(mask), &mask);
865 if compile_prog "" "" "sched_setaffinity(,,)"; then
866 linux_3arg_affinity="yes"
870 int main(int argc, char **argv)
873 return sched_setaffinity(0, &mask);
876 if compile_prog "" "" "sched_setaffinity(,)"; then
877 linux_2arg_affinity="yes"
880 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
881 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
883 ##########################################
884 # clock_gettime probe
885 if test "$clock_gettime" != "yes" ; then
891 int main(int argc, char **argv)
893 return clock_gettime(0, NULL);
896 if compile_prog "" "" "clock_gettime"; then
898 elif compile_prog "" "-lrt" "clock_gettime"; then
902 print_config "clock_gettime" "$clock_gettime"
904 ##########################################
905 # CLOCK_MONOTONIC probe
906 if test "$clock_monotonic" != "yes" ; then
909 if test "$clock_gettime" = "yes" ; then
913 int main(int argc, char **argv)
915 return clock_gettime(CLOCK_MONOTONIC, NULL);
918 if compile_prog "" "$LIBS" "clock monotonic"; then
919 clock_monotonic="yes"
922 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
924 ##########################################
925 # CLOCK_MONOTONIC_RAW probe
926 if test "$clock_monotonic_raw" != "yes" ; then
927 clock_monotonic_raw="no"
929 if test "$clock_gettime" = "yes" ; then
933 int main(int argc, char **argv)
935 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
938 if compile_prog "" "$LIBS" "clock monotonic"; then
939 clock_monotonic_raw="yes"
942 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
944 ##########################################
945 # CLOCK_MONOTONIC_PRECISE probe
946 if test "$clock_monotonic_precise" != "yes" ; then
947 clock_monotonic_precise="no"
949 if test "$clock_gettime" = "yes" ; then
953 int main(int argc, char **argv)
955 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
958 if compile_prog "" "$LIBS" "clock monotonic precise"; then
959 clock_monotonic_precise="yes"
962 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
964 ##########################################
966 if test "$clockid_t" != "yes" ; then
972 int main(int argc, char **argv)
974 volatile clockid_t cid;
975 memset((void*)&cid, 0, sizeof(cid));
979 if compile_prog "" "$LIBS" "clockid_t"; then
982 print_config "clockid_t" "$clockid_t"
984 ##########################################
985 # gettimeofday() probe
986 if test "$gettimeofday" != "yes" ; then
990 #include <sys/time.h>
992 int main(int argc, char **argv)
995 return gettimeofday(&tv, NULL);
998 if compile_prog "" "" "gettimeofday"; then
1001 print_config "gettimeofday" "$gettimeofday"
1003 ##########################################
1005 if test "$fdatasync" != "yes" ; then
1011 int main(int argc, char **argv)
1013 return fdatasync(0);
1016 if compile_prog "" "" "fdatasync"; then
1019 print_config "fdatasync" "$fdatasync"
1021 ##########################################
1022 # sync_file_range() probe
1023 if test "$sync_file_range" != "yes" ; then
1024 sync_file_range="no"
1030 #include <linux/fs.h>
1031 int main(int argc, char **argv)
1033 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1034 SYNC_FILE_RANGE_WAIT_AFTER;
1035 return sync_file_range(0, 0, 0, flags);
1038 if compile_prog "" "" "sync_file_range"; then
1039 sync_file_range="yes"
1041 print_config "sync_file_range" "$sync_file_range"
1043 ##########################################
1044 # ext4 move extent probe
1045 if test "$ext4_me" != "yes" ; then
1050 #include <sys/ioctl.h>
1051 int main(int argc, char **argv)
1053 struct move_extent me;
1054 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1057 if compile_prog "" "" "ext4 move extent" ; then
1059 elif test $targetos = "Linux" ; then
1060 # On Linux, just default to it on and let it error at runtime if we really
1061 # don't have it. None of my updated systems have it defined, but it does
1062 # work. Takes a while to bubble back.
1065 print_config "EXT4 move extent" "$ext4_me"
1067 ##########################################
1069 if test "$linux_splice" != "yes" ; then
1075 int main(int argc, char **argv)
1077 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1080 if compile_prog "" "" "linux splice"; then
1083 print_config "Linux splice(2)" "$linux_splice"
1085 ##########################################
1087 if test "$guasi" != "yes" ; then
1092 #include <guasi_syscalls.h>
1093 int main(int argc, char **argv)
1095 guasi_t ctx = guasi_create(0, 0, 0);
1099 if compile_prog "" "" "guasi"; then
1102 print_config "GUASI" "$guasi"
1104 ##########################################
1106 if test "$fusion_aw" != "yes" ; then
1110 #include <nvm/nvm_primitives.h>
1111 int main(int argc, char **argv)
1113 nvm_version_t ver_info;
1114 nvm_handle_t handle;
1116 handle = nvm_get_handle(0, &ver_info);
1117 return nvm_atomic_write(handle, 0, 0, 0);
1120 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1121 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1124 print_config "Fusion-io atomic engine" "$fusion_aw"
1126 ##########################################
1128 if test "$libnuma" != "yes" ; then
1133 int main(int argc, char **argv)
1135 return numa_available();
1138 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1142 print_config "libnuma" "$libnuma"
1144 ##########################################
1145 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1146 if test "$libnuma" = "yes" ; then
1150 int main(int argc, char **argv)
1152 struct bitmask *mask = numa_parse_nodestring(NULL);
1153 return mask->size == 0;
1156 if compile_prog "" "" "libnuma api"; then
1159 print_config "libnuma v2" "$libnuma_v2"
1162 ##########################################
1164 if test "$strsep" != "yes" ; then
1169 int main(int argc, char **argv)
1171 static char *string = "This is a string";
1172 strsep(&string, "needle");
1176 if compile_prog "" "" "strsep"; then
1179 print_config "strsep" "$strsep"
1181 ##########################################
1182 # strcasestr() probe
1183 if test "$strcasestr" != "yes" ; then
1188 int main(int argc, char **argv)
1190 return strcasestr(argv[0], argv[1]) != NULL;
1193 if compile_prog "" "" "strcasestr"; then
1196 print_config "strcasestr" "$strcasestr"
1198 ##########################################
1200 if test "$strlcat" != "yes" ; then
1205 int main(int argc, char **argv)
1207 static char dst[64];
1208 static char *string = "This is a string";
1209 memset(dst, 0, sizeof(dst));
1210 strlcat(dst, string, sizeof(dst));
1214 if compile_prog "" "" "strlcat"; then
1217 print_config "strlcat" "$strlcat"
1219 ##########################################
1220 # getopt_long_only() probe
1221 if test "$getopt_long_only" != "yes" ; then
1222 getopt_long_only="no"
1228 int main(int argc, char **argv)
1230 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1234 if compile_prog "" "" "getopt_long_only"; then
1235 getopt_long_only="yes"
1237 print_config "getopt_long_only()" "$getopt_long_only"
1239 ##########################################
1241 if test "$inet_aton" != "yes" ; then
1245 #include <sys/socket.h>
1246 #include <arpa/inet.h>
1248 int main(int argc, char **argv)
1251 return inet_aton(NULL, &in);
1254 if compile_prog "" "" "inet_aton"; then
1257 print_config "inet_aton" "$inet_aton"
1259 ##########################################
1261 if test "$socklen_t" != "yes" ; then
1265 #include <sys/socket.h>
1266 int main(int argc, char **argv)
1272 if compile_prog "" "" "socklen_t"; then
1275 print_config "socklen_t" "$socklen_t"
1277 ##########################################
1278 # Whether or not __thread is supported for TLS
1279 if test "$tls_thread" != "yes" ; then
1284 static __thread int ret;
1285 int main(int argc, char **argv)
1290 if compile_prog "" "" "__thread"; then
1293 print_config "__thread" "$tls_thread"
1295 ##########################################
1296 # Check if we have required gtk/glib support for gfio
1297 if test "$gfio" != "yes" ; then
1300 if test "$gfio_check" = "yes" ; then
1304 #include <gtk/gtk.h>
1307 gdk_threads_enter();
1308 gdk_threads_leave();
1310 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1313 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1314 ORG_LDFLAGS=$LDFLAGS
1315 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1316 if test "$?" != "0" ; then
1317 echo "configure: gtk and gthread not found"
1320 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1321 if test "$?" != "0" ; then
1322 echo "configure: gtk and gthread not found"
1325 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1327 if test "$?" = "0" ; then
1329 GFIO_LIBS="$LIBS $GTK_LIBS"
1330 CFLAGS="$CFLAGS $GTK_CFLAGS"
1332 echo "GTK found, but need version 2.18 or higher"
1336 echo "Please install gtk and gdk libraries"
1339 LDFLAGS=$ORG_LDFLAGS
1342 if test "$gfio_check" = "yes" ; then
1343 print_config "gtk 2.18 or higher" "$gfio"
1346 ##########################################
1347 # Check whether we have getrusage(RUSAGE_THREAD)
1348 if test "$rusage_thread" != "yes" ; then
1352 #include <sys/time.h>
1353 #include <sys/resource.h>
1354 int main(int argc, char **argv)
1357 getrusage(RUSAGE_THREAD, &ru);
1361 if compile_prog "" "" "RUSAGE_THREAD"; then
1364 print_config "RUSAGE_THREAD" "$rusage_thread"
1366 ##########################################
1367 # Check whether we have SCHED_IDLE
1368 if test "$sched_idle" != "yes" ; then
1373 int main(int argc, char **argv)
1375 struct sched_param p;
1376 return sched_setscheduler(0, SCHED_IDLE, &p);
1379 if compile_prog "" "" "SCHED_IDLE"; then
1382 print_config "SCHED_IDLE" "$sched_idle"
1384 ##########################################
1385 # Check whether we have TCP_NODELAY
1386 if test "$tcp_nodelay" != "yes" ; then
1391 #include <sys/types.h>
1392 #include <sys/socket.h>
1393 #include <netinet/tcp.h>
1394 int main(int argc, char **argv)
1396 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1399 if compile_prog "" "" "TCP_NODELAY"; then
1402 print_config "TCP_NODELAY" "$tcp_nodelay"
1404 ##########################################
1405 # Check whether we have SO_SNDBUF
1406 if test "$window_size" != "yes" ; then
1411 #include <sys/types.h>
1412 #include <sys/socket.h>
1413 #include <netinet/tcp.h>
1414 int main(int argc, char **argv)
1416 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1417 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1420 if compile_prog "" "" "SO_SNDBUF"; then
1423 print_config "Net engine window_size" "$window_size"
1425 ##########################################
1426 # Check whether we have TCP_MAXSEG
1427 if test "$mss" != "yes" ; then
1432 #include <sys/types.h>
1433 #include <sys/socket.h>
1434 #include <netinet/tcp.h>
1435 #include <arpa/inet.h>
1436 #include <netinet/in.h>
1437 int main(int argc, char **argv)
1439 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1442 if compile_prog "" "" "TCP_MAXSEG"; then
1445 print_config "TCP_MAXSEG" "$mss"
1447 ##########################################
1448 # Check whether we have RLIMIT_MEMLOCK
1449 if test "$rlimit_memlock" != "yes" ; then
1453 #include <sys/time.h>
1454 #include <sys/resource.h>
1455 int main(int argc, char **argv)
1458 return getrlimit(RLIMIT_MEMLOCK, &rl);
1461 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1462 rlimit_memlock="yes"
1464 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1466 ##########################################
1467 # Check whether we have pwritev/preadv
1468 if test "$pwritev" != "yes" ; then
1473 #include <sys/uio.h>
1474 int main(int argc, char **argv)
1476 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1479 if compile_prog "" "" "pwritev"; then
1482 print_config "pwritev/preadv" "$pwritev"
1484 ##########################################
1485 # Check whether we have pwritev2/preadv2
1486 if test "$pwritev2" != "yes" ; then
1491 #include <sys/uio.h>
1492 int main(int argc, char **argv)
1494 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1497 if compile_prog "" "" "pwritev2"; then
1500 print_config "pwritev2/preadv2" "$pwritev2"
1502 ##########################################
1503 # Check whether we have the required functions for ipv6
1504 if test "$ipv6" != "yes" ; then
1508 #include <sys/types.h>
1509 #include <sys/socket.h>
1510 #include <netinet/in.h>
1513 int main(int argc, char **argv)
1515 struct addrinfo hints;
1516 struct in6_addr addr;
1519 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1521 printf("%s\n", gai_strerror(ret));
1526 if compile_prog "" "" "ipv6"; then
1529 print_config "IPv6 helpers" "$ipv6"
1531 ##########################################
1533 if test "$rados" != "yes" ; then
1537 #include <rados/librados.h>
1539 int main(int argc, char **argv)
1542 rados_ioctx_t io_ctx;
1543 const char cluster_name[] = "ceph";
1544 const char user_name[] = "client.admin";
1545 const char pool[] = "rados";
1547 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1548 rados_create2(&cluster, cluster_name, user_name, 0);
1549 rados_ioctx_create(cluster, pool, &io_ctx);
1554 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1555 LIBS="-lrados $LIBS"
1558 print_config "Rados engine" "$rados"
1560 ##########################################
1562 if test "$rbd" != "yes" ; then
1566 #include <rbd/librbd.h>
1568 int main(int argc, char **argv)
1571 rados_ioctx_t io_ctx;
1572 const char cluster_name[] = "ceph";
1573 const char user_name[] = "client.admin";
1574 const char pool[] = "rbd";
1575 int major, minor, extra;
1577 rbd_version(&major, &minor, &extra);
1578 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1579 rados_create2(&cluster, cluster_name, user_name, 0);
1580 rados_ioctx_create(cluster, pool, &io_ctx);
1585 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1586 LIBS="-lrbd -lrados $LIBS"
1589 print_config "Rados Block Device engine" "$rbd"
1591 ##########################################
1592 # check for rbd_poll
1593 if test "$rbd_poll" != "yes" ; then
1596 if test "$rbd" = "yes"; then
1598 #include <rbd/librbd.h>
1599 #include <sys/eventfd.h>
1601 int main(int argc, char **argv)
1604 rbd_completion_t comp;
1606 int fd = eventfd(0, EFD_NONBLOCK);
1607 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1608 rbd_poll_io_events(image, comp, 1);
1613 if compile_prog "" "-lrbd -lrados" "rbd"; then
1616 print_config "rbd_poll" "$rbd_poll"
1619 ##########################################
1620 # check for rbd_invalidate_cache()
1621 if test "$rbd_inval" != "yes" ; then
1624 if test "$rbd" = "yes"; then
1626 #include <rbd/librbd.h>
1628 int main(int argc, char **argv)
1632 return rbd_invalidate_cache(image);
1635 if compile_prog "" "-lrbd -lrados" "rbd"; then
1638 print_config "rbd_invalidate_cache" "$rbd_inval"
1641 ##########################################
1643 if test "$rbd_blkin" != "yes" ; then
1647 #include <rbd/librbd.h>
1648 #include <zipkin_c.h>
1650 int main(int argc, char **argv)
1653 struct blkin_trace_info t_info;
1654 blkin_init_trace_info(&t_info);
1655 rbd_completion_t completion;
1660 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1664 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1665 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1666 LIBS="-lblkin $LIBS"
1669 print_config "rbd blkin tracing" "$rbd_blkin"
1671 ##########################################
1672 # Check whether we have setvbuf
1673 if test "$setvbuf" != "yes" ; then
1678 int main(int argc, char **argv)
1682 setvbuf(f, buf, _IOFBF, sizeof(buf));
1686 if compile_prog "" "" "setvbuf"; then
1689 print_config "setvbuf" "$setvbuf"
1691 ##########################################
1693 if test "$gfapi" != "yes" ; then
1697 #include <glusterfs/api/glfs.h>
1699 int main(int argc, char **argv)
1701 glfs_t *g = glfs_new("foo");
1706 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1707 LIBS="-lgfapi -lglusterfs $LIBS"
1710 print_config "Gluster API engine" "$gfapi"
1712 ##########################################
1713 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1714 if test "$gfapi" = "yes" ; then
1717 #include <glusterfs/api/glfs.h>
1719 int main(int argc, char **argv)
1722 int ret = glfs_fadvise(fd, 0, 0, 1);
1727 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1730 print_config "Gluster API use fadvise" "$gf_fadvise"
1733 ##########################################
1734 # check for gfapi trim support
1735 if test "$gf_trim" != "yes" ; then
1738 if test "$gfapi" = "yes" ; then
1740 #include <glusterfs/api/glfs.h>
1742 int main(int argc, char **argv)
1744 return glfs_discard_async(NULL, 0, 0);
1747 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1750 print_config "Gluster API trim support" "$gf_trim"
1753 ##########################################
1754 # Check if we support stckf on s390
1755 if test "$s390_z196_facilities" != "yes" ; then
1756 s390_z196_facilities="no"
1759 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1760 int main(int argc, char **argv)
1762 /* We want just 1 double word to be returned. */
1763 register unsigned long reg0 asm("0") = 0;
1764 unsigned long stfle_bits;
1765 asm volatile(".machine push" "\n\t"
1766 ".machine \"z9-109\"" "\n\t"
1769 : "=QS" (stfle_bits), "+d" (reg0)
1772 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1778 if compile_prog "" "" "s390_z196_facilities"; then
1780 if [ $? -eq 0 ]; then
1781 s390_z196_facilities="yes"
1784 print_config "s390_z196_facilities" "$s390_z196_facilities"
1786 ##########################################
1787 # Check if we have required environment variables configured for libhdfs
1788 if test "$libhdfs" = "yes" ; then
1790 if test "$JAVA_HOME" = "" ; then
1791 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1794 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1795 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1798 if test "$FIO_LIBHDFS_LIB" = "" ; then
1799 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1802 if test "$hdfs_conf_error" = "1" ; then
1806 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1807 FIO_HDFS_CPU="amd64"
1810 print_config "HDFS engine" "$libhdfs"
1812 ##########################################
1813 # Check whether we have MTD
1814 if test "$mtd" != "yes" ; then
1819 #include <mtd/mtd-user.h>
1820 #include <sys/ioctl.h>
1821 int main(int argc, char **argv)
1823 struct mtd_write_req ops;
1824 struct mtd_info_user info;
1825 memset(&ops, 0, sizeof(ops));
1826 info.type = MTD_MLCNANDFLASH;
1827 return ioctl(0, MEMGETINFO, &info);
1830 if compile_prog "" "" "mtd"; then
1833 print_config "MTD" "$mtd"
1835 ##########################################
1836 # Check whether we have libpmem
1837 if test "$libpmem" != "yes" ; then
1841 #include <libpmem.h>
1842 int main(int argc, char **argv)
1845 rc = pmem_is_pmem(0, 0);
1849 if compile_prog "" "-lpmem" "libpmem"; then
1853 print_config "libpmem" "$libpmem"
1855 ##########################################
1856 # Check whether we have libpmemblk
1857 # libpmem is a prerequisite
1858 if test "$libpmemblk" != "yes" ; then
1861 if test "$libpmem" = "yes"; then
1863 #include <libpmemblk.h>
1864 int main(int argc, char **argv)
1867 pbp = pmemblk_open("", 0);
1871 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1873 LIBS="-lpmemblk $LIBS"
1876 print_config "libpmemblk" "$libpmemblk"
1878 # Choose the ioengines
1879 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1882 if test "$libpmemblk" = "yes"; then
1887 ##########################################
1888 # Report whether pmemblk engine is enabled
1889 print_config "NVML pmemblk engine" "$pmemblk"
1891 ##########################################
1892 # Report whether dev-dax engine is enabled
1893 print_config "NVML dev-dax engine" "$devdax"
1895 ##########################################
1896 # Report whether libpmem engine is enabled
1897 print_config "NVML libpmem engine" "$pmem"
1899 ##########################################
1900 # Check if we have lex/yacc available
1905 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1906 if test "$targetos" != "SunOS" ; then
1907 LEX=$(which lex 2> /dev/null)
1908 if test -x "$LEX" ; then
1911 YACC=$(which bison 2> /dev/null)
1912 if test -x "$YACC" ; then
1916 YACC=$(which yacc 2> /dev/null)
1917 if test -x "$YACC" ; then
1921 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1925 if test "$arith" = "yes" ; then
1927 extern int yywrap(void);
1929 int main(int argc, char **argv)
1935 if compile_prog "" "-ll" "lex"; then
1944 # Check if lex fails using -o
1945 if test "$arith" = "yes" ; then
1946 if test "$force_no_lex_o" = "yes" ; then
1949 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1950 if test "$?" = "0" ; then
1958 print_config "lex/yacc for arithmetic" "$arith"
1960 ##########################################
1961 # Check whether we have setmntent/getmntent
1962 if test "$getmntent" != "yes" ; then
1968 int main(int argc, char **argv)
1970 FILE *mtab = setmntent(NULL, "r");
1971 struct mntent *mnt = getmntent(mtab);
1976 if compile_prog "" "" "getmntent"; then
1979 print_config "getmntent" "$getmntent"
1981 ##########################################
1982 # Check whether we have getmntinfo
1983 # These are originally added for BSDs, but may also work
1984 # on other operating systems with getmntinfo(3).
1986 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1987 # Note that NetBSD needs -Werror to catch warning as error.
1988 if test "$getmntinfo" != "yes" ; then
1993 #include <sys/param.h>
1994 #include <sys/mount.h>
1995 int main(int argc, char **argv)
1998 return getmntinfo(&st, MNT_NOWAIT);
2001 if compile_prog "-Werror" "" "getmntinfo"; then
2004 print_config "getmntinfo" "$getmntinfo"
2006 # getmntinfo(3) for NetBSD.
2007 if test "$getmntinfo_statvfs" != "yes" ; then
2008 getmntinfo_statvfs="no"
2012 #include <sys/statvfs.h>
2013 int main(int argc, char **argv)
2016 return getmntinfo(&st, MNT_NOWAIT);
2019 # Skip the test if the one with statfs arg is detected.
2020 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2021 getmntinfo_statvfs="yes"
2022 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2025 ##########################################
2026 # Check whether we have _Static_assert
2027 if test "$static_assert" != "yes" ; then
2039 int main(int argc, char **argv)
2041 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2045 if compile_prog "" "" "static_assert"; then
2048 print_config "Static Assert" "$static_assert"
2050 ##########################################
2051 # Check whether we have bool / stdbool.h
2052 if test "$have_bool" != "yes" ; then
2056 #include <stdbool.h>
2057 int main(int argc, char **argv)
2060 return var != false;
2063 if compile_prog "" "" "bool"; then
2066 print_config "bool" "$have_bool"
2068 ##########################################
2069 # Check whether we have strndup()
2074 int main(int argc, char **argv)
2076 char *res = strndup("test string", 8);
2082 if compile_prog "" "" "strndup"; then
2085 print_config "strndup" "$strndup"
2087 ##########################################
2088 # check march=armv8-a+crc+crypto
2089 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2090 march_armv8_a_crc_crypto="no"
2092 if test "$cpu" = "arm64" ; then
2094 #include <sys/auxv.h>
2095 #include <arm_acle.h>
2096 #include <arm_neon.h>
2103 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2104 march_armv8_a_crc_crypto="yes"
2105 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2108 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2110 ##########################################
2112 if test "$cuda" != "yes" ; then
2117 int main(int argc, char **argv)
2122 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2126 print_config "cuda" "$cuda"
2128 ##########################################
2129 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2132 #include <sys/stat.h>
2133 #include <sys/types.h>
2134 int main(int argc, char **argv)
2136 return mkdir("/tmp/bla", 0600);
2139 if compile_prog "" "" "mkdir(a, b)"; then
2142 print_config "mkdir(a, b)" "$mkdir_two"
2144 #############################################################################
2146 if test "$wordsize" = "64" ; then
2147 output_sym "CONFIG_64BIT"
2148 elif test "$wordsize" = "32" ; then
2149 output_sym "CONFIG_32BIT"
2151 fatal "Unknown wordsize!"
2153 if test "$bigendian" = "yes" ; then
2154 output_sym "CONFIG_BIG_ENDIAN"
2156 output_sym "CONFIG_LITTLE_ENDIAN"
2158 if test "$zlib" = "yes" ; then
2159 output_sym "CONFIG_ZLIB"
2161 if test "$libaio" = "yes" ; then
2162 output_sym "CONFIG_LIBAIO"
2164 if test "$posix_aio" = "yes" ; then
2165 output_sym "CONFIG_POSIXAIO"
2167 if test "$posix_aio_fsync" = "yes" ; then
2168 output_sym "CONFIG_POSIXAIO_FSYNC"
2170 if test "$posix_pshared" = "yes" ; then
2171 output_sym "CONFIG_PSHARED"
2173 if test "$linux_fallocate" = "yes" ; then
2174 output_sym "CONFIG_LINUX_FALLOCATE"
2176 if test "$posix_fallocate" = "yes" ; then
2177 output_sym "CONFIG_POSIX_FALLOCATE"
2179 if test "$fdatasync" = "yes" ; then
2180 output_sym "CONFIG_FDATASYNC"
2182 if test "$sync_file_range" = "yes" ; then
2183 output_sym "CONFIG_SYNC_FILE_RANGE"
2185 if test "$sfaa" = "yes" ; then
2186 output_sym "CONFIG_SFAA"
2188 if test "$sync_sync" = "yes" ; then
2189 output_sym "CONFIG_SYNC_SYNC"
2191 if test "$cmp_swap" = "yes" ; then
2192 output_sym "CONFIG_CMP_SWAP"
2194 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2195 output_sym "CONFIG_RDMA"
2197 if test "$clock_gettime" = "yes" ; then
2198 output_sym "CONFIG_CLOCK_GETTIME"
2200 if test "$clock_monotonic" = "yes" ; then
2201 output_sym "CONFIG_CLOCK_MONOTONIC"
2203 if test "$clock_monotonic_raw" = "yes" ; then
2204 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2206 if test "$clock_monotonic_precise" = "yes" ; then
2207 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2209 if test "$clockid_t" = "yes"; then
2210 output_sym "CONFIG_CLOCKID_T"
2212 if test "$gettimeofday" = "yes" ; then
2213 output_sym "CONFIG_GETTIMEOFDAY"
2215 if test "$posix_fadvise" = "yes" ; then
2216 output_sym "CONFIG_POSIX_FADVISE"
2218 if test "$linux_3arg_affinity" = "yes" ; then
2219 output_sym "CONFIG_3ARG_AFFINITY"
2220 elif test "$linux_2arg_affinity" = "yes" ; then
2221 output_sym "CONFIG_2ARG_AFFINITY"
2223 if test "$strsep" = "yes" ; then
2224 output_sym "CONFIG_STRSEP"
2226 if test "$strcasestr" = "yes" ; then
2227 output_sym "CONFIG_STRCASESTR"
2229 if test "$strlcat" = "yes" ; then
2230 output_sym "CONFIG_STRLCAT"
2232 if test "$getopt_long_only" = "yes" ; then
2233 output_sym "CONFIG_GETOPT_LONG_ONLY"
2235 if test "$inet_aton" = "yes" ; then
2236 output_sym "CONFIG_INET_ATON"
2238 if test "$socklen_t" = "yes" ; then
2239 output_sym "CONFIG_SOCKLEN_T"
2241 if test "$ext4_me" = "yes" ; then
2242 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2244 if test "$linux_splice" = "yes" ; then
2245 output_sym "CONFIG_LINUX_SPLICE"
2247 if test "$guasi" = "yes" ; then
2248 output_sym "CONFIG_GUASI"
2250 if test "$fusion_aw" = "yes" ; then
2251 output_sym "CONFIG_FUSION_AW"
2253 if test "$libnuma_v2" = "yes" ; then
2254 output_sym "CONFIG_LIBNUMA"
2256 if test "$solaris_aio" = "yes" ; then
2257 output_sym "CONFIG_SOLARISAIO"
2259 if test "$tls_thread" = "yes" ; then
2260 output_sym "CONFIG_TLS_THREAD"
2262 if test "$rusage_thread" = "yes" ; then
2263 output_sym "CONFIG_RUSAGE_THREAD"
2265 if test "$gfio" = "yes" ; then
2266 output_sym "CONFIG_GFIO"
2268 if test "$esx" = "yes" ; then
2269 output_sym "CONFIG_ESX"
2270 output_sym "CONFIG_NO_SHM"
2272 if test "$sched_idle" = "yes" ; then
2273 output_sym "CONFIG_SCHED_IDLE"
2275 if test "$tcp_nodelay" = "yes" ; then
2276 output_sym "CONFIG_TCP_NODELAY"
2278 if test "$window_size" = "yes" ; then
2279 output_sym "CONFIG_NET_WINDOWSIZE"
2281 if test "$mss" = "yes" ; then
2282 output_sym "CONFIG_NET_MSS"
2284 if test "$rlimit_memlock" = "yes" ; then
2285 output_sym "CONFIG_RLIMIT_MEMLOCK"
2287 if test "$pwritev" = "yes" ; then
2288 output_sym "CONFIG_PWRITEV"
2290 if test "$pwritev2" = "yes" ; then
2291 output_sym "CONFIG_PWRITEV2"
2293 if test "$ipv6" = "yes" ; then
2294 output_sym "CONFIG_IPV6"
2296 if test "$rados" = "yes" ; then
2297 output_sym "CONFIG_RADOS"
2299 if test "$rbd" = "yes" ; then
2300 output_sym "CONFIG_RBD"
2302 if test "$rbd_poll" = "yes" ; then
2303 output_sym "CONFIG_RBD_POLL"
2305 if test "$rbd_inval" = "yes" ; then
2306 output_sym "CONFIG_RBD_INVAL"
2308 if test "$rbd_blkin" = "yes" ; then
2309 output_sym "CONFIG_RBD_BLKIN"
2311 if test "$setvbuf" = "yes" ; then
2312 output_sym "CONFIG_SETVBUF"
2314 if test "$s390_z196_facilities" = "yes" ; then
2315 output_sym "CONFIG_S390_Z196_FACILITIES"
2316 CFLAGS="$CFLAGS -march=z9-109"
2318 if test "$gfapi" = "yes" ; then
2319 output_sym "CONFIG_GFAPI"
2321 if test "$gf_fadvise" = "yes" ; then
2322 output_sym "CONFIG_GF_FADVISE"
2324 if test "$gf_trim" = "yes" ; then
2325 output_sym "CONFIG_GF_TRIM"
2327 if test "$libhdfs" = "yes" ; then
2328 output_sym "CONFIG_LIBHDFS"
2329 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2330 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2331 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2332 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2334 if test "$mtd" = "yes" ; then
2335 output_sym "CONFIG_MTD"
2337 if test "$pmemblk" = "yes" ; then
2338 output_sym "CONFIG_PMEMBLK"
2340 if test "$devdax" = "yes" ; then
2341 output_sym "CONFIG_LINUX_DEVDAX"
2343 if test "$pmem" = "yes" ; then
2344 output_sym "CONFIG_LIBPMEM"
2346 if test "$arith" = "yes" ; then
2347 output_sym "CONFIG_ARITHMETIC"
2348 if test "$yacc_is_bison" = "yes" ; then
2349 echo "YACC=$YACC -y" >> $config_host_mak
2351 echo "YACC=$YACC" >> $config_host_mak
2353 if test "$lex_use_o" = "yes" ; then
2354 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2357 if test "$getmntent" = "yes" ; then
2358 output_sym "CONFIG_GETMNTENT"
2360 if test "$getmntinfo" = "yes" ; then
2361 output_sym "CONFIG_GETMNTINFO"
2363 if test "$getmntinfo_statvfs" = "yes" ; then
2364 output_sym "CONFIG_GETMNTINFO_STATVFS"
2366 if test "$static_assert" = "yes" ; then
2367 output_sym "CONFIG_STATIC_ASSERT"
2369 if test "$have_bool" = "yes" ; then
2370 output_sym "CONFIG_HAVE_BOOL"
2372 if test "$strndup" = "yes" ; then
2373 output_sym "CONFIG_HAVE_STRNDUP"
2375 if test "$disable_opt" = "yes" ; then
2376 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2378 if test "$zlib" = "no" ; then
2379 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2381 if test "$cuda" = "yes" ; then
2382 output_sym "CONFIG_CUDA"
2384 if test "$mkdir_two" = "yes" ; then
2385 output_sym "CONFIG_HAVE_MKDIR_TWO"
2388 echo "LIBS+=$LIBS" >> $config_host_mak
2389 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2390 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2391 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2392 echo "CC=$cc" >> $config_host_mak
2393 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2394 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2396 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2397 cat > Makefile <<EOF
2398 SRCDIR:=`dirname $0`
2399 include \$(SRCDIR)/Makefile