3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
20 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
21 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
22 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
26 config_host_mak="config-host.mak"
27 config_host_h="config-host.h"
29 rm -rf $config_host_mak
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
40 # Print result for each configuration test
42 printf "%-30s%s\n" "$1" "$2"
46 CFLAGS="-D_GNU_SOURCE -include config-host.h"
49 # Print a helpful header at the top of config.log
50 echo "# FIO configure log $(date)" >> config.log
51 printf "# Configured with:" >> config.log
52 printf " '%s'" "$0" "$@" >> config.log
54 echo "#" >> config.log
56 # Print configure header at the top of $config_host_h
57 echo "/*" > $config_host_h
58 echo " * Automatically generated by configure - do not modify" >> $config_host_h
59 printf " * Configured with:" >> $config_host_h
60 printf " * '%s'" "$0" "$@" >> $config_host_h
61 echo "" >> $config_host_h
62 echo " */" >> $config_host_h
65 # Run the compiler, capturing its output to the log.
66 echo $cc "$@" >> config.log
67 $cc "$@" >> config.log 2>&1 || return $?
68 # Test passed. If this is an --enable-werror build, rerun
69 # the test with -Werror and bail out if it fails. This
70 # makes warning-generating-errors in configure test code
71 # obvious to developers.
72 if test "$werror" != "yes"; then
75 # Don't bother rerunning the compile if we were already using -Werror
81 echo $cc -Werror "$@" >> config.log
82 $cc -Werror "$@" >> config.log 2>&1 && return $?
83 echo "ERROR: configure test passed without -Werror but failed with -Werror."
84 echo "This is probably a bug in the configure script. The failing command"
85 echo "will be at the bottom of config.log."
86 fatal "You can run configure with --disable-werror to bypass this check."
90 do_cc $CFLAGS -c -o $TMPO $TMPC
95 local_ldflags="$2 $LIBS"
96 echo "Compiling test case $3" >> config.log
97 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 feature_not_found() {
105 echo "ERROR: User requested feature $feature"
106 if test ! -z "$packages" ; then
107 echo "ERROR: That feature needs $packages installed"
109 echo "ERROR: configure was not able to find it"
114 type "$1" >/dev/null 2>&1
120 #error $1 not defined
131 echo "$1=y" >> $config_host_mak
132 echo "#define $1" >> $config_host_h
151 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
153 --prefix=*) prefix="$optarg"
155 --cpu=*) cpu="$optarg"
157 # esx is cross compiled and cannot be detect through simple uname calls
163 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
165 --build-32bit-win) build_32bit_win="yes"
167 --build-static) build_static="yes"
169 --enable-gfio) gfio_check="yes"
171 --disable-numa) disable_numa="yes"
173 --disable-rdma) disable_rdma="yes"
175 --disable-rbd) disable_rbd="yes"
177 --disable-rbd-blkin) disable_rbd_blkin="yes"
179 --disable-gfapi) disable_gfapi="yes"
181 --enable-libhdfs) libhdfs="yes"
183 --disable-lex) disable_lex="yes"
185 --enable-lex) disable_lex="no"
187 --disable-shm) no_shm="yes"
189 --disable-optimizations) disable_opt="yes"
191 --disable-pmem) disable_pmem="yes"
193 --enable-cuda) enable_cuda="yes"
199 echo "Bad option $opt"
205 if test "$show_help" = "yes" ; then
206 echo "--prefix= Use this directory as installation prefix"
207 echo "--cpu= Specify target CPU if auto-detect fails"
208 echo "--cc= Specify compiler to use"
209 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
210 echo "--build-32bit-win Enable 32-bit build on Windows"
211 echo "--build-static Build a static fio"
212 echo "--esx Configure build options for esx"
213 echo "--enable-gfio Enable building of gtk gfio"
214 echo "--disable-numa Disable libnuma even if found"
215 echo "--disable-rdma Disable RDMA support even if found"
216 echo "--disable-gfapi Disable gfapi"
217 echo "--enable-libhdfs Enable hdfs support"
218 echo "--disable-lex Disable use of lex/yacc for math"
219 echo "--disable-pmem Disable pmem based engines even if found"
220 echo "--enable-lex Enable use of lex/yacc for math"
221 echo "--disable-shm Disable SHM support"
222 echo "--disable-optimizations Don't enable compiler optimizations"
223 echo "--enable-cuda Enable GPUDirect RDMA support"
227 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
228 cc="${CC-${cross_prefix}gcc}"
230 if check_define __ANDROID__ ; then
232 elif check_define __linux__ ; then
234 elif check_define __OpenBSD__ ; then
236 elif check_define __sun__ ; then
238 CFLAGS="$CFLAGS -D_REENTRANT"
239 elif check_define _WIN32 ; then
245 echo "# Automatically generated by configure - do not modify" > $config_host_mak
246 printf "# Configured with:" >> $config_host_mak
247 printf " '%s'" "$0" "$@" >> $config_host_mak
248 echo >> $config_host_mak
249 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
251 if test "$no_shm" = "yes" ; then
252 output_sym "CONFIG_NO_SHM"
255 if test "$disable_opt" = "yes" ; then
256 output_sym "CONFIG_FIO_NO_OPT"
259 # Some host OSes need non-standard checks for which CPU to use.
260 # Note that these checks are broken for cross-compilation: if you're
261 # cross-compiling to one of these OSes then you'll need to specify
262 # the correct CPU with the --cpu option.
265 # Unless explicitly enabled, turn off lex.
266 # OpenBSD will hit syntax error when enabled.
267 if test -z "$disable_lex" ; then
274 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
275 # we can run 64-bit userspace code.
276 # If the user didn't specify a CPU explicitly and the kernel says this is
277 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
279 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
282 # Error at compile time linking of weak/partial symbols if possible...
289 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
290 echo "Disabling weak symbols"
291 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
295 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
296 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
299 LIBS="-lnsl -lsocket"
302 # We still force some options, so keep this message here.
303 echo "Forcing some known good options on Windows"
304 if test -z "$CC" ; then
305 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
306 CC="i686-w64-mingw32-gcc"
307 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
308 echo "Building with zlib support"
309 output_sym "CONFIG_ZLIB"
310 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
313 CC="x86_64-w64-mingw32-gcc"
314 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
315 echo "Building with zlib support"
316 output_sym "CONFIG_ZLIB"
317 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
321 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
322 output_sym "CONFIG_32BIT"
324 output_sym "CONFIG_64BIT_LLP64"
326 # We need this to be output_sym'd here because this is Windows specific.
327 # The regular configure path never sets this config.
328 output_sym "CONFIG_WINDOWSAIO"
329 # We now take the regular configuration path without having exit 0 here.
330 # Flags below are still necessary mostly for MinGW.
335 clock_gettime="yes" # clock_monotonic probe has dependency on this
336 clock_monotonic="yes"
343 echo "CC=$CC" >> $config_host_mak
344 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
348 if test ! -z "$cpu" ; then
349 # command line argument
351 elif check_define __i386__ ; then
353 elif check_define __x86_64__ ; then
355 elif check_define __sparc__ ; then
356 if check_define __arch64__ ; then
361 elif check_define _ARCH_PPC ; then
362 if check_define _ARCH_PPC64 ; then
367 elif check_define __mips__ ; then
369 elif check_define __ia64__ ; then
371 elif check_define __s390__ ; then
372 if check_define __s390x__ ; then
377 elif check_define __arm__ ; then
379 elif check_define __aarch64__ ; then
381 elif check_define __hppa__ ; then
387 # Normalise host CPU name and set ARCH.
389 ia64|ppc|ppc64|s390|s390x|sparc64)
392 i386|i486|i586|i686|i86pc|BePC)
404 hppa|parisc|parisc64)
418 if test -z "$CC" ; then
419 if test "$targetos" = "FreeBSD"; then
428 cc="${CC-${cross_prefix}gcc}"
430 ##########################################
431 # check cross compile
433 if test "$cross_compile" != "yes" ; then
442 if compile_prog "" "" "cross"; then
443 $TMPE 2>/dev/null || cross_compile="yes"
445 fatal "compile test failed"
448 ##########################################
450 if test "$bigendian" != "yes" ; then
453 if test "$cross_compile" = "no" ; then
455 #include <inttypes.h>
458 volatile uint32_t i=0x01234567;
459 return (*((uint8_t*)(&i))) == 0x67;
462 if compile_prog "" "" "endian"; then
463 $TMPE && bigendian="yes"
466 # If we're cross compiling, try our best to work it out and rely on the
467 # run-time check to fail if we get it wrong.
472 #if __BYTE_ORDER != __BIG_ENDIAN
473 # error "Unknown endianness"
477 compile_prog "" "" "endian" && bigendian="yes"
478 check_define "__ARMEB__" && bigendian="yes"
479 check_define "__MIPSEB__" && bigendian="yes"
483 print_config "Operating system" "$targetos"
484 print_config "CPU" "$cpu"
485 print_config "Big endian" "$bigendian"
486 print_config "Compiler" "$cc"
487 print_config "Cross compile" "$cross_compile"
490 ##########################################
491 # See if we need to build a static build
492 if test "$build_static" = "yes" ; then
493 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
494 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
498 print_config "Static build" "$build_static"
500 ##########################################
505 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
508 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
512 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
514 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
517 fatal "Unknown wordsize"
519 print_config "Wordsize" "$wordsize"
521 ##########################################
523 if test "$zlib" != "yes" ; then
531 if (inflateInit(&stream) != Z_OK)
536 if compile_prog "" "-lz" "zlib" ; then
540 print_config "zlib" "$zlib"
542 ##########################################
544 if test "$libaio" != "yes" ; then
547 if test "$esx" != "yes" ; then
557 if compile_prog "" "-laio" "libaio" ; then
561 if test "$libaio" = "yes" ; then
562 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
567 print_config "Linux AIO support" "$libaio"
569 ##########################################
571 if test "$posix_aio" != "yes" ; then
574 if test "$posix_aio_lrt" != "yes" ; then
586 if compile_prog "" "" "posixaio" ; then
588 elif compile_prog "" "-lrt" "posixaio"; then
593 print_config "POSIX AIO support" "$posix_aio"
594 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
596 ##########################################
597 # posix aio fsync probe
598 if test "$posix_aio_fsync" != "yes" ; then
601 if test "$posix_aio" = "yes" ; then
608 return aio_fsync(O_SYNC, &cb);
612 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
616 print_config "POSIX AIO fsync" "$posix_aio_fsync"
618 ##########################################
619 # POSIX pshared attribute probe
620 if test "$posix_pshared" != "yes" ; then
627 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
628 # if defined(__CYGWIN__)
629 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
630 # elif defined(__APPLE__)
631 # include <AvailabilityMacros.h>
632 # include <TargetConditionals.h>
633 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
634 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
638 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
643 if compile_prog "" "$LIBS" "posix_pshared" ; then
646 print_config "POSIX pshared support" "$posix_pshared"
648 ##########################################
650 if test "$solaris_aio" != "yes" ; then
654 #include <sys/types.h>
655 #include <sys/asynch.h>
660 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
664 if compile_prog "" "-laio" "solarisaio" ; then
668 print_config "Solaris AIO support" "$solaris_aio"
670 ##########################################
671 # __sync_fetch_and_add test
672 if test "$sfaa" != "yes" ; then
676 #include <inttypes.h>
677 static int sfaa(uint64_t *ptr)
679 return __sync_fetch_and_add(ptr, 0);
682 int main(int argc, char **argv)
689 if compile_prog "" "" "__sync_fetch_and_add()" ; then
692 print_config "__sync_fetch_and_add" "$sfaa"
694 ##########################################
696 if test "$libverbs" != "yes" ; then
701 #include <infiniband/arch.h>
702 int main(int argc, char **argv)
704 struct ibv_pd *pd = ibv_alloc_pd(NULL);
708 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
710 LIBS="-libverbs $LIBS"
712 print_config "libverbs" "$libverbs"
714 ##########################################
716 if test "$rdmacm" != "yes" ; then
721 #include <rdma/rdma_cma.h>
722 int main(int argc, char **argv)
724 rdma_destroy_qp(NULL);
728 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
730 LIBS="-lrdmacm $LIBS"
732 print_config "rdmacm" "$rdmacm"
734 ##########################################
735 # Linux fallocate probe
736 if test "$linux_fallocate" != "yes" ; then
742 #include <linux/falloc.h>
743 int main(int argc, char **argv)
745 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
749 if compile_prog "" "" "linux_fallocate"; then
750 linux_fallocate="yes"
752 print_config "Linux fallocate" "$linux_fallocate"
754 ##########################################
755 # POSIX fadvise probe
756 if test "$posix_fadvise" != "yes" ; then
762 int main(int argc, char **argv)
764 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
768 if compile_prog "" "" "posix_fadvise"; then
771 print_config "POSIX fadvise" "$posix_fadvise"
773 ##########################################
774 # POSIX fallocate probe
775 if test "$posix_fallocate" != "yes" ; then
781 int main(int argc, char **argv)
783 int r = posix_fallocate(0, 0, 1024);
787 if compile_prog "" "" "posix_fallocate"; then
788 posix_fallocate="yes"
790 print_config "POSIX fallocate" "$posix_fallocate"
792 ##########################################
793 # sched_set/getaffinity 2 or 3 argument test
794 if test "$linux_2arg_affinity" != "yes" ; then
795 linux_2arg_affinity="no"
797 if test "$linux_3arg_affinity" != "yes" ; then
798 linux_3arg_affinity="no"
802 int main(int argc, char **argv)
805 return sched_setaffinity(0, sizeof(mask), &mask);
808 if compile_prog "" "" "sched_setaffinity(,,)"; then
809 linux_3arg_affinity="yes"
813 int main(int argc, char **argv)
816 return sched_setaffinity(0, &mask);
819 if compile_prog "" "" "sched_setaffinity(,)"; then
820 linux_2arg_affinity="yes"
823 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
824 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
826 ##########################################
827 # clock_gettime probe
828 if test "$clock_gettime" != "yes" ; then
834 int main(int argc, char **argv)
836 return clock_gettime(0, NULL);
839 if compile_prog "" "" "clock_gettime"; then
841 elif compile_prog "" "-lrt" "clock_gettime"; then
845 print_config "clock_gettime" "$clock_gettime"
847 ##########################################
848 # CLOCK_MONOTONIC probe
849 if test "$clock_monotonic" != "yes" ; then
852 if test "$clock_gettime" = "yes" ; then
856 int main(int argc, char **argv)
858 return clock_gettime(CLOCK_MONOTONIC, NULL);
861 if compile_prog "" "$LIBS" "clock monotonic"; then
862 clock_monotonic="yes"
865 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
867 ##########################################
868 # CLOCK_MONOTONIC_RAW probe
869 if test "$clock_monotonic_raw" != "yes" ; then
870 clock_monotonic_raw="no"
872 if test "$clock_gettime" = "yes" ; then
876 int main(int argc, char **argv)
878 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
881 if compile_prog "" "$LIBS" "clock monotonic"; then
882 clock_monotonic_raw="yes"
885 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
887 ##########################################
888 # CLOCK_MONOTONIC_PRECISE probe
889 if test "$clock_monotonic_precise" != "yes" ; then
890 clock_monotonic_precise="no"
892 if test "$clock_gettime" = "yes" ; then
896 int main(int argc, char **argv)
898 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
901 if compile_prog "" "$LIBS" "clock monotonic precise"; then
902 clock_monotonic_precise="yes"
905 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
907 ##########################################
909 if test "$clockid_t" != "yes" ; then
915 int main(int argc, char **argv)
917 volatile clockid_t cid;
918 memset((void*)&cid, 0, sizeof(cid));
922 if compile_prog "" "$LIBS" "clockid_t"; then
925 print_config "clockid_t" "$clockid_t"
927 ##########################################
928 # gettimeofday() probe
929 if test "$gettimeofday" != "yes" ; then
933 #include <sys/time.h>
935 int main(int argc, char **argv)
938 return gettimeofday(&tv, NULL);
941 if compile_prog "" "" "gettimeofday"; then
944 print_config "gettimeofday" "$gettimeofday"
946 ##########################################
948 if test "$fdatasync" != "yes" ; then
954 int main(int argc, char **argv)
959 if compile_prog "" "" "fdatasync"; then
962 print_config "fdatasync" "$fdatasync"
964 ##########################################
965 # sync_file_range() probe
966 if test "$sync_file_range" != "yes" ; then
973 #include <linux/fs.h>
974 int main(int argc, char **argv)
976 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
977 SYNC_FILE_RANGE_WAIT_AFTER;
978 return sync_file_range(0, 0, 0, flags);
981 if compile_prog "" "" "sync_file_range"; then
982 sync_file_range="yes"
984 print_config "sync_file_range" "$sync_file_range"
986 ##########################################
987 # ext4 move extent probe
988 if test "$ext4_me" != "yes" ; then
993 #include <sys/ioctl.h>
994 int main(int argc, char **argv)
996 struct move_extent me;
997 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1000 if compile_prog "" "" "ext4 move extent" ; then
1002 elif test $targetos = "Linux" ; then
1003 # On Linux, just default to it on and let it error at runtime if we really
1004 # don't have it. None of my updated systems have it defined, but it does
1005 # work. Takes a while to bubble back.
1008 print_config "EXT4 move extent" "$ext4_me"
1010 ##########################################
1012 if test "$linux_splice" != "yes" ; then
1018 int main(int argc, char **argv)
1020 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1023 if compile_prog "" "" "linux splice"; then
1026 print_config "Linux splice(2)" "$linux_splice"
1028 ##########################################
1030 if test "$guasi" != "yes" ; then
1035 #include <guasi_syscalls.h>
1036 int main(int argc, char **argv)
1038 guasi_t ctx = guasi_create(0, 0, 0);
1042 if compile_prog "" "" "guasi"; then
1045 print_config "GUASI" "$guasi"
1047 ##########################################
1049 if test "$fusion_aw" != "yes" ; then
1053 #include <nvm/nvm_primitives.h>
1054 int main(int argc, char **argv)
1056 nvm_version_t ver_info;
1057 nvm_handle_t handle;
1059 handle = nvm_get_handle(0, &ver_info);
1060 return nvm_atomic_write(handle, 0, 0, 0);
1063 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1064 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1067 print_config "Fusion-io atomic engine" "$fusion_aw"
1069 ##########################################
1071 if test "$libnuma" != "yes" ; then
1076 int main(int argc, char **argv)
1078 return numa_available();
1081 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1085 print_config "libnuma" "$libnuma"
1087 ##########################################
1088 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1089 if test "$libnuma" = "yes" ; then
1093 int main(int argc, char **argv)
1095 struct bitmask *mask = numa_parse_nodestring(NULL);
1096 return mask->size == 0;
1099 if compile_prog "" "" "libnuma api"; then
1102 print_config "libnuma v2" "$libnuma_v2"
1105 ##########################################
1107 if test "$strsep" != "yes" ; then
1112 int main(int argc, char **argv)
1114 static char *string = "This is a string";
1115 strsep(&string, "needle");
1119 if compile_prog "" "" "strsep"; then
1122 print_config "strsep" "$strsep"
1124 ##########################################
1125 # strcasestr() probe
1126 if test "$strcasestr" != "yes" ; then
1131 int main(int argc, char **argv)
1133 return strcasestr(argv[0], argv[1]) != NULL;
1136 if compile_prog "" "" "strcasestr"; then
1139 print_config "strcasestr" "$strcasestr"
1141 ##########################################
1143 if test "$strlcat" != "yes" ; then
1148 int main(int argc, char **argv)
1150 static char dst[64];
1151 static char *string = "This is a string";
1152 memset(dst, 0, sizeof(dst));
1153 strlcat(dst, string, sizeof(dst));
1157 if compile_prog "" "" "strlcat"; then
1160 print_config "strlcat" "$strlcat"
1162 ##########################################
1163 # getopt_long_only() probe
1164 if test "$getopt_long_only" != "yes" ; then
1165 getopt_long_only="no"
1171 int main(int argc, char **argv)
1173 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1177 if compile_prog "" "" "getopt_long_only"; then
1178 getopt_long_only="yes"
1180 print_config "getopt_long_only()" "$getopt_long_only"
1182 ##########################################
1184 if test "$inet_aton" != "yes" ; then
1188 #include <sys/socket.h>
1189 #include <arpa/inet.h>
1191 int main(int argc, char **argv)
1194 return inet_aton(NULL, &in);
1197 if compile_prog "" "" "inet_aton"; then
1200 print_config "inet_aton" "$inet_aton"
1202 ##########################################
1204 if test "$socklen_t" != "yes" ; then
1208 #include <sys/socket.h>
1209 int main(int argc, char **argv)
1215 if compile_prog "" "" "socklen_t"; then
1218 print_config "socklen_t" "$socklen_t"
1220 ##########################################
1221 # Whether or not __thread is supported for TLS
1222 if test "$tls_thread" != "yes" ; then
1227 static __thread int ret;
1228 int main(int argc, char **argv)
1233 if compile_prog "" "" "__thread"; then
1236 print_config "__thread" "$tls_thread"
1238 ##########################################
1239 # Check if we have required gtk/glib support for gfio
1240 if test "$gfio" != "yes" ; then
1243 if test "$gfio_check" = "yes" ; then
1247 #include <gtk/gtk.h>
1250 gdk_threads_enter();
1251 gdk_threads_leave();
1253 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1256 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1257 ORG_LDFLAGS=$LDFLAGS
1258 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1259 if test "$?" != "0" ; then
1260 echo "configure: gtk and gthread not found"
1263 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1264 if test "$?" != "0" ; then
1265 echo "configure: gtk and gthread not found"
1268 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1270 if test "$?" = "0" ; then
1272 GFIO_LIBS="$LIBS $GTK_LIBS"
1273 CFLAGS="$CFLAGS $GTK_CFLAGS"
1275 echo "GTK found, but need version 2.18 or higher"
1279 echo "Please install gtk and gdk libraries"
1282 LDFLAGS=$ORG_LDFLAGS
1285 if test "$gfio_check" = "yes" ; then
1286 print_config "gtk 2.18 or higher" "$gfio"
1289 ##########################################
1290 # Check whether we have getrusage(RUSAGE_THREAD)
1291 if test "$rusage_thread" != "yes" ; then
1295 #include <sys/time.h>
1296 #include <sys/resource.h>
1297 int main(int argc, char **argv)
1300 getrusage(RUSAGE_THREAD, &ru);
1304 if compile_prog "" "" "RUSAGE_THREAD"; then
1307 print_config "RUSAGE_THREAD" "$rusage_thread"
1309 ##########################################
1310 # Check whether we have SCHED_IDLE
1311 if test "$sched_idle" != "yes" ; then
1316 int main(int argc, char **argv)
1318 struct sched_param p;
1319 return sched_setscheduler(0, SCHED_IDLE, &p);
1322 if compile_prog "" "" "SCHED_IDLE"; then
1325 print_config "SCHED_IDLE" "$sched_idle"
1327 ##########################################
1328 # Check whether we have TCP_NODELAY
1329 if test "$tcp_nodelay" != "yes" ; then
1334 #include <sys/types.h>
1335 #include <sys/socket.h>
1336 #include <netinet/tcp.h>
1337 int main(int argc, char **argv)
1339 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1342 if compile_prog "" "" "TCP_NODELAY"; then
1345 print_config "TCP_NODELAY" "$tcp_nodelay"
1347 ##########################################
1348 # Check whether we have SO_SNDBUF
1349 if test "$window_size" != "yes" ; then
1354 #include <sys/types.h>
1355 #include <sys/socket.h>
1356 #include <netinet/tcp.h>
1357 int main(int argc, char **argv)
1359 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1360 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1363 if compile_prog "" "" "SO_SNDBUF"; then
1366 print_config "Net engine window_size" "$window_size"
1368 ##########################################
1369 # Check whether we have TCP_MAXSEG
1370 if test "$mss" != "yes" ; then
1375 #include <sys/types.h>
1376 #include <sys/socket.h>
1377 #include <netinet/tcp.h>
1378 #include <arpa/inet.h>
1379 #include <netinet/in.h>
1380 int main(int argc, char **argv)
1382 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1385 if compile_prog "" "" "TCP_MAXSEG"; then
1388 print_config "TCP_MAXSEG" "$mss"
1390 ##########################################
1391 # Check whether we have RLIMIT_MEMLOCK
1392 if test "$rlimit_memlock" != "yes" ; then
1396 #include <sys/time.h>
1397 #include <sys/resource.h>
1398 int main(int argc, char **argv)
1401 return getrlimit(RLIMIT_MEMLOCK, &rl);
1404 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1405 rlimit_memlock="yes"
1407 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1409 ##########################################
1410 # Check whether we have pwritev/preadv
1411 if test "$pwritev" != "yes" ; then
1416 #include <sys/uio.h>
1417 int main(int argc, char **argv)
1419 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1422 if compile_prog "" "" "pwritev"; then
1425 print_config "pwritev/preadv" "$pwritev"
1427 ##########################################
1428 # Check whether we have pwritev2/preadv2
1429 if test "$pwritev2" != "yes" ; then
1434 #include <sys/uio.h>
1435 int main(int argc, char **argv)
1437 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1440 if compile_prog "" "" "pwritev2"; then
1443 print_config "pwritev2/preadv2" "$pwritev2"
1445 ##########################################
1446 # Check whether we have the required functions for ipv6
1447 if test "$ipv6" != "yes" ; then
1451 #include <sys/types.h>
1452 #include <sys/socket.h>
1453 #include <netinet/in.h>
1456 int main(int argc, char **argv)
1458 struct addrinfo hints;
1459 struct in6_addr addr;
1462 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1464 printf("%s\n", gai_strerror(ret));
1469 if compile_prog "" "" "ipv6"; then
1472 print_config "IPv6 helpers" "$ipv6"
1474 ##########################################
1476 if test "$rbd" != "yes" ; then
1480 #include <rbd/librbd.h>
1482 int main(int argc, char **argv)
1485 rados_ioctx_t io_ctx;
1486 const char pool[] = "rbd";
1488 int major, minor, extra;
1489 rbd_version(&major, &minor, &extra);
1491 rados_ioctx_create(cluster, pool, &io_ctx);
1495 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1496 LIBS="-lrbd -lrados $LIBS"
1499 print_config "Rados Block Device engine" "$rbd"
1501 ##########################################
1502 # check for rbd_poll
1503 if test "$rbd_poll" != "yes" ; then
1506 if test "$rbd" = "yes"; then
1508 #include <rbd/librbd.h>
1509 #include <sys/eventfd.h>
1511 int main(int argc, char **argv)
1514 rbd_completion_t comp;
1516 int fd = eventfd(0, EFD_NONBLOCK);
1517 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1518 rbd_poll_io_events(image, comp, 1);
1523 if compile_prog "" "-lrbd -lrados" "rbd"; then
1526 print_config "rbd_poll" "$rbd_poll"
1529 ##########################################
1530 # check for rbd_invaidate_cache()
1531 if test "$rbd_inval" != "yes" ; then
1534 if test "$rbd" = "yes"; then
1536 #include <rbd/librbd.h>
1538 int main(int argc, char **argv)
1542 return rbd_invalidate_cache(image);
1545 if compile_prog "" "-lrbd -lrados" "rbd"; then
1548 print_config "rbd_invalidate_cache" "$rbd_inval"
1551 ##########################################
1553 if test "$rbd_blkin" != "yes" ; then
1557 #include <rbd/librbd.h>
1558 #include <zipkin_c.h>
1560 int main(int argc, char **argv)
1563 struct blkin_trace_info t_info;
1564 blkin_init_trace_info(&t_info);
1565 rbd_completion_t completion;
1570 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1574 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1575 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1576 LIBS="-lblkin $LIBS"
1579 print_config "rbd blkin tracing" "$rbd_blkin"
1581 ##########################################
1582 # Check whether we have setvbuf
1583 if test "$setvbuf" != "yes" ; then
1588 int main(int argc, char **argv)
1592 setvbuf(f, buf, _IOFBF, sizeof(buf));
1596 if compile_prog "" "" "setvbuf"; then
1599 print_config "setvbuf" "$setvbuf"
1601 ##########################################
1603 if test "$gfapi" != "yes" ; then
1607 #include <glusterfs/api/glfs.h>
1609 int main(int argc, char **argv)
1611 glfs_t *g = glfs_new("foo");
1616 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1617 LIBS="-lgfapi -lglusterfs $LIBS"
1620 print_config "Gluster API engine" "$gfapi"
1622 ##########################################
1623 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1624 if test "$gfapi" = "yes" ; then
1627 #include <glusterfs/api/glfs.h>
1629 int main(int argc, char **argv)
1632 int ret = glfs_fadvise(fd, 0, 0, 1);
1637 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1640 print_config "Gluster API use fadvise" "$gf_fadvise"
1643 ##########################################
1644 # check for gfapi trim support
1645 if test "$gf_trim" != "yes" ; then
1648 if test "$gfapi" = "yes" ; then
1650 #include <glusterfs/api/glfs.h>
1652 int main(int argc, char **argv)
1654 return glfs_discard_async(NULL, 0, 0);
1657 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1660 print_config "Gluster API trim support" "$gf_trim"
1663 ##########################################
1664 # Check if we support stckf on s390
1665 if test "$s390_z196_facilities" != "yes" ; then
1666 s390_z196_facilities="no"
1669 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1670 int main(int argc, char **argv)
1672 /* We want just 1 double word to be returned. */
1673 register unsigned long reg0 asm("0") = 0;
1674 unsigned long stfle_bits;
1675 asm volatile(".machine push" "\n\t"
1676 ".machine \"z9-109\"" "\n\t"
1679 : "=QS" (stfle_bits), "+d" (reg0)
1682 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1688 if compile_prog "" "" "s390_z196_facilities"; then
1690 if [ $? -eq 0 ]; then
1691 s390_z196_facilities="yes"
1694 print_config "s390_z196_facilities" "$s390_z196_facilities"
1696 ##########################################
1697 # Check if we have required environment variables configured for libhdfs
1698 if test "$libhdfs" = "yes" ; then
1700 if test "$JAVA_HOME" = "" ; then
1701 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1704 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1705 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1708 if test "$FIO_LIBHDFS_LIB" = "" ; then
1709 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1712 if test "$hdfs_conf_error" = "1" ; then
1716 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1717 FIO_HDFS_CPU="amd64"
1720 print_config "HDFS engine" "$libhdfs"
1722 ##########################################
1723 # Check whether we have MTD
1724 if test "$mtd" != "yes" ; then
1729 #include <mtd/mtd-user.h>
1730 #include <sys/ioctl.h>
1731 int main(int argc, char **argv)
1733 struct mtd_write_req ops;
1734 struct mtd_info_user info;
1735 memset(&ops, 0, sizeof(ops));
1736 info.type = MTD_MLCNANDFLASH;
1737 return ioctl(0, MEMGETINFO, &info);
1740 if compile_prog "" "" "mtd"; then
1743 print_config "MTD" "$mtd"
1745 ##########################################
1746 # Check whether we have libpmem
1747 if test "$libpmem" != "yes" ; then
1751 #include <libpmem.h>
1752 int main(int argc, char **argv)
1755 rc = pmem_is_pmem(0, 0);
1759 if compile_prog "" "-lpmem" "libpmem"; then
1763 print_config "libpmem" "$libpmem"
1765 ##########################################
1766 # Check whether we have libpmemblk
1767 # libpmem is a prerequisite
1768 if test "$libpmemblk" != "yes" ; then
1771 if test "$libpmem" = "yes"; then
1773 #include <libpmemblk.h>
1774 int main(int argc, char **argv)
1777 pbp = pmemblk_open("", 0);
1781 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1783 LIBS="-lpmemblk $LIBS"
1786 print_config "libpmemblk" "$libpmemblk"
1788 # Choose the ioengines
1789 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1791 if test "$libpmemblk" = "yes"; then
1796 ##########################################
1797 # Report whether pmemblk engine is enabled
1798 print_config "NVML pmemblk engine" "$pmemblk"
1800 ##########################################
1801 # Report whether dev-dax engine is enabled
1802 print_config "NVML dev-dax engine" "$devdax"
1804 ##########################################
1805 # Check if we have lex/yacc available
1810 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1811 if test "$targetos" != "SunOS" ; then
1812 LEX=$(which lex 2> /dev/null)
1813 if test -x "$LEX" ; then
1816 YACC=$(which bison 2> /dev/null)
1817 if test -x "$YACC" ; then
1821 YACC=$(which yacc 2> /dev/null)
1822 if test -x "$YACC" ; then
1826 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1830 if test "$arith" = "yes" ; then
1832 extern int yywrap(void);
1834 int main(int argc, char **argv)
1840 if compile_prog "" "-ll" "lex"; then
1849 # Check if lex fails using -o
1850 if test "$arith" = "yes" ; then
1851 if test "$force_no_lex_o" = "yes" ; then
1854 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1855 if test "$?" = "0" ; then
1863 print_config "lex/yacc for arithmetic" "$arith"
1865 ##########################################
1866 # Check whether we have setmntent/getmntent
1867 if test "$getmntent" != "yes" ; then
1873 int main(int argc, char **argv)
1875 FILE *mtab = setmntent(NULL, "r");
1876 struct mntent *mnt = getmntent(mtab);
1881 if compile_prog "" "" "getmntent"; then
1884 print_config "getmntent" "$getmntent"
1886 ##########################################
1887 # Check whether we have getmntinfo
1888 # These are originally added for BSDs, but may also work
1889 # on other operating systems with getmntinfo(3).
1891 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1892 # Note that NetBSD needs -Werror to catch warning as error.
1893 if test "$getmntinfo" != "yes" ; then
1898 #include <sys/param.h>
1899 #include <sys/mount.h>
1900 int main(int argc, char **argv)
1903 return getmntinfo(&st, MNT_NOWAIT);
1906 if compile_prog "-Werror" "" "getmntinfo"; then
1909 print_config "getmntinfo" "$getmntinfo"
1911 # getmntinfo(3) for NetBSD.
1912 if test "$getmntinfo_statvfs" != "yes" ; then
1913 getmntinfo_statvfs="no"
1917 #include <sys/statvfs.h>
1918 int main(int argc, char **argv)
1921 return getmntinfo(&st, MNT_NOWAIT);
1924 # Skip the test if the one with statfs arg is detected.
1925 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1926 getmntinfo_statvfs="yes"
1927 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
1930 ##########################################
1931 # Check whether we have _Static_assert
1932 if test "$static_assert" != "yes" ; then
1944 int main(int argc, char **argv)
1946 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
1950 if compile_prog "" "" "static_assert"; then
1953 print_config "Static Assert" "$static_assert"
1955 ##########################################
1956 # Check whether we have bool / stdbool.h
1957 if test "$have_bool" != "yes" ; then
1961 #include <stdbool.h>
1962 int main(int argc, char **argv)
1965 return var != false;
1968 if compile_prog "" "" "bool"; then
1971 print_config "bool" "$have_bool"
1973 ##########################################
1974 # Check whether we have strndup()
1979 int main(int argc, char **argv)
1981 char *res = strndup("test string", 8);
1987 if compile_prog "" "" "strndup"; then
1990 print_config "strndup" "$strndup"
1992 ##########################################
1993 # check march=armv8-a+crc+crypto
1994 if test "$march_armv8_a_crc_crypto" != "yes" ; then
1995 march_armv8_a_crc_crypto="no"
1997 if test "$cpu" = "arm64" ; then
1999 #include <sys/auxv.h>
2000 #include <arm_acle.h>
2001 #include <arm_neon.h>
2008 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2009 march_armv8_a_crc_crypto="yes"
2010 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2013 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2015 ##########################################
2017 if test "$cuda" != "yes" ; then
2022 int main(int argc, char **argv)
2027 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2031 print_config "cuda" "$cuda"
2033 #############################################################################
2035 if test "$wordsize" = "64" ; then
2036 output_sym "CONFIG_64BIT"
2037 elif test "$wordsize" = "32" ; then
2038 output_sym "CONFIG_32BIT"
2040 fatal "Unknown wordsize!"
2042 if test "$bigendian" = "yes" ; then
2043 output_sym "CONFIG_BIG_ENDIAN"
2045 output_sym "CONFIG_LITTLE_ENDIAN"
2047 if test "$zlib" = "yes" ; then
2048 output_sym "CONFIG_ZLIB"
2050 if test "$libaio" = "yes" ; then
2051 output_sym "CONFIG_LIBAIO"
2053 if test "$posix_aio" = "yes" ; then
2054 output_sym "CONFIG_POSIXAIO"
2056 if test "$posix_aio_fsync" = "yes" ; then
2057 output_sym "CONFIG_POSIXAIO_FSYNC"
2059 if test "$posix_pshared" = "yes" ; then
2060 output_sym "CONFIG_PSHARED"
2062 if test "$linux_fallocate" = "yes" ; then
2063 output_sym "CONFIG_LINUX_FALLOCATE"
2065 if test "$posix_fallocate" = "yes" ; then
2066 output_sym "CONFIG_POSIX_FALLOCATE"
2068 if test "$fdatasync" = "yes" ; then
2069 output_sym "CONFIG_FDATASYNC"
2071 if test "$sync_file_range" = "yes" ; then
2072 output_sym "CONFIG_SYNC_FILE_RANGE"
2074 if test "$sfaa" = "yes" ; then
2075 output_sym "CONFIG_SFAA"
2077 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2078 output_sym "CONFIG_RDMA"
2080 if test "$clock_gettime" = "yes" ; then
2081 output_sym "CONFIG_CLOCK_GETTIME"
2083 if test "$clock_monotonic" = "yes" ; then
2084 output_sym "CONFIG_CLOCK_MONOTONIC"
2086 if test "$clock_monotonic_raw" = "yes" ; then
2087 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2089 if test "$clock_monotonic_precise" = "yes" ; then
2090 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2092 if test "$clockid_t" = "yes"; then
2093 output_sym "CONFIG_CLOCKID_T"
2095 if test "$gettimeofday" = "yes" ; then
2096 output_sym "CONFIG_GETTIMEOFDAY"
2098 if test "$posix_fadvise" = "yes" ; then
2099 output_sym "CONFIG_POSIX_FADVISE"
2101 if test "$linux_3arg_affinity" = "yes" ; then
2102 output_sym "CONFIG_3ARG_AFFINITY"
2103 elif test "$linux_2arg_affinity" = "yes" ; then
2104 output_sym "CONFIG_2ARG_AFFINITY"
2106 if test "$strsep" = "yes" ; then
2107 output_sym "CONFIG_STRSEP"
2109 if test "$strcasestr" = "yes" ; then
2110 output_sym "CONFIG_STRCASESTR"
2112 if test "$strlcat" = "yes" ; then
2113 output_sym "CONFIG_STRLCAT"
2115 if test "$getopt_long_only" = "yes" ; then
2116 output_sym "CONFIG_GETOPT_LONG_ONLY"
2118 if test "$inet_aton" = "yes" ; then
2119 output_sym "CONFIG_INET_ATON"
2121 if test "$socklen_t" = "yes" ; then
2122 output_sym "CONFIG_SOCKLEN_T"
2124 if test "$ext4_me" = "yes" ; then
2125 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2127 if test "$linux_splice" = "yes" ; then
2128 output_sym "CONFIG_LINUX_SPLICE"
2130 if test "$guasi" = "yes" ; then
2131 output_sym "CONFIG_GUASI"
2133 if test "$fusion_aw" = "yes" ; then
2134 output_sym "CONFIG_FUSION_AW"
2136 if test "$libnuma_v2" = "yes" ; then
2137 output_sym "CONFIG_LIBNUMA"
2139 if test "$solaris_aio" = "yes" ; then
2140 output_sym "CONFIG_SOLARISAIO"
2142 if test "$tls_thread" = "yes" ; then
2143 output_sym "CONFIG_TLS_THREAD"
2145 if test "$rusage_thread" = "yes" ; then
2146 output_sym "CONFIG_RUSAGE_THREAD"
2148 if test "$gfio" = "yes" ; then
2149 output_sym "CONFIG_GFIO"
2151 if test "$esx" = "yes" ; then
2152 output_sym "CONFIG_ESX"
2153 output_sym "CONFIG_NO_SHM"
2155 if test "$sched_idle" = "yes" ; then
2156 output_sym "CONFIG_SCHED_IDLE"
2158 if test "$tcp_nodelay" = "yes" ; then
2159 output_sym "CONFIG_TCP_NODELAY"
2161 if test "$window_size" = "yes" ; then
2162 output_sym "CONFIG_NET_WINDOWSIZE"
2164 if test "$mss" = "yes" ; then
2165 output_sym "CONFIG_NET_MSS"
2167 if test "$rlimit_memlock" = "yes" ; then
2168 output_sym "CONFIG_RLIMIT_MEMLOCK"
2170 if test "$pwritev" = "yes" ; then
2171 output_sym "CONFIG_PWRITEV"
2173 if test "$pwritev2" = "yes" ; then
2174 output_sym "CONFIG_PWRITEV2"
2176 if test "$ipv6" = "yes" ; then
2177 output_sym "CONFIG_IPV6"
2179 if test "$rbd" = "yes" ; then
2180 output_sym "CONFIG_RBD"
2182 if test "$rbd_poll" = "yes" ; then
2183 output_sym "CONFIG_RBD_POLL"
2185 if test "$rbd_inval" = "yes" ; then
2186 output_sym "CONFIG_RBD_INVAL"
2188 if test "$rbd_blkin" = "yes" ; then
2189 output_sym "CONFIG_RBD_BLKIN"
2191 if test "$setvbuf" = "yes" ; then
2192 output_sym "CONFIG_SETVBUF"
2194 if test "$s390_z196_facilities" = "yes" ; then
2195 output_sym "CONFIG_S390_Z196_FACILITIES"
2196 CFLAGS="$CFLAGS -march=z9-109"
2198 if test "$gfapi" = "yes" ; then
2199 output_sym "CONFIG_GFAPI"
2201 if test "$gf_fadvise" = "yes" ; then
2202 output_sym "CONFIG_GF_FADVISE"
2204 if test "$gf_trim" = "yes" ; then
2205 output_sym "CONFIG_GF_TRIM"
2207 if test "$libhdfs" = "yes" ; then
2208 output_sym "CONFIG_LIBHDFS"
2209 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2210 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2211 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2212 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2214 if test "$mtd" = "yes" ; then
2215 output_sym "CONFIG_MTD"
2217 if test "$pmemblk" = "yes" ; then
2218 output_sym "CONFIG_PMEMBLK"
2220 if test "$devdax" = "yes" ; then
2221 output_sym "CONFIG_LINUX_DEVDAX"
2223 if test "$arith" = "yes" ; then
2224 output_sym "CONFIG_ARITHMETIC"
2225 if test "$yacc_is_bison" = "yes" ; then
2226 echo "YACC=$YACC -y" >> $config_host_mak
2228 echo "YACC=$YACC" >> $config_host_mak
2230 if test "$lex_use_o" = "yes" ; then
2231 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2234 if test "$getmntent" = "yes" ; then
2235 output_sym "CONFIG_GETMNTENT"
2237 if test "$getmntinfo" = "yes" ; then
2238 output_sym "CONFIG_GETMNTINFO"
2240 if test "$getmntinfo_statvfs" = "yes" ; then
2241 output_sym "CONFIG_GETMNTINFO_STATVFS"
2243 if test "$static_assert" = "yes" ; then
2244 output_sym "CONFIG_STATIC_ASSERT"
2246 if test "$have_bool" = "yes" ; then
2247 output_sym "CONFIG_HAVE_BOOL"
2249 if test "$strndup" = "yes" ; then
2250 output_sym "CONFIG_HAVE_STRNDUP"
2252 if test "$disable_opt" = "yes" ; then
2253 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2255 if test "$zlib" = "no" ; then
2256 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2258 if test "$cuda" = "yes" ; then
2259 output_sym "CONFIG_CUDA"
2262 echo "LIBS+=$LIBS" >> $config_host_mak
2263 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2264 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2265 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2266 echo "CC=$cc" >> $config_host_mak
2267 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2268 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2270 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2271 cat > Makefile <<EOF
2272 SRCDIR:=`dirname $0`
2273 include \$(SRCDIR)/Makefile