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-rbd) disable_rbd="yes"
178 --disable-rbd-blkin) disable_rbd_blkin="yes"
180 --disable-gfapi) disable_gfapi="yes"
182 --enable-libhdfs) libhdfs="yes"
184 --disable-lex) disable_lex="yes"
186 --enable-lex) disable_lex="no"
188 --disable-shm) no_shm="yes"
190 --disable-optimizations) disable_opt="yes"
192 --disable-pmem) disable_pmem="yes"
194 --enable-cuda) enable_cuda="yes"
200 echo "Bad option $opt"
206 if test "$show_help" = "yes" ; then
207 echo "--prefix= Use this directory as installation prefix"
208 echo "--cpu= Specify target CPU if auto-detect fails"
209 echo "--cc= Specify compiler to use"
210 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
211 echo "--build-32bit-win Enable 32-bit build on Windows"
212 echo "--build-static Build a static fio"
213 echo "--esx Configure build options for esx"
214 echo "--enable-gfio Enable building of gtk gfio"
215 echo "--disable-numa Disable libnuma even if found"
216 echo "--disable-rdma Disable RDMA support even if found"
217 echo "--disable-gfapi Disable gfapi"
218 echo "--enable-libhdfs Enable hdfs support"
219 echo "--disable-lex Disable use of lex/yacc for math"
220 echo "--disable-pmem Disable pmem based engines even if found"
221 echo "--enable-lex Enable use of lex/yacc for math"
222 echo "--disable-shm Disable SHM support"
223 echo "--disable-optimizations Don't enable compiler optimizations"
224 echo "--enable-cuda Enable GPUDirect RDMA support"
228 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
229 # Preferred compiler (can be overriden later after we know the platform):
231 # ${cross_prefix}gcc (if cross-prefix specified)
234 if test -z "${CC}${cross_prefix}"; then
241 cc="${CC-${cross_prefix}gcc}"
244 if check_define __ANDROID__ ; then
246 elif check_define __linux__ ; then
248 elif check_define __OpenBSD__ ; then
250 elif check_define __sun__ ; then
252 CFLAGS="$CFLAGS -D_REENTRANT"
253 elif check_define _WIN32 ; then
259 echo "# Automatically generated by configure - do not modify" > $config_host_mak
260 printf "# Configured with:" >> $config_host_mak
261 printf " '%s'" "$0" "$@" >> $config_host_mak
262 echo >> $config_host_mak
263 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
265 if test "$no_shm" = "yes" ; then
266 output_sym "CONFIG_NO_SHM"
269 if test "$disable_opt" = "yes" ; then
270 output_sym "CONFIG_FIO_NO_OPT"
273 # Some host OSes need non-standard checks for which CPU to use.
274 # Note that these checks are broken for cross-compilation: if you're
275 # cross-compiling to one of these OSes then you'll need to specify
276 # the correct CPU with the --cpu option.
279 # Unless explicitly enabled, turn off lex.
280 # OpenBSD will hit syntax error when enabled.
281 if test -z "$disable_lex" ; then
288 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
289 # we can run 64-bit userspace code.
290 # If the user didn't specify a CPU explicitly and the kernel says this is
291 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
293 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
296 # Error at compile time linking of weak/partial symbols if possible...
303 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
304 echo "Disabling weak symbols"
305 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
309 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
310 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
313 LIBS="-lnsl -lsocket"
316 # We still force some options, so keep this message here.
317 echo "Forcing some known good options on Windows"
318 if test -z "${CC}${cross_prefix}"; then
319 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
320 cc="i686-w64-mingw32-gcc"
321 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
322 echo "Building with zlib support"
323 output_sym "CONFIG_ZLIB"
324 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
327 cc="x86_64-w64-mingw32-gcc"
328 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
329 echo "Building with zlib support"
330 output_sym "CONFIG_ZLIB"
331 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
335 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
336 output_sym "CONFIG_32BIT"
338 output_sym "CONFIG_64BIT_LLP64"
340 # We need this to be output_sym'd here because this is Windows specific.
341 # The regular configure path never sets this config.
342 output_sym "CONFIG_WINDOWSAIO"
343 # We now take the regular configuration path without having exit 0 here.
344 # Flags below are still necessary mostly for MinGW.
351 clock_gettime="yes" # clock_monotonic probe has dependency on this
352 clock_monotonic="yes"
360 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
364 # Now we know the target platform we can have another guess at the preferred
365 # compiler when it wasn't explictly set
366 if test -z "${CC}${cross_prefix}"; then
367 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
373 if test -z "$cc"; then
374 echo "configure: failed to find compiler"
378 if test ! -z "$cpu" ; then
379 # command line argument
381 elif check_define __i386__ ; then
383 elif check_define __x86_64__ ; then
385 elif check_define __sparc__ ; then
386 if check_define __arch64__ ; then
391 elif check_define _ARCH_PPC ; then
392 if check_define _ARCH_PPC64 ; then
397 elif check_define __mips__ ; then
399 elif check_define __ia64__ ; then
401 elif check_define __s390__ ; then
402 if check_define __s390x__ ; then
407 elif check_define __arm__ ; then
409 elif check_define __aarch64__ ; then
411 elif check_define __hppa__ ; then
417 # Normalise host CPU name and set ARCH.
419 ia64|ppc|ppc64|s390|s390x|sparc64)
422 i386|i486|i586|i686|i86pc|BePC)
434 hppa|parisc|parisc64)
448 ##########################################
449 # check cross compile
451 if test "$cross_compile" != "yes" ; then
460 if compile_prog "" "" "cross"; then
461 $TMPE 2>/dev/null || cross_compile="yes"
463 fatal "compile test failed"
466 ##########################################
468 if test "$bigendian" != "yes" ; then
471 if test "$cross_compile" = "no" ; then
473 #include <inttypes.h>
476 volatile uint32_t i=0x01234567;
477 return (*((uint8_t*)(&i))) == 0x67;
480 if compile_prog "" "" "endian"; then
481 $TMPE && bigendian="yes"
484 # If we're cross compiling, try our best to work it out and rely on the
485 # run-time check to fail if we get it wrong.
490 #if __BYTE_ORDER != __BIG_ENDIAN
491 # error "Unknown endianness"
495 compile_prog "" "" "endian" && bigendian="yes"
496 check_define "__ARMEB__" && bigendian="yes"
497 check_define "__MIPSEB__" && bigendian="yes"
501 print_config "Operating system" "$targetos"
502 print_config "CPU" "$cpu"
503 print_config "Big endian" "$bigendian"
504 print_config "Compiler" "$cc"
505 print_config "Cross compile" "$cross_compile"
508 ##########################################
509 # See if we need to build a static build
510 if test "$build_static" = "yes" ; then
511 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
512 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
516 print_config "Static build" "$build_static"
518 ##########################################
523 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
526 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
530 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
532 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
535 fatal "Unknown wordsize"
537 print_config "Wordsize" "$wordsize"
539 ##########################################
541 if test "$zlib" != "yes" ; then
549 if (inflateInit(&stream) != Z_OK)
554 if compile_prog "" "-lz" "zlib" ; then
558 print_config "zlib" "$zlib"
560 ##########################################
562 if test "$libaio" != "yes" ; then
565 if test "$esx" != "yes" ; then
575 if compile_prog "" "-laio" "libaio" ; then
579 if test "$libaio" = "yes" ; then
580 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
585 print_config "Linux AIO support" "$libaio"
587 ##########################################
589 if test "$posix_aio" != "yes" ; then
592 if test "$posix_aio_lrt" != "yes" ; then
604 if compile_prog "" "" "posixaio" ; then
606 elif compile_prog "" "-lrt" "posixaio"; then
611 print_config "POSIX AIO support" "$posix_aio"
612 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
614 ##########################################
615 # posix aio fsync probe
616 if test "$posix_aio_fsync" != "yes" ; then
619 if test "$posix_aio" = "yes" ; then
626 return aio_fsync(O_SYNC, &cb);
630 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
634 print_config "POSIX AIO fsync" "$posix_aio_fsync"
636 ##########################################
637 # POSIX pshared attribute probe
638 if test "$posix_pshared" != "yes" ; then
645 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
646 # if defined(__CYGWIN__)
647 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
648 # elif defined(__APPLE__)
649 # include <AvailabilityMacros.h>
650 # include <TargetConditionals.h>
651 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
652 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
656 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
661 if compile_prog "" "$LIBS" "posix_pshared" ; then
664 print_config "POSIX pshared support" "$posix_pshared"
666 ##########################################
668 if test "$solaris_aio" != "yes" ; then
672 #include <sys/types.h>
673 #include <sys/asynch.h>
678 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
682 if compile_prog "" "-laio" "solarisaio" ; then
686 print_config "Solaris AIO support" "$solaris_aio"
688 ##########################################
689 # __sync_fetch_and_add test
690 if test "$sfaa" != "yes" ; then
694 #include <inttypes.h>
695 static int sfaa(uint64_t *ptr)
697 return __sync_fetch_and_add(ptr, 0);
700 int main(int argc, char **argv)
707 if compile_prog "" "" "__sync_fetch_and_add()" ; then
710 print_config "__sync_fetch_and_add" "$sfaa"
712 ##########################################
713 # __sync_synchronize() test
714 if test "$sync_sync" != "yes" ; then
718 #include <inttypes.h>
720 int main(int argc, char **argv)
722 __sync_synchronize();
726 if compile_prog "" "" "__sync_synchronize()" ; then
729 print_config "__sync_synchronize" "$sync_sync"
731 ##########################################
732 # __sync_val_compare_and_swap() test
733 if test "$cmp_swap" != "yes" ; then
737 #include <inttypes.h>
739 int main(int argc, char **argv)
742 return __sync_val_compare_and_swap(&x, 1, 2);
745 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
748 print_config "__sync_val_compare_and_swap" "$cmp_swap"
750 ##########################################
752 if test "$libverbs" != "yes" ; then
756 #include <infiniband/verbs.h>
757 int main(int argc, char **argv)
759 struct ibv_pd *pd = ibv_alloc_pd(NULL);
763 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
765 LIBS="-libverbs $LIBS"
767 print_config "libverbs" "$libverbs"
769 ##########################################
771 if test "$rdmacm" != "yes" ; then
776 #include <rdma/rdma_cma.h>
777 int main(int argc, char **argv)
779 rdma_destroy_qp(NULL);
783 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
785 LIBS="-lrdmacm $LIBS"
787 print_config "rdmacm" "$rdmacm"
789 ##########################################
790 # Linux fallocate probe
791 if test "$linux_fallocate" != "yes" ; then
797 #include <linux/falloc.h>
798 int main(int argc, char **argv)
800 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
804 if compile_prog "" "" "linux_fallocate"; then
805 linux_fallocate="yes"
807 print_config "Linux fallocate" "$linux_fallocate"
809 ##########################################
810 # POSIX fadvise probe
811 if test "$posix_fadvise" != "yes" ; then
817 int main(int argc, char **argv)
819 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
823 if compile_prog "" "" "posix_fadvise"; then
826 print_config "POSIX fadvise" "$posix_fadvise"
828 ##########################################
829 # POSIX fallocate probe
830 if test "$posix_fallocate" != "yes" ; then
836 int main(int argc, char **argv)
838 int r = posix_fallocate(0, 0, 1024);
842 if compile_prog "" "" "posix_fallocate"; then
843 posix_fallocate="yes"
845 print_config "POSIX fallocate" "$posix_fallocate"
847 ##########################################
848 # sched_set/getaffinity 2 or 3 argument test
849 if test "$linux_2arg_affinity" != "yes" ; then
850 linux_2arg_affinity="no"
852 if test "$linux_3arg_affinity" != "yes" ; then
853 linux_3arg_affinity="no"
857 int main(int argc, char **argv)
860 return sched_setaffinity(0, sizeof(mask), &mask);
863 if compile_prog "" "" "sched_setaffinity(,,)"; then
864 linux_3arg_affinity="yes"
868 int main(int argc, char **argv)
871 return sched_setaffinity(0, &mask);
874 if compile_prog "" "" "sched_setaffinity(,)"; then
875 linux_2arg_affinity="yes"
878 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
879 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
881 ##########################################
882 # clock_gettime probe
883 if test "$clock_gettime" != "yes" ; then
889 int main(int argc, char **argv)
891 return clock_gettime(0, NULL);
894 if compile_prog "" "" "clock_gettime"; then
896 elif compile_prog "" "-lrt" "clock_gettime"; then
900 print_config "clock_gettime" "$clock_gettime"
902 ##########################################
903 # CLOCK_MONOTONIC probe
904 if test "$clock_monotonic" != "yes" ; then
907 if test "$clock_gettime" = "yes" ; then
911 int main(int argc, char **argv)
913 return clock_gettime(CLOCK_MONOTONIC, NULL);
916 if compile_prog "" "$LIBS" "clock monotonic"; then
917 clock_monotonic="yes"
920 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
922 ##########################################
923 # CLOCK_MONOTONIC_RAW probe
924 if test "$clock_monotonic_raw" != "yes" ; then
925 clock_monotonic_raw="no"
927 if test "$clock_gettime" = "yes" ; then
931 int main(int argc, char **argv)
933 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
936 if compile_prog "" "$LIBS" "clock monotonic"; then
937 clock_monotonic_raw="yes"
940 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
942 ##########################################
943 # CLOCK_MONOTONIC_PRECISE probe
944 if test "$clock_monotonic_precise" != "yes" ; then
945 clock_monotonic_precise="no"
947 if test "$clock_gettime" = "yes" ; then
951 int main(int argc, char **argv)
953 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
956 if compile_prog "" "$LIBS" "clock monotonic precise"; then
957 clock_monotonic_precise="yes"
960 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
962 ##########################################
964 if test "$clockid_t" != "yes" ; then
970 int main(int argc, char **argv)
972 volatile clockid_t cid;
973 memset((void*)&cid, 0, sizeof(cid));
977 if compile_prog "" "$LIBS" "clockid_t"; then
980 print_config "clockid_t" "$clockid_t"
982 ##########################################
983 # gettimeofday() probe
984 if test "$gettimeofday" != "yes" ; then
988 #include <sys/time.h>
990 int main(int argc, char **argv)
993 return gettimeofday(&tv, NULL);
996 if compile_prog "" "" "gettimeofday"; then
999 print_config "gettimeofday" "$gettimeofday"
1001 ##########################################
1003 if test "$fdatasync" != "yes" ; then
1009 int main(int argc, char **argv)
1011 return fdatasync(0);
1014 if compile_prog "" "" "fdatasync"; then
1017 print_config "fdatasync" "$fdatasync"
1019 ##########################################
1020 # sync_file_range() probe
1021 if test "$sync_file_range" != "yes" ; then
1022 sync_file_range="no"
1028 #include <linux/fs.h>
1029 int main(int argc, char **argv)
1031 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1032 SYNC_FILE_RANGE_WAIT_AFTER;
1033 return sync_file_range(0, 0, 0, flags);
1036 if compile_prog "" "" "sync_file_range"; then
1037 sync_file_range="yes"
1039 print_config "sync_file_range" "$sync_file_range"
1041 ##########################################
1042 # ext4 move extent probe
1043 if test "$ext4_me" != "yes" ; then
1048 #include <sys/ioctl.h>
1049 int main(int argc, char **argv)
1051 struct move_extent me;
1052 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1055 if compile_prog "" "" "ext4 move extent" ; then
1057 elif test $targetos = "Linux" ; then
1058 # On Linux, just default to it on and let it error at runtime if we really
1059 # don't have it. None of my updated systems have it defined, but it does
1060 # work. Takes a while to bubble back.
1063 print_config "EXT4 move extent" "$ext4_me"
1065 ##########################################
1067 if test "$linux_splice" != "yes" ; then
1073 int main(int argc, char **argv)
1075 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1078 if compile_prog "" "" "linux splice"; then
1081 print_config "Linux splice(2)" "$linux_splice"
1083 ##########################################
1085 if test "$guasi" != "yes" ; then
1090 #include <guasi_syscalls.h>
1091 int main(int argc, char **argv)
1093 guasi_t ctx = guasi_create(0, 0, 0);
1097 if compile_prog "" "" "guasi"; then
1100 print_config "GUASI" "$guasi"
1102 ##########################################
1104 if test "$fusion_aw" != "yes" ; then
1108 #include <nvm/nvm_primitives.h>
1109 int main(int argc, char **argv)
1111 nvm_version_t ver_info;
1112 nvm_handle_t handle;
1114 handle = nvm_get_handle(0, &ver_info);
1115 return nvm_atomic_write(handle, 0, 0, 0);
1118 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1119 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1122 print_config "Fusion-io atomic engine" "$fusion_aw"
1124 ##########################################
1126 if test "$libnuma" != "yes" ; then
1131 int main(int argc, char **argv)
1133 return numa_available();
1136 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1140 print_config "libnuma" "$libnuma"
1142 ##########################################
1143 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1144 if test "$libnuma" = "yes" ; then
1148 int main(int argc, char **argv)
1150 struct bitmask *mask = numa_parse_nodestring(NULL);
1151 return mask->size == 0;
1154 if compile_prog "" "" "libnuma api"; then
1157 print_config "libnuma v2" "$libnuma_v2"
1160 ##########################################
1162 if test "$strsep" != "yes" ; then
1167 int main(int argc, char **argv)
1169 static char *string = "This is a string";
1170 strsep(&string, "needle");
1174 if compile_prog "" "" "strsep"; then
1177 print_config "strsep" "$strsep"
1179 ##########################################
1180 # strcasestr() probe
1181 if test "$strcasestr" != "yes" ; then
1186 int main(int argc, char **argv)
1188 return strcasestr(argv[0], argv[1]) != NULL;
1191 if compile_prog "" "" "strcasestr"; then
1194 print_config "strcasestr" "$strcasestr"
1196 ##########################################
1198 if test "$strlcat" != "yes" ; then
1203 int main(int argc, char **argv)
1205 static char dst[64];
1206 static char *string = "This is a string";
1207 memset(dst, 0, sizeof(dst));
1208 strlcat(dst, string, sizeof(dst));
1212 if compile_prog "" "" "strlcat"; then
1215 print_config "strlcat" "$strlcat"
1217 ##########################################
1218 # getopt_long_only() probe
1219 if test "$getopt_long_only" != "yes" ; then
1220 getopt_long_only="no"
1226 int main(int argc, char **argv)
1228 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1232 if compile_prog "" "" "getopt_long_only"; then
1233 getopt_long_only="yes"
1235 print_config "getopt_long_only()" "$getopt_long_only"
1237 ##########################################
1239 if test "$inet_aton" != "yes" ; then
1243 #include <sys/socket.h>
1244 #include <arpa/inet.h>
1246 int main(int argc, char **argv)
1249 return inet_aton(NULL, &in);
1252 if compile_prog "" "" "inet_aton"; then
1255 print_config "inet_aton" "$inet_aton"
1257 ##########################################
1259 if test "$socklen_t" != "yes" ; then
1263 #include <sys/socket.h>
1264 int main(int argc, char **argv)
1270 if compile_prog "" "" "socklen_t"; then
1273 print_config "socklen_t" "$socklen_t"
1275 ##########################################
1276 # Whether or not __thread is supported for TLS
1277 if test "$tls_thread" != "yes" ; then
1282 static __thread int ret;
1283 int main(int argc, char **argv)
1288 if compile_prog "" "" "__thread"; then
1291 print_config "__thread" "$tls_thread"
1293 ##########################################
1294 # Check if we have required gtk/glib support for gfio
1295 if test "$gfio" != "yes" ; then
1298 if test "$gfio_check" = "yes" ; then
1302 #include <gtk/gtk.h>
1305 gdk_threads_enter();
1306 gdk_threads_leave();
1308 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1311 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1312 ORG_LDFLAGS=$LDFLAGS
1313 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1314 if test "$?" != "0" ; then
1315 echo "configure: gtk and gthread not found"
1318 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1319 if test "$?" != "0" ; then
1320 echo "configure: gtk and gthread not found"
1323 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1325 if test "$?" = "0" ; then
1327 GFIO_LIBS="$LIBS $GTK_LIBS"
1328 CFLAGS="$CFLAGS $GTK_CFLAGS"
1330 echo "GTK found, but need version 2.18 or higher"
1334 echo "Please install gtk and gdk libraries"
1337 LDFLAGS=$ORG_LDFLAGS
1340 if test "$gfio_check" = "yes" ; then
1341 print_config "gtk 2.18 or higher" "$gfio"
1344 ##########################################
1345 # Check whether we have getrusage(RUSAGE_THREAD)
1346 if test "$rusage_thread" != "yes" ; then
1350 #include <sys/time.h>
1351 #include <sys/resource.h>
1352 int main(int argc, char **argv)
1355 getrusage(RUSAGE_THREAD, &ru);
1359 if compile_prog "" "" "RUSAGE_THREAD"; then
1362 print_config "RUSAGE_THREAD" "$rusage_thread"
1364 ##########################################
1365 # Check whether we have SCHED_IDLE
1366 if test "$sched_idle" != "yes" ; then
1371 int main(int argc, char **argv)
1373 struct sched_param p;
1374 return sched_setscheduler(0, SCHED_IDLE, &p);
1377 if compile_prog "" "" "SCHED_IDLE"; then
1380 print_config "SCHED_IDLE" "$sched_idle"
1382 ##########################################
1383 # Check whether we have TCP_NODELAY
1384 if test "$tcp_nodelay" != "yes" ; then
1389 #include <sys/types.h>
1390 #include <sys/socket.h>
1391 #include <netinet/tcp.h>
1392 int main(int argc, char **argv)
1394 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1397 if compile_prog "" "" "TCP_NODELAY"; then
1400 print_config "TCP_NODELAY" "$tcp_nodelay"
1402 ##########################################
1403 # Check whether we have SO_SNDBUF
1404 if test "$window_size" != "yes" ; then
1409 #include <sys/types.h>
1410 #include <sys/socket.h>
1411 #include <netinet/tcp.h>
1412 int main(int argc, char **argv)
1414 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1415 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1418 if compile_prog "" "" "SO_SNDBUF"; then
1421 print_config "Net engine window_size" "$window_size"
1423 ##########################################
1424 # Check whether we have TCP_MAXSEG
1425 if test "$mss" != "yes" ; then
1430 #include <sys/types.h>
1431 #include <sys/socket.h>
1432 #include <netinet/tcp.h>
1433 #include <arpa/inet.h>
1434 #include <netinet/in.h>
1435 int main(int argc, char **argv)
1437 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1440 if compile_prog "" "" "TCP_MAXSEG"; then
1443 print_config "TCP_MAXSEG" "$mss"
1445 ##########################################
1446 # Check whether we have RLIMIT_MEMLOCK
1447 if test "$rlimit_memlock" != "yes" ; then
1451 #include <sys/time.h>
1452 #include <sys/resource.h>
1453 int main(int argc, char **argv)
1456 return getrlimit(RLIMIT_MEMLOCK, &rl);
1459 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1460 rlimit_memlock="yes"
1462 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1464 ##########################################
1465 # Check whether we have pwritev/preadv
1466 if test "$pwritev" != "yes" ; then
1471 #include <sys/uio.h>
1472 int main(int argc, char **argv)
1474 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1477 if compile_prog "" "" "pwritev"; then
1480 print_config "pwritev/preadv" "$pwritev"
1482 ##########################################
1483 # Check whether we have pwritev2/preadv2
1484 if test "$pwritev2" != "yes" ; then
1489 #include <sys/uio.h>
1490 int main(int argc, char **argv)
1492 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1495 if compile_prog "" "" "pwritev2"; then
1498 print_config "pwritev2/preadv2" "$pwritev2"
1500 ##########################################
1501 # Check whether we have the required functions for ipv6
1502 if test "$ipv6" != "yes" ; then
1506 #include <sys/types.h>
1507 #include <sys/socket.h>
1508 #include <netinet/in.h>
1511 int main(int argc, char **argv)
1513 struct addrinfo hints;
1514 struct in6_addr addr;
1517 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1519 printf("%s\n", gai_strerror(ret));
1524 if compile_prog "" "" "ipv6"; then
1527 print_config "IPv6 helpers" "$ipv6"
1529 ##########################################
1531 if test "$rbd" != "yes" ; then
1535 #include <rbd/librbd.h>
1537 int main(int argc, char **argv)
1540 rados_ioctx_t io_ctx;
1541 const char cluster_name[] = "ceph";
1542 const char user_name[] = "client.admin";
1543 const char pool[] = "rbd";
1544 int major, minor, extra;
1546 rbd_version(&major, &minor, &extra);
1547 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1548 rados_create2(&cluster, cluster_name, user_name, 0);
1549 rados_ioctx_create(cluster, pool, &io_ctx);
1554 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1555 LIBS="-lrbd -lrados $LIBS"
1558 print_config "Rados Block Device engine" "$rbd"
1560 ##########################################
1561 # check for rbd_poll
1562 if test "$rbd_poll" != "yes" ; then
1565 if test "$rbd" = "yes"; then
1567 #include <rbd/librbd.h>
1568 #include <sys/eventfd.h>
1570 int main(int argc, char **argv)
1573 rbd_completion_t comp;
1575 int fd = eventfd(0, EFD_NONBLOCK);
1576 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1577 rbd_poll_io_events(image, comp, 1);
1582 if compile_prog "" "-lrbd -lrados" "rbd"; then
1585 print_config "rbd_poll" "$rbd_poll"
1588 ##########################################
1589 # check for rbd_invalidate_cache()
1590 if test "$rbd_inval" != "yes" ; then
1593 if test "$rbd" = "yes"; then
1595 #include <rbd/librbd.h>
1597 int main(int argc, char **argv)
1601 return rbd_invalidate_cache(image);
1604 if compile_prog "" "-lrbd -lrados" "rbd"; then
1607 print_config "rbd_invalidate_cache" "$rbd_inval"
1610 ##########################################
1612 if test "$rbd_blkin" != "yes" ; then
1616 #include <rbd/librbd.h>
1617 #include <zipkin_c.h>
1619 int main(int argc, char **argv)
1622 struct blkin_trace_info t_info;
1623 blkin_init_trace_info(&t_info);
1624 rbd_completion_t completion;
1629 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1633 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1634 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1635 LIBS="-lblkin $LIBS"
1638 print_config "rbd blkin tracing" "$rbd_blkin"
1640 ##########################################
1641 # Check whether we have setvbuf
1642 if test "$setvbuf" != "yes" ; then
1647 int main(int argc, char **argv)
1651 setvbuf(f, buf, _IOFBF, sizeof(buf));
1655 if compile_prog "" "" "setvbuf"; then
1658 print_config "setvbuf" "$setvbuf"
1660 ##########################################
1662 if test "$gfapi" != "yes" ; then
1666 #include <glusterfs/api/glfs.h>
1668 int main(int argc, char **argv)
1670 glfs_t *g = glfs_new("foo");
1675 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1676 LIBS="-lgfapi -lglusterfs $LIBS"
1679 print_config "Gluster API engine" "$gfapi"
1681 ##########################################
1682 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1683 if test "$gfapi" = "yes" ; then
1686 #include <glusterfs/api/glfs.h>
1688 int main(int argc, char **argv)
1691 int ret = glfs_fadvise(fd, 0, 0, 1);
1696 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1699 print_config "Gluster API use fadvise" "$gf_fadvise"
1702 ##########################################
1703 # check for gfapi trim support
1704 if test "$gf_trim" != "yes" ; then
1707 if test "$gfapi" = "yes" ; then
1709 #include <glusterfs/api/glfs.h>
1711 int main(int argc, char **argv)
1713 return glfs_discard_async(NULL, 0, 0);
1716 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1719 print_config "Gluster API trim support" "$gf_trim"
1722 ##########################################
1723 # Check if we support stckf on s390
1724 if test "$s390_z196_facilities" != "yes" ; then
1725 s390_z196_facilities="no"
1728 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1729 int main(int argc, char **argv)
1731 /* We want just 1 double word to be returned. */
1732 register unsigned long reg0 asm("0") = 0;
1733 unsigned long stfle_bits;
1734 asm volatile(".machine push" "\n\t"
1735 ".machine \"z9-109\"" "\n\t"
1738 : "=QS" (stfle_bits), "+d" (reg0)
1741 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1747 if compile_prog "" "" "s390_z196_facilities"; then
1749 if [ $? -eq 0 ]; then
1750 s390_z196_facilities="yes"
1753 print_config "s390_z196_facilities" "$s390_z196_facilities"
1755 ##########################################
1756 # Check if we have required environment variables configured for libhdfs
1757 if test "$libhdfs" = "yes" ; then
1759 if test "$JAVA_HOME" = "" ; then
1760 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1763 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1764 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1767 if test "$FIO_LIBHDFS_LIB" = "" ; then
1768 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1771 if test "$hdfs_conf_error" = "1" ; then
1775 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1776 FIO_HDFS_CPU="amd64"
1779 print_config "HDFS engine" "$libhdfs"
1781 ##########################################
1782 # Check whether we have MTD
1783 if test "$mtd" != "yes" ; then
1788 #include <mtd/mtd-user.h>
1789 #include <sys/ioctl.h>
1790 int main(int argc, char **argv)
1792 struct mtd_write_req ops;
1793 struct mtd_info_user info;
1794 memset(&ops, 0, sizeof(ops));
1795 info.type = MTD_MLCNANDFLASH;
1796 return ioctl(0, MEMGETINFO, &info);
1799 if compile_prog "" "" "mtd"; then
1802 print_config "MTD" "$mtd"
1804 ##########################################
1805 # Check whether we have libpmem
1806 if test "$libpmem" != "yes" ; then
1810 #include <libpmem.h>
1811 int main(int argc, char **argv)
1814 rc = pmem_is_pmem(0, 0);
1818 if compile_prog "" "-lpmem" "libpmem"; then
1822 print_config "libpmem" "$libpmem"
1824 ##########################################
1825 # Check whether we have libpmemblk
1826 # libpmem is a prerequisite
1827 if test "$libpmemblk" != "yes" ; then
1830 if test "$libpmem" = "yes"; then
1832 #include <libpmemblk.h>
1833 int main(int argc, char **argv)
1836 pbp = pmemblk_open("", 0);
1840 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1842 LIBS="-lpmemblk $LIBS"
1845 print_config "libpmemblk" "$libpmemblk"
1847 # Choose the ioengines
1848 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1851 if test "$libpmemblk" = "yes"; then
1856 ##########################################
1857 # Report whether pmemblk engine is enabled
1858 print_config "NVML pmemblk engine" "$pmemblk"
1860 ##########################################
1861 # Report whether dev-dax engine is enabled
1862 print_config "NVML dev-dax engine" "$devdax"
1864 ##########################################
1865 # Report whether libpmem engine is enabled
1866 print_config "NVML libpmem engine" "$pmem"
1868 ##########################################
1869 # Check if we have lex/yacc available
1874 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1875 if test "$targetos" != "SunOS" ; then
1876 LEX=$(which lex 2> /dev/null)
1877 if test -x "$LEX" ; then
1880 YACC=$(which bison 2> /dev/null)
1881 if test -x "$YACC" ; then
1885 YACC=$(which yacc 2> /dev/null)
1886 if test -x "$YACC" ; then
1890 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1894 if test "$arith" = "yes" ; then
1896 extern int yywrap(void);
1898 int main(int argc, char **argv)
1904 if compile_prog "" "-ll" "lex"; then
1913 # Check if lex fails using -o
1914 if test "$arith" = "yes" ; then
1915 if test "$force_no_lex_o" = "yes" ; then
1918 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1919 if test "$?" = "0" ; then
1927 print_config "lex/yacc for arithmetic" "$arith"
1929 ##########################################
1930 # Check whether we have setmntent/getmntent
1931 if test "$getmntent" != "yes" ; then
1937 int main(int argc, char **argv)
1939 FILE *mtab = setmntent(NULL, "r");
1940 struct mntent *mnt = getmntent(mtab);
1945 if compile_prog "" "" "getmntent"; then
1948 print_config "getmntent" "$getmntent"
1950 ##########################################
1951 # Check whether we have getmntinfo
1952 # These are originally added for BSDs, but may also work
1953 # on other operating systems with getmntinfo(3).
1955 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1956 # Note that NetBSD needs -Werror to catch warning as error.
1957 if test "$getmntinfo" != "yes" ; then
1962 #include <sys/param.h>
1963 #include <sys/mount.h>
1964 int main(int argc, char **argv)
1967 return getmntinfo(&st, MNT_NOWAIT);
1970 if compile_prog "-Werror" "" "getmntinfo"; then
1973 print_config "getmntinfo" "$getmntinfo"
1975 # getmntinfo(3) for NetBSD.
1976 if test "$getmntinfo_statvfs" != "yes" ; then
1977 getmntinfo_statvfs="no"
1981 #include <sys/statvfs.h>
1982 int main(int argc, char **argv)
1985 return getmntinfo(&st, MNT_NOWAIT);
1988 # Skip the test if the one with statfs arg is detected.
1989 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1990 getmntinfo_statvfs="yes"
1991 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
1994 ##########################################
1995 # Check whether we have _Static_assert
1996 if test "$static_assert" != "yes" ; then
2008 int main(int argc, char **argv)
2010 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2014 if compile_prog "" "" "static_assert"; then
2017 print_config "Static Assert" "$static_assert"
2019 ##########################################
2020 # Check whether we have bool / stdbool.h
2021 if test "$have_bool" != "yes" ; then
2025 #include <stdbool.h>
2026 int main(int argc, char **argv)
2029 return var != false;
2032 if compile_prog "" "" "bool"; then
2035 print_config "bool" "$have_bool"
2037 ##########################################
2038 # Check whether we have strndup()
2043 int main(int argc, char **argv)
2045 char *res = strndup("test string", 8);
2051 if compile_prog "" "" "strndup"; then
2054 print_config "strndup" "$strndup"
2056 ##########################################
2057 # check march=armv8-a+crc+crypto
2058 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2059 march_armv8_a_crc_crypto="no"
2061 if test "$cpu" = "arm64" ; then
2063 #include <sys/auxv.h>
2064 #include <arm_acle.h>
2065 #include <arm_neon.h>
2072 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2073 march_armv8_a_crc_crypto="yes"
2074 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2077 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2079 ##########################################
2081 if test "$cuda" != "yes" ; then
2086 int main(int argc, char **argv)
2091 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2095 print_config "cuda" "$cuda"
2097 ##########################################
2098 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2101 #include <sys/stat.h>
2102 #include <sys/types.h>
2103 int main(int argc, char **argv)
2105 return mkdir("/tmp/bla", 0600);
2108 if compile_prog "" "" "mkdir(a, b)"; then
2111 print_config "mkdir(a, b)" "$mkdir_two"
2113 #############################################################################
2115 if test "$wordsize" = "64" ; then
2116 output_sym "CONFIG_64BIT"
2117 elif test "$wordsize" = "32" ; then
2118 output_sym "CONFIG_32BIT"
2120 fatal "Unknown wordsize!"
2122 if test "$bigendian" = "yes" ; then
2123 output_sym "CONFIG_BIG_ENDIAN"
2125 output_sym "CONFIG_LITTLE_ENDIAN"
2127 if test "$zlib" = "yes" ; then
2128 output_sym "CONFIG_ZLIB"
2130 if test "$libaio" = "yes" ; then
2131 output_sym "CONFIG_LIBAIO"
2133 if test "$posix_aio" = "yes" ; then
2134 output_sym "CONFIG_POSIXAIO"
2136 if test "$posix_aio_fsync" = "yes" ; then
2137 output_sym "CONFIG_POSIXAIO_FSYNC"
2139 if test "$posix_pshared" = "yes" ; then
2140 output_sym "CONFIG_PSHARED"
2142 if test "$linux_fallocate" = "yes" ; then
2143 output_sym "CONFIG_LINUX_FALLOCATE"
2145 if test "$posix_fallocate" = "yes" ; then
2146 output_sym "CONFIG_POSIX_FALLOCATE"
2148 if test "$fdatasync" = "yes" ; then
2149 output_sym "CONFIG_FDATASYNC"
2151 if test "$sync_file_range" = "yes" ; then
2152 output_sym "CONFIG_SYNC_FILE_RANGE"
2154 if test "$sfaa" = "yes" ; then
2155 output_sym "CONFIG_SFAA"
2157 if test "$sync_sync" = "yes" ; then
2158 output_sym "CONFIG_SYNC_SYNC"
2160 if test "$cmp_swap" = "yes" ; then
2161 output_sym "CONFIG_CMP_SWAP"
2163 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2164 output_sym "CONFIG_RDMA"
2166 if test "$clock_gettime" = "yes" ; then
2167 output_sym "CONFIG_CLOCK_GETTIME"
2169 if test "$clock_monotonic" = "yes" ; then
2170 output_sym "CONFIG_CLOCK_MONOTONIC"
2172 if test "$clock_monotonic_raw" = "yes" ; then
2173 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2175 if test "$clock_monotonic_precise" = "yes" ; then
2176 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2178 if test "$clockid_t" = "yes"; then
2179 output_sym "CONFIG_CLOCKID_T"
2181 if test "$gettimeofday" = "yes" ; then
2182 output_sym "CONFIG_GETTIMEOFDAY"
2184 if test "$posix_fadvise" = "yes" ; then
2185 output_sym "CONFIG_POSIX_FADVISE"
2187 if test "$linux_3arg_affinity" = "yes" ; then
2188 output_sym "CONFIG_3ARG_AFFINITY"
2189 elif test "$linux_2arg_affinity" = "yes" ; then
2190 output_sym "CONFIG_2ARG_AFFINITY"
2192 if test "$strsep" = "yes" ; then
2193 output_sym "CONFIG_STRSEP"
2195 if test "$strcasestr" = "yes" ; then
2196 output_sym "CONFIG_STRCASESTR"
2198 if test "$strlcat" = "yes" ; then
2199 output_sym "CONFIG_STRLCAT"
2201 if test "$getopt_long_only" = "yes" ; then
2202 output_sym "CONFIG_GETOPT_LONG_ONLY"
2204 if test "$inet_aton" = "yes" ; then
2205 output_sym "CONFIG_INET_ATON"
2207 if test "$socklen_t" = "yes" ; then
2208 output_sym "CONFIG_SOCKLEN_T"
2210 if test "$ext4_me" = "yes" ; then
2211 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2213 if test "$linux_splice" = "yes" ; then
2214 output_sym "CONFIG_LINUX_SPLICE"
2216 if test "$guasi" = "yes" ; then
2217 output_sym "CONFIG_GUASI"
2219 if test "$fusion_aw" = "yes" ; then
2220 output_sym "CONFIG_FUSION_AW"
2222 if test "$libnuma_v2" = "yes" ; then
2223 output_sym "CONFIG_LIBNUMA"
2225 if test "$solaris_aio" = "yes" ; then
2226 output_sym "CONFIG_SOLARISAIO"
2228 if test "$tls_thread" = "yes" ; then
2229 output_sym "CONFIG_TLS_THREAD"
2231 if test "$rusage_thread" = "yes" ; then
2232 output_sym "CONFIG_RUSAGE_THREAD"
2234 if test "$gfio" = "yes" ; then
2235 output_sym "CONFIG_GFIO"
2237 if test "$esx" = "yes" ; then
2238 output_sym "CONFIG_ESX"
2239 output_sym "CONFIG_NO_SHM"
2241 if test "$sched_idle" = "yes" ; then
2242 output_sym "CONFIG_SCHED_IDLE"
2244 if test "$tcp_nodelay" = "yes" ; then
2245 output_sym "CONFIG_TCP_NODELAY"
2247 if test "$window_size" = "yes" ; then
2248 output_sym "CONFIG_NET_WINDOWSIZE"
2250 if test "$mss" = "yes" ; then
2251 output_sym "CONFIG_NET_MSS"
2253 if test "$rlimit_memlock" = "yes" ; then
2254 output_sym "CONFIG_RLIMIT_MEMLOCK"
2256 if test "$pwritev" = "yes" ; then
2257 output_sym "CONFIG_PWRITEV"
2259 if test "$pwritev2" = "yes" ; then
2260 output_sym "CONFIG_PWRITEV2"
2262 if test "$ipv6" = "yes" ; then
2263 output_sym "CONFIG_IPV6"
2265 if test "$rbd" = "yes" ; then
2266 output_sym "CONFIG_RBD"
2268 if test "$rbd_poll" = "yes" ; then
2269 output_sym "CONFIG_RBD_POLL"
2271 if test "$rbd_inval" = "yes" ; then
2272 output_sym "CONFIG_RBD_INVAL"
2274 if test "$rbd_blkin" = "yes" ; then
2275 output_sym "CONFIG_RBD_BLKIN"
2277 if test "$setvbuf" = "yes" ; then
2278 output_sym "CONFIG_SETVBUF"
2280 if test "$s390_z196_facilities" = "yes" ; then
2281 output_sym "CONFIG_S390_Z196_FACILITIES"
2282 CFLAGS="$CFLAGS -march=z9-109"
2284 if test "$gfapi" = "yes" ; then
2285 output_sym "CONFIG_GFAPI"
2287 if test "$gf_fadvise" = "yes" ; then
2288 output_sym "CONFIG_GF_FADVISE"
2290 if test "$gf_trim" = "yes" ; then
2291 output_sym "CONFIG_GF_TRIM"
2293 if test "$libhdfs" = "yes" ; then
2294 output_sym "CONFIG_LIBHDFS"
2295 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2296 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2297 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2298 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2300 if test "$mtd" = "yes" ; then
2301 output_sym "CONFIG_MTD"
2303 if test "$pmemblk" = "yes" ; then
2304 output_sym "CONFIG_PMEMBLK"
2306 if test "$devdax" = "yes" ; then
2307 output_sym "CONFIG_LINUX_DEVDAX"
2309 if test "$pmem" = "yes" ; then
2310 output_sym "CONFIG_LIBPMEM"
2312 if test "$arith" = "yes" ; then
2313 output_sym "CONFIG_ARITHMETIC"
2314 if test "$yacc_is_bison" = "yes" ; then
2315 echo "YACC=$YACC -y" >> $config_host_mak
2317 echo "YACC=$YACC" >> $config_host_mak
2319 if test "$lex_use_o" = "yes" ; then
2320 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2323 if test "$getmntent" = "yes" ; then
2324 output_sym "CONFIG_GETMNTENT"
2326 if test "$getmntinfo" = "yes" ; then
2327 output_sym "CONFIG_GETMNTINFO"
2329 if test "$getmntinfo_statvfs" = "yes" ; then
2330 output_sym "CONFIG_GETMNTINFO_STATVFS"
2332 if test "$static_assert" = "yes" ; then
2333 output_sym "CONFIG_STATIC_ASSERT"
2335 if test "$have_bool" = "yes" ; then
2336 output_sym "CONFIG_HAVE_BOOL"
2338 if test "$strndup" = "yes" ; then
2339 output_sym "CONFIG_HAVE_STRNDUP"
2341 if test "$disable_opt" = "yes" ; then
2342 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2344 if test "$zlib" = "no" ; then
2345 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2347 if test "$cuda" = "yes" ; then
2348 output_sym "CONFIG_CUDA"
2350 if test "$mkdir_two" = "yes" ; then
2351 output_sym "CONFIG_HAVE_MKDIR_TWO"
2354 echo "LIBS+=$LIBS" >> $config_host_mak
2355 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2356 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2357 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2358 echo "CC=$cc" >> $config_host_mak
2359 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2360 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2362 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2363 cat > Makefile <<EOF
2364 SRCDIR:=`dirname $0`
2365 include \$(SRCDIR)/Makefile