3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h"
50 # Print a helpful header at the top of config.log
51 echo "# FIO configure log $(date)" >> config.log
52 printf "# Configured with:" >> config.log
53 printf " '%s'" "$0" "$@" >> config.log
55 echo "#" >> config.log
57 # Print configure header at the top of $config_host_h
58 echo "/*" > $config_host_h
59 echo " * Automatically generated by configure - do not modify" >> $config_host_h
60 printf " * Configured with:" >> $config_host_h
61 printf " * '%s'" "$0" "$@" >> $config_host_h
62 echo "" >> $config_host_h
63 echo " */" >> $config_host_h
66 # Run the compiler, capturing its output to the log.
67 echo $cc "$@" >> config.log
68 $cc "$@" >> config.log 2>&1 || return $?
69 # Test passed. If this is an --enable-werror build, rerun
70 # the test with -Werror and bail out if it fails. This
71 # makes warning-generating-errors in configure test code
72 # obvious to developers.
73 if test "$werror" != "yes"; then
76 # Don't bother rerunning the compile if we were already using -Werror
82 echo $cc -Werror "$@" >> config.log
83 $cc -Werror "$@" >> config.log 2>&1 && return $?
84 echo "ERROR: configure test passed without -Werror but failed with -Werror."
85 echo "This is probably a bug in the configure script. The failing command"
86 echo "will be at the bottom of config.log."
87 fatal "You can run configure with --disable-werror to bypass this check."
91 do_cc $CFLAGS -c -o $TMPO $TMPC
96 local_ldflags="$2 $LIBS"
97 echo "Compiling test case $3" >> config.log
98 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
101 feature_not_found() {
106 echo "ERROR: User requested feature $feature"
107 if test ! -z "$packages" ; then
108 echo "ERROR: That feature needs $packages installed"
110 echo "ERROR: configure was not able to find it"
115 type "$1" >/dev/null 2>&1
121 #error $1 not defined
132 echo "$1=y" >> $config_host_mak
133 echo "#define $1" >> $config_host_h
155 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
157 --prefix=*) prefix="$optarg"
159 --cpu=*) cpu="$optarg"
161 # esx is cross compiled and cannot be detect through simple uname calls
167 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
169 --build-32bit-win) build_32bit_win="yes"
171 --target-win-ver=*) target_win_ver="$optarg"
173 --build-static) build_static="yes"
175 --enable-gfio) gfio_check="yes"
177 --disable-numa) disable_numa="yes"
179 --disable-rdma) disable_rdma="yes"
181 --disable-rados) disable_rados="yes"
183 --disable-rbd) disable_rbd="yes"
185 --disable-http) disable_http="yes"
187 --disable-gfapi) disable_gfapi="yes"
189 --enable-libhdfs) libhdfs="yes"
191 --disable-lex) disable_lex="yes"
193 --enable-lex) disable_lex="no"
195 --disable-shm) no_shm="yes"
197 --disable-optimizations) disable_opt="yes"
199 --disable-pmem) disable_pmem="yes"
201 --enable-cuda) enable_cuda="yes"
203 --disable-native) disable_native="yes"
205 --with-ime=*) ime_path="$optarg"
211 echo "Bad option $opt"
217 if test "$show_help" = "yes" ; then
218 echo "--prefix= Use this directory as installation prefix"
219 echo "--cpu= Specify target CPU if auto-detect fails"
220 echo "--cc= Specify compiler to use"
221 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
222 echo "--build-32bit-win Enable 32-bit build on Windows"
223 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
224 echo "--build-static Build a static fio"
225 echo "--esx Configure build options for esx"
226 echo "--enable-gfio Enable building of gtk gfio"
227 echo "--disable-numa Disable libnuma even if found"
228 echo "--disable-rdma Disable RDMA support even if found"
229 echo "--disable-rados Disable Rados support even if found"
230 echo "--disable-rbd Disable Rados Block Device even if found"
231 echo "--disable-http Disable HTTP support even if found"
232 echo "--disable-gfapi Disable gfapi"
233 echo "--enable-libhdfs Enable hdfs support"
234 echo "--disable-lex Disable use of lex/yacc for math"
235 echo "--disable-pmem Disable pmem based engines even if found"
236 echo "--enable-lex Enable use of lex/yacc for math"
237 echo "--disable-shm Disable SHM support"
238 echo "--disable-optimizations Don't enable compiler optimizations"
239 echo "--enable-cuda Enable GPUDirect RDMA support"
240 echo "--disable-native Don't build for native host"
241 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
245 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
246 # Preferred compiler (can be overriden later after we know the platform):
248 # ${cross_prefix}gcc (if cross-prefix specified)
251 if test -z "${CC}${cross_prefix}"; then
258 cc="${CC-${cross_prefix}gcc}"
261 if check_define __ANDROID__ ; then
263 elif check_define __linux__ ; then
265 elif check_define __OpenBSD__ ; then
267 elif check_define __NetBSD__ ; then
269 elif check_define __sun__ ; then
271 CFLAGS="$CFLAGS -D_REENTRANT"
272 elif check_define _WIN32 ; then
278 echo "# Automatically generated by configure - do not modify" > $config_host_mak
279 printf "# Configured with:" >> $config_host_mak
280 printf " '%s'" "$0" "$@" >> $config_host_mak
281 echo >> $config_host_mak
282 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
284 if test "$no_shm" = "yes" ; then
285 output_sym "CONFIG_NO_SHM"
288 if test "$disable_opt" = "yes" ; then
289 output_sym "CONFIG_FIO_NO_OPT"
292 # Some host OSes need non-standard checks for which CPU to use.
293 # Note that these checks are broken for cross-compilation: if you're
294 # cross-compiling to one of these OSes then you'll need to specify
295 # the correct CPU with the --cpu option.
298 # Unless explicitly enabled, turn off lex.
299 # OpenBSD will hit syntax error when enabled.
300 if test -z "$disable_lex" ; then
307 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
308 # we can run 64-bit userspace code.
309 # If the user didn't specify a CPU explicitly and the kernel says this is
310 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
312 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
315 # Error at compile time linking of weak/partial symbols if possible...
322 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
323 echo "Disabling weak symbols"
324 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
328 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
329 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
332 LIBS="-lnsl -lsocket"
335 # We still force some options, so keep this message here.
336 echo "Forcing some known good options on Windows"
337 if test -z "${CC}${cross_prefix}"; then
338 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
339 cc="i686-w64-mingw32-gcc"
341 cc="x86_64-w64-mingw32-gcc"
345 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
346 if test -z "$target_win_ver"; then
347 # Default Windows API target
350 if test "$target_win_ver" = "XP"; then
351 output_sym "CONFIG_WINDOWS_XP"
352 elif test "$target_win_ver" = "7"; then
353 output_sym "CONFIG_WINDOWS_7"
354 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
356 fatal "Unknown target Windows version"
359 # We need this to be output_sym'd here because this is Windows specific.
360 # The regular configure path never sets this config.
361 output_sym "CONFIG_WINDOWSAIO"
362 # We now take the regular configuration path without having exit 0 here.
363 # Flags below are still necessary mostly for MinGW.
367 clock_gettime="yes" # clock_monotonic probe has dependency on this
368 clock_monotonic="yes"
376 # Now we know the target platform we can have another guess at the preferred
377 # compiler when it wasn't explictly set
378 if test -z "${CC}${cross_prefix}"; then
379 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
385 if test -z "$cc"; then
386 echo "configure: failed to find compiler"
390 if test ! -z "$cpu" ; then
391 # command line argument
393 elif check_define __i386__ ; then
395 elif check_define __x86_64__ ; then
397 elif check_define __sparc__ ; then
398 if check_define __arch64__ ; then
403 elif check_define _ARCH_PPC ; then
404 if check_define _ARCH_PPC64 ; then
409 elif check_define __mips__ ; then
411 elif check_define __ia64__ ; then
413 elif check_define __s390__ ; then
414 if check_define __s390x__ ; then
419 elif check_define __arm__ ; then
421 elif check_define __aarch64__ ; then
423 elif check_define __hppa__ ; then
429 # Normalise host CPU name and set ARCH.
431 ia64|ppc|ppc64|s390|s390x|sparc64)
434 i386|i486|i586|i686|i86pc|BePC)
446 hppa|parisc|parisc64)
460 ##########################################
461 # check cross compile
463 if test "$cross_compile" != "yes" ; then
472 if compile_prog "" "" "cross"; then
473 $TMPE 2>/dev/null || cross_compile="yes"
475 fatal "compile test failed"
478 ##########################################
480 if test "$bigendian" != "yes" ; then
483 if test "$cross_compile" = "no" ; then
485 #include <inttypes.h>
488 volatile uint32_t i=0x01234567;
489 return (*((uint8_t*)(&i))) == 0x67;
492 if compile_prog "" "" "endian"; then
493 $TMPE && bigendian="yes"
496 # If we're cross compiling, try our best to work it out and rely on the
497 # run-time check to fail if we get it wrong.
502 #if __BYTE_ORDER != __BIG_ENDIAN
503 # error "Unknown endianness"
507 compile_prog "" "" "endian" && bigendian="yes"
508 check_define "__ARMEB__" && bigendian="yes"
509 check_define "__MIPSEB__" && bigendian="yes"
513 print_config "Operating system" "$targetos"
514 print_config "CPU" "$cpu"
515 print_config "Big endian" "$bigendian"
516 if test ! -z "$target_win_ver"; then
517 print_config "Target Windows version" "$target_win_ver"
519 print_config "Compiler" "$cc"
520 print_config "Cross compile" "$cross_compile"
523 ##########################################
524 # See if we need to build a static build
525 if test "$build_static" = "yes" ; then
526 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
527 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
531 print_config "Static build" "$build_static"
533 ##########################################
538 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
541 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
545 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
547 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
550 fatal "Unknown wordsize"
552 print_config "Wordsize" "$wordsize"
554 ##########################################
556 if test "$zlib" != "yes" ; then
564 if (inflateInit(&stream) != Z_OK)
569 if compile_prog "" "-lz" "zlib" ; then
573 print_config "zlib" "$zlib"
575 ##########################################
577 if test "$libaio" != "yes" ; then
580 if test "$esx" != "yes" ; then
590 if compile_prog "" "-laio" "libaio" ; then
594 if test "$libaio" = "yes" ; then
595 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
600 print_config "Linux AIO support" "$libaio"
602 ##########################################
604 if test "$posix_aio" != "yes" ; then
607 if test "$posix_aio_lrt" != "yes" ; then
619 if compile_prog "" "" "posixaio" ; then
621 elif compile_prog "" "-lrt" "posixaio -lrt"; then
626 print_config "POSIX AIO support" "$posix_aio"
627 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
629 ##########################################
630 # posix aio fsync probe
631 if test "$posix_aio_fsync" != "yes" ; then
634 if test "$posix_aio" = "yes" ; then
641 return aio_fsync(O_SYNC, &cb);
645 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
649 print_config "POSIX AIO fsync" "$posix_aio_fsync"
651 ##########################################
652 # POSIX pshared attribute probe
653 if test "$posix_pshared" != "yes" ; then
660 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
661 # if defined(__CYGWIN__)
662 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
663 # elif defined(__APPLE__)
664 # include <AvailabilityMacros.h>
665 # include <TargetConditionals.h>
666 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
667 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
671 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
676 if compile_prog "" "$LIBS" "posix_pshared" ; then
679 print_config "POSIX pshared support" "$posix_pshared"
681 ##########################################
683 if test "$solaris_aio" != "yes" ; then
687 #include <sys/types.h>
688 #include <sys/asynch.h>
693 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
697 if compile_prog "" "-laio" "solarisaio" ; then
701 print_config "Solaris AIO support" "$solaris_aio"
703 ##########################################
704 # __sync_fetch_and_add test
705 if test "$sfaa" != "yes" ; then
709 #include <inttypes.h>
710 static int sfaa(uint64_t *ptr)
712 return __sync_fetch_and_add(ptr, 0);
715 int main(int argc, char **argv)
722 if compile_prog "" "" "__sync_fetch_and_add()" ; then
725 print_config "__sync_fetch_and_add" "$sfaa"
727 ##########################################
728 # __sync_synchronize() test
729 if test "$sync_sync" != "yes" ; then
733 #include <inttypes.h>
735 int main(int argc, char **argv)
737 __sync_synchronize();
741 if compile_prog "" "" "__sync_synchronize()" ; then
744 print_config "__sync_synchronize" "$sync_sync"
746 ##########################################
747 # __sync_val_compare_and_swap() test
748 if test "$cmp_swap" != "yes" ; then
752 #include <inttypes.h>
754 int main(int argc, char **argv)
757 return __sync_val_compare_and_swap(&x, 1, 2);
760 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
763 print_config "__sync_val_compare_and_swap" "$cmp_swap"
765 ##########################################
767 if test "$libverbs" != "yes" ; then
771 #include <infiniband/verbs.h>
772 int main(int argc, char **argv)
774 struct ibv_pd *pd = ibv_alloc_pd(NULL);
778 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
780 LIBS="-libverbs $LIBS"
782 print_config "libverbs" "$libverbs"
784 ##########################################
786 if test "$rdmacm" != "yes" ; then
791 #include <rdma/rdma_cma.h>
792 int main(int argc, char **argv)
794 rdma_destroy_qp(NULL);
798 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
800 LIBS="-lrdmacm $LIBS"
802 print_config "rdmacm" "$rdmacm"
804 ##########################################
805 # asprintf() and vasprintf() probes
806 if test "$have_asprintf" != "yes" ; then
812 int main(int argc, char **argv)
814 return asprintf(NULL, "%s", "str") == 0;
817 if compile_prog "" "" "have_asprintf"; then
820 print_config "asprintf()" "$have_asprintf"
822 if test "$have_vasprintf" != "yes" ; then
828 int main(int argc, char **argv)
830 return vasprintf(NULL, "%s", NULL) == 0;
833 if compile_prog "" "" "have_vasprintf"; then
836 print_config "vasprintf()" "$have_vasprintf"
838 ##########################################
839 # Linux fallocate probe
840 if test "$linux_fallocate" != "yes" ; then
846 #include <linux/falloc.h>
847 int main(int argc, char **argv)
849 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
853 if compile_prog "" "" "linux_fallocate"; then
854 linux_fallocate="yes"
856 print_config "Linux fallocate" "$linux_fallocate"
858 ##########################################
859 # POSIX fadvise probe
860 if test "$posix_fadvise" != "yes" ; then
866 int main(int argc, char **argv)
868 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
872 if compile_prog "" "" "posix_fadvise"; then
875 print_config "POSIX fadvise" "$posix_fadvise"
877 ##########################################
878 # POSIX fallocate probe
879 if test "$posix_fallocate" != "yes" ; then
885 int main(int argc, char **argv)
887 int r = posix_fallocate(0, 0, 1024);
891 if compile_prog "" "" "posix_fallocate"; then
892 posix_fallocate="yes"
894 print_config "POSIX fallocate" "$posix_fallocate"
896 ##########################################
897 # sched_set/getaffinity 2 or 3 argument test
898 if test "$linux_2arg_affinity" != "yes" ; then
899 linux_2arg_affinity="no"
901 if test "$linux_3arg_affinity" != "yes" ; then
902 linux_3arg_affinity="no"
906 int main(int argc, char **argv)
909 return sched_setaffinity(0, sizeof(mask), &mask);
912 if compile_prog "" "" "sched_setaffinity(,,)"; then
913 linux_3arg_affinity="yes"
917 int main(int argc, char **argv)
920 return sched_setaffinity(0, &mask);
923 if compile_prog "" "" "sched_setaffinity(,)"; then
924 linux_2arg_affinity="yes"
927 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
928 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
930 ##########################################
931 # clock_gettime probe
932 if test "$clock_gettime" != "yes" ; then
938 int main(int argc, char **argv)
940 return clock_gettime(0, NULL);
943 if compile_prog "" "" "clock_gettime"; then
945 elif compile_prog "" "-lrt" "clock_gettime"; then
949 print_config "clock_gettime" "$clock_gettime"
951 ##########################################
952 # CLOCK_MONOTONIC probe
953 if test "$clock_monotonic" != "yes" ; then
956 if test "$clock_gettime" = "yes" ; then
960 int main(int argc, char **argv)
962 return clock_gettime(CLOCK_MONOTONIC, NULL);
965 if compile_prog "" "$LIBS" "clock monotonic"; then
966 clock_monotonic="yes"
969 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
971 ##########################################
972 # CLOCK_MONOTONIC_RAW probe
973 if test "$clock_monotonic_raw" != "yes" ; then
974 clock_monotonic_raw="no"
976 if test "$clock_gettime" = "yes" ; then
980 int main(int argc, char **argv)
982 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
985 if compile_prog "" "$LIBS" "clock monotonic"; then
986 clock_monotonic_raw="yes"
989 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
991 ##########################################
992 # CLOCK_MONOTONIC_PRECISE probe
993 if test "$clock_monotonic_precise" != "yes" ; then
994 clock_monotonic_precise="no"
996 if test "$clock_gettime" = "yes" ; then
1000 int main(int argc, char **argv)
1002 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
1005 if compile_prog "" "$LIBS" "clock monotonic precise"; then
1006 clock_monotonic_precise="yes"
1009 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1011 ##########################################
1013 if test "$clockid_t" != "yes" ; then
1019 int main(int argc, char **argv)
1021 volatile clockid_t cid;
1022 memset((void*)&cid, 0, sizeof(cid));
1026 if compile_prog "" "$LIBS" "clockid_t"; then
1029 print_config "clockid_t" "$clockid_t"
1031 ##########################################
1032 # gettimeofday() probe
1033 if test "$gettimeofday" != "yes" ; then
1037 #include <sys/time.h>
1039 int main(int argc, char **argv)
1042 return gettimeofday(&tv, NULL);
1045 if compile_prog "" "" "gettimeofday"; then
1048 print_config "gettimeofday" "$gettimeofday"
1050 ##########################################
1052 if test "$fdatasync" != "yes" ; then
1058 int main(int argc, char **argv)
1060 return fdatasync(0);
1063 if compile_prog "" "" "fdatasync"; then
1066 print_config "fdatasync" "$fdatasync"
1068 ##########################################
1069 # sync_file_range() probe
1070 if test "$sync_file_range" != "yes" ; then
1071 sync_file_range="no"
1077 #include <linux/fs.h>
1078 int main(int argc, char **argv)
1080 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1081 SYNC_FILE_RANGE_WAIT_AFTER;
1082 return sync_file_range(0, 0, 0, flags);
1085 if compile_prog "" "" "sync_file_range"; then
1086 sync_file_range="yes"
1088 print_config "sync_file_range" "$sync_file_range"
1090 ##########################################
1091 # ext4 move extent probe
1092 if test "$ext4_me" != "yes" ; then
1097 #include <sys/ioctl.h>
1098 int main(int argc, char **argv)
1100 struct move_extent me;
1101 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1104 if compile_prog "" "" "ext4 move extent" ; then
1106 elif test $targetos = "Linux" ; then
1107 # On Linux, just default to it on and let it error at runtime if we really
1108 # don't have it. None of my updated systems have it defined, but it does
1109 # work. Takes a while to bubble back.
1112 print_config "EXT4 move extent" "$ext4_me"
1114 ##########################################
1116 if test "$linux_splice" != "yes" ; then
1122 int main(int argc, char **argv)
1124 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1127 if compile_prog "" "" "linux splice"; then
1130 print_config "Linux splice(2)" "$linux_splice"
1132 ##########################################
1134 if test "$guasi" != "yes" ; then
1139 #include <guasi_syscalls.h>
1140 int main(int argc, char **argv)
1142 guasi_t ctx = guasi_create(0, 0, 0);
1146 if compile_prog "" "" "guasi"; then
1149 print_config "GUASI" "$guasi"
1151 ##########################################
1153 if test "$fusion_aw" != "yes" ; then
1157 #include <nvm/nvm_primitives.h>
1158 int main(int argc, char **argv)
1160 nvm_version_t ver_info;
1161 nvm_handle_t handle;
1163 handle = nvm_get_handle(0, &ver_info);
1164 return nvm_atomic_write(handle, 0, 0, 0);
1167 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1168 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1171 print_config "Fusion-io atomic engine" "$fusion_aw"
1173 ##########################################
1175 if test "$libnuma" != "yes" ; then
1180 int main(int argc, char **argv)
1182 return numa_available();
1185 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1189 print_config "libnuma" "$libnuma"
1191 ##########################################
1192 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1193 if test "$libnuma" = "yes" ; then
1197 int main(int argc, char **argv)
1199 struct bitmask *mask = numa_parse_nodestring(NULL);
1200 return mask->size == 0;
1203 if compile_prog "" "" "libnuma api"; then
1206 print_config "libnuma v2" "$libnuma_v2"
1209 ##########################################
1211 if test "$strsep" != "yes" ; then
1216 int main(int argc, char **argv)
1218 static char *string = "This is a string";
1219 strsep(&string, "needle");
1223 if compile_prog "" "" "strsep"; then
1226 print_config "strsep" "$strsep"
1228 ##########################################
1229 # strcasestr() probe
1230 if test "$strcasestr" != "yes" ; then
1235 int main(int argc, char **argv)
1237 return strcasestr(argv[0], argv[1]) != NULL;
1240 if compile_prog "" "" "strcasestr"; then
1243 print_config "strcasestr" "$strcasestr"
1245 ##########################################
1247 if test "$strlcat" != "yes" ; then
1252 int main(int argc, char **argv)
1254 static char dst[64];
1255 static char *string = "This is a string";
1256 memset(dst, 0, sizeof(dst));
1257 strlcat(dst, string, sizeof(dst));
1261 if compile_prog "" "" "strlcat"; then
1264 print_config "strlcat" "$strlcat"
1266 ##########################################
1267 # getopt_long_only() probe
1268 if test "$getopt_long_only" != "yes" ; then
1269 getopt_long_only="no"
1275 int main(int argc, char **argv)
1277 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1281 if compile_prog "" "" "getopt_long_only"; then
1282 getopt_long_only="yes"
1284 print_config "getopt_long_only()" "$getopt_long_only"
1286 ##########################################
1288 if test "$inet_aton" != "yes" ; then
1292 #include <sys/socket.h>
1293 #include <arpa/inet.h>
1295 int main(int argc, char **argv)
1298 return inet_aton(NULL, &in);
1301 if compile_prog "" "" "inet_aton"; then
1304 print_config "inet_aton" "$inet_aton"
1306 ##########################################
1308 if test "$socklen_t" != "yes" ; then
1312 #include <sys/socket.h>
1313 int main(int argc, char **argv)
1319 if compile_prog "" "" "socklen_t"; then
1322 print_config "socklen_t" "$socklen_t"
1324 ##########################################
1325 # Whether or not __thread is supported for TLS
1326 if test "$tls_thread" != "yes" ; then
1331 static __thread int ret;
1332 int main(int argc, char **argv)
1337 if compile_prog "" "" "__thread"; then
1340 print_config "__thread" "$tls_thread"
1342 ##########################################
1343 # Check if we have required gtk/glib support for gfio
1344 if test "$gfio" != "yes" ; then
1347 if test "$gfio_check" = "yes" ; then
1351 #include <gtk/gtk.h>
1354 gdk_threads_enter();
1355 gdk_threads_leave();
1357 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1360 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1361 ORG_LDFLAGS=$LDFLAGS
1362 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1363 if test "$?" != "0" ; then
1364 echo "configure: gtk and gthread not found"
1367 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1368 if test "$?" != "0" ; then
1369 echo "configure: gtk and gthread not found"
1372 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1374 if test "$?" = "0" ; then
1376 GFIO_LIBS="$LIBS $GTK_LIBS"
1377 CFLAGS="$CFLAGS $GTK_CFLAGS"
1379 echo "GTK found, but need version 2.18 or higher"
1383 echo "Please install gtk and gdk libraries"
1386 LDFLAGS=$ORG_LDFLAGS
1389 if test "$gfio_check" = "yes" ; then
1390 print_config "gtk 2.18 or higher" "$gfio"
1393 ##########################################
1394 # Check whether we have getrusage(RUSAGE_THREAD)
1395 if test "$rusage_thread" != "yes" ; then
1399 #include <sys/time.h>
1400 #include <sys/resource.h>
1401 int main(int argc, char **argv)
1404 getrusage(RUSAGE_THREAD, &ru);
1408 if compile_prog "" "" "RUSAGE_THREAD"; then
1411 print_config "RUSAGE_THREAD" "$rusage_thread"
1413 ##########################################
1414 # Check whether we have SCHED_IDLE
1415 if test "$sched_idle" != "yes" ; then
1420 int main(int argc, char **argv)
1422 struct sched_param p;
1423 return sched_setscheduler(0, SCHED_IDLE, &p);
1426 if compile_prog "" "" "SCHED_IDLE"; then
1429 print_config "SCHED_IDLE" "$sched_idle"
1431 ##########################################
1432 # Check whether we have TCP_NODELAY
1433 if test "$tcp_nodelay" != "yes" ; then
1438 #include <sys/types.h>
1439 #include <sys/socket.h>
1440 #include <netinet/tcp.h>
1441 int main(int argc, char **argv)
1443 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1446 if compile_prog "" "" "TCP_NODELAY"; then
1449 print_config "TCP_NODELAY" "$tcp_nodelay"
1451 ##########################################
1452 # Check whether we have SO_SNDBUF
1453 if test "$window_size" != "yes" ; then
1458 #include <sys/types.h>
1459 #include <sys/socket.h>
1460 #include <netinet/tcp.h>
1461 int main(int argc, char **argv)
1463 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1464 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1467 if compile_prog "" "" "SO_SNDBUF"; then
1470 print_config "Net engine window_size" "$window_size"
1472 ##########################################
1473 # Check whether we have TCP_MAXSEG
1474 if test "$mss" != "yes" ; then
1479 #include <sys/types.h>
1480 #include <sys/socket.h>
1481 #include <netinet/tcp.h>
1482 #include <arpa/inet.h>
1483 #include <netinet/in.h>
1484 int main(int argc, char **argv)
1486 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1489 if compile_prog "" "" "TCP_MAXSEG"; then
1492 print_config "TCP_MAXSEG" "$mss"
1494 ##########################################
1495 # Check whether we have RLIMIT_MEMLOCK
1496 if test "$rlimit_memlock" != "yes" ; then
1500 #include <sys/time.h>
1501 #include <sys/resource.h>
1502 int main(int argc, char **argv)
1505 return getrlimit(RLIMIT_MEMLOCK, &rl);
1508 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1509 rlimit_memlock="yes"
1511 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1513 ##########################################
1514 # Check whether we have pwritev/preadv
1515 if test "$pwritev" != "yes" ; then
1520 #include <sys/uio.h>
1521 int main(int argc, char **argv)
1523 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1526 if compile_prog "" "" "pwritev"; then
1529 print_config "pwritev/preadv" "$pwritev"
1531 ##########################################
1532 # Check whether we have pwritev2/preadv2
1533 if test "$pwritev2" != "yes" ; then
1538 #include <sys/uio.h>
1539 int main(int argc, char **argv)
1541 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1544 if compile_prog "" "" "pwritev2"; then
1547 print_config "pwritev2/preadv2" "$pwritev2"
1549 ##########################################
1550 # Check whether we have the required functions for ipv6
1551 if test "$ipv6" != "yes" ; then
1555 #include <sys/types.h>
1556 #include <sys/socket.h>
1557 #include <netinet/in.h>
1560 int main(int argc, char **argv)
1562 struct addrinfo hints;
1563 struct in6_addr addr;
1566 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1568 printf("%s\n", gai_strerror(ret));
1573 if compile_prog "" "" "ipv6"; then
1576 print_config "IPv6 helpers" "$ipv6"
1578 ##########################################
1580 if test "$http" != "yes" ; then
1583 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1585 #include <curl/curl.h>
1586 #include <openssl/hmac.h>
1588 int main(int argc, char **argv)
1593 curl = curl_easy_init();
1594 curl_easy_cleanup(curl);
1596 ctx = HMAC_CTX_new();
1597 HMAC_CTX_reset(ctx);
1602 # openssl < 1.1.0 uses the HMAC_CTX type directly
1604 #include <curl/curl.h>
1605 #include <openssl/hmac.h>
1607 int main(int argc, char **argv)
1612 curl = curl_easy_init();
1613 curl_easy_cleanup(curl);
1615 HMAC_CTX_init(&ctx);
1616 HMAC_CTX_cleanup(&ctx);
1620 if test "$disable_http" != "yes"; then
1621 HTTP_LIBS="-lcurl -lssl -lcrypto"
1622 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1623 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1625 LIBS="$HTTP_LIBS $LIBS"
1626 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1628 LIBS="$HTTP_LIBS $LIBS"
1631 print_config "http engine" "$http"
1633 ##########################################
1635 if test "$rados" != "yes" ; then
1639 #include <rados/librados.h>
1641 int main(int argc, char **argv)
1644 rados_ioctx_t io_ctx;
1645 const char cluster_name[] = "ceph";
1646 const char user_name[] = "client.admin";
1647 const char pool[] = "rados";
1649 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1650 rados_create2(&cluster, cluster_name, user_name, 0);
1651 rados_ioctx_create(cluster, pool, &io_ctx);
1656 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1657 LIBS="-lrados $LIBS"
1660 print_config "Rados engine" "$rados"
1662 ##########################################
1664 if test "$rbd" != "yes" ; then
1668 #include <rbd/librbd.h>
1670 int main(int argc, char **argv)
1673 rados_ioctx_t io_ctx;
1674 const char cluster_name[] = "ceph";
1675 const char user_name[] = "client.admin";
1676 const char pool[] = "rbd";
1677 int major, minor, extra;
1679 rbd_version(&major, &minor, &extra);
1680 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1681 rados_create2(&cluster, cluster_name, user_name, 0);
1682 rados_ioctx_create(cluster, pool, &io_ctx);
1687 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1688 LIBS="-lrbd -lrados $LIBS"
1691 print_config "Rados Block Device engine" "$rbd"
1693 ##########################################
1694 # check for rbd_poll
1695 if test "$rbd_poll" != "yes" ; then
1698 if test "$rbd" = "yes"; then
1700 #include <rbd/librbd.h>
1701 #include <sys/eventfd.h>
1703 int main(int argc, char **argv)
1706 rbd_completion_t comp;
1708 int fd = eventfd(0, EFD_NONBLOCK);
1709 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1710 rbd_poll_io_events(image, comp, 1);
1715 if compile_prog "" "-lrbd -lrados" "rbd"; then
1718 print_config "rbd_poll" "$rbd_poll"
1721 ##########################################
1722 # check for rbd_invalidate_cache()
1723 if test "$rbd_inval" != "yes" ; then
1726 if test "$rbd" = "yes"; then
1728 #include <rbd/librbd.h>
1730 int main(int argc, char **argv)
1734 return rbd_invalidate_cache(image);
1737 if compile_prog "" "-lrbd -lrados" "rbd"; then
1740 print_config "rbd_invalidate_cache" "$rbd_inval"
1743 ##########################################
1744 # Check whether we have setvbuf
1745 if test "$setvbuf" != "yes" ; then
1750 int main(int argc, char **argv)
1754 setvbuf(f, buf, _IOFBF, sizeof(buf));
1758 if compile_prog "" "" "setvbuf"; then
1761 print_config "setvbuf" "$setvbuf"
1763 ##########################################
1765 if test "$gfapi" != "yes" ; then
1769 #include <glusterfs/api/glfs.h>
1771 int main(int argc, char **argv)
1773 glfs_t *g = glfs_new("foo");
1778 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1779 LIBS="-lgfapi -lglusterfs $LIBS"
1782 print_config "Gluster API engine" "$gfapi"
1784 ##########################################
1785 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1786 if test "$gfapi" = "yes" ; then
1789 #include <glusterfs/api/glfs.h>
1791 int main(int argc, char **argv)
1794 int ret = glfs_fadvise(fd, 0, 0, 1);
1799 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1802 print_config "Gluster API use fadvise" "$gf_fadvise"
1805 ##########################################
1806 # check for gfapi trim support
1807 if test "$gf_trim" != "yes" ; then
1810 if test "$gfapi" = "yes" ; then
1812 #include <glusterfs/api/glfs.h>
1814 int main(int argc, char **argv)
1816 return glfs_discard_async(NULL, 0, 0);
1819 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1822 print_config "Gluster API trim support" "$gf_trim"
1825 ##########################################
1826 # Check if we support stckf on s390
1827 if test "$s390_z196_facilities" != "yes" ; then
1828 s390_z196_facilities="no"
1831 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1832 int main(int argc, char **argv)
1834 /* We want just 1 double word to be returned. */
1835 register unsigned long reg0 asm("0") = 0;
1836 unsigned long stfle_bits;
1837 asm volatile(".machine push" "\n\t"
1838 ".machine \"z9-109\"" "\n\t"
1841 : "=QS" (stfle_bits), "+d" (reg0)
1844 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1850 if compile_prog "" "" "s390_z196_facilities"; then
1852 if [ $? -eq 0 ]; then
1853 s390_z196_facilities="yes"
1856 print_config "s390_z196_facilities" "$s390_z196_facilities"
1858 ##########################################
1859 # Check if we have required environment variables configured for libhdfs
1860 if test "$libhdfs" = "yes" ; then
1862 if test "$JAVA_HOME" = "" ; then
1863 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1866 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1867 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1870 if test "$FIO_LIBHDFS_LIB" = "" ; then
1871 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1874 if test "$hdfs_conf_error" = "1" ; then
1878 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1879 FIO_HDFS_CPU="amd64"
1882 print_config "HDFS engine" "$libhdfs"
1884 ##########################################
1885 # Check whether we have MTD
1886 if test "$mtd" != "yes" ; then
1891 #include <mtd/mtd-user.h>
1892 #include <sys/ioctl.h>
1893 int main(int argc, char **argv)
1895 struct mtd_write_req ops;
1896 struct mtd_info_user info;
1897 memset(&ops, 0, sizeof(ops));
1898 info.type = MTD_MLCNANDFLASH;
1899 return ioctl(0, MEMGETINFO, &info);
1902 if compile_prog "" "" "mtd"; then
1905 print_config "MTD" "$mtd"
1907 ##########################################
1908 # Check whether we have libpmem
1909 if test "$libpmem" != "yes" ; then
1913 #include <libpmem.h>
1914 int main(int argc, char **argv)
1917 rc = pmem_is_pmem(0, 0);
1921 if compile_prog "" "-lpmem" "libpmem"; then
1925 print_config "libpmem" "$libpmem"
1927 ##########################################
1928 # Check whether we have libpmemblk
1929 # libpmem is a prerequisite
1930 if test "$libpmemblk" != "yes" ; then
1933 if test "$libpmem" = "yes"; then
1935 #include <libpmemblk.h>
1936 int main(int argc, char **argv)
1939 pbp = pmemblk_open("", 0);
1943 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1945 LIBS="-lpmemblk $LIBS"
1948 print_config "libpmemblk" "$libpmemblk"
1950 # Choose the ioengines
1951 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1954 if test "$libpmemblk" = "yes"; then
1959 ##########################################
1960 # Report whether pmemblk engine is enabled
1961 print_config "PMDK pmemblk engine" "$pmemblk"
1963 ##########################################
1964 # Report whether dev-dax engine is enabled
1965 print_config "PMDK dev-dax engine" "$devdax"
1967 ##########################################
1968 # Report whether libpmem engine is enabled
1969 print_config "PMDK libpmem engine" "$pmem"
1971 ##########################################
1972 # Check whether we support DDN's IME
1973 if test "$libime" != "yes" ; then
1977 #include <ime_native.h>
1978 int main(int argc, char **argv)
1982 rc = ime_native_finalize();
1986 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
1988 CFLAGS="-I${ime_path}/include $CFLAGS"
1989 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
1990 LIBS="-lim_client $LIBS"
1992 print_config "DDN's Infinite Memory Engine" "$libime"
1994 ##########################################
1995 # Check if we have lex/yacc available
2000 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2001 if test "$targetos" != "SunOS" ; then
2002 LEX=$(which lex 2> /dev/null)
2003 if test -x "$LEX" ; then
2006 YACC=$(which bison 2> /dev/null)
2007 if test -x "$YACC" ; then
2011 YACC=$(which yacc 2> /dev/null)
2012 if test -x "$YACC" ; then
2016 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2020 if test "$arith" = "yes" ; then
2022 extern int yywrap(void);
2024 int main(int argc, char **argv)
2030 if compile_prog "" "-ll" "lex"; then
2039 # Check if lex fails using -o
2040 if test "$arith" = "yes" ; then
2041 if test "$force_no_lex_o" = "yes" ; then
2044 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
2045 if test "$?" = "0" ; then
2053 print_config "lex/yacc for arithmetic" "$arith"
2055 ##########################################
2056 # Check whether we have setmntent/getmntent
2057 if test "$getmntent" != "yes" ; then
2063 int main(int argc, char **argv)
2065 FILE *mtab = setmntent(NULL, "r");
2066 struct mntent *mnt = getmntent(mtab);
2071 if compile_prog "" "" "getmntent"; then
2074 print_config "getmntent" "$getmntent"
2076 ##########################################
2077 # Check whether we have getmntinfo
2078 # These are originally added for BSDs, but may also work
2079 # on other operating systems with getmntinfo(3).
2081 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2082 # Note that NetBSD needs -Werror to catch warning as error.
2083 if test "$getmntinfo" != "yes" ; then
2088 #include <sys/param.h>
2089 #include <sys/mount.h>
2090 int main(int argc, char **argv)
2093 return getmntinfo(&st, MNT_NOWAIT);
2096 if compile_prog "-Werror" "" "getmntinfo"; then
2099 print_config "getmntinfo" "$getmntinfo"
2101 # getmntinfo(3) for NetBSD.
2102 if test "$getmntinfo_statvfs" != "yes" ; then
2103 getmntinfo_statvfs="no"
2107 #include <sys/statvfs.h>
2108 int main(int argc, char **argv)
2111 return getmntinfo(&st, MNT_NOWAIT);
2114 # Skip the test if the one with statfs arg is detected.
2115 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2116 getmntinfo_statvfs="yes"
2117 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2120 ##########################################
2121 # Check whether we have _Static_assert
2122 if test "$static_assert" != "yes" ; then
2134 int main(int argc, char **argv)
2136 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2140 if compile_prog "" "" "static_assert"; then
2143 print_config "Static Assert" "$static_assert"
2145 ##########################################
2146 # Check whether we have bool / stdbool.h
2147 if test "$have_bool" != "yes" ; then
2151 #include <stdbool.h>
2152 int main(int argc, char **argv)
2155 return var != false;
2158 if compile_prog "" "" "bool"; then
2161 print_config "bool" "$have_bool"
2163 ##########################################
2164 # Check whether we have strndup()
2169 int main(int argc, char **argv)
2171 char *res = strndup("test string", 8);
2177 if compile_prog "" "" "strndup"; then
2180 print_config "strndup" "$strndup"
2182 ##########################################
2183 # <valgrind/drd.h> probe
2184 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2185 # also available but not the other way around.
2186 if test "$valgrind_dev" != "yes" ; then
2190 #include <valgrind/drd.h>
2191 int main(int argc, char **argv)
2196 if compile_prog "" "" "valgrind_dev"; then
2199 print_config "Valgrind headers" "$valgrind_dev"
2201 ##########################################
2202 # <linux/blkzoned.h> probe
2203 if test "$linux_blkzoned" != "yes" ; then
2207 #include <linux/blkzoned.h>
2208 int main(int argc, char **argv)
2213 if compile_prog "" "" "linux_blkzoned"; then
2214 linux_blkzoned="yes"
2216 print_config "Zoned block device support" "$linux_blkzoned"
2218 ##########################################
2219 # check march=armv8-a+crc+crypto
2220 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2221 march_armv8_a_crc_crypto="no"
2223 if test "$cpu" = "arm64" ; then
2225 #include <arm_acle.h>
2226 #include <arm_neon.h>
2227 #include <sys/auxv.h>
2231 /* Can we also do a runtime probe? */
2233 return getauxval(AT_HWCAP);
2235 # error "Don't know how to do runtime probe for ARM CRC32c"
2239 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2240 march_armv8_a_crc_crypto="yes"
2241 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2245 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2247 ##########################################
2249 if test "$cuda" != "yes" ; then
2254 int main(int argc, char **argv)
2259 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2263 print_config "cuda" "$cuda"
2265 ##########################################
2266 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2269 #include <sys/stat.h>
2270 #include <sys/types.h>
2271 int main(int argc, char **argv)
2273 return mkdir("/tmp/bla", 0600);
2276 if compile_prog "" "" "mkdir(a, b)"; then
2279 print_config "mkdir(a, b)" "$mkdir_two"
2281 ##########################################
2282 # check for cc -march=native
2285 int main(int argc, char **argv)
2290 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2291 compile_prog "-march=native" "" "march=native"; then
2294 print_config "Build march=native" "$build_native"
2296 #############################################################################
2298 if test "$wordsize" = "64" ; then
2299 output_sym "CONFIG_64BIT"
2300 elif test "$wordsize" = "32" ; then
2301 output_sym "CONFIG_32BIT"
2303 fatal "Unknown wordsize!"
2305 if test "$bigendian" = "yes" ; then
2306 output_sym "CONFIG_BIG_ENDIAN"
2308 output_sym "CONFIG_LITTLE_ENDIAN"
2310 if test "$zlib" = "yes" ; then
2311 output_sym "CONFIG_ZLIB"
2313 if test "$libaio" = "yes" ; then
2314 output_sym "CONFIG_LIBAIO"
2316 if test "$posix_aio" = "yes" ; then
2317 output_sym "CONFIG_POSIXAIO"
2319 if test "$posix_aio_fsync" = "yes" ; then
2320 output_sym "CONFIG_POSIXAIO_FSYNC"
2322 if test "$posix_pshared" = "yes" ; then
2323 output_sym "CONFIG_PSHARED"
2325 if test "$have_asprintf" = "yes" ; then
2326 output_sym "CONFIG_HAVE_ASPRINTF"
2328 if test "$have_vasprintf" = "yes" ; then
2329 output_sym "CONFIG_HAVE_VASPRINTF"
2331 if test "$linux_fallocate" = "yes" ; then
2332 output_sym "CONFIG_LINUX_FALLOCATE"
2334 if test "$posix_fallocate" = "yes" ; then
2335 output_sym "CONFIG_POSIX_FALLOCATE"
2337 if test "$fdatasync" = "yes" ; then
2338 output_sym "CONFIG_FDATASYNC"
2340 if test "$sync_file_range" = "yes" ; then
2341 output_sym "CONFIG_SYNC_FILE_RANGE"
2343 if test "$sfaa" = "yes" ; then
2344 output_sym "CONFIG_SFAA"
2346 if test "$sync_sync" = "yes" ; then
2347 output_sym "CONFIG_SYNC_SYNC"
2349 if test "$cmp_swap" = "yes" ; then
2350 output_sym "CONFIG_CMP_SWAP"
2352 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2353 output_sym "CONFIG_RDMA"
2355 if test "$clock_gettime" = "yes" ; then
2356 output_sym "CONFIG_CLOCK_GETTIME"
2358 if test "$clock_monotonic" = "yes" ; then
2359 output_sym "CONFIG_CLOCK_MONOTONIC"
2361 if test "$clock_monotonic_raw" = "yes" ; then
2362 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2364 if test "$clock_monotonic_precise" = "yes" ; then
2365 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2367 if test "$clockid_t" = "yes"; then
2368 output_sym "CONFIG_CLOCKID_T"
2370 if test "$gettimeofday" = "yes" ; then
2371 output_sym "CONFIG_GETTIMEOFDAY"
2373 if test "$posix_fadvise" = "yes" ; then
2374 output_sym "CONFIG_POSIX_FADVISE"
2376 if test "$linux_3arg_affinity" = "yes" ; then
2377 output_sym "CONFIG_3ARG_AFFINITY"
2378 elif test "$linux_2arg_affinity" = "yes" ; then
2379 output_sym "CONFIG_2ARG_AFFINITY"
2381 if test "$strsep" = "yes" ; then
2382 output_sym "CONFIG_STRSEP"
2384 if test "$strcasestr" = "yes" ; then
2385 output_sym "CONFIG_STRCASESTR"
2387 if test "$strlcat" = "yes" ; then
2388 output_sym "CONFIG_STRLCAT"
2390 if test "$getopt_long_only" = "yes" ; then
2391 output_sym "CONFIG_GETOPT_LONG_ONLY"
2393 if test "$inet_aton" = "yes" ; then
2394 output_sym "CONFIG_INET_ATON"
2396 if test "$socklen_t" = "yes" ; then
2397 output_sym "CONFIG_SOCKLEN_T"
2399 if test "$ext4_me" = "yes" ; then
2400 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2402 if test "$linux_splice" = "yes" ; then
2403 output_sym "CONFIG_LINUX_SPLICE"
2405 if test "$guasi" = "yes" ; then
2406 output_sym "CONFIG_GUASI"
2408 if test "$fusion_aw" = "yes" ; then
2409 output_sym "CONFIG_FUSION_AW"
2411 if test "$libnuma_v2" = "yes" ; then
2412 output_sym "CONFIG_LIBNUMA"
2414 if test "$solaris_aio" = "yes" ; then
2415 output_sym "CONFIG_SOLARISAIO"
2417 if test "$tls_thread" = "yes" ; then
2418 output_sym "CONFIG_TLS_THREAD"
2420 if test "$rusage_thread" = "yes" ; then
2421 output_sym "CONFIG_RUSAGE_THREAD"
2423 if test "$gfio" = "yes" ; then
2424 output_sym "CONFIG_GFIO"
2426 if test "$esx" = "yes" ; then
2427 output_sym "CONFIG_ESX"
2428 output_sym "CONFIG_NO_SHM"
2430 if test "$sched_idle" = "yes" ; then
2431 output_sym "CONFIG_SCHED_IDLE"
2433 if test "$tcp_nodelay" = "yes" ; then
2434 output_sym "CONFIG_TCP_NODELAY"
2436 if test "$window_size" = "yes" ; then
2437 output_sym "CONFIG_NET_WINDOWSIZE"
2439 if test "$mss" = "yes" ; then
2440 output_sym "CONFIG_NET_MSS"
2442 if test "$rlimit_memlock" = "yes" ; then
2443 output_sym "CONFIG_RLIMIT_MEMLOCK"
2445 if test "$pwritev" = "yes" ; then
2446 output_sym "CONFIG_PWRITEV"
2448 if test "$pwritev2" = "yes" ; then
2449 output_sym "CONFIG_PWRITEV2"
2451 if test "$ipv6" = "yes" ; then
2452 output_sym "CONFIG_IPV6"
2454 if test "$http" = "yes" ; then
2455 output_sym "CONFIG_HTTP"
2457 if test "$rados" = "yes" ; then
2458 output_sym "CONFIG_RADOS"
2460 if test "$rbd" = "yes" ; then
2461 output_sym "CONFIG_RBD"
2463 if test "$rbd_poll" = "yes" ; then
2464 output_sym "CONFIG_RBD_POLL"
2466 if test "$rbd_inval" = "yes" ; then
2467 output_sym "CONFIG_RBD_INVAL"
2469 if test "$setvbuf" = "yes" ; then
2470 output_sym "CONFIG_SETVBUF"
2472 if test "$s390_z196_facilities" = "yes" ; then
2473 output_sym "CONFIG_S390_Z196_FACILITIES"
2474 CFLAGS="$CFLAGS -march=z9-109"
2477 if test "$gfapi" = "yes" ; then
2478 output_sym "CONFIG_GFAPI"
2480 if test "$gf_fadvise" = "yes" ; then
2481 output_sym "CONFIG_GF_FADVISE"
2483 if test "$gf_trim" = "yes" ; then
2484 output_sym "CONFIG_GF_TRIM"
2486 if test "$libhdfs" = "yes" ; then
2487 output_sym "CONFIG_LIBHDFS"
2488 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2489 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2490 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2491 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2493 if test "$mtd" = "yes" ; then
2494 output_sym "CONFIG_MTD"
2496 if test "$pmemblk" = "yes" ; then
2497 output_sym "CONFIG_PMEMBLK"
2499 if test "$devdax" = "yes" ; then
2500 output_sym "CONFIG_LINUX_DEVDAX"
2502 if test "$pmem" = "yes" ; then
2503 output_sym "CONFIG_LIBPMEM"
2505 if test "$libime" = "yes" ; then
2506 output_sym "CONFIG_IME"
2508 if test "$arith" = "yes" ; then
2509 output_sym "CONFIG_ARITHMETIC"
2510 if test "$yacc_is_bison" = "yes" ; then
2511 echo "YACC=$YACC -y" >> $config_host_mak
2513 echo "YACC=$YACC" >> $config_host_mak
2515 if test "$lex_use_o" = "yes" ; then
2516 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2519 if test "$getmntent" = "yes" ; then
2520 output_sym "CONFIG_GETMNTENT"
2522 if test "$getmntinfo" = "yes" ; then
2523 output_sym "CONFIG_GETMNTINFO"
2525 if test "$getmntinfo_statvfs" = "yes" ; then
2526 output_sym "CONFIG_GETMNTINFO_STATVFS"
2528 if test "$static_assert" = "yes" ; then
2529 output_sym "CONFIG_STATIC_ASSERT"
2531 if test "$have_bool" = "yes" ; then
2532 output_sym "CONFIG_HAVE_BOOL"
2534 if test "$strndup" = "yes" ; then
2535 output_sym "CONFIG_HAVE_STRNDUP"
2537 if test "$disable_opt" = "yes" ; then
2538 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2540 if test "$valgrind_dev" = "yes"; then
2541 output_sym "CONFIG_VALGRIND_DEV"
2543 if test "$linux_blkzoned" = "yes" ; then
2544 output_sym "CONFIG_LINUX_BLKZONED"
2546 if test "$zlib" = "no" ; then
2547 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2548 if test "$build_static" = "yes"; then
2549 echo "Note that some distros have separate packages for static libraries."
2552 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2553 output_sym "ARCH_HAVE_CRC_CRYPTO"
2555 if test "$cuda" = "yes" ; then
2556 output_sym "CONFIG_CUDA"
2558 if test "$mkdir_two" = "yes" ; then
2559 output_sym "CONFIG_HAVE_MKDIR_TWO"
2561 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2562 output_sym "CONFIG_BUILD_NATIVE"
2565 echo "LIBS+=$LIBS" >> $config_host_mak
2566 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2567 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2568 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2569 echo "CC=$cc" >> $config_host_mak
2570 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2571 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2573 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2574 cat > Makefile <<EOF
2575 SRCDIR:=`dirname $0`
2576 include \$(SRCDIR)/Makefile