3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
20 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
21 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
22 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
26 config_host_mak="config-host.mak"
27 config_host_h="config-host.h"
29 rm -rf $config_host_mak
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
40 # Print result for each configuration test
42 printf "%-30s%s\n" "$1" "$2"
46 CFLAGS="-D_GNU_SOURCE -include config-host.h"
49 # Print a helpful header at the top of config.log
50 echo "# FIO configure log $(date)" >> config.log
51 printf "# Configured with:" >> config.log
52 printf " '%s'" "$0" "$@" >> config.log
54 echo "#" >> config.log
56 # Print configure header at the top of $config_host_h
57 echo "/*" > $config_host_h
58 echo " * Automatically generated by configure - do not modify" >> $config_host_h
59 printf " * Configured with:" >> $config_host_h
60 printf " * '%s'" "$0" "$@" >> $config_host_h
61 echo "" >> $config_host_h
62 echo " */" >> $config_host_h
65 # Run the compiler, capturing its output to the log.
66 echo $cc "$@" >> config.log
67 $cc "$@" >> config.log 2>&1 || return $?
68 # Test passed. If this is an --enable-werror build, rerun
69 # the test with -Werror and bail out if it fails. This
70 # makes warning-generating-errors in configure test code
71 # obvious to developers.
72 if test "$werror" != "yes"; then
75 # Don't bother rerunning the compile if we were already using -Werror
81 echo $cc -Werror "$@" >> config.log
82 $cc -Werror "$@" >> config.log 2>&1 && return $?
83 echo "ERROR: configure test passed without -Werror but failed with -Werror."
84 echo "This is probably a bug in the configure script. The failing command"
85 echo "will be at the bottom of config.log."
86 fatal "You can run configure with --disable-werror to bypass this check."
90 do_cc $CFLAGS -c -o $TMPO $TMPC
95 local_ldflags="$2 $LIBS"
96 echo "Compiling test case $3" >> config.log
97 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 feature_not_found() {
105 echo "ERROR: User requested feature $feature"
106 if test ! -z "$packages" ; then
107 echo "ERROR: That feature needs $packages installed"
109 echo "ERROR: configure was not able to find it"
114 type "$1" >/dev/null 2>&1
120 #error $1 not defined
131 echo "$1=y" >> $config_host_mak
132 echo "#define $1" >> $config_host_h
152 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
154 --prefix=*) prefix="$optarg"
156 --cpu=*) cpu="$optarg"
158 # esx is cross compiled and cannot be detect through simple uname calls
164 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
166 --build-32bit-win) build_32bit_win="yes"
168 --build-static) build_static="yes"
170 --enable-gfio) gfio_check="yes"
172 --disable-numa) disable_numa="yes"
174 --disable-rdma) disable_rdma="yes"
176 --disable-rados) disable_rados="yes"
178 --disable-rbd) disable_rbd="yes"
180 --disable-rbd-blkin) disable_rbd_blkin="yes"
182 --disable-gfapi) disable_gfapi="yes"
184 --enable-libhdfs) libhdfs="yes"
186 --disable-lex) disable_lex="yes"
188 --enable-lex) disable_lex="no"
190 --disable-shm) no_shm="yes"
192 --disable-optimizations) disable_opt="yes"
194 --disable-pmem) disable_pmem="yes"
196 --enable-cuda) enable_cuda="yes"
202 echo "Bad option $opt"
208 if test "$show_help" = "yes" ; then
209 echo "--prefix= Use this directory as installation prefix"
210 echo "--cpu= Specify target CPU if auto-detect fails"
211 echo "--cc= Specify compiler to use"
212 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
213 echo "--build-32bit-win Enable 32-bit build on Windows"
214 echo "--build-static Build a static fio"
215 echo "--esx Configure build options for esx"
216 echo "--enable-gfio Enable building of gtk gfio"
217 echo "--disable-numa Disable libnuma even if found"
218 echo "--disable-rdma Disable RDMA support even if found"
219 echo "--disable-gfapi Disable gfapi"
220 echo "--enable-libhdfs Enable hdfs support"
221 echo "--disable-lex Disable use of lex/yacc for math"
222 echo "--disable-pmem Disable pmem based engines even if found"
223 echo "--enable-lex Enable use of lex/yacc for math"
224 echo "--disable-shm Disable SHM support"
225 echo "--disable-optimizations Don't enable compiler optimizations"
226 echo "--enable-cuda Enable GPUDirect RDMA support"
230 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
231 # Preferred compiler (can be overriden later after we know the platform):
233 # ${cross_prefix}gcc (if cross-prefix specified)
236 if test -z "${CC}${cross_prefix}"; then
243 cc="${CC-${cross_prefix}gcc}"
246 if check_define __ANDROID__ ; then
248 elif check_define __linux__ ; then
250 elif check_define __OpenBSD__ ; then
252 elif check_define __sun__ ; then
254 CFLAGS="$CFLAGS -D_REENTRANT"
255 elif check_define _WIN32 ; then
261 echo "# Automatically generated by configure - do not modify" > $config_host_mak
262 printf "# Configured with:" >> $config_host_mak
263 printf " '%s'" "$0" "$@" >> $config_host_mak
264 echo >> $config_host_mak
265 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
267 if test "$no_shm" = "yes" ; then
268 output_sym "CONFIG_NO_SHM"
271 if test "$disable_opt" = "yes" ; then
272 output_sym "CONFIG_FIO_NO_OPT"
275 # Some host OSes need non-standard checks for which CPU to use.
276 # Note that these checks are broken for cross-compilation: if you're
277 # cross-compiling to one of these OSes then you'll need to specify
278 # the correct CPU with the --cpu option.
281 # Unless explicitly enabled, turn off lex.
282 # OpenBSD will hit syntax error when enabled.
283 if test -z "$disable_lex" ; then
290 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
291 # we can run 64-bit userspace code.
292 # If the user didn't specify a CPU explicitly and the kernel says this is
293 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
295 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
298 # Error at compile time linking of weak/partial symbols if possible...
305 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
306 echo "Disabling weak symbols"
307 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
311 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
312 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
315 LIBS="-lnsl -lsocket"
318 # We still force some options, so keep this message here.
319 echo "Forcing some known good options on Windows"
320 if test -z "${CC}${cross_prefix}"; then
321 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
322 cc="i686-w64-mingw32-gcc"
324 cc="x86_64-w64-mingw32-gcc"
327 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
328 output_sym "CONFIG_32BIT"
330 output_sym "CONFIG_64BIT_LLP64"
332 # We need this to be output_sym'd here because this is Windows specific.
333 # The regular configure path never sets this config.
334 output_sym "CONFIG_WINDOWSAIO"
335 # We now take the regular configuration path without having exit 0 here.
336 # Flags below are still necessary mostly for MinGW.
343 clock_gettime="yes" # clock_monotonic probe has dependency on this
344 clock_monotonic="yes"
352 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
356 # Now we know the target platform we can have another guess at the preferred
357 # compiler when it wasn't explictly set
358 if test -z "${CC}${cross_prefix}"; then
359 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
365 if test -z "$cc"; then
366 echo "configure: failed to find compiler"
370 if test ! -z "$cpu" ; then
371 # command line argument
373 elif check_define __i386__ ; then
375 elif check_define __x86_64__ ; then
377 elif check_define __sparc__ ; then
378 if check_define __arch64__ ; then
383 elif check_define _ARCH_PPC ; then
384 if check_define _ARCH_PPC64 ; then
389 elif check_define __mips__ ; then
391 elif check_define __ia64__ ; then
393 elif check_define __s390__ ; then
394 if check_define __s390x__ ; then
399 elif check_define __arm__ ; then
401 elif check_define __aarch64__ ; then
403 elif check_define __hppa__ ; then
409 # Normalise host CPU name and set ARCH.
411 ia64|ppc|ppc64|s390|s390x|sparc64)
414 i386|i486|i586|i686|i86pc|BePC)
426 hppa|parisc|parisc64)
440 ##########################################
441 # check cross compile
443 if test "$cross_compile" != "yes" ; then
452 if compile_prog "" "" "cross"; then
453 $TMPE 2>/dev/null || cross_compile="yes"
455 fatal "compile test failed"
458 ##########################################
460 if test "$bigendian" != "yes" ; then
463 if test "$cross_compile" = "no" ; then
465 #include <inttypes.h>
468 volatile uint32_t i=0x01234567;
469 return (*((uint8_t*)(&i))) == 0x67;
472 if compile_prog "" "" "endian"; then
473 $TMPE && bigendian="yes"
476 # If we're cross compiling, try our best to work it out and rely on the
477 # run-time check to fail if we get it wrong.
482 #if __BYTE_ORDER != __BIG_ENDIAN
483 # error "Unknown endianness"
487 compile_prog "" "" "endian" && bigendian="yes"
488 check_define "__ARMEB__" && bigendian="yes"
489 check_define "__MIPSEB__" && bigendian="yes"
493 print_config "Operating system" "$targetos"
494 print_config "CPU" "$cpu"
495 print_config "Big endian" "$bigendian"
496 print_config "Compiler" "$cc"
497 print_config "Cross compile" "$cross_compile"
500 ##########################################
501 # See if we need to build a static build
502 if test "$build_static" = "yes" ; then
503 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
504 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
508 print_config "Static build" "$build_static"
510 ##########################################
515 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
518 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
522 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
524 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
527 fatal "Unknown wordsize"
529 print_config "Wordsize" "$wordsize"
531 ##########################################
533 if test "$zlib" != "yes" ; then
541 if (inflateInit(&stream) != Z_OK)
546 if compile_prog "" "-lz" "zlib" ; then
550 print_config "zlib" "$zlib"
552 ##########################################
554 if test "$libaio" != "yes" ; then
557 if test "$esx" != "yes" ; then
567 if compile_prog "" "-laio" "libaio" ; then
571 if test "$libaio" = "yes" ; then
572 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
577 print_config "Linux AIO support" "$libaio"
579 ##########################################
581 if test "$posix_aio" != "yes" ; then
584 if test "$posix_aio_lrt" != "yes" ; then
596 if compile_prog "" "" "posixaio" ; then
598 elif compile_prog "" "-lrt" "posixaio"; then
603 print_config "POSIX AIO support" "$posix_aio"
604 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
606 ##########################################
607 # posix aio fsync probe
608 if test "$posix_aio_fsync" != "yes" ; then
611 if test "$posix_aio" = "yes" ; then
618 return aio_fsync(O_SYNC, &cb);
622 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
626 print_config "POSIX AIO fsync" "$posix_aio_fsync"
628 ##########################################
629 # POSIX pshared attribute probe
630 if test "$posix_pshared" != "yes" ; then
637 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
638 # if defined(__CYGWIN__)
639 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
640 # elif defined(__APPLE__)
641 # include <AvailabilityMacros.h>
642 # include <TargetConditionals.h>
643 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
644 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
648 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
653 if compile_prog "" "$LIBS" "posix_pshared" ; then
656 print_config "POSIX pshared support" "$posix_pshared"
658 ##########################################
660 if test "$solaris_aio" != "yes" ; then
664 #include <sys/types.h>
665 #include <sys/asynch.h>
670 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
674 if compile_prog "" "-laio" "solarisaio" ; then
678 print_config "Solaris AIO support" "$solaris_aio"
680 ##########################################
681 # __sync_fetch_and_add test
682 if test "$sfaa" != "yes" ; then
686 #include <inttypes.h>
687 static int sfaa(uint64_t *ptr)
689 return __sync_fetch_and_add(ptr, 0);
692 int main(int argc, char **argv)
699 if compile_prog "" "" "__sync_fetch_and_add()" ; then
702 print_config "__sync_fetch_and_add" "$sfaa"
704 ##########################################
705 # __sync_synchronize() test
706 if test "$sync_sync" != "yes" ; then
710 #include <inttypes.h>
712 int main(int argc, char **argv)
714 __sync_synchronize();
718 if compile_prog "" "" "__sync_synchronize()" ; then
721 print_config "__sync_synchronize" "$sync_sync"
723 ##########################################
724 # __sync_val_compare_and_swap() test
725 if test "$cmp_swap" != "yes" ; then
729 #include <inttypes.h>
731 int main(int argc, char **argv)
734 return __sync_val_compare_and_swap(&x, 1, 2);
737 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
740 print_config "__sync_val_compare_and_swap" "$cmp_swap"
742 ##########################################
744 if test "$libverbs" != "yes" ; then
748 #include <infiniband/verbs.h>
749 int main(int argc, char **argv)
751 struct ibv_pd *pd = ibv_alloc_pd(NULL);
755 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
757 LIBS="-libverbs $LIBS"
759 print_config "libverbs" "$libverbs"
761 ##########################################
763 if test "$rdmacm" != "yes" ; then
768 #include <rdma/rdma_cma.h>
769 int main(int argc, char **argv)
771 rdma_destroy_qp(NULL);
775 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
777 LIBS="-lrdmacm $LIBS"
779 print_config "rdmacm" "$rdmacm"
781 ##########################################
782 # Linux fallocate probe
783 if test "$linux_fallocate" != "yes" ; then
789 #include <linux/falloc.h>
790 int main(int argc, char **argv)
792 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
796 if compile_prog "" "" "linux_fallocate"; then
797 linux_fallocate="yes"
799 print_config "Linux fallocate" "$linux_fallocate"
801 ##########################################
802 # POSIX fadvise probe
803 if test "$posix_fadvise" != "yes" ; then
809 int main(int argc, char **argv)
811 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
815 if compile_prog "" "" "posix_fadvise"; then
818 print_config "POSIX fadvise" "$posix_fadvise"
820 ##########################################
821 # POSIX fallocate probe
822 if test "$posix_fallocate" != "yes" ; then
828 int main(int argc, char **argv)
830 int r = posix_fallocate(0, 0, 1024);
834 if compile_prog "" "" "posix_fallocate"; then
835 posix_fallocate="yes"
837 print_config "POSIX fallocate" "$posix_fallocate"
839 ##########################################
840 # sched_set/getaffinity 2 or 3 argument test
841 if test "$linux_2arg_affinity" != "yes" ; then
842 linux_2arg_affinity="no"
844 if test "$linux_3arg_affinity" != "yes" ; then
845 linux_3arg_affinity="no"
849 int main(int argc, char **argv)
852 return sched_setaffinity(0, sizeof(mask), &mask);
855 if compile_prog "" "" "sched_setaffinity(,,)"; then
856 linux_3arg_affinity="yes"
860 int main(int argc, char **argv)
863 return sched_setaffinity(0, &mask);
866 if compile_prog "" "" "sched_setaffinity(,)"; then
867 linux_2arg_affinity="yes"
870 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
871 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
873 ##########################################
874 # clock_gettime probe
875 if test "$clock_gettime" != "yes" ; then
881 int main(int argc, char **argv)
883 return clock_gettime(0, NULL);
886 if compile_prog "" "" "clock_gettime"; then
888 elif compile_prog "" "-lrt" "clock_gettime"; then
892 print_config "clock_gettime" "$clock_gettime"
894 ##########################################
895 # CLOCK_MONOTONIC probe
896 if test "$clock_monotonic" != "yes" ; then
899 if test "$clock_gettime" = "yes" ; then
903 int main(int argc, char **argv)
905 return clock_gettime(CLOCK_MONOTONIC, NULL);
908 if compile_prog "" "$LIBS" "clock monotonic"; then
909 clock_monotonic="yes"
912 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
914 ##########################################
915 # CLOCK_MONOTONIC_RAW probe
916 if test "$clock_monotonic_raw" != "yes" ; then
917 clock_monotonic_raw="no"
919 if test "$clock_gettime" = "yes" ; then
923 int main(int argc, char **argv)
925 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
928 if compile_prog "" "$LIBS" "clock monotonic"; then
929 clock_monotonic_raw="yes"
932 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
934 ##########################################
935 # CLOCK_MONOTONIC_PRECISE probe
936 if test "$clock_monotonic_precise" != "yes" ; then
937 clock_monotonic_precise="no"
939 if test "$clock_gettime" = "yes" ; then
943 int main(int argc, char **argv)
945 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
948 if compile_prog "" "$LIBS" "clock monotonic precise"; then
949 clock_monotonic_precise="yes"
952 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
954 ##########################################
956 if test "$clockid_t" != "yes" ; then
962 int main(int argc, char **argv)
964 volatile clockid_t cid;
965 memset((void*)&cid, 0, sizeof(cid));
969 if compile_prog "" "$LIBS" "clockid_t"; then
972 print_config "clockid_t" "$clockid_t"
974 ##########################################
975 # gettimeofday() probe
976 if test "$gettimeofday" != "yes" ; then
980 #include <sys/time.h>
982 int main(int argc, char **argv)
985 return gettimeofday(&tv, NULL);
988 if compile_prog "" "" "gettimeofday"; then
991 print_config "gettimeofday" "$gettimeofday"
993 ##########################################
995 if test "$fdatasync" != "yes" ; then
1001 int main(int argc, char **argv)
1003 return fdatasync(0);
1006 if compile_prog "" "" "fdatasync"; then
1009 print_config "fdatasync" "$fdatasync"
1011 ##########################################
1012 # sync_file_range() probe
1013 if test "$sync_file_range" != "yes" ; then
1014 sync_file_range="no"
1020 #include <linux/fs.h>
1021 int main(int argc, char **argv)
1023 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1024 SYNC_FILE_RANGE_WAIT_AFTER;
1025 return sync_file_range(0, 0, 0, flags);
1028 if compile_prog "" "" "sync_file_range"; then
1029 sync_file_range="yes"
1031 print_config "sync_file_range" "$sync_file_range"
1033 ##########################################
1034 # ext4 move extent probe
1035 if test "$ext4_me" != "yes" ; then
1040 #include <sys/ioctl.h>
1041 int main(int argc, char **argv)
1043 struct move_extent me;
1044 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1047 if compile_prog "" "" "ext4 move extent" ; then
1049 elif test $targetos = "Linux" ; then
1050 # On Linux, just default to it on and let it error at runtime if we really
1051 # don't have it. None of my updated systems have it defined, but it does
1052 # work. Takes a while to bubble back.
1055 print_config "EXT4 move extent" "$ext4_me"
1057 ##########################################
1059 if test "$linux_splice" != "yes" ; then
1065 int main(int argc, char **argv)
1067 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1070 if compile_prog "" "" "linux splice"; then
1073 print_config "Linux splice(2)" "$linux_splice"
1075 ##########################################
1077 if test "$guasi" != "yes" ; then
1082 #include <guasi_syscalls.h>
1083 int main(int argc, char **argv)
1085 guasi_t ctx = guasi_create(0, 0, 0);
1089 if compile_prog "" "" "guasi"; then
1092 print_config "GUASI" "$guasi"
1094 ##########################################
1096 if test "$fusion_aw" != "yes" ; then
1100 #include <nvm/nvm_primitives.h>
1101 int main(int argc, char **argv)
1103 nvm_version_t ver_info;
1104 nvm_handle_t handle;
1106 handle = nvm_get_handle(0, &ver_info);
1107 return nvm_atomic_write(handle, 0, 0, 0);
1110 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1111 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1114 print_config "Fusion-io atomic engine" "$fusion_aw"
1116 ##########################################
1118 if test "$libnuma" != "yes" ; then
1123 int main(int argc, char **argv)
1125 return numa_available();
1128 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1132 print_config "libnuma" "$libnuma"
1134 ##########################################
1135 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1136 if test "$libnuma" = "yes" ; then
1140 int main(int argc, char **argv)
1142 struct bitmask *mask = numa_parse_nodestring(NULL);
1143 return mask->size == 0;
1146 if compile_prog "" "" "libnuma api"; then
1149 print_config "libnuma v2" "$libnuma_v2"
1152 ##########################################
1154 if test "$strsep" != "yes" ; then
1159 int main(int argc, char **argv)
1161 static char *string = "This is a string";
1162 strsep(&string, "needle");
1166 if compile_prog "" "" "strsep"; then
1169 print_config "strsep" "$strsep"
1171 ##########################################
1172 # strcasestr() probe
1173 if test "$strcasestr" != "yes" ; then
1178 int main(int argc, char **argv)
1180 return strcasestr(argv[0], argv[1]) != NULL;
1183 if compile_prog "" "" "strcasestr"; then
1186 print_config "strcasestr" "$strcasestr"
1188 ##########################################
1190 if test "$strlcat" != "yes" ; then
1195 int main(int argc, char **argv)
1197 static char dst[64];
1198 static char *string = "This is a string";
1199 memset(dst, 0, sizeof(dst));
1200 strlcat(dst, string, sizeof(dst));
1204 if compile_prog "" "" "strlcat"; then
1207 print_config "strlcat" "$strlcat"
1209 ##########################################
1210 # getopt_long_only() probe
1211 if test "$getopt_long_only" != "yes" ; then
1212 getopt_long_only="no"
1218 int main(int argc, char **argv)
1220 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1224 if compile_prog "" "" "getopt_long_only"; then
1225 getopt_long_only="yes"
1227 print_config "getopt_long_only()" "$getopt_long_only"
1229 ##########################################
1231 if test "$inet_aton" != "yes" ; then
1235 #include <sys/socket.h>
1236 #include <arpa/inet.h>
1238 int main(int argc, char **argv)
1241 return inet_aton(NULL, &in);
1244 if compile_prog "" "" "inet_aton"; then
1247 print_config "inet_aton" "$inet_aton"
1249 ##########################################
1251 if test "$socklen_t" != "yes" ; then
1255 #include <sys/socket.h>
1256 int main(int argc, char **argv)
1262 if compile_prog "" "" "socklen_t"; then
1265 print_config "socklen_t" "$socklen_t"
1267 ##########################################
1268 # Whether or not __thread is supported for TLS
1269 if test "$tls_thread" != "yes" ; then
1274 static __thread int ret;
1275 int main(int argc, char **argv)
1280 if compile_prog "" "" "__thread"; then
1283 print_config "__thread" "$tls_thread"
1285 ##########################################
1286 # Check if we have required gtk/glib support for gfio
1287 if test "$gfio" != "yes" ; then
1290 if test "$gfio_check" = "yes" ; then
1294 #include <gtk/gtk.h>
1297 gdk_threads_enter();
1298 gdk_threads_leave();
1300 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1303 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1304 ORG_LDFLAGS=$LDFLAGS
1305 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1306 if test "$?" != "0" ; then
1307 echo "configure: gtk and gthread not found"
1310 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1311 if test "$?" != "0" ; then
1312 echo "configure: gtk and gthread not found"
1315 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1317 if test "$?" = "0" ; then
1319 GFIO_LIBS="$LIBS $GTK_LIBS"
1320 CFLAGS="$CFLAGS $GTK_CFLAGS"
1322 echo "GTK found, but need version 2.18 or higher"
1326 echo "Please install gtk and gdk libraries"
1329 LDFLAGS=$ORG_LDFLAGS
1332 if test "$gfio_check" = "yes" ; then
1333 print_config "gtk 2.18 or higher" "$gfio"
1336 ##########################################
1337 # Check whether we have getrusage(RUSAGE_THREAD)
1338 if test "$rusage_thread" != "yes" ; then
1342 #include <sys/time.h>
1343 #include <sys/resource.h>
1344 int main(int argc, char **argv)
1347 getrusage(RUSAGE_THREAD, &ru);
1351 if compile_prog "" "" "RUSAGE_THREAD"; then
1354 print_config "RUSAGE_THREAD" "$rusage_thread"
1356 ##########################################
1357 # Check whether we have SCHED_IDLE
1358 if test "$sched_idle" != "yes" ; then
1363 int main(int argc, char **argv)
1365 struct sched_param p;
1366 return sched_setscheduler(0, SCHED_IDLE, &p);
1369 if compile_prog "" "" "SCHED_IDLE"; then
1372 print_config "SCHED_IDLE" "$sched_idle"
1374 ##########################################
1375 # Check whether we have TCP_NODELAY
1376 if test "$tcp_nodelay" != "yes" ; then
1381 #include <sys/types.h>
1382 #include <sys/socket.h>
1383 #include <netinet/tcp.h>
1384 int main(int argc, char **argv)
1386 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1389 if compile_prog "" "" "TCP_NODELAY"; then
1392 print_config "TCP_NODELAY" "$tcp_nodelay"
1394 ##########################################
1395 # Check whether we have SO_SNDBUF
1396 if test "$window_size" != "yes" ; then
1401 #include <sys/types.h>
1402 #include <sys/socket.h>
1403 #include <netinet/tcp.h>
1404 int main(int argc, char **argv)
1406 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1407 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1410 if compile_prog "" "" "SO_SNDBUF"; then
1413 print_config "Net engine window_size" "$window_size"
1415 ##########################################
1416 # Check whether we have TCP_MAXSEG
1417 if test "$mss" != "yes" ; then
1422 #include <sys/types.h>
1423 #include <sys/socket.h>
1424 #include <netinet/tcp.h>
1425 #include <arpa/inet.h>
1426 #include <netinet/in.h>
1427 int main(int argc, char **argv)
1429 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1432 if compile_prog "" "" "TCP_MAXSEG"; then
1435 print_config "TCP_MAXSEG" "$mss"
1437 ##########################################
1438 # Check whether we have RLIMIT_MEMLOCK
1439 if test "$rlimit_memlock" != "yes" ; then
1443 #include <sys/time.h>
1444 #include <sys/resource.h>
1445 int main(int argc, char **argv)
1448 return getrlimit(RLIMIT_MEMLOCK, &rl);
1451 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1452 rlimit_memlock="yes"
1454 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1456 ##########################################
1457 # Check whether we have pwritev/preadv
1458 if test "$pwritev" != "yes" ; then
1463 #include <sys/uio.h>
1464 int main(int argc, char **argv)
1466 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1469 if compile_prog "" "" "pwritev"; then
1472 print_config "pwritev/preadv" "$pwritev"
1474 ##########################################
1475 # Check whether we have pwritev2/preadv2
1476 if test "$pwritev2" != "yes" ; then
1481 #include <sys/uio.h>
1482 int main(int argc, char **argv)
1484 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1487 if compile_prog "" "" "pwritev2"; then
1490 print_config "pwritev2/preadv2" "$pwritev2"
1492 ##########################################
1493 # Check whether we have the required functions for ipv6
1494 if test "$ipv6" != "yes" ; then
1498 #include <sys/types.h>
1499 #include <sys/socket.h>
1500 #include <netinet/in.h>
1503 int main(int argc, char **argv)
1505 struct addrinfo hints;
1506 struct in6_addr addr;
1509 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1511 printf("%s\n", gai_strerror(ret));
1516 if compile_prog "" "" "ipv6"; then
1519 print_config "IPv6 helpers" "$ipv6"
1521 ##########################################
1523 if test "$rados" != "yes" ; then
1527 #include <rados/librados.h>
1529 int main(int argc, char **argv)
1532 rados_ioctx_t io_ctx;
1533 const char cluster_name[] = "ceph";
1534 const char user_name[] = "client.admin";
1535 const char pool[] = "rados";
1537 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1538 rados_create2(&cluster, cluster_name, user_name, 0);
1539 rados_ioctx_create(cluster, pool, &io_ctx);
1544 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1545 LIBS="-lrados $LIBS"
1548 print_config "Rados engine" "$rados"
1550 ##########################################
1552 if test "$rbd" != "yes" ; then
1556 #include <rbd/librbd.h>
1558 int main(int argc, char **argv)
1561 rados_ioctx_t io_ctx;
1562 const char cluster_name[] = "ceph";
1563 const char user_name[] = "client.admin";
1564 const char pool[] = "rbd";
1565 int major, minor, extra;
1567 rbd_version(&major, &minor, &extra);
1568 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1569 rados_create2(&cluster, cluster_name, user_name, 0);
1570 rados_ioctx_create(cluster, pool, &io_ctx);
1575 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1576 LIBS="-lrbd -lrados $LIBS"
1579 print_config "Rados Block Device engine" "$rbd"
1581 ##########################################
1582 # check for rbd_poll
1583 if test "$rbd_poll" != "yes" ; then
1586 if test "$rbd" = "yes"; then
1588 #include <rbd/librbd.h>
1589 #include <sys/eventfd.h>
1591 int main(int argc, char **argv)
1594 rbd_completion_t comp;
1596 int fd = eventfd(0, EFD_NONBLOCK);
1597 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1598 rbd_poll_io_events(image, comp, 1);
1603 if compile_prog "" "-lrbd -lrados" "rbd"; then
1606 print_config "rbd_poll" "$rbd_poll"
1609 ##########################################
1610 # check for rbd_invalidate_cache()
1611 if test "$rbd_inval" != "yes" ; then
1614 if test "$rbd" = "yes"; then
1616 #include <rbd/librbd.h>
1618 int main(int argc, char **argv)
1622 return rbd_invalidate_cache(image);
1625 if compile_prog "" "-lrbd -lrados" "rbd"; then
1628 print_config "rbd_invalidate_cache" "$rbd_inval"
1631 ##########################################
1633 if test "$rbd_blkin" != "yes" ; then
1637 #include <rbd/librbd.h>
1638 #include <zipkin_c.h>
1640 int main(int argc, char **argv)
1643 struct blkin_trace_info t_info;
1644 blkin_init_trace_info(&t_info);
1645 rbd_completion_t completion;
1650 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1654 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1655 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1656 LIBS="-lblkin $LIBS"
1659 print_config "rbd blkin tracing" "$rbd_blkin"
1661 ##########################################
1662 # Check whether we have setvbuf
1663 if test "$setvbuf" != "yes" ; then
1668 int main(int argc, char **argv)
1672 setvbuf(f, buf, _IOFBF, sizeof(buf));
1676 if compile_prog "" "" "setvbuf"; then
1679 print_config "setvbuf" "$setvbuf"
1681 ##########################################
1683 if test "$gfapi" != "yes" ; then
1687 #include <glusterfs/api/glfs.h>
1689 int main(int argc, char **argv)
1691 glfs_t *g = glfs_new("foo");
1696 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1697 LIBS="-lgfapi -lglusterfs $LIBS"
1700 print_config "Gluster API engine" "$gfapi"
1702 ##########################################
1703 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1704 if test "$gfapi" = "yes" ; then
1707 #include <glusterfs/api/glfs.h>
1709 int main(int argc, char **argv)
1712 int ret = glfs_fadvise(fd, 0, 0, 1);
1717 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1720 print_config "Gluster API use fadvise" "$gf_fadvise"
1723 ##########################################
1724 # check for gfapi trim support
1725 if test "$gf_trim" != "yes" ; then
1728 if test "$gfapi" = "yes" ; then
1730 #include <glusterfs/api/glfs.h>
1732 int main(int argc, char **argv)
1734 return glfs_discard_async(NULL, 0, 0);
1737 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1740 print_config "Gluster API trim support" "$gf_trim"
1743 ##########################################
1744 # Check if we support stckf on s390
1745 if test "$s390_z196_facilities" != "yes" ; then
1746 s390_z196_facilities="no"
1749 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1750 int main(int argc, char **argv)
1752 /* We want just 1 double word to be returned. */
1753 register unsigned long reg0 asm("0") = 0;
1754 unsigned long stfle_bits;
1755 asm volatile(".machine push" "\n\t"
1756 ".machine \"z9-109\"" "\n\t"
1759 : "=QS" (stfle_bits), "+d" (reg0)
1762 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1768 if compile_prog "" "" "s390_z196_facilities"; then
1770 if [ $? -eq 0 ]; then
1771 s390_z196_facilities="yes"
1774 print_config "s390_z196_facilities" "$s390_z196_facilities"
1776 ##########################################
1777 # Check if we have required environment variables configured for libhdfs
1778 if test "$libhdfs" = "yes" ; then
1780 if test "$JAVA_HOME" = "" ; then
1781 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1784 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1785 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1788 if test "$FIO_LIBHDFS_LIB" = "" ; then
1789 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1792 if test "$hdfs_conf_error" = "1" ; then
1796 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1797 FIO_HDFS_CPU="amd64"
1800 print_config "HDFS engine" "$libhdfs"
1802 ##########################################
1803 # Check whether we have MTD
1804 if test "$mtd" != "yes" ; then
1809 #include <mtd/mtd-user.h>
1810 #include <sys/ioctl.h>
1811 int main(int argc, char **argv)
1813 struct mtd_write_req ops;
1814 struct mtd_info_user info;
1815 memset(&ops, 0, sizeof(ops));
1816 info.type = MTD_MLCNANDFLASH;
1817 return ioctl(0, MEMGETINFO, &info);
1820 if compile_prog "" "" "mtd"; then
1823 print_config "MTD" "$mtd"
1825 ##########################################
1826 # Check whether we have libpmem
1827 if test "$libpmem" != "yes" ; then
1831 #include <libpmem.h>
1832 int main(int argc, char **argv)
1835 rc = pmem_is_pmem(0, 0);
1839 if compile_prog "" "-lpmem" "libpmem"; then
1843 print_config "libpmem" "$libpmem"
1845 ##########################################
1846 # Check whether we have libpmemblk
1847 # libpmem is a prerequisite
1848 if test "$libpmemblk" != "yes" ; then
1851 if test "$libpmem" = "yes"; then
1853 #include <libpmemblk.h>
1854 int main(int argc, char **argv)
1857 pbp = pmemblk_open("", 0);
1861 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1863 LIBS="-lpmemblk $LIBS"
1866 print_config "libpmemblk" "$libpmemblk"
1868 # Choose the ioengines
1869 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1872 if test "$libpmemblk" = "yes"; then
1877 ##########################################
1878 # Report whether pmemblk engine is enabled
1879 print_config "NVML pmemblk engine" "$pmemblk"
1881 ##########################################
1882 # Report whether dev-dax engine is enabled
1883 print_config "NVML dev-dax engine" "$devdax"
1885 ##########################################
1886 # Report whether libpmem engine is enabled
1887 print_config "NVML libpmem engine" "$pmem"
1889 ##########################################
1890 # Check if we have lex/yacc available
1895 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1896 if test "$targetos" != "SunOS" ; then
1897 LEX=$(which lex 2> /dev/null)
1898 if test -x "$LEX" ; then
1901 YACC=$(which bison 2> /dev/null)
1902 if test -x "$YACC" ; then
1906 YACC=$(which yacc 2> /dev/null)
1907 if test -x "$YACC" ; then
1911 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1915 if test "$arith" = "yes" ; then
1917 extern int yywrap(void);
1919 int main(int argc, char **argv)
1925 if compile_prog "" "-ll" "lex"; then
1934 # Check if lex fails using -o
1935 if test "$arith" = "yes" ; then
1936 if test "$force_no_lex_o" = "yes" ; then
1939 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1940 if test "$?" = "0" ; then
1948 print_config "lex/yacc for arithmetic" "$arith"
1950 ##########################################
1951 # Check whether we have setmntent/getmntent
1952 if test "$getmntent" != "yes" ; then
1958 int main(int argc, char **argv)
1960 FILE *mtab = setmntent(NULL, "r");
1961 struct mntent *mnt = getmntent(mtab);
1966 if compile_prog "" "" "getmntent"; then
1969 print_config "getmntent" "$getmntent"
1971 ##########################################
1972 # Check whether we have getmntinfo
1973 # These are originally added for BSDs, but may also work
1974 # on other operating systems with getmntinfo(3).
1976 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1977 # Note that NetBSD needs -Werror to catch warning as error.
1978 if test "$getmntinfo" != "yes" ; then
1983 #include <sys/param.h>
1984 #include <sys/mount.h>
1985 int main(int argc, char **argv)
1988 return getmntinfo(&st, MNT_NOWAIT);
1991 if compile_prog "-Werror" "" "getmntinfo"; then
1994 print_config "getmntinfo" "$getmntinfo"
1996 # getmntinfo(3) for NetBSD.
1997 if test "$getmntinfo_statvfs" != "yes" ; then
1998 getmntinfo_statvfs="no"
2002 #include <sys/statvfs.h>
2003 int main(int argc, char **argv)
2006 return getmntinfo(&st, MNT_NOWAIT);
2009 # Skip the test if the one with statfs arg is detected.
2010 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2011 getmntinfo_statvfs="yes"
2012 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2015 ##########################################
2016 # Check whether we have _Static_assert
2017 if test "$static_assert" != "yes" ; then
2029 int main(int argc, char **argv)
2031 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2035 if compile_prog "" "" "static_assert"; then
2038 print_config "Static Assert" "$static_assert"
2040 ##########################################
2041 # Check whether we have bool / stdbool.h
2042 if test "$have_bool" != "yes" ; then
2046 #include <stdbool.h>
2047 int main(int argc, char **argv)
2050 return var != false;
2053 if compile_prog "" "" "bool"; then
2056 print_config "bool" "$have_bool"
2058 ##########################################
2059 # Check whether we have strndup()
2064 int main(int argc, char **argv)
2066 char *res = strndup("test string", 8);
2072 if compile_prog "" "" "strndup"; then
2075 print_config "strndup" "$strndup"
2077 ##########################################
2078 # check march=armv8-a+crc+crypto
2079 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2080 march_armv8_a_crc_crypto="no"
2082 if test "$cpu" = "arm64" ; then
2084 #include <sys/auxv.h>
2085 #include <arm_acle.h>
2086 #include <arm_neon.h>
2093 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2094 march_armv8_a_crc_crypto="yes"
2095 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2098 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2100 ##########################################
2102 if test "$cuda" != "yes" ; then
2107 int main(int argc, char **argv)
2112 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2116 print_config "cuda" "$cuda"
2118 ##########################################
2119 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2122 #include <sys/stat.h>
2123 #include <sys/types.h>
2124 int main(int argc, char **argv)
2126 return mkdir("/tmp/bla", 0600);
2129 if compile_prog "" "" "mkdir(a, b)"; then
2132 print_config "mkdir(a, b)" "$mkdir_two"
2134 #############################################################################
2136 if test "$wordsize" = "64" ; then
2137 output_sym "CONFIG_64BIT"
2138 elif test "$wordsize" = "32" ; then
2139 output_sym "CONFIG_32BIT"
2141 fatal "Unknown wordsize!"
2143 if test "$bigendian" = "yes" ; then
2144 output_sym "CONFIG_BIG_ENDIAN"
2146 output_sym "CONFIG_LITTLE_ENDIAN"
2148 if test "$zlib" = "yes" ; then
2149 output_sym "CONFIG_ZLIB"
2151 if test "$libaio" = "yes" ; then
2152 output_sym "CONFIG_LIBAIO"
2154 if test "$posix_aio" = "yes" ; then
2155 output_sym "CONFIG_POSIXAIO"
2157 if test "$posix_aio_fsync" = "yes" ; then
2158 output_sym "CONFIG_POSIXAIO_FSYNC"
2160 if test "$posix_pshared" = "yes" ; then
2161 output_sym "CONFIG_PSHARED"
2163 if test "$linux_fallocate" = "yes" ; then
2164 output_sym "CONFIG_LINUX_FALLOCATE"
2166 if test "$posix_fallocate" = "yes" ; then
2167 output_sym "CONFIG_POSIX_FALLOCATE"
2169 if test "$fdatasync" = "yes" ; then
2170 output_sym "CONFIG_FDATASYNC"
2172 if test "$sync_file_range" = "yes" ; then
2173 output_sym "CONFIG_SYNC_FILE_RANGE"
2175 if test "$sfaa" = "yes" ; then
2176 output_sym "CONFIG_SFAA"
2178 if test "$sync_sync" = "yes" ; then
2179 output_sym "CONFIG_SYNC_SYNC"
2181 if test "$cmp_swap" = "yes" ; then
2182 output_sym "CONFIG_CMP_SWAP"
2184 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2185 output_sym "CONFIG_RDMA"
2187 if test "$clock_gettime" = "yes" ; then
2188 output_sym "CONFIG_CLOCK_GETTIME"
2190 if test "$clock_monotonic" = "yes" ; then
2191 output_sym "CONFIG_CLOCK_MONOTONIC"
2193 if test "$clock_monotonic_raw" = "yes" ; then
2194 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2196 if test "$clock_monotonic_precise" = "yes" ; then
2197 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2199 if test "$clockid_t" = "yes"; then
2200 output_sym "CONFIG_CLOCKID_T"
2202 if test "$gettimeofday" = "yes" ; then
2203 output_sym "CONFIG_GETTIMEOFDAY"
2205 if test "$posix_fadvise" = "yes" ; then
2206 output_sym "CONFIG_POSIX_FADVISE"
2208 if test "$linux_3arg_affinity" = "yes" ; then
2209 output_sym "CONFIG_3ARG_AFFINITY"
2210 elif test "$linux_2arg_affinity" = "yes" ; then
2211 output_sym "CONFIG_2ARG_AFFINITY"
2213 if test "$strsep" = "yes" ; then
2214 output_sym "CONFIG_STRSEP"
2216 if test "$strcasestr" = "yes" ; then
2217 output_sym "CONFIG_STRCASESTR"
2219 if test "$strlcat" = "yes" ; then
2220 output_sym "CONFIG_STRLCAT"
2222 if test "$getopt_long_only" = "yes" ; then
2223 output_sym "CONFIG_GETOPT_LONG_ONLY"
2225 if test "$inet_aton" = "yes" ; then
2226 output_sym "CONFIG_INET_ATON"
2228 if test "$socklen_t" = "yes" ; then
2229 output_sym "CONFIG_SOCKLEN_T"
2231 if test "$ext4_me" = "yes" ; then
2232 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2234 if test "$linux_splice" = "yes" ; then
2235 output_sym "CONFIG_LINUX_SPLICE"
2237 if test "$guasi" = "yes" ; then
2238 output_sym "CONFIG_GUASI"
2240 if test "$fusion_aw" = "yes" ; then
2241 output_sym "CONFIG_FUSION_AW"
2243 if test "$libnuma_v2" = "yes" ; then
2244 output_sym "CONFIG_LIBNUMA"
2246 if test "$solaris_aio" = "yes" ; then
2247 output_sym "CONFIG_SOLARISAIO"
2249 if test "$tls_thread" = "yes" ; then
2250 output_sym "CONFIG_TLS_THREAD"
2252 if test "$rusage_thread" = "yes" ; then
2253 output_sym "CONFIG_RUSAGE_THREAD"
2255 if test "$gfio" = "yes" ; then
2256 output_sym "CONFIG_GFIO"
2258 if test "$esx" = "yes" ; then
2259 output_sym "CONFIG_ESX"
2260 output_sym "CONFIG_NO_SHM"
2262 if test "$sched_idle" = "yes" ; then
2263 output_sym "CONFIG_SCHED_IDLE"
2265 if test "$tcp_nodelay" = "yes" ; then
2266 output_sym "CONFIG_TCP_NODELAY"
2268 if test "$window_size" = "yes" ; then
2269 output_sym "CONFIG_NET_WINDOWSIZE"
2271 if test "$mss" = "yes" ; then
2272 output_sym "CONFIG_NET_MSS"
2274 if test "$rlimit_memlock" = "yes" ; then
2275 output_sym "CONFIG_RLIMIT_MEMLOCK"
2277 if test "$pwritev" = "yes" ; then
2278 output_sym "CONFIG_PWRITEV"
2280 if test "$pwritev2" = "yes" ; then
2281 output_sym "CONFIG_PWRITEV2"
2283 if test "$ipv6" = "yes" ; then
2284 output_sym "CONFIG_IPV6"
2286 if test "$rados" = "yes" ; then
2287 output_sym "CONFIG_RADOS"
2289 if test "$rbd" = "yes" ; then
2290 output_sym "CONFIG_RBD"
2292 if test "$rbd_poll" = "yes" ; then
2293 output_sym "CONFIG_RBD_POLL"
2295 if test "$rbd_inval" = "yes" ; then
2296 output_sym "CONFIG_RBD_INVAL"
2298 if test "$rbd_blkin" = "yes" ; then
2299 output_sym "CONFIG_RBD_BLKIN"
2301 if test "$setvbuf" = "yes" ; then
2302 output_sym "CONFIG_SETVBUF"
2304 if test "$s390_z196_facilities" = "yes" ; then
2305 output_sym "CONFIG_S390_Z196_FACILITIES"
2306 CFLAGS="$CFLAGS -march=z9-109"
2308 if test "$gfapi" = "yes" ; then
2309 output_sym "CONFIG_GFAPI"
2311 if test "$gf_fadvise" = "yes" ; then
2312 output_sym "CONFIG_GF_FADVISE"
2314 if test "$gf_trim" = "yes" ; then
2315 output_sym "CONFIG_GF_TRIM"
2317 if test "$libhdfs" = "yes" ; then
2318 output_sym "CONFIG_LIBHDFS"
2319 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2320 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2321 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2322 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2324 if test "$mtd" = "yes" ; then
2325 output_sym "CONFIG_MTD"
2327 if test "$pmemblk" = "yes" ; then
2328 output_sym "CONFIG_PMEMBLK"
2330 if test "$devdax" = "yes" ; then
2331 output_sym "CONFIG_LINUX_DEVDAX"
2333 if test "$pmem" = "yes" ; then
2334 output_sym "CONFIG_LIBPMEM"
2336 if test "$arith" = "yes" ; then
2337 output_sym "CONFIG_ARITHMETIC"
2338 if test "$yacc_is_bison" = "yes" ; then
2339 echo "YACC=$YACC -y" >> $config_host_mak
2341 echo "YACC=$YACC" >> $config_host_mak
2343 if test "$lex_use_o" = "yes" ; then
2344 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2347 if test "$getmntent" = "yes" ; then
2348 output_sym "CONFIG_GETMNTENT"
2350 if test "$getmntinfo" = "yes" ; then
2351 output_sym "CONFIG_GETMNTINFO"
2353 if test "$getmntinfo_statvfs" = "yes" ; then
2354 output_sym "CONFIG_GETMNTINFO_STATVFS"
2356 if test "$static_assert" = "yes" ; then
2357 output_sym "CONFIG_STATIC_ASSERT"
2359 if test "$have_bool" = "yes" ; then
2360 output_sym "CONFIG_HAVE_BOOL"
2362 if test "$strndup" = "yes" ; then
2363 output_sym "CONFIG_HAVE_STRNDUP"
2365 if test "$disable_opt" = "yes" ; then
2366 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2368 if test "$zlib" = "no" ; then
2369 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2371 if test "$cuda" = "yes" ; then
2372 output_sym "CONFIG_CUDA"
2374 if test "$mkdir_two" = "yes" ; then
2375 output_sym "CONFIG_HAVE_MKDIR_TWO"
2378 echo "LIBS+=$LIBS" >> $config_host_mak
2379 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2380 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2381 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2382 echo "CC=$cc" >> $config_host_mak
2383 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2384 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2386 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2387 cat > Makefile <<EOF
2388 SRCDIR:=`dirname $0`
2389 include \$(SRCDIR)/Makefile