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 --build-static) build_static="yes"
172 --enable-gfio) gfio_check="yes"
174 --disable-numa) disable_numa="yes"
176 --disable-rdma) disable_rdma="yes"
178 --disable-rados) disable_rados="yes"
180 --disable-rbd) disable_rbd="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"
198 --disable-native) disable_native="yes"
204 echo "Bad option $opt"
210 if test "$show_help" = "yes" ; then
211 echo "--prefix= Use this directory as installation prefix"
212 echo "--cpu= Specify target CPU if auto-detect fails"
213 echo "--cc= Specify compiler to use"
214 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
215 echo "--build-32bit-win Enable 32-bit build on Windows"
216 echo "--build-static Build a static fio"
217 echo "--esx Configure build options for esx"
218 echo "--enable-gfio Enable building of gtk gfio"
219 echo "--disable-numa Disable libnuma even if found"
220 echo "--disable-rdma Disable RDMA support even if found"
221 echo "--disable-gfapi Disable gfapi"
222 echo "--enable-libhdfs Enable hdfs support"
223 echo "--disable-lex Disable use of lex/yacc for math"
224 echo "--disable-pmem Disable pmem based engines even if found"
225 echo "--enable-lex Enable use of lex/yacc for math"
226 echo "--disable-shm Disable SHM support"
227 echo "--disable-optimizations Don't enable compiler optimizations"
228 echo "--enable-cuda Enable GPUDirect RDMA support"
229 echo "--disable-native Don't build for native host"
233 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
234 # Preferred compiler (can be overriden later after we know the platform):
236 # ${cross_prefix}gcc (if cross-prefix specified)
239 if test -z "${CC}${cross_prefix}"; then
246 cc="${CC-${cross_prefix}gcc}"
249 if check_define __ANDROID__ ; then
251 elif check_define __linux__ ; then
253 elif check_define __OpenBSD__ ; then
255 elif check_define __NetBSD__ ; then
257 elif check_define __sun__ ; then
259 CFLAGS="$CFLAGS -D_REENTRANT"
260 elif check_define _WIN32 ; then
266 echo "# Automatically generated by configure - do not modify" > $config_host_mak
267 printf "# Configured with:" >> $config_host_mak
268 printf " '%s'" "$0" "$@" >> $config_host_mak
269 echo >> $config_host_mak
270 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
272 if test "$no_shm" = "yes" ; then
273 output_sym "CONFIG_NO_SHM"
276 if test "$disable_opt" = "yes" ; then
277 output_sym "CONFIG_FIO_NO_OPT"
280 # Some host OSes need non-standard checks for which CPU to use.
281 # Note that these checks are broken for cross-compilation: if you're
282 # cross-compiling to one of these OSes then you'll need to specify
283 # the correct CPU with the --cpu option.
286 # Unless explicitly enabled, turn off lex.
287 # OpenBSD will hit syntax error when enabled.
288 if test -z "$disable_lex" ; then
295 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
296 # we can run 64-bit userspace code.
297 # If the user didn't specify a CPU explicitly and the kernel says this is
298 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
300 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
303 # Error at compile time linking of weak/partial symbols if possible...
310 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
311 echo "Disabling weak symbols"
312 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
316 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
317 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
320 LIBS="-lnsl -lsocket"
323 # We still force some options, so keep this message here.
324 echo "Forcing some known good options on Windows"
325 if test -z "${CC}${cross_prefix}"; then
326 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
327 cc="i686-w64-mingw32-gcc"
329 cc="x86_64-w64-mingw32-gcc"
332 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
333 output_sym "CONFIG_32BIT"
335 output_sym "CONFIG_64BIT_LLP64"
337 # We need this to be output_sym'd here because this is Windows specific.
338 # The regular configure path never sets this config.
339 output_sym "CONFIG_WINDOWSAIO"
340 # We now take the regular configuration path without having exit 0 here.
341 # Flags below are still necessary mostly for MinGW.
348 clock_gettime="yes" # clock_monotonic probe has dependency on this
349 clock_monotonic="yes"
357 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
361 # Now we know the target platform we can have another guess at the preferred
362 # compiler when it wasn't explictly set
363 if test -z "${CC}${cross_prefix}"; then
364 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
370 if test -z "$cc"; then
371 echo "configure: failed to find compiler"
375 if test ! -z "$cpu" ; then
376 # command line argument
378 elif check_define __i386__ ; then
380 elif check_define __x86_64__ ; then
382 elif check_define __sparc__ ; then
383 if check_define __arch64__ ; then
388 elif check_define _ARCH_PPC ; then
389 if check_define _ARCH_PPC64 ; then
394 elif check_define __mips__ ; then
396 elif check_define __ia64__ ; then
398 elif check_define __s390__ ; then
399 if check_define __s390x__ ; then
404 elif check_define __arm__ ; then
406 elif check_define __aarch64__ ; then
408 elif check_define __hppa__ ; then
414 # Normalise host CPU name and set ARCH.
416 ia64|ppc|ppc64|s390|s390x|sparc64)
419 i386|i486|i586|i686|i86pc|BePC)
431 hppa|parisc|parisc64)
445 ##########################################
446 # check cross compile
448 if test "$cross_compile" != "yes" ; then
457 if compile_prog "" "" "cross"; then
458 $TMPE 2>/dev/null || cross_compile="yes"
460 fatal "compile test failed"
463 ##########################################
465 if test "$bigendian" != "yes" ; then
468 if test "$cross_compile" = "no" ; then
470 #include <inttypes.h>
473 volatile uint32_t i=0x01234567;
474 return (*((uint8_t*)(&i))) == 0x67;
477 if compile_prog "" "" "endian"; then
478 $TMPE && bigendian="yes"
481 # If we're cross compiling, try our best to work it out and rely on the
482 # run-time check to fail if we get it wrong.
487 #if __BYTE_ORDER != __BIG_ENDIAN
488 # error "Unknown endianness"
492 compile_prog "" "" "endian" && bigendian="yes"
493 check_define "__ARMEB__" && bigendian="yes"
494 check_define "__MIPSEB__" && bigendian="yes"
498 print_config "Operating system" "$targetos"
499 print_config "CPU" "$cpu"
500 print_config "Big endian" "$bigendian"
501 print_config "Compiler" "$cc"
502 print_config "Cross compile" "$cross_compile"
505 ##########################################
506 # See if we need to build a static build
507 if test "$build_static" = "yes" ; then
508 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
509 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
513 print_config "Static build" "$build_static"
515 ##########################################
520 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
523 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
527 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
529 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
532 fatal "Unknown wordsize"
534 print_config "Wordsize" "$wordsize"
536 ##########################################
538 if test "$zlib" != "yes" ; then
546 if (inflateInit(&stream) != Z_OK)
551 if compile_prog "" "-lz" "zlib" ; then
555 print_config "zlib" "$zlib"
557 ##########################################
559 if test "$libaio" != "yes" ; then
562 if test "$esx" != "yes" ; then
572 if compile_prog "" "-laio" "libaio" ; then
576 if test "$libaio" = "yes" ; then
577 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
582 print_config "Linux AIO support" "$libaio"
584 ##########################################
586 if test "$posix_aio" != "yes" ; then
589 if test "$posix_aio_lrt" != "yes" ; then
601 if compile_prog "" "" "posixaio" ; then
603 elif compile_prog "" "-lrt" "posixaio -lrt"; then
608 print_config "POSIX AIO support" "$posix_aio"
609 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
611 ##########################################
612 # posix aio fsync probe
613 if test "$posix_aio_fsync" != "yes" ; then
616 if test "$posix_aio" = "yes" ; then
623 return aio_fsync(O_SYNC, &cb);
627 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
631 print_config "POSIX AIO fsync" "$posix_aio_fsync"
633 ##########################################
634 # POSIX pshared attribute probe
635 if test "$posix_pshared" != "yes" ; then
642 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
643 # if defined(__CYGWIN__)
644 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
645 # elif defined(__APPLE__)
646 # include <AvailabilityMacros.h>
647 # include <TargetConditionals.h>
648 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
649 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
653 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
658 if compile_prog "" "$LIBS" "posix_pshared" ; then
661 print_config "POSIX pshared support" "$posix_pshared"
663 ##########################################
665 if test "$solaris_aio" != "yes" ; then
669 #include <sys/types.h>
670 #include <sys/asynch.h>
675 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
679 if compile_prog "" "-laio" "solarisaio" ; then
683 print_config "Solaris AIO support" "$solaris_aio"
685 ##########################################
686 # __sync_fetch_and_add test
687 if test "$sfaa" != "yes" ; then
691 #include <inttypes.h>
692 static int sfaa(uint64_t *ptr)
694 return __sync_fetch_and_add(ptr, 0);
697 int main(int argc, char **argv)
704 if compile_prog "" "" "__sync_fetch_and_add()" ; then
707 print_config "__sync_fetch_and_add" "$sfaa"
709 ##########################################
710 # __sync_synchronize() test
711 if test "$sync_sync" != "yes" ; then
715 #include <inttypes.h>
717 int main(int argc, char **argv)
719 __sync_synchronize();
723 if compile_prog "" "" "__sync_synchronize()" ; then
726 print_config "__sync_synchronize" "$sync_sync"
728 ##########################################
729 # __sync_val_compare_and_swap() test
730 if test "$cmp_swap" != "yes" ; then
734 #include <inttypes.h>
736 int main(int argc, char **argv)
739 return __sync_val_compare_and_swap(&x, 1, 2);
742 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
745 print_config "__sync_val_compare_and_swap" "$cmp_swap"
747 ##########################################
749 if test "$libverbs" != "yes" ; then
753 #include <infiniband/verbs.h>
754 int main(int argc, char **argv)
756 struct ibv_pd *pd = ibv_alloc_pd(NULL);
760 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
762 LIBS="-libverbs $LIBS"
764 print_config "libverbs" "$libverbs"
766 ##########################################
768 if test "$rdmacm" != "yes" ; then
773 #include <rdma/rdma_cma.h>
774 int main(int argc, char **argv)
776 rdma_destroy_qp(NULL);
780 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
782 LIBS="-lrdmacm $LIBS"
784 print_config "rdmacm" "$rdmacm"
786 ##########################################
787 # asprintf() and vasprintf() probes
788 if test "$have_asprintf" != "yes" ; then
794 int main(int argc, char **argv)
796 return asprintf(NULL, "%s", "str") == 0;
799 if compile_prog "" "" "have_asprintf"; then
802 print_config "asprintf()" "$have_asprintf"
804 if test "$have_vasprintf" != "yes" ; then
810 int main(int argc, char **argv)
812 return vasprintf(NULL, "%s", NULL) == 0;
815 if compile_prog "" "" "have_vasprintf"; then
818 print_config "vasprintf()" "$have_vasprintf"
820 ##########################################
821 # Linux fallocate probe
822 if test "$linux_fallocate" != "yes" ; then
828 #include <linux/falloc.h>
829 int main(int argc, char **argv)
831 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
835 if compile_prog "" "" "linux_fallocate"; then
836 linux_fallocate="yes"
838 print_config "Linux fallocate" "$linux_fallocate"
840 ##########################################
841 # POSIX fadvise probe
842 if test "$posix_fadvise" != "yes" ; then
848 int main(int argc, char **argv)
850 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
854 if compile_prog "" "" "posix_fadvise"; then
857 print_config "POSIX fadvise" "$posix_fadvise"
859 ##########################################
860 # POSIX fallocate probe
861 if test "$posix_fallocate" != "yes" ; then
867 int main(int argc, char **argv)
869 int r = posix_fallocate(0, 0, 1024);
873 if compile_prog "" "" "posix_fallocate"; then
874 posix_fallocate="yes"
876 print_config "POSIX fallocate" "$posix_fallocate"
878 ##########################################
879 # sched_set/getaffinity 2 or 3 argument test
880 if test "$linux_2arg_affinity" != "yes" ; then
881 linux_2arg_affinity="no"
883 if test "$linux_3arg_affinity" != "yes" ; then
884 linux_3arg_affinity="no"
888 int main(int argc, char **argv)
891 return sched_setaffinity(0, sizeof(mask), &mask);
894 if compile_prog "" "" "sched_setaffinity(,,)"; then
895 linux_3arg_affinity="yes"
899 int main(int argc, char **argv)
902 return sched_setaffinity(0, &mask);
905 if compile_prog "" "" "sched_setaffinity(,)"; then
906 linux_2arg_affinity="yes"
909 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
910 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
912 ##########################################
913 # clock_gettime probe
914 if test "$clock_gettime" != "yes" ; then
920 int main(int argc, char **argv)
922 return clock_gettime(0, NULL);
925 if compile_prog "" "" "clock_gettime"; then
927 elif compile_prog "" "-lrt" "clock_gettime"; then
931 print_config "clock_gettime" "$clock_gettime"
933 ##########################################
934 # CLOCK_MONOTONIC probe
935 if test "$clock_monotonic" != "yes" ; then
938 if test "$clock_gettime" = "yes" ; then
942 int main(int argc, char **argv)
944 return clock_gettime(CLOCK_MONOTONIC, NULL);
947 if compile_prog "" "$LIBS" "clock monotonic"; then
948 clock_monotonic="yes"
951 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
953 ##########################################
954 # CLOCK_MONOTONIC_RAW probe
955 if test "$clock_monotonic_raw" != "yes" ; then
956 clock_monotonic_raw="no"
958 if test "$clock_gettime" = "yes" ; then
962 int main(int argc, char **argv)
964 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
967 if compile_prog "" "$LIBS" "clock monotonic"; then
968 clock_monotonic_raw="yes"
971 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
973 ##########################################
974 # CLOCK_MONOTONIC_PRECISE probe
975 if test "$clock_monotonic_precise" != "yes" ; then
976 clock_monotonic_precise="no"
978 if test "$clock_gettime" = "yes" ; then
982 int main(int argc, char **argv)
984 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
987 if compile_prog "" "$LIBS" "clock monotonic precise"; then
988 clock_monotonic_precise="yes"
991 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
993 ##########################################
995 if test "$clockid_t" != "yes" ; then
1001 int main(int argc, char **argv)
1003 volatile clockid_t cid;
1004 memset((void*)&cid, 0, sizeof(cid));
1008 if compile_prog "" "$LIBS" "clockid_t"; then
1011 print_config "clockid_t" "$clockid_t"
1013 ##########################################
1014 # gettimeofday() probe
1015 if test "$gettimeofday" != "yes" ; then
1019 #include <sys/time.h>
1021 int main(int argc, char **argv)
1024 return gettimeofday(&tv, NULL);
1027 if compile_prog "" "" "gettimeofday"; then
1030 print_config "gettimeofday" "$gettimeofday"
1032 ##########################################
1034 if test "$fdatasync" != "yes" ; then
1040 int main(int argc, char **argv)
1042 return fdatasync(0);
1045 if compile_prog "" "" "fdatasync"; then
1048 print_config "fdatasync" "$fdatasync"
1050 ##########################################
1051 # sync_file_range() probe
1052 if test "$sync_file_range" != "yes" ; then
1053 sync_file_range="no"
1059 #include <linux/fs.h>
1060 int main(int argc, char **argv)
1062 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1063 SYNC_FILE_RANGE_WAIT_AFTER;
1064 return sync_file_range(0, 0, 0, flags);
1067 if compile_prog "" "" "sync_file_range"; then
1068 sync_file_range="yes"
1070 print_config "sync_file_range" "$sync_file_range"
1072 ##########################################
1073 # ext4 move extent probe
1074 if test "$ext4_me" != "yes" ; then
1079 #include <sys/ioctl.h>
1080 int main(int argc, char **argv)
1082 struct move_extent me;
1083 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1086 if compile_prog "" "" "ext4 move extent" ; then
1088 elif test $targetos = "Linux" ; then
1089 # On Linux, just default to it on and let it error at runtime if we really
1090 # don't have it. None of my updated systems have it defined, but it does
1091 # work. Takes a while to bubble back.
1094 print_config "EXT4 move extent" "$ext4_me"
1096 ##########################################
1098 if test "$linux_splice" != "yes" ; then
1104 int main(int argc, char **argv)
1106 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1109 if compile_prog "" "" "linux splice"; then
1112 print_config "Linux splice(2)" "$linux_splice"
1114 ##########################################
1116 if test "$guasi" != "yes" ; then
1121 #include <guasi_syscalls.h>
1122 int main(int argc, char **argv)
1124 guasi_t ctx = guasi_create(0, 0, 0);
1128 if compile_prog "" "" "guasi"; then
1131 print_config "GUASI" "$guasi"
1133 ##########################################
1135 if test "$fusion_aw" != "yes" ; then
1139 #include <nvm/nvm_primitives.h>
1140 int main(int argc, char **argv)
1142 nvm_version_t ver_info;
1143 nvm_handle_t handle;
1145 handle = nvm_get_handle(0, &ver_info);
1146 return nvm_atomic_write(handle, 0, 0, 0);
1149 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1150 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1153 print_config "Fusion-io atomic engine" "$fusion_aw"
1155 ##########################################
1157 if test "$libnuma" != "yes" ; then
1162 int main(int argc, char **argv)
1164 return numa_available();
1167 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1171 print_config "libnuma" "$libnuma"
1173 ##########################################
1174 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1175 if test "$libnuma" = "yes" ; then
1179 int main(int argc, char **argv)
1181 struct bitmask *mask = numa_parse_nodestring(NULL);
1182 return mask->size == 0;
1185 if compile_prog "" "" "libnuma api"; then
1188 print_config "libnuma v2" "$libnuma_v2"
1191 ##########################################
1193 if test "$strsep" != "yes" ; then
1198 int main(int argc, char **argv)
1200 static char *string = "This is a string";
1201 strsep(&string, "needle");
1205 if compile_prog "" "" "strsep"; then
1208 print_config "strsep" "$strsep"
1210 ##########################################
1211 # strcasestr() probe
1212 if test "$strcasestr" != "yes" ; then
1217 int main(int argc, char **argv)
1219 return strcasestr(argv[0], argv[1]) != NULL;
1222 if compile_prog "" "" "strcasestr"; then
1225 print_config "strcasestr" "$strcasestr"
1227 ##########################################
1229 if test "$strlcat" != "yes" ; then
1234 int main(int argc, char **argv)
1236 static char dst[64];
1237 static char *string = "This is a string";
1238 memset(dst, 0, sizeof(dst));
1239 strlcat(dst, string, sizeof(dst));
1243 if compile_prog "" "" "strlcat"; then
1246 print_config "strlcat" "$strlcat"
1248 ##########################################
1249 # getopt_long_only() probe
1250 if test "$getopt_long_only" != "yes" ; then
1251 getopt_long_only="no"
1257 int main(int argc, char **argv)
1259 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1263 if compile_prog "" "" "getopt_long_only"; then
1264 getopt_long_only="yes"
1266 print_config "getopt_long_only()" "$getopt_long_only"
1268 ##########################################
1270 if test "$inet_aton" != "yes" ; then
1274 #include <sys/socket.h>
1275 #include <arpa/inet.h>
1277 int main(int argc, char **argv)
1280 return inet_aton(NULL, &in);
1283 if compile_prog "" "" "inet_aton"; then
1286 print_config "inet_aton" "$inet_aton"
1288 ##########################################
1290 if test "$socklen_t" != "yes" ; then
1294 #include <sys/socket.h>
1295 int main(int argc, char **argv)
1301 if compile_prog "" "" "socklen_t"; then
1304 print_config "socklen_t" "$socklen_t"
1306 ##########################################
1307 # Whether or not __thread is supported for TLS
1308 if test "$tls_thread" != "yes" ; then
1313 static __thread int ret;
1314 int main(int argc, char **argv)
1319 if compile_prog "" "" "__thread"; then
1322 print_config "__thread" "$tls_thread"
1324 ##########################################
1325 # Check if we have required gtk/glib support for gfio
1326 if test "$gfio" != "yes" ; then
1329 if test "$gfio_check" = "yes" ; then
1333 #include <gtk/gtk.h>
1336 gdk_threads_enter();
1337 gdk_threads_leave();
1339 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1342 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1343 ORG_LDFLAGS=$LDFLAGS
1344 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1345 if test "$?" != "0" ; then
1346 echo "configure: gtk and gthread not found"
1349 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1350 if test "$?" != "0" ; then
1351 echo "configure: gtk and gthread not found"
1354 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1356 if test "$?" = "0" ; then
1358 GFIO_LIBS="$LIBS $GTK_LIBS"
1359 CFLAGS="$CFLAGS $GTK_CFLAGS"
1361 echo "GTK found, but need version 2.18 or higher"
1365 echo "Please install gtk and gdk libraries"
1368 LDFLAGS=$ORG_LDFLAGS
1371 if test "$gfio_check" = "yes" ; then
1372 print_config "gtk 2.18 or higher" "$gfio"
1375 ##########################################
1376 # Check whether we have getrusage(RUSAGE_THREAD)
1377 if test "$rusage_thread" != "yes" ; then
1381 #include <sys/time.h>
1382 #include <sys/resource.h>
1383 int main(int argc, char **argv)
1386 getrusage(RUSAGE_THREAD, &ru);
1390 if compile_prog "" "" "RUSAGE_THREAD"; then
1393 print_config "RUSAGE_THREAD" "$rusage_thread"
1395 ##########################################
1396 # Check whether we have SCHED_IDLE
1397 if test "$sched_idle" != "yes" ; then
1402 int main(int argc, char **argv)
1404 struct sched_param p;
1405 return sched_setscheduler(0, SCHED_IDLE, &p);
1408 if compile_prog "" "" "SCHED_IDLE"; then
1411 print_config "SCHED_IDLE" "$sched_idle"
1413 ##########################################
1414 # Check whether we have TCP_NODELAY
1415 if test "$tcp_nodelay" != "yes" ; then
1420 #include <sys/types.h>
1421 #include <sys/socket.h>
1422 #include <netinet/tcp.h>
1423 int main(int argc, char **argv)
1425 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1428 if compile_prog "" "" "TCP_NODELAY"; then
1431 print_config "TCP_NODELAY" "$tcp_nodelay"
1433 ##########################################
1434 # Check whether we have SO_SNDBUF
1435 if test "$window_size" != "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 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1446 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1449 if compile_prog "" "" "SO_SNDBUF"; then
1452 print_config "Net engine window_size" "$window_size"
1454 ##########################################
1455 # Check whether we have TCP_MAXSEG
1456 if test "$mss" != "yes" ; then
1461 #include <sys/types.h>
1462 #include <sys/socket.h>
1463 #include <netinet/tcp.h>
1464 #include <arpa/inet.h>
1465 #include <netinet/in.h>
1466 int main(int argc, char **argv)
1468 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1471 if compile_prog "" "" "TCP_MAXSEG"; then
1474 print_config "TCP_MAXSEG" "$mss"
1476 ##########################################
1477 # Check whether we have RLIMIT_MEMLOCK
1478 if test "$rlimit_memlock" != "yes" ; then
1482 #include <sys/time.h>
1483 #include <sys/resource.h>
1484 int main(int argc, char **argv)
1487 return getrlimit(RLIMIT_MEMLOCK, &rl);
1490 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1491 rlimit_memlock="yes"
1493 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1495 ##########################################
1496 # Check whether we have pwritev/preadv
1497 if test "$pwritev" != "yes" ; then
1502 #include <sys/uio.h>
1503 int main(int argc, char **argv)
1505 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1508 if compile_prog "" "" "pwritev"; then
1511 print_config "pwritev/preadv" "$pwritev"
1513 ##########################################
1514 # Check whether we have pwritev2/preadv2
1515 if test "$pwritev2" != "yes" ; then
1520 #include <sys/uio.h>
1521 int main(int argc, char **argv)
1523 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1526 if compile_prog "" "" "pwritev2"; then
1529 print_config "pwritev2/preadv2" "$pwritev2"
1531 ##########################################
1532 # Check whether we have the required functions for ipv6
1533 if test "$ipv6" != "yes" ; then
1537 #include <sys/types.h>
1538 #include <sys/socket.h>
1539 #include <netinet/in.h>
1542 int main(int argc, char **argv)
1544 struct addrinfo hints;
1545 struct in6_addr addr;
1548 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1550 printf("%s\n", gai_strerror(ret));
1555 if compile_prog "" "" "ipv6"; then
1558 print_config "IPv6 helpers" "$ipv6"
1560 ##########################################
1562 if test "$rados" != "yes" ; then
1566 #include <rados/librados.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[] = "rados";
1576 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1577 rados_create2(&cluster, cluster_name, user_name, 0);
1578 rados_ioctx_create(cluster, pool, &io_ctx);
1583 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1584 LIBS="-lrados $LIBS"
1587 print_config "Rados engine" "$rados"
1589 ##########################################
1591 if test "$rbd" != "yes" ; then
1595 #include <rbd/librbd.h>
1597 int main(int argc, char **argv)
1600 rados_ioctx_t io_ctx;
1601 const char cluster_name[] = "ceph";
1602 const char user_name[] = "client.admin";
1603 const char pool[] = "rbd";
1604 int major, minor, extra;
1606 rbd_version(&major, &minor, &extra);
1607 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1608 rados_create2(&cluster, cluster_name, user_name, 0);
1609 rados_ioctx_create(cluster, pool, &io_ctx);
1614 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1615 LIBS="-lrbd -lrados $LIBS"
1618 print_config "Rados Block Device engine" "$rbd"
1620 ##########################################
1621 # check for rbd_poll
1622 if test "$rbd_poll" != "yes" ; then
1625 if test "$rbd" = "yes"; then
1627 #include <rbd/librbd.h>
1628 #include <sys/eventfd.h>
1630 int main(int argc, char **argv)
1633 rbd_completion_t comp;
1635 int fd = eventfd(0, EFD_NONBLOCK);
1636 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1637 rbd_poll_io_events(image, comp, 1);
1642 if compile_prog "" "-lrbd -lrados" "rbd"; then
1645 print_config "rbd_poll" "$rbd_poll"
1648 ##########################################
1649 # check for rbd_invalidate_cache()
1650 if test "$rbd_inval" != "yes" ; then
1653 if test "$rbd" = "yes"; then
1655 #include <rbd/librbd.h>
1657 int main(int argc, char **argv)
1661 return rbd_invalidate_cache(image);
1664 if compile_prog "" "-lrbd -lrados" "rbd"; then
1667 print_config "rbd_invalidate_cache" "$rbd_inval"
1670 ##########################################
1671 # Check whether we have setvbuf
1672 if test "$setvbuf" != "yes" ; then
1677 int main(int argc, char **argv)
1681 setvbuf(f, buf, _IOFBF, sizeof(buf));
1685 if compile_prog "" "" "setvbuf"; then
1688 print_config "setvbuf" "$setvbuf"
1690 ##########################################
1692 if test "$gfapi" != "yes" ; then
1696 #include <glusterfs/api/glfs.h>
1698 int main(int argc, char **argv)
1700 glfs_t *g = glfs_new("foo");
1705 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1706 LIBS="-lgfapi -lglusterfs $LIBS"
1709 print_config "Gluster API engine" "$gfapi"
1711 ##########################################
1712 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1713 if test "$gfapi" = "yes" ; then
1716 #include <glusterfs/api/glfs.h>
1718 int main(int argc, char **argv)
1721 int ret = glfs_fadvise(fd, 0, 0, 1);
1726 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1729 print_config "Gluster API use fadvise" "$gf_fadvise"
1732 ##########################################
1733 # check for gfapi trim support
1734 if test "$gf_trim" != "yes" ; then
1737 if test "$gfapi" = "yes" ; then
1739 #include <glusterfs/api/glfs.h>
1741 int main(int argc, char **argv)
1743 return glfs_discard_async(NULL, 0, 0);
1746 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1749 print_config "Gluster API trim support" "$gf_trim"
1752 ##########################################
1753 # Check if we support stckf on s390
1754 if test "$s390_z196_facilities" != "yes" ; then
1755 s390_z196_facilities="no"
1758 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1759 int main(int argc, char **argv)
1761 /* We want just 1 double word to be returned. */
1762 register unsigned long reg0 asm("0") = 0;
1763 unsigned long stfle_bits;
1764 asm volatile(".machine push" "\n\t"
1765 ".machine \"z9-109\"" "\n\t"
1768 : "=QS" (stfle_bits), "+d" (reg0)
1771 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1777 if compile_prog "" "" "s390_z196_facilities"; then
1779 if [ $? -eq 0 ]; then
1780 s390_z196_facilities="yes"
1783 print_config "s390_z196_facilities" "$s390_z196_facilities"
1785 ##########################################
1786 # Check if we have required environment variables configured for libhdfs
1787 if test "$libhdfs" = "yes" ; then
1789 if test "$JAVA_HOME" = "" ; then
1790 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1793 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1794 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1797 if test "$FIO_LIBHDFS_LIB" = "" ; then
1798 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1801 if test "$hdfs_conf_error" = "1" ; then
1805 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1806 FIO_HDFS_CPU="amd64"
1809 print_config "HDFS engine" "$libhdfs"
1811 ##########################################
1812 # Check whether we have MTD
1813 if test "$mtd" != "yes" ; then
1818 #include <mtd/mtd-user.h>
1819 #include <sys/ioctl.h>
1820 int main(int argc, char **argv)
1822 struct mtd_write_req ops;
1823 struct mtd_info_user info;
1824 memset(&ops, 0, sizeof(ops));
1825 info.type = MTD_MLCNANDFLASH;
1826 return ioctl(0, MEMGETINFO, &info);
1829 if compile_prog "" "" "mtd"; then
1832 print_config "MTD" "$mtd"
1834 ##########################################
1835 # Check whether we have libpmem
1836 if test "$libpmem" != "yes" ; then
1840 #include <libpmem.h>
1841 int main(int argc, char **argv)
1844 rc = pmem_is_pmem(0, 0);
1848 if compile_prog "" "-lpmem" "libpmem"; then
1852 print_config "libpmem" "$libpmem"
1854 ##########################################
1855 # Check whether we have libpmemblk
1856 # libpmem is a prerequisite
1857 if test "$libpmemblk" != "yes" ; then
1860 if test "$libpmem" = "yes"; then
1862 #include <libpmemblk.h>
1863 int main(int argc, char **argv)
1866 pbp = pmemblk_open("", 0);
1870 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1872 LIBS="-lpmemblk $LIBS"
1875 print_config "libpmemblk" "$libpmemblk"
1877 # Choose the ioengines
1878 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1881 if test "$libpmemblk" = "yes"; then
1886 ##########################################
1887 # Report whether pmemblk engine is enabled
1888 print_config "NVML pmemblk engine" "$pmemblk"
1890 ##########################################
1891 # Report whether dev-dax engine is enabled
1892 print_config "NVML dev-dax engine" "$devdax"
1894 ##########################################
1895 # Report whether libpmem engine is enabled
1896 print_config "NVML libpmem engine" "$pmem"
1898 ##########################################
1899 # Check if we have lex/yacc available
1904 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1905 if test "$targetos" != "SunOS" ; then
1906 LEX=$(which lex 2> /dev/null)
1907 if test -x "$LEX" ; then
1910 YACC=$(which bison 2> /dev/null)
1911 if test -x "$YACC" ; then
1915 YACC=$(which yacc 2> /dev/null)
1916 if test -x "$YACC" ; then
1920 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1924 if test "$arith" = "yes" ; then
1926 extern int yywrap(void);
1928 int main(int argc, char **argv)
1934 if compile_prog "" "-ll" "lex"; then
1943 # Check if lex fails using -o
1944 if test "$arith" = "yes" ; then
1945 if test "$force_no_lex_o" = "yes" ; then
1948 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1949 if test "$?" = "0" ; then
1957 print_config "lex/yacc for arithmetic" "$arith"
1959 ##########################################
1960 # Check whether we have setmntent/getmntent
1961 if test "$getmntent" != "yes" ; then
1967 int main(int argc, char **argv)
1969 FILE *mtab = setmntent(NULL, "r");
1970 struct mntent *mnt = getmntent(mtab);
1975 if compile_prog "" "" "getmntent"; then
1978 print_config "getmntent" "$getmntent"
1980 ##########################################
1981 # Check whether we have getmntinfo
1982 # These are originally added for BSDs, but may also work
1983 # on other operating systems with getmntinfo(3).
1985 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1986 # Note that NetBSD needs -Werror to catch warning as error.
1987 if test "$getmntinfo" != "yes" ; then
1992 #include <sys/param.h>
1993 #include <sys/mount.h>
1994 int main(int argc, char **argv)
1997 return getmntinfo(&st, MNT_NOWAIT);
2000 if compile_prog "-Werror" "" "getmntinfo"; then
2003 print_config "getmntinfo" "$getmntinfo"
2005 # getmntinfo(3) for NetBSD.
2006 if test "$getmntinfo_statvfs" != "yes" ; then
2007 getmntinfo_statvfs="no"
2011 #include <sys/statvfs.h>
2012 int main(int argc, char **argv)
2015 return getmntinfo(&st, MNT_NOWAIT);
2018 # Skip the test if the one with statfs arg is detected.
2019 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2020 getmntinfo_statvfs="yes"
2021 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2024 ##########################################
2025 # Check whether we have _Static_assert
2026 if test "$static_assert" != "yes" ; then
2038 int main(int argc, char **argv)
2040 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2044 if compile_prog "" "" "static_assert"; then
2047 print_config "Static Assert" "$static_assert"
2049 ##########################################
2050 # Check whether we have bool / stdbool.h
2051 if test "$have_bool" != "yes" ; then
2055 #include <stdbool.h>
2056 int main(int argc, char **argv)
2059 return var != false;
2062 if compile_prog "" "" "bool"; then
2065 print_config "bool" "$have_bool"
2067 ##########################################
2068 # Check whether we have strndup()
2073 int main(int argc, char **argv)
2075 char *res = strndup("test string", 8);
2081 if compile_prog "" "" "strndup"; then
2084 print_config "strndup" "$strndup"
2086 ##########################################
2087 # <valgrind/drd.h> probe
2088 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2089 # also available but not the other way around.
2090 if test "$valgrind_dev" != "yes" ; then
2094 #include <valgrind/drd.h>
2095 int main(int argc, char **argv)
2100 if compile_prog "" "" "valgrind_dev"; then
2103 print_config "Valgrind headers" "$valgrind_dev"
2105 # check march=armv8-a+crc+crypto
2106 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2107 march_armv8_a_crc_crypto="no"
2109 if test "$cpu" = "arm64" ; then
2111 #include <arm_acle.h>
2112 #include <arm_neon.h>
2113 #include <sys/auxv.h>
2117 /* Can we also do a runtime probe? */
2119 return getauxval(AT_HWCAP);
2121 # error "Don't know how to do runtime probe for ARM CRC32c"
2125 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2126 march_armv8_a_crc_crypto="yes"
2127 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2131 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2133 ##########################################
2135 if test "$cuda" != "yes" ; then
2140 int main(int argc, char **argv)
2145 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2149 print_config "cuda" "$cuda"
2151 ##########################################
2152 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2155 #include <sys/stat.h>
2156 #include <sys/types.h>
2157 int main(int argc, char **argv)
2159 return mkdir("/tmp/bla", 0600);
2162 if compile_prog "" "" "mkdir(a, b)"; then
2165 print_config "mkdir(a, b)" "$mkdir_two"
2167 ##########################################
2168 # check for cc -march=native
2171 int main(int argc, char **argv)
2176 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2177 compile_prog "-march=native" "" "march=native"; then
2180 print_config "Build march=native" "$build_native"
2182 #############################################################################
2184 if test "$wordsize" = "64" ; then
2185 output_sym "CONFIG_64BIT"
2186 elif test "$wordsize" = "32" ; then
2187 output_sym "CONFIG_32BIT"
2189 fatal "Unknown wordsize!"
2191 if test "$bigendian" = "yes" ; then
2192 output_sym "CONFIG_BIG_ENDIAN"
2194 output_sym "CONFIG_LITTLE_ENDIAN"
2196 if test "$zlib" = "yes" ; then
2197 output_sym "CONFIG_ZLIB"
2199 if test "$libaio" = "yes" ; then
2200 output_sym "CONFIG_LIBAIO"
2202 if test "$posix_aio" = "yes" ; then
2203 output_sym "CONFIG_POSIXAIO"
2205 if test "$posix_aio_fsync" = "yes" ; then
2206 output_sym "CONFIG_POSIXAIO_FSYNC"
2208 if test "$posix_pshared" = "yes" ; then
2209 output_sym "CONFIG_PSHARED"
2211 if test "$have_asprintf" = "yes" ; then
2212 output_sym "HAVE_ASPRINTF"
2214 if test "$have_vasprintf" = "yes" ; then
2215 output_sym "HAVE_VASPRINTF"
2217 if test "$linux_fallocate" = "yes" ; then
2218 output_sym "CONFIG_LINUX_FALLOCATE"
2220 if test "$posix_fallocate" = "yes" ; then
2221 output_sym "CONFIG_POSIX_FALLOCATE"
2223 if test "$fdatasync" = "yes" ; then
2224 output_sym "CONFIG_FDATASYNC"
2226 if test "$sync_file_range" = "yes" ; then
2227 output_sym "CONFIG_SYNC_FILE_RANGE"
2229 if test "$sfaa" = "yes" ; then
2230 output_sym "CONFIG_SFAA"
2232 if test "$sync_sync" = "yes" ; then
2233 output_sym "CONFIG_SYNC_SYNC"
2235 if test "$cmp_swap" = "yes" ; then
2236 output_sym "CONFIG_CMP_SWAP"
2238 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2239 output_sym "CONFIG_RDMA"
2241 if test "$clock_gettime" = "yes" ; then
2242 output_sym "CONFIG_CLOCK_GETTIME"
2244 if test "$clock_monotonic" = "yes" ; then
2245 output_sym "CONFIG_CLOCK_MONOTONIC"
2247 if test "$clock_monotonic_raw" = "yes" ; then
2248 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2250 if test "$clock_monotonic_precise" = "yes" ; then
2251 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2253 if test "$clockid_t" = "yes"; then
2254 output_sym "CONFIG_CLOCKID_T"
2256 if test "$gettimeofday" = "yes" ; then
2257 output_sym "CONFIG_GETTIMEOFDAY"
2259 if test "$posix_fadvise" = "yes" ; then
2260 output_sym "CONFIG_POSIX_FADVISE"
2262 if test "$linux_3arg_affinity" = "yes" ; then
2263 output_sym "CONFIG_3ARG_AFFINITY"
2264 elif test "$linux_2arg_affinity" = "yes" ; then
2265 output_sym "CONFIG_2ARG_AFFINITY"
2267 if test "$strsep" = "yes" ; then
2268 output_sym "CONFIG_STRSEP"
2270 if test "$strcasestr" = "yes" ; then
2271 output_sym "CONFIG_STRCASESTR"
2273 if test "$strlcat" = "yes" ; then
2274 output_sym "CONFIG_STRLCAT"
2276 if test "$getopt_long_only" = "yes" ; then
2277 output_sym "CONFIG_GETOPT_LONG_ONLY"
2279 if test "$inet_aton" = "yes" ; then
2280 output_sym "CONFIG_INET_ATON"
2282 if test "$socklen_t" = "yes" ; then
2283 output_sym "CONFIG_SOCKLEN_T"
2285 if test "$ext4_me" = "yes" ; then
2286 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2288 if test "$linux_splice" = "yes" ; then
2289 output_sym "CONFIG_LINUX_SPLICE"
2291 if test "$guasi" = "yes" ; then
2292 output_sym "CONFIG_GUASI"
2294 if test "$fusion_aw" = "yes" ; then
2295 output_sym "CONFIG_FUSION_AW"
2297 if test "$libnuma_v2" = "yes" ; then
2298 output_sym "CONFIG_LIBNUMA"
2300 if test "$solaris_aio" = "yes" ; then
2301 output_sym "CONFIG_SOLARISAIO"
2303 if test "$tls_thread" = "yes" ; then
2304 output_sym "CONFIG_TLS_THREAD"
2306 if test "$rusage_thread" = "yes" ; then
2307 output_sym "CONFIG_RUSAGE_THREAD"
2309 if test "$gfio" = "yes" ; then
2310 output_sym "CONFIG_GFIO"
2312 if test "$esx" = "yes" ; then
2313 output_sym "CONFIG_ESX"
2314 output_sym "CONFIG_NO_SHM"
2316 if test "$sched_idle" = "yes" ; then
2317 output_sym "CONFIG_SCHED_IDLE"
2319 if test "$tcp_nodelay" = "yes" ; then
2320 output_sym "CONFIG_TCP_NODELAY"
2322 if test "$window_size" = "yes" ; then
2323 output_sym "CONFIG_NET_WINDOWSIZE"
2325 if test "$mss" = "yes" ; then
2326 output_sym "CONFIG_NET_MSS"
2328 if test "$rlimit_memlock" = "yes" ; then
2329 output_sym "CONFIG_RLIMIT_MEMLOCK"
2331 if test "$pwritev" = "yes" ; then
2332 output_sym "CONFIG_PWRITEV"
2334 if test "$pwritev2" = "yes" ; then
2335 output_sym "CONFIG_PWRITEV2"
2337 if test "$ipv6" = "yes" ; then
2338 output_sym "CONFIG_IPV6"
2340 if test "$rados" = "yes" ; then
2341 output_sym "CONFIG_RADOS"
2343 if test "$rbd" = "yes" ; then
2344 output_sym "CONFIG_RBD"
2346 if test "$rbd_poll" = "yes" ; then
2347 output_sym "CONFIG_RBD_POLL"
2349 if test "$rbd_inval" = "yes" ; then
2350 output_sym "CONFIG_RBD_INVAL"
2352 if test "$setvbuf" = "yes" ; then
2353 output_sym "CONFIG_SETVBUF"
2355 if test "$s390_z196_facilities" = "yes" ; then
2356 output_sym "CONFIG_S390_Z196_FACILITIES"
2357 CFLAGS="$CFLAGS -march=z9-109"
2360 if test "$gfapi" = "yes" ; then
2361 output_sym "CONFIG_GFAPI"
2363 if test "$gf_fadvise" = "yes" ; then
2364 output_sym "CONFIG_GF_FADVISE"
2366 if test "$gf_trim" = "yes" ; then
2367 output_sym "CONFIG_GF_TRIM"
2369 if test "$libhdfs" = "yes" ; then
2370 output_sym "CONFIG_LIBHDFS"
2371 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2372 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2373 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2374 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2376 if test "$mtd" = "yes" ; then
2377 output_sym "CONFIG_MTD"
2379 if test "$pmemblk" = "yes" ; then
2380 output_sym "CONFIG_PMEMBLK"
2382 if test "$devdax" = "yes" ; then
2383 output_sym "CONFIG_LINUX_DEVDAX"
2385 if test "$pmem" = "yes" ; then
2386 output_sym "CONFIG_LIBPMEM"
2388 if test "$arith" = "yes" ; then
2389 output_sym "CONFIG_ARITHMETIC"
2390 if test "$yacc_is_bison" = "yes" ; then
2391 echo "YACC=$YACC -y" >> $config_host_mak
2393 echo "YACC=$YACC" >> $config_host_mak
2395 if test "$lex_use_o" = "yes" ; then
2396 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2399 if test "$getmntent" = "yes" ; then
2400 output_sym "CONFIG_GETMNTENT"
2402 if test "$getmntinfo" = "yes" ; then
2403 output_sym "CONFIG_GETMNTINFO"
2405 if test "$getmntinfo_statvfs" = "yes" ; then
2406 output_sym "CONFIG_GETMNTINFO_STATVFS"
2408 if test "$static_assert" = "yes" ; then
2409 output_sym "CONFIG_STATIC_ASSERT"
2411 if test "$have_bool" = "yes" ; then
2412 output_sym "CONFIG_HAVE_BOOL"
2414 if test "$strndup" = "yes" ; then
2415 output_sym "CONFIG_HAVE_STRNDUP"
2417 if test "$disable_opt" = "yes" ; then
2418 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2420 if test "$valgrind_dev" = "yes"; then
2421 output_sym "CONFIG_VALGRIND_DEV"
2423 if test "$zlib" = "no" ; then
2424 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2425 if test "$build_static" = "yes"; then
2426 echo "Note that some distros have separate packages for static libraries."
2429 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2430 output_sym "ARCH_HAVE_CRC_CRYPTO"
2432 if test "$cuda" = "yes" ; then
2433 output_sym "CONFIG_CUDA"
2435 if test "$mkdir_two" = "yes" ; then
2436 output_sym "CONFIG_HAVE_MKDIR_TWO"
2438 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2439 output_sym "CONFIG_BUILD_NATIVE"
2442 echo "LIBS+=$LIBS" >> $config_host_mak
2443 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2444 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2445 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2446 echo "CC=$cc" >> $config_host_mak
2447 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2448 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2450 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2451 cat > Makefile <<EOF
2452 SRCDIR:=`dirname $0`
2453 include \$(SRCDIR)/Makefile