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
156 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
158 --prefix=*) prefix="$optarg"
160 --cpu=*) cpu="$optarg"
162 # esx is cross compiled and cannot be detect through simple uname calls
168 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
170 --build-32bit-win) build_32bit_win="yes"
172 --target-win-ver=*) target_win_ver="$optarg"
174 --build-static) build_static="yes"
176 --enable-gfio) gfio_check="yes"
178 --disable-numa) disable_numa="yes"
180 --disable-rdma) disable_rdma="yes"
182 --disable-rados) disable_rados="yes"
184 --disable-rbd) disable_rbd="yes"
186 --disable-http) disable_http="yes"
188 --disable-gfapi) disable_gfapi="yes"
190 --enable-libhdfs) libhdfs="yes"
192 --disable-lex) disable_lex="yes"
194 --enable-lex) disable_lex="no"
196 --disable-shm) no_shm="yes"
198 --disable-optimizations) disable_opt="yes"
200 --disable-pmem) disable_pmem="yes"
202 --enable-cuda) enable_cuda="yes"
204 --disable-native) disable_native="yes"
206 --with-ime=*) ime_path="$optarg"
208 --enable-libiscsi) libiscsi="yes"
214 echo "Bad option $opt"
220 if test "$show_help" = "yes" ; then
221 echo "--prefix= Use this directory as installation prefix"
222 echo "--cpu= Specify target CPU if auto-detect fails"
223 echo "--cc= Specify compiler to use"
224 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
225 echo "--build-32bit-win Enable 32-bit build on Windows"
226 echo "--target-win-ver= Minimum version of Windows to target (XP or 7)"
227 echo "--build-static Build a static fio"
228 echo "--esx Configure build options for esx"
229 echo "--enable-gfio Enable building of gtk gfio"
230 echo "--disable-numa Disable libnuma even if found"
231 echo "--disable-rdma Disable RDMA support even if found"
232 echo "--disable-rados Disable Rados support even if found"
233 echo "--disable-rbd Disable Rados Block Device even if found"
234 echo "--disable-http Disable HTTP support even if found"
235 echo "--disable-gfapi Disable gfapi"
236 echo "--enable-libhdfs Enable hdfs support"
237 echo "--disable-lex Disable use of lex/yacc for math"
238 echo "--disable-pmem Disable pmem based engines even if found"
239 echo "--enable-lex Enable use of lex/yacc for math"
240 echo "--disable-shm Disable SHM support"
241 echo "--disable-optimizations Don't enable compiler optimizations"
242 echo "--enable-cuda Enable GPUDirect RDMA support"
243 echo "--disable-native Don't build for native host"
244 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
245 echo "--enable-libiscsi Enable iscsi support"
249 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
250 # Preferred compiler (can be overriden later after we know the platform):
252 # ${cross_prefix}gcc (if cross-prefix specified)
255 if test -z "${CC}${cross_prefix}"; then
262 cc="${CC-${cross_prefix}gcc}"
265 if check_define __ANDROID__ ; then
267 elif check_define __linux__ ; then
269 elif check_define __OpenBSD__ ; then
271 elif check_define __NetBSD__ ; then
273 elif check_define __sun__ ; then
275 CFLAGS="$CFLAGS -D_REENTRANT"
276 elif check_define _WIN32 ; then
282 echo "# Automatically generated by configure - do not modify" > $config_host_mak
283 printf "# Configured with:" >> $config_host_mak
284 printf " '%s'" "$0" "$@" >> $config_host_mak
285 echo >> $config_host_mak
286 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
288 if test "$no_shm" = "yes" ; then
289 output_sym "CONFIG_NO_SHM"
292 if test "$disable_opt" = "yes" ; then
293 output_sym "CONFIG_FIO_NO_OPT"
296 # Some host OSes need non-standard checks for which CPU to use.
297 # Note that these checks are broken for cross-compilation: if you're
298 # cross-compiling to one of these OSes then you'll need to specify
299 # the correct CPU with the --cpu option.
302 # Unless explicitly enabled, turn off lex.
303 # OpenBSD will hit syntax error when enabled.
304 if test -z "$disable_lex" ; then
311 CFLAGS="$CFLAGS -I/usr/local/include"
312 LDFLAGS="$LDFLAGS -L/usr/local/lib"
315 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
316 # we can run 64-bit userspace code.
317 # If the user didn't specify a CPU explicitly and the kernel says this is
318 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
320 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
323 # Error at compile time linking of weak/partial symbols if possible...
330 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
331 echo "Disabling weak symbols"
332 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
336 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
337 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
340 LIBS="-lnsl -lsocket"
343 # We still force some options, so keep this message here.
344 echo "Forcing some known good options on Windows"
345 if test -z "${CC}${cross_prefix}"; then
346 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
347 cc="i686-w64-mingw32-gcc"
349 cc="x86_64-w64-mingw32-gcc"
353 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
354 if test -z "$target_win_ver"; then
355 # Default Windows API target
358 if test "$target_win_ver" = "XP"; then
359 output_sym "CONFIG_WINDOWS_XP"
360 elif test "$target_win_ver" = "7"; then
361 output_sym "CONFIG_WINDOWS_7"
362 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
364 fatal "Unknown target Windows version"
367 # We need this to be output_sym'd here because this is Windows specific.
368 # The regular configure path never sets this config.
369 output_sym "CONFIG_WINDOWSAIO"
370 # We now take the regular configuration path without having exit 0 here.
371 # Flags below are still necessary mostly for MinGW.
376 clock_gettime="yes" # clock_monotonic probe has dependency on this
377 clock_monotonic="yes"
385 # Now we know the target platform we can have another guess at the preferred
386 # compiler when it wasn't explictly set
387 if test -z "${CC}${cross_prefix}"; then
388 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
394 if test -z "$cc"; then
395 echo "configure: failed to find compiler"
399 if test ! -z "$cpu" ; then
400 # command line argument
402 elif check_define __i386__ ; then
404 elif check_define __x86_64__ ; then
406 elif check_define __sparc__ ; then
407 if check_define __arch64__ ; then
412 elif check_define _ARCH_PPC ; then
413 if check_define _ARCH_PPC64 ; then
418 elif check_define __mips__ ; then
420 elif check_define __ia64__ ; then
422 elif check_define __s390__ ; then
423 if check_define __s390x__ ; then
428 elif check_define __arm__ ; then
430 elif check_define __aarch64__ ; then
432 elif check_define __hppa__ ; then
438 # Normalise host CPU name and set ARCH.
440 ia64|ppc|ppc64|s390|s390x|sparc64)
443 i386|i486|i586|i686|i86pc|BePC)
455 hppa|parisc|parisc64)
469 ##########################################
470 # check cross compile
472 if test "$cross_compile" != "yes" ; then
481 if compile_prog "" "" "cross"; then
482 $TMPE 2>/dev/null || cross_compile="yes"
484 fatal "compile test failed"
487 ##########################################
489 if test "$bigendian" != "yes" ; then
492 if test "$cross_compile" = "no" ; then
494 #include <inttypes.h>
497 volatile uint32_t i=0x01234567;
498 return (*((uint8_t*)(&i))) == 0x67;
501 if compile_prog "" "" "endian"; then
502 $TMPE && bigendian="yes"
505 # If we're cross compiling, try our best to work it out and rely on the
506 # run-time check to fail if we get it wrong.
511 #if __BYTE_ORDER != __BIG_ENDIAN
512 # error "Unknown endianness"
516 compile_prog "" "" "endian" && bigendian="yes"
517 check_define "__ARMEB__" && bigendian="yes"
518 check_define "__MIPSEB__" && bigendian="yes"
522 print_config "Operating system" "$targetos"
523 print_config "CPU" "$cpu"
524 print_config "Big endian" "$bigendian"
525 if test ! -z "$target_win_ver"; then
526 print_config "Target Windows version" "$target_win_ver"
528 print_config "Compiler" "$cc"
529 print_config "Cross compile" "$cross_compile"
532 ##########################################
533 # See if we need to build a static build
534 if test "$build_static" = "yes" ; then
535 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
536 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
540 print_config "Static build" "$build_static"
542 ##########################################
547 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
550 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
554 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
556 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
559 fatal "Unknown wordsize"
561 print_config "Wordsize" "$wordsize"
563 ##########################################
565 if test "$zlib" != "yes" ; then
573 if (inflateInit(&stream) != Z_OK)
578 if compile_prog "" "-lz" "zlib" ; then
582 print_config "zlib" "$zlib"
584 ##########################################
586 if test "$libaio" != "yes" ; then
589 if test "$esx" != "yes" ; then
599 if compile_prog "" "-laio" "libaio" ; then
603 if test "$libaio" = "yes" ; then
604 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
609 print_config "Linux AIO support" "$libaio"
611 ##########################################
613 if test "$posix_aio" != "yes" ; then
616 if test "$posix_aio_lrt" != "yes" ; then
628 if compile_prog "" "" "posixaio" ; then
630 elif compile_prog "" "-lrt" "posixaio -lrt"; then
635 print_config "POSIX AIO support" "$posix_aio"
636 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
638 ##########################################
639 # posix aio fsync probe
640 if test "$posix_aio_fsync" != "yes" ; then
643 if test "$posix_aio" = "yes" ; then
650 return aio_fsync(O_SYNC, &cb);
654 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
658 print_config "POSIX AIO fsync" "$posix_aio_fsync"
660 ##########################################
661 # POSIX pshared attribute probe
662 if test "$posix_pshared" != "yes" ; then
669 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
670 # if defined(__CYGWIN__)
671 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
672 # elif defined(__APPLE__)
673 # include <AvailabilityMacros.h>
674 # include <TargetConditionals.h>
675 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
676 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
680 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
685 if compile_prog "" "$LIBS" "posix_pshared" ; then
688 print_config "POSIX pshared support" "$posix_pshared"
690 ##########################################
692 if test "$solaris_aio" != "yes" ; then
696 #include <sys/types.h>
697 #include <sys/asynch.h>
702 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
706 if compile_prog "" "-laio" "solarisaio" ; then
710 print_config "Solaris AIO support" "$solaris_aio"
712 ##########################################
713 # __sync_fetch_and_add test
714 if test "$sfaa" != "yes" ; then
718 #include <inttypes.h>
719 static int sfaa(uint64_t *ptr)
721 return __sync_fetch_and_add(ptr, 0);
724 int main(int argc, char **argv)
731 if compile_prog "" "" "__sync_fetch_and_add()" ; then
734 print_config "__sync_fetch_and_add" "$sfaa"
736 ##########################################
737 # __sync_synchronize() test
738 if test "$sync_sync" != "yes" ; then
742 #include <inttypes.h>
744 int main(int argc, char **argv)
746 __sync_synchronize();
750 if compile_prog "" "" "__sync_synchronize()" ; then
753 print_config "__sync_synchronize" "$sync_sync"
755 ##########################################
756 # __sync_val_compare_and_swap() test
757 if test "$cmp_swap" != "yes" ; then
761 #include <inttypes.h>
763 int main(int argc, char **argv)
766 return __sync_val_compare_and_swap(&x, 1, 2);
769 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
772 print_config "__sync_val_compare_and_swap" "$cmp_swap"
774 ##########################################
776 if test "$libverbs" != "yes" ; then
780 #include <infiniband/verbs.h>
781 int main(int argc, char **argv)
783 struct ibv_pd *pd = ibv_alloc_pd(NULL);
787 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
789 LIBS="-libverbs $LIBS"
791 print_config "libverbs" "$libverbs"
793 ##########################################
795 if test "$rdmacm" != "yes" ; then
800 #include <rdma/rdma_cma.h>
801 int main(int argc, char **argv)
803 rdma_destroy_qp(NULL);
807 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
809 LIBS="-lrdmacm $LIBS"
811 print_config "rdmacm" "$rdmacm"
813 ##########################################
814 # asprintf() and vasprintf() probes
815 if test "$have_asprintf" != "yes" ; then
821 int main(int argc, char **argv)
823 return asprintf(NULL, "%s", "str") == 0;
826 if compile_prog "" "" "have_asprintf"; then
829 print_config "asprintf()" "$have_asprintf"
831 if test "$have_vasprintf" != "yes" ; then
837 int main(int argc, char **argv)
839 return vasprintf(NULL, "%s", NULL) == 0;
842 if compile_prog "" "" "have_vasprintf"; then
845 print_config "vasprintf()" "$have_vasprintf"
847 ##########################################
848 # Linux fallocate probe
849 if test "$linux_fallocate" != "yes" ; then
855 #include <linux/falloc.h>
856 int main(int argc, char **argv)
858 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
862 if compile_prog "" "" "linux_fallocate"; then
863 linux_fallocate="yes"
865 print_config "Linux fallocate" "$linux_fallocate"
867 ##########################################
868 # POSIX fadvise probe
869 if test "$posix_fadvise" != "yes" ; then
875 int main(int argc, char **argv)
877 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
881 if compile_prog "" "" "posix_fadvise"; then
884 print_config "POSIX fadvise" "$posix_fadvise"
886 ##########################################
887 # POSIX fallocate probe
888 if test "$posix_fallocate" != "yes" ; then
894 int main(int argc, char **argv)
896 int r = posix_fallocate(0, 0, 1024);
900 if compile_prog "" "" "posix_fallocate"; then
901 posix_fallocate="yes"
903 print_config "POSIX fallocate" "$posix_fallocate"
905 ##########################################
906 # sched_set/getaffinity 2 or 3 argument test
907 if test "$linux_2arg_affinity" != "yes" ; then
908 linux_2arg_affinity="no"
910 if test "$linux_3arg_affinity" != "yes" ; then
911 linux_3arg_affinity="no"
915 int main(int argc, char **argv)
918 return sched_setaffinity(0, sizeof(mask), &mask);
921 if compile_prog "" "" "sched_setaffinity(,,)"; then
922 linux_3arg_affinity="yes"
926 int main(int argc, char **argv)
929 return sched_setaffinity(0, &mask);
932 if compile_prog "" "" "sched_setaffinity(,)"; then
933 linux_2arg_affinity="yes"
936 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
937 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
939 ##########################################
940 # clock_gettime probe
941 if test "$clock_gettime" != "yes" ; then
947 int main(int argc, char **argv)
949 return clock_gettime(0, NULL);
952 if compile_prog "" "" "clock_gettime"; then
954 elif compile_prog "" "-lrt" "clock_gettime"; then
958 print_config "clock_gettime" "$clock_gettime"
960 ##########################################
961 # CLOCK_MONOTONIC probe
962 if test "$clock_monotonic" != "yes" ; then
965 if test "$clock_gettime" = "yes" ; then
969 int main(int argc, char **argv)
971 return clock_gettime(CLOCK_MONOTONIC, NULL);
974 if compile_prog "" "$LIBS" "clock monotonic"; then
975 clock_monotonic="yes"
978 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
980 ##########################################
981 # CLOCK_MONOTONIC_RAW probe
982 if test "$clock_monotonic_raw" != "yes" ; then
983 clock_monotonic_raw="no"
985 if test "$clock_gettime" = "yes" ; then
989 int main(int argc, char **argv)
991 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
994 if compile_prog "" "$LIBS" "clock monotonic"; then
995 clock_monotonic_raw="yes"
998 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
1000 ##########################################
1001 # CLOCK_MONOTONIC_PRECISE probe
1002 if test "$clock_monotonic_precise" != "yes" ; then
1003 clock_monotonic_precise="no"
1005 if test "$clock_gettime" = "yes" ; then
1009 int main(int argc, char **argv)
1011 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
1014 if compile_prog "" "$LIBS" "clock monotonic precise"; then
1015 clock_monotonic_precise="yes"
1018 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
1020 ##########################################
1022 if test "$clockid_t" != "yes" ; then
1028 int main(int argc, char **argv)
1030 volatile clockid_t cid;
1031 memset((void*)&cid, 0, sizeof(cid));
1035 if compile_prog "" "$LIBS" "clockid_t"; then
1038 print_config "clockid_t" "$clockid_t"
1040 ##########################################
1041 # gettimeofday() probe
1042 if test "$gettimeofday" != "yes" ; then
1046 #include <sys/time.h>
1048 int main(int argc, char **argv)
1051 return gettimeofday(&tv, NULL);
1054 if compile_prog "" "" "gettimeofday"; then
1057 print_config "gettimeofday" "$gettimeofday"
1059 ##########################################
1061 if test "$fdatasync" != "yes" ; then
1067 int main(int argc, char **argv)
1069 return fdatasync(0);
1072 if compile_prog "" "" "fdatasync"; then
1075 print_config "fdatasync" "$fdatasync"
1077 ##########################################
1078 # sync_file_range() probe
1079 if test "$sync_file_range" != "yes" ; then
1080 sync_file_range="no"
1086 #include <linux/fs.h>
1087 int main(int argc, char **argv)
1089 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1090 SYNC_FILE_RANGE_WAIT_AFTER;
1091 return sync_file_range(0, 0, 0, flags);
1094 if compile_prog "" "" "sync_file_range"; then
1095 sync_file_range="yes"
1097 print_config "sync_file_range" "$sync_file_range"
1099 ##########################################
1100 # ext4 move extent probe
1101 if test "$ext4_me" != "yes" ; then
1106 #include <sys/ioctl.h>
1107 int main(int argc, char **argv)
1109 struct move_extent me;
1110 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1113 if compile_prog "" "" "ext4 move extent" ; then
1115 elif test $targetos = "Linux" ; then
1116 # On Linux, just default to it on and let it error at runtime if we really
1117 # don't have it. None of my updated systems have it defined, but it does
1118 # work. Takes a while to bubble back.
1121 print_config "EXT4 move extent" "$ext4_me"
1123 ##########################################
1125 if test "$linux_splice" != "yes" ; then
1131 int main(int argc, char **argv)
1133 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1136 if compile_prog "" "" "linux splice"; then
1139 print_config "Linux splice(2)" "$linux_splice"
1141 ##########################################
1143 if test "$guasi" != "yes" ; then
1148 #include <guasi_syscalls.h>
1149 int main(int argc, char **argv)
1151 guasi_t ctx = guasi_create(0, 0, 0);
1155 if compile_prog "" "" "guasi"; then
1158 print_config "GUASI" "$guasi"
1160 ##########################################
1162 if test "$libnuma" != "yes" ; then
1167 int main(int argc, char **argv)
1169 return numa_available();
1172 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1176 print_config "libnuma" "$libnuma"
1178 ##########################################
1179 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1180 if test "$libnuma" = "yes" ; then
1184 int main(int argc, char **argv)
1186 struct bitmask *mask = numa_parse_nodestring(NULL);
1187 return mask->size == 0;
1190 if compile_prog "" "" "libnuma api"; then
1193 print_config "libnuma v2" "$libnuma_v2"
1196 ##########################################
1198 if test "$strsep" != "yes" ; then
1203 int main(int argc, char **argv)
1205 static char *string = "This is a string";
1206 strsep(&string, "needle");
1210 if compile_prog "" "" "strsep"; then
1213 print_config "strsep" "$strsep"
1215 ##########################################
1216 # strcasestr() probe
1217 if test "$strcasestr" != "yes" ; then
1222 int main(int argc, char **argv)
1224 return strcasestr(argv[0], argv[1]) != NULL;
1227 if compile_prog "" "" "strcasestr"; then
1230 print_config "strcasestr" "$strcasestr"
1232 ##########################################
1234 if test "$strlcat" != "yes" ; then
1239 int main(int argc, char **argv)
1241 static char dst[64];
1242 static char *string = "This is a string";
1243 memset(dst, 0, sizeof(dst));
1244 strlcat(dst, string, sizeof(dst));
1248 if compile_prog "" "" "strlcat"; then
1251 print_config "strlcat" "$strlcat"
1253 ##########################################
1254 # getopt_long_only() probe
1255 if test "$getopt_long_only" != "yes" ; then
1256 getopt_long_only="no"
1262 int main(int argc, char **argv)
1264 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1268 if compile_prog "" "" "getopt_long_only"; then
1269 getopt_long_only="yes"
1271 print_config "getopt_long_only()" "$getopt_long_only"
1273 ##########################################
1275 if test "$inet_aton" != "yes" ; then
1279 #include <sys/socket.h>
1280 #include <arpa/inet.h>
1282 int main(int argc, char **argv)
1285 return inet_aton(NULL, &in);
1288 if compile_prog "" "" "inet_aton"; then
1291 print_config "inet_aton" "$inet_aton"
1293 ##########################################
1295 if test "$socklen_t" != "yes" ; then
1299 #include <sys/socket.h>
1300 int main(int argc, char **argv)
1306 if compile_prog "" "" "socklen_t"; then
1309 print_config "socklen_t" "$socklen_t"
1311 ##########################################
1312 # Whether or not __thread is supported for TLS
1313 if test "$tls_thread" != "yes" ; then
1318 static __thread int ret;
1319 int main(int argc, char **argv)
1324 if compile_prog "" "" "__thread"; then
1327 print_config "__thread" "$tls_thread"
1329 ##########################################
1330 # Check if we have required gtk/glib support for gfio
1331 if test "$gfio" != "yes" ; then
1334 if test "$gfio_check" = "yes" ; then
1338 #include <gtk/gtk.h>
1341 gdk_threads_enter();
1342 gdk_threads_leave();
1344 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1347 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1348 ORG_LDFLAGS=$LDFLAGS
1349 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1350 if test "$?" != "0" ; then
1351 echo "configure: gtk and gthread not found"
1354 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1355 if test "$?" != "0" ; then
1356 echo "configure: gtk and gthread not found"
1359 if ! ${cross_prefix}pkg-config --atleast-version 2.18.0 gtk+-2.0; then
1360 echo "GTK found, but need version 2.18 or higher"
1363 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1365 GFIO_LIBS="$LIBS $GTK_LIBS"
1366 CFLAGS="$CFLAGS $GTK_CFLAGS"
1368 echo "Please install gtk and gdk libraries"
1372 LDFLAGS=$ORG_LDFLAGS
1375 if test "$gfio_check" = "yes" ; then
1376 print_config "gtk 2.18 or higher" "$gfio"
1379 ##########################################
1380 # Check whether we have getrusage(RUSAGE_THREAD)
1381 if test "$rusage_thread" != "yes" ; then
1385 #include <sys/time.h>
1386 #include <sys/resource.h>
1387 int main(int argc, char **argv)
1390 getrusage(RUSAGE_THREAD, &ru);
1394 if compile_prog "" "" "RUSAGE_THREAD"; then
1397 print_config "RUSAGE_THREAD" "$rusage_thread"
1399 ##########################################
1400 # Check whether we have SCHED_IDLE
1401 if test "$sched_idle" != "yes" ; then
1406 int main(int argc, char **argv)
1408 struct sched_param p;
1409 return sched_setscheduler(0, SCHED_IDLE, &p);
1412 if compile_prog "" "" "SCHED_IDLE"; then
1415 print_config "SCHED_IDLE" "$sched_idle"
1417 ##########################################
1418 # Check whether we have TCP_NODELAY
1419 if test "$tcp_nodelay" != "yes" ; then
1424 #include <sys/types.h>
1425 #include <sys/socket.h>
1426 #include <netinet/tcp.h>
1427 int main(int argc, char **argv)
1429 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1432 if compile_prog "" "" "TCP_NODELAY"; then
1435 print_config "TCP_NODELAY" "$tcp_nodelay"
1437 ##########################################
1438 # Check whether we have SO_SNDBUF
1439 if test "$window_size" != "yes" ; then
1444 #include <sys/types.h>
1445 #include <sys/socket.h>
1446 #include <netinet/tcp.h>
1447 int main(int argc, char **argv)
1449 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1450 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1453 if compile_prog "" "" "SO_SNDBUF"; then
1456 print_config "Net engine window_size" "$window_size"
1458 ##########################################
1459 # Check whether we have TCP_MAXSEG
1460 if test "$mss" != "yes" ; then
1465 #include <sys/types.h>
1466 #include <sys/socket.h>
1467 #include <netinet/tcp.h>
1468 #include <arpa/inet.h>
1469 #include <netinet/in.h>
1470 int main(int argc, char **argv)
1472 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1475 if compile_prog "" "" "TCP_MAXSEG"; then
1478 print_config "TCP_MAXSEG" "$mss"
1480 ##########################################
1481 # Check whether we have RLIMIT_MEMLOCK
1482 if test "$rlimit_memlock" != "yes" ; then
1486 #include <sys/time.h>
1487 #include <sys/resource.h>
1488 int main(int argc, char **argv)
1491 return getrlimit(RLIMIT_MEMLOCK, &rl);
1494 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1495 rlimit_memlock="yes"
1497 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1499 ##########################################
1500 # Check whether we have pwritev/preadv
1501 if test "$pwritev" != "yes" ; then
1506 #include <sys/uio.h>
1507 int main(int argc, char **argv)
1509 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1512 if compile_prog "" "" "pwritev"; then
1515 print_config "pwritev/preadv" "$pwritev"
1517 ##########################################
1518 # Check whether we have pwritev2/preadv2
1519 if test "$pwritev2" != "yes" ; then
1524 #include <sys/uio.h>
1525 int main(int argc, char **argv)
1527 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1530 if compile_prog "" "" "pwritev2"; then
1533 print_config "pwritev2/preadv2" "$pwritev2"
1535 ##########################################
1536 # Check whether we have the required functions for ipv6
1537 if test "$ipv6" != "yes" ; then
1541 #include <sys/types.h>
1542 #include <sys/socket.h>
1543 #include <netinet/in.h>
1546 int main(int argc, char **argv)
1548 struct addrinfo hints;
1549 struct in6_addr addr;
1552 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1554 printf("%s\n", gai_strerror(ret));
1559 if compile_prog "" "" "ipv6"; then
1562 print_config "IPv6 helpers" "$ipv6"
1564 ##########################################
1566 if test "$http" != "yes" ; then
1569 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1571 #include <curl/curl.h>
1572 #include <openssl/hmac.h>
1574 int main(int argc, char **argv)
1579 curl = curl_easy_init();
1580 curl_easy_cleanup(curl);
1582 ctx = HMAC_CTX_new();
1583 HMAC_CTX_reset(ctx);
1588 # openssl < 1.1.0 uses the HMAC_CTX type directly
1590 #include <curl/curl.h>
1591 #include <openssl/hmac.h>
1593 int main(int argc, char **argv)
1598 curl = curl_easy_init();
1599 curl_easy_cleanup(curl);
1601 HMAC_CTX_init(&ctx);
1602 HMAC_CTX_cleanup(&ctx);
1606 if test "$disable_http" != "yes"; then
1607 HTTP_LIBS="-lcurl -lssl -lcrypto"
1608 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1609 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1611 LIBS="$HTTP_LIBS $LIBS"
1612 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1614 LIBS="$HTTP_LIBS $LIBS"
1617 print_config "http engine" "$http"
1619 ##########################################
1621 if test "$rados" != "yes" ; then
1625 #include <rados/librados.h>
1627 int main(int argc, char **argv)
1630 rados_ioctx_t io_ctx;
1631 const char cluster_name[] = "ceph";
1632 const char user_name[] = "client.admin";
1633 const char pool[] = "rados";
1635 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1636 rados_create2(&cluster, cluster_name, user_name, 0);
1637 rados_ioctx_create(cluster, pool, &io_ctx);
1642 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1643 LIBS="-lrados $LIBS"
1646 print_config "Rados engine" "$rados"
1648 ##########################################
1650 if test "$rbd" != "yes" ; then
1654 #include <rbd/librbd.h>
1656 int main(int argc, char **argv)
1659 rados_ioctx_t io_ctx;
1660 const char cluster_name[] = "ceph";
1661 const char user_name[] = "client.admin";
1662 const char pool[] = "rbd";
1663 int major, minor, extra;
1665 rbd_version(&major, &minor, &extra);
1666 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1667 rados_create2(&cluster, cluster_name, user_name, 0);
1668 rados_ioctx_create(cluster, pool, &io_ctx);
1673 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1674 LIBS="-lrbd -lrados $LIBS"
1677 print_config "Rados Block Device engine" "$rbd"
1679 ##########################################
1680 # check for rbd_poll
1681 if test "$rbd_poll" != "yes" ; then
1684 if test "$rbd" = "yes"; then
1686 #include <rbd/librbd.h>
1687 #include <sys/eventfd.h>
1689 int main(int argc, char **argv)
1692 rbd_completion_t comp;
1694 int fd = eventfd(0, EFD_NONBLOCK);
1695 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1696 rbd_poll_io_events(image, comp, 1);
1701 if compile_prog "" "-lrbd -lrados" "rbd"; then
1704 print_config "rbd_poll" "$rbd_poll"
1707 ##########################################
1708 # check for rbd_invalidate_cache()
1709 if test "$rbd_inval" != "yes" ; then
1712 if test "$rbd" = "yes"; then
1714 #include <rbd/librbd.h>
1716 int main(int argc, char **argv)
1720 return rbd_invalidate_cache(image);
1723 if compile_prog "" "-lrbd -lrados" "rbd"; then
1726 print_config "rbd_invalidate_cache" "$rbd_inval"
1729 ##########################################
1730 # Check whether we have setvbuf
1731 if test "$setvbuf" != "yes" ; then
1736 int main(int argc, char **argv)
1740 setvbuf(f, buf, _IOFBF, sizeof(buf));
1744 if compile_prog "" "" "setvbuf"; then
1747 print_config "setvbuf" "$setvbuf"
1749 ##########################################
1751 if test "$gfapi" != "yes" ; then
1755 #include <glusterfs/api/glfs.h>
1757 int main(int argc, char **argv)
1759 glfs_t *g = glfs_new("foo");
1764 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1765 LIBS="-lgfapi -lglusterfs $LIBS"
1768 print_config "Gluster API engine" "$gfapi"
1770 ##########################################
1771 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1772 if test "$gfapi" = "yes" ; then
1775 #include <glusterfs/api/glfs.h>
1777 int main(int argc, char **argv)
1780 int ret = glfs_fadvise(fd, 0, 0, 1);
1785 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1788 print_config "Gluster API use fadvise" "$gf_fadvise"
1791 ##########################################
1792 # check for newer gfapi
1793 if test "$gfapi" = "yes" ; then
1796 #include <glusterfs/api/glfs.h>
1798 int main(int argc, char **argv)
1800 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
1803 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
1806 print_config "Gluster new API" "$gf_new"
1809 ##########################################
1810 # check for gfapi trim support
1811 if test "$gf_trim" != "yes" ; then
1814 if test "$gfapi" = "yes" ; then
1816 #include <glusterfs/api/glfs.h>
1818 int main(int argc, char **argv)
1820 return glfs_discard_async(NULL, 0, 0);
1823 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1826 print_config "Gluster API trim support" "$gf_trim"
1829 ##########################################
1830 # Check if we support stckf on s390
1831 if test "$s390_z196_facilities" != "yes" ; then
1832 s390_z196_facilities="no"
1835 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1836 int main(int argc, char **argv)
1838 /* We want just 1 double word to be returned. */
1839 register unsigned long reg0 asm("0") = 0;
1840 unsigned long stfle_bits;
1841 asm volatile(".machine push" "\n\t"
1842 ".machine \"z9-109\"" "\n\t"
1845 : "=QS" (stfle_bits), "+d" (reg0)
1848 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1854 if compile_prog "" "" "s390_z196_facilities"; then
1856 if [ $? -eq 0 ]; then
1857 s390_z196_facilities="yes"
1860 print_config "s390_z196_facilities" "$s390_z196_facilities"
1862 ##########################################
1863 # Check if we have required environment variables configured for libhdfs
1864 if test "$libhdfs" = "yes" ; then
1866 if test "$JAVA_HOME" = "" ; then
1867 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1870 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1871 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1874 if test "$FIO_LIBHDFS_LIB" = "" ; then
1875 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1878 if test "$hdfs_conf_error" = "1" ; then
1882 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1883 FIO_HDFS_CPU="amd64"
1886 print_config "HDFS engine" "$libhdfs"
1888 ##########################################
1889 # Check whether we have MTD
1890 if test "$mtd" != "yes" ; then
1895 #include <mtd/mtd-user.h>
1896 #include <sys/ioctl.h>
1897 int main(int argc, char **argv)
1899 struct mtd_write_req ops;
1900 struct mtd_info_user info;
1901 memset(&ops, 0, sizeof(ops));
1902 info.type = MTD_MLCNANDFLASH;
1903 return ioctl(0, MEMGETINFO, &info);
1906 if compile_prog "" "" "mtd"; then
1909 print_config "MTD" "$mtd"
1911 ##########################################
1912 # Check whether we have libpmem
1913 if test "$libpmem" != "yes" ; then
1917 #include <libpmem.h>
1918 int main(int argc, char **argv)
1921 rc = pmem_is_pmem(0, 0);
1925 if compile_prog "" "-lpmem" "libpmem"; then
1929 print_config "libpmem" "$libpmem"
1931 ##########################################
1932 # Check whether we have libpmemblk
1933 # libpmem is a prerequisite
1934 if test "$libpmemblk" != "yes" ; then
1937 if test "$libpmem" = "yes"; then
1939 #include <libpmemblk.h>
1940 int main(int argc, char **argv)
1943 pbp = pmemblk_open("", 0);
1947 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1949 LIBS="-lpmemblk $LIBS"
1952 print_config "libpmemblk" "$libpmemblk"
1954 # Choose the ioengines
1955 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1958 if test "$libpmemblk" = "yes"; then
1963 ##########################################
1964 # Report whether pmemblk engine is enabled
1965 print_config "PMDK pmemblk engine" "$pmemblk"
1967 ##########################################
1968 # Report whether dev-dax engine is enabled
1969 print_config "PMDK dev-dax engine" "$devdax"
1971 ##########################################
1972 # Report whether libpmem engine is enabled
1973 print_config "PMDK libpmem engine" "$pmem"
1975 ##########################################
1976 # Check whether we support DDN's IME
1977 if test "$libime" != "yes" ; then
1981 #include <ime_native.h>
1982 int main(int argc, char **argv)
1986 rc = ime_native_finalize();
1990 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
1992 CFLAGS="-I${ime_path}/include $CFLAGS"
1993 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
1994 LIBS="-lim_client $LIBS"
1996 print_config "DDN's Infinite Memory Engine" "$libime"
1998 ##########################################
1999 # Check if we have required environment variables configured for libiscsi
2000 if test "$libiscsi" = "yes" ; then
2001 if $(pkg-config --atleast-version=1.9.0 libiscsi); then
2003 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2004 libiscsi_libs=$(pkg-config --libs libiscsi)
2006 if test "$libiscsi" = "yes" ; then
2007 echo "libiscsi" "Install libiscsi >= 1.9.0"
2012 print_config "iscsi engine" "$libiscsi"
2014 ##########################################
2015 # Check if we have lex/yacc available
2020 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2021 if test "$targetos" != "SunOS" ; then
2022 LEX=$(which lex 2> /dev/null)
2023 if test -x "$LEX" ; then
2026 YACC=$(which bison 2> /dev/null)
2027 if test -x "$YACC" ; then
2031 YACC=$(which yacc 2> /dev/null)
2032 if test -x "$YACC" ; then
2036 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2040 if test "$arith" = "yes" ; then
2042 extern int yywrap(void);
2044 int main(int argc, char **argv)
2050 if compile_prog "" "-ll" "lex"; then
2059 # Check if lex fails using -o
2060 if test "$arith" = "yes" ; then
2061 if test "$force_no_lex_o" = "yes" ; then
2064 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
2065 if test "$?" = "0" ; then
2073 print_config "lex/yacc for arithmetic" "$arith"
2075 ##########################################
2076 # Check whether we have setmntent/getmntent
2077 if test "$getmntent" != "yes" ; then
2083 int main(int argc, char **argv)
2085 FILE *mtab = setmntent(NULL, "r");
2086 struct mntent *mnt = getmntent(mtab);
2091 if compile_prog "" "" "getmntent"; then
2094 print_config "getmntent" "$getmntent"
2096 ##########################################
2097 # Check whether we have getmntinfo
2098 # These are originally added for BSDs, but may also work
2099 # on other operating systems with getmntinfo(3).
2101 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2102 # Note that NetBSD needs -Werror to catch warning as error.
2103 if test "$getmntinfo" != "yes" ; then
2108 #include <sys/param.h>
2109 #include <sys/mount.h>
2110 int main(int argc, char **argv)
2113 return getmntinfo(&st, MNT_NOWAIT);
2116 if compile_prog "-Werror" "" "getmntinfo"; then
2119 print_config "getmntinfo" "$getmntinfo"
2121 # getmntinfo(3) for NetBSD.
2122 if test "$getmntinfo_statvfs" != "yes" ; then
2123 getmntinfo_statvfs="no"
2127 #include <sys/statvfs.h>
2128 int main(int argc, char **argv)
2131 return getmntinfo(&st, MNT_NOWAIT);
2134 # Skip the test if the one with statfs arg is detected.
2135 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2136 getmntinfo_statvfs="yes"
2137 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2140 ##########################################
2141 # Check whether we have _Static_assert
2142 if test "$static_assert" != "yes" ; then
2154 int main(int argc, char **argv)
2156 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2160 if compile_prog "" "" "static_assert"; then
2163 print_config "Static Assert" "$static_assert"
2165 ##########################################
2166 # Check whether we have bool / stdbool.h
2167 if test "$have_bool" != "yes" ; then
2171 #include <stdbool.h>
2172 int main(int argc, char **argv)
2175 return var != false;
2178 if compile_prog "" "" "bool"; then
2181 print_config "bool" "$have_bool"
2183 ##########################################
2184 # Check whether we have strndup()
2189 int main(int argc, char **argv)
2191 char *res = strndup("test string", 8);
2197 if compile_prog "" "" "strndup"; then
2200 print_config "strndup" "$strndup"
2202 ##########################################
2203 # <valgrind/drd.h> probe
2204 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2205 # also available but not the other way around.
2206 if test "$valgrind_dev" != "yes" ; then
2210 #include <valgrind/drd.h>
2211 int main(int argc, char **argv)
2216 if compile_prog "" "" "valgrind_dev"; then
2219 print_config "Valgrind headers" "$valgrind_dev"
2221 ##########################################
2222 # <linux/blkzoned.h> probe
2223 if test "$linux_blkzoned" != "yes" ; then
2227 #include <linux/blkzoned.h>
2228 int main(int argc, char **argv)
2233 if compile_prog "" "" "linux_blkzoned"; then
2234 linux_blkzoned="yes"
2236 print_config "Zoned block device support" "$linux_blkzoned"
2238 ##########################################
2239 # check march=armv8-a+crc+crypto
2240 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2241 march_armv8_a_crc_crypto="no"
2243 if test "$cpu" = "arm64" ; then
2245 #include <arm_acle.h>
2246 #include <arm_neon.h>
2247 #include <sys/auxv.h>
2251 /* Can we also do a runtime probe? */
2253 return getauxval(AT_HWCAP);
2255 # error "Don't know how to do runtime probe for ARM CRC32c"
2259 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2260 march_armv8_a_crc_crypto="yes"
2261 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2265 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2267 ##########################################
2269 if test "$cuda" != "yes" ; then
2274 int main(int argc, char **argv)
2279 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2283 print_config "cuda" "$cuda"
2285 ##########################################
2286 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2289 #include <sys/stat.h>
2290 #include <sys/types.h>
2291 int main(int argc, char **argv)
2293 return mkdir("/tmp/bla", 0600);
2296 if compile_prog "" "" "mkdir(a, b)"; then
2299 print_config "mkdir(a, b)" "$mkdir_two"
2301 ##########################################
2302 # check for cc -march=native
2305 int main(int argc, char **argv)
2310 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2311 compile_prog "-march=native" "" "march=native"; then
2314 print_config "Build march=native" "$build_native"
2316 ##########################################
2318 if test "$cunit" != "yes" ; then
2322 #include <CUnit/CUnit.h>
2323 #include <CUnit/Basic.h>
2326 if (CU_initialize_registry() != CUE_SUCCESS)
2327 return CU_get_error();
2328 CU_basic_set_mode(CU_BRM_VERBOSE);
2329 CU_basic_run_tests();
2330 CU_cleanup_registry();
2331 return CU_get_error();
2334 if compile_prog "" "-lcunit" "CUnit"; then
2337 print_config "CUnit" "$cunit"
2339 ##########################################
2340 # check for __kernel_rwf_t
2343 #include <linux/fs.h>
2344 int main(int argc, char **argv)
2351 if compile_prog "" "" "__kernel_rwf_t"; then
2352 __kernel_rwf_t="yes"
2354 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2356 ##########################################
2357 # check if gcc has -Wimplicit-fallthrough
2360 int main(int argc, char **argv)
2365 if compile_prog "-Wimplicit-fallthrough" "" "-Wimplicit-fallthrough"; then
2368 print_config "-Wimplicit-fallthrough" "$fallthrough"
2370 ##########################################
2371 # check for MADV_HUGEPAGE support
2372 if test "$thp" != "yes" ; then
2375 if test "$esx" != "yes" ; then
2377 #include <sys/mman.h>
2380 return madvise(0, 0x1000, MADV_HUGEPAGE);
2383 if compile_prog "" "" "thp" ; then
2386 if test "$thp" = "yes" ; then
2387 feature_not_found "Transparent Huge Page" ""
2392 print_config "MADV_HUGEPAGE" "$thp"
2394 ##########################################
2395 # check for gettid()
2399 int main(int argc, char **argv)
2404 if compile_prog "" "" "gettid"; then
2407 print_config "gettid" "$gettid"
2409 #############################################################################
2411 if test "$wordsize" = "64" ; then
2412 output_sym "CONFIG_64BIT"
2413 elif test "$wordsize" = "32" ; then
2414 output_sym "CONFIG_32BIT"
2416 fatal "Unknown wordsize!"
2418 if test "$bigendian" = "yes" ; then
2419 output_sym "CONFIG_BIG_ENDIAN"
2421 output_sym "CONFIG_LITTLE_ENDIAN"
2423 if test "$zlib" = "yes" ; then
2424 output_sym "CONFIG_ZLIB"
2426 if test "$libaio" = "yes" ; then
2427 output_sym "CONFIG_LIBAIO"
2429 if test "$posix_aio" = "yes" ; then
2430 output_sym "CONFIG_POSIXAIO"
2432 if test "$posix_aio_fsync" = "yes" ; then
2433 output_sym "CONFIG_POSIXAIO_FSYNC"
2435 if test "$posix_pshared" = "yes" ; then
2436 output_sym "CONFIG_PSHARED"
2438 if test "$have_asprintf" = "yes" ; then
2439 output_sym "CONFIG_HAVE_ASPRINTF"
2441 if test "$have_vasprintf" = "yes" ; then
2442 output_sym "CONFIG_HAVE_VASPRINTF"
2444 if test "$linux_fallocate" = "yes" ; then
2445 output_sym "CONFIG_LINUX_FALLOCATE"
2447 if test "$posix_fallocate" = "yes" ; then
2448 output_sym "CONFIG_POSIX_FALLOCATE"
2450 if test "$fdatasync" = "yes" ; then
2451 output_sym "CONFIG_FDATASYNC"
2453 if test "$sync_file_range" = "yes" ; then
2454 output_sym "CONFIG_SYNC_FILE_RANGE"
2456 if test "$sfaa" = "yes" ; then
2457 output_sym "CONFIG_SFAA"
2459 if test "$sync_sync" = "yes" ; then
2460 output_sym "CONFIG_SYNC_SYNC"
2462 if test "$cmp_swap" = "yes" ; then
2463 output_sym "CONFIG_CMP_SWAP"
2465 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2466 output_sym "CONFIG_RDMA"
2468 if test "$clock_gettime" = "yes" ; then
2469 output_sym "CONFIG_CLOCK_GETTIME"
2471 if test "$clock_monotonic" = "yes" ; then
2472 output_sym "CONFIG_CLOCK_MONOTONIC"
2474 if test "$clock_monotonic_raw" = "yes" ; then
2475 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2477 if test "$clock_monotonic_precise" = "yes" ; then
2478 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2480 if test "$clockid_t" = "yes"; then
2481 output_sym "CONFIG_CLOCKID_T"
2483 if test "$gettimeofday" = "yes" ; then
2484 output_sym "CONFIG_GETTIMEOFDAY"
2486 if test "$posix_fadvise" = "yes" ; then
2487 output_sym "CONFIG_POSIX_FADVISE"
2489 if test "$linux_3arg_affinity" = "yes" ; then
2490 output_sym "CONFIG_3ARG_AFFINITY"
2491 elif test "$linux_2arg_affinity" = "yes" ; then
2492 output_sym "CONFIG_2ARG_AFFINITY"
2494 if test "$strsep" = "yes" ; then
2495 output_sym "CONFIG_STRSEP"
2497 if test "$strcasestr" = "yes" ; then
2498 output_sym "CONFIG_STRCASESTR"
2500 if test "$strlcat" = "yes" ; then
2501 output_sym "CONFIG_STRLCAT"
2503 if test "$getopt_long_only" = "yes" ; then
2504 output_sym "CONFIG_GETOPT_LONG_ONLY"
2506 if test "$inet_aton" = "yes" ; then
2507 output_sym "CONFIG_INET_ATON"
2509 if test "$socklen_t" = "yes" ; then
2510 output_sym "CONFIG_SOCKLEN_T"
2512 if test "$ext4_me" = "yes" ; then
2513 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2515 if test "$linux_splice" = "yes" ; then
2516 output_sym "CONFIG_LINUX_SPLICE"
2518 if test "$guasi" = "yes" ; then
2519 output_sym "CONFIG_GUASI"
2521 if test "$libnuma_v2" = "yes" ; then
2522 output_sym "CONFIG_LIBNUMA"
2524 if test "$solaris_aio" = "yes" ; then
2525 output_sym "CONFIG_SOLARISAIO"
2527 if test "$tls_thread" = "yes" ; then
2528 output_sym "CONFIG_TLS_THREAD"
2530 if test "$rusage_thread" = "yes" ; then
2531 output_sym "CONFIG_RUSAGE_THREAD"
2533 if test "$gfio" = "yes" ; then
2534 output_sym "CONFIG_GFIO"
2536 if test "$esx" = "yes" ; then
2537 output_sym "CONFIG_ESX"
2538 output_sym "CONFIG_NO_SHM"
2540 if test "$sched_idle" = "yes" ; then
2541 output_sym "CONFIG_SCHED_IDLE"
2543 if test "$tcp_nodelay" = "yes" ; then
2544 output_sym "CONFIG_TCP_NODELAY"
2546 if test "$window_size" = "yes" ; then
2547 output_sym "CONFIG_NET_WINDOWSIZE"
2549 if test "$mss" = "yes" ; then
2550 output_sym "CONFIG_NET_MSS"
2552 if test "$rlimit_memlock" = "yes" ; then
2553 output_sym "CONFIG_RLIMIT_MEMLOCK"
2555 if test "$pwritev" = "yes" ; then
2556 output_sym "CONFIG_PWRITEV"
2558 if test "$pwritev2" = "yes" ; then
2559 output_sym "CONFIG_PWRITEV2"
2561 if test "$ipv6" = "yes" ; then
2562 output_sym "CONFIG_IPV6"
2564 if test "$http" = "yes" ; then
2565 output_sym "CONFIG_HTTP"
2567 if test "$rados" = "yes" ; then
2568 output_sym "CONFIG_RADOS"
2570 if test "$rbd" = "yes" ; then
2571 output_sym "CONFIG_RBD"
2573 if test "$rbd_poll" = "yes" ; then
2574 output_sym "CONFIG_RBD_POLL"
2576 if test "$rbd_inval" = "yes" ; then
2577 output_sym "CONFIG_RBD_INVAL"
2579 if test "$setvbuf" = "yes" ; then
2580 output_sym "CONFIG_SETVBUF"
2582 if test "$s390_z196_facilities" = "yes" ; then
2583 output_sym "CONFIG_S390_Z196_FACILITIES"
2584 CFLAGS="$CFLAGS -march=z9-109"
2587 if test "$gfapi" = "yes" ; then
2588 output_sym "CONFIG_GFAPI"
2590 if test "$gf_fadvise" = "yes" ; then
2591 output_sym "CONFIG_GF_FADVISE"
2593 if test "$gf_trim" = "yes" ; then
2594 output_sym "CONFIG_GF_TRIM"
2596 if test "$gf_new" = "yes" ; then
2597 output_sym "CONFIG_GF_NEW_API"
2599 if test "$libhdfs" = "yes" ; then
2600 output_sym "CONFIG_LIBHDFS"
2601 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2602 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2603 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2604 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2606 if test "$mtd" = "yes" ; then
2607 output_sym "CONFIG_MTD"
2609 if test "$pmemblk" = "yes" ; then
2610 output_sym "CONFIG_PMEMBLK"
2612 if test "$devdax" = "yes" ; then
2613 output_sym "CONFIG_LINUX_DEVDAX"
2615 if test "$pmem" = "yes" ; then
2616 output_sym "CONFIG_LIBPMEM"
2618 if test "$libime" = "yes" ; then
2619 output_sym "CONFIG_IME"
2621 if test "$arith" = "yes" ; then
2622 output_sym "CONFIG_ARITHMETIC"
2623 if test "$yacc_is_bison" = "yes" ; then
2624 echo "YACC=$YACC -y" >> $config_host_mak
2626 echo "YACC=$YACC" >> $config_host_mak
2628 if test "$lex_use_o" = "yes" ; then
2629 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2632 if test "$getmntent" = "yes" ; then
2633 output_sym "CONFIG_GETMNTENT"
2635 if test "$getmntinfo" = "yes" ; then
2636 output_sym "CONFIG_GETMNTINFO"
2638 if test "$getmntinfo_statvfs" = "yes" ; then
2639 output_sym "CONFIG_GETMNTINFO_STATVFS"
2641 if test "$static_assert" = "yes" ; then
2642 output_sym "CONFIG_STATIC_ASSERT"
2644 if test "$have_bool" = "yes" ; then
2645 output_sym "CONFIG_HAVE_BOOL"
2647 if test "$strndup" = "yes" ; then
2648 output_sym "CONFIG_HAVE_STRNDUP"
2650 if test "$disable_opt" = "yes" ; then
2651 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2653 if test "$valgrind_dev" = "yes"; then
2654 output_sym "CONFIG_VALGRIND_DEV"
2656 if test "$linux_blkzoned" = "yes" ; then
2657 output_sym "CONFIG_LINUX_BLKZONED"
2659 if test "$zlib" = "no" ; then
2660 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2661 if test "$build_static" = "yes"; then
2662 echo "Note that some distros have separate packages for static libraries."
2665 if test "$march_armv8_a_crc_crypto" = "yes" ; then
2666 output_sym "ARCH_HAVE_CRC_CRYPTO"
2668 if test "$cuda" = "yes" ; then
2669 output_sym "CONFIG_CUDA"
2671 if test "$mkdir_two" = "yes" ; then
2672 output_sym "CONFIG_HAVE_MKDIR_TWO"
2674 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2675 output_sym "CONFIG_BUILD_NATIVE"
2677 if test "$cunit" = "yes" ; then
2678 output_sym "CONFIG_HAVE_CUNIT"
2680 if test "$__kernel_rwf_t" = "yes"; then
2681 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
2683 if test "$gettid" = "yes"; then
2684 output_sym "CONFIG_HAVE_GETTID"
2686 if test "$fallthrough" = "yes"; then
2687 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
2689 if test "$thp" = "yes" ; then
2690 output_sym "CONFIG_HAVE_THP"
2692 if test "$libiscsi" = "yes" ; then
2693 output_sym "CONFIG_LIBISCSI"
2694 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
2695 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
2696 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
2699 echo "LIBS+=$LIBS" >> $config_host_mak
2700 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2701 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2702 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2703 echo "CC=$cc" >> $config_host_mak
2704 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2705 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2707 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2708 cat > Makefile <<EOF
2709 SRCDIR:=`dirname $0`
2710 include \$(SRCDIR)/Makefile