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
41 CFLAGS="-D_GNU_SOURCE -include config-host.h"
44 # Print a helpful header at the top of config.log
45 echo "# FIO configure log $(date)" >> config.log
46 printf "# Configured with:" >> config.log
47 printf " '%s'" "$0" "$@" >> config.log
49 echo "#" >> config.log
51 # Print configure header at the top of $config_host_h
52 echo "/*" > $config_host_h
53 echo " * Automatically generated by configure - do not modify" >> $config_host_h
54 printf " * Configured with:" >> $config_host_h
55 printf " * '%s'" "$0" "$@" >> $config_host_h
56 echo "" >> $config_host_h
57 echo " */" >> $config_host_h
60 # Run the compiler, capturing its output to the log.
61 echo $cc "$@" >> config.log
62 $cc "$@" >> config.log 2>&1 || return $?
63 # Test passed. If this is an --enable-werror build, rerun
64 # the test with -Werror and bail out if it fails. This
65 # makes warning-generating-errors in configure test code
66 # obvious to developers.
67 if test "$werror" != "yes"; then
70 # Don't bother rerunning the compile if we were already using -Werror
76 echo $cc -Werror "$@" >> config.log
77 $cc -Werror "$@" >> config.log 2>&1 && return $?
78 echo "ERROR: configure test passed without -Werror but failed with -Werror."
79 echo "This is probably a bug in the configure script. The failing command"
80 echo "will be at the bottom of config.log."
81 fatal "You can run configure with --disable-werror to bypass this check."
85 do_cc $CFLAGS -c -o $TMPO $TMPC
90 local_ldflags="$2 $LIBS"
91 echo "Compiling test case $3" >> config.log
92 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 echo "ERROR: User requested feature $feature"
101 if test ! -z "$packages" ; then
102 echo "ERROR: That feature needs $packages installed"
104 echo "ERROR: configure was not able to find it"
109 type "$1" >/dev/null 2>&1
115 #error $1 not defined
126 echo "$1=y" >> $config_host_mak
127 echo "#define $1" >> $config_host_h
146 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
148 --prefix=*) prefix="$optarg"
150 --cpu=*) cpu="$optarg"
152 # esx is cross compiled and cannot be detect through simple uname calls
158 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
160 --build-32bit-win) build_32bit_win="yes"
162 --build-static) build_static="yes"
167 --disable-numa) disable_numa="yes"
169 --disable-rdma) disable_rdma="yes"
171 --disable-rbd) disable_rbd="yes"
173 --disable-rbd-blkin) disable_rbd_blkin="yes"
175 --disable-gfapi) disable_gfapi="yes"
177 --enable-libhdfs) libhdfs="yes"
179 --disable-lex) disable_lex="yes"
181 --enable-lex) disable_lex="no"
183 --disable-shm) no_shm="yes"
185 --disable-optimizations) disable_opt="yes"
187 --disable-pmem) disable_pmem="yes"
189 --enable-cuda) enable_cuda="yes"
195 echo "Bad option $opt"
201 if test "$show_help" = "yes" ; then
202 echo "--prefix= Use this directory as installation prefix"
203 echo "--cpu= Specify target CPU if auto-detect fails"
204 echo "--cc= Specify compiler to use"
205 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
206 echo "--build-32bit-win Enable 32-bit build on Windows"
207 echo "--build-static Build a static fio"
208 echo "--esx Configure build options for esx"
209 echo "--enable-gfio Enable building of gtk gfio"
210 echo "--disable-numa Disable libnuma even if found"
211 echo "--disable-rdma Disable RDMA support even if found"
212 echo "--disable-gfapi Disable gfapi"
213 echo "--enable-libhdfs Enable hdfs support"
214 echo "--disable-lex Disable use of lex/yacc for math"
215 echo "--disable-pmem Disable pmem based engines even if found"
216 echo "--enable-lex Enable use of lex/yacc for math"
217 echo "--disable-shm Disable SHM support"
218 echo "--disable-optimizations Don't enable compiler optimizations"
219 echo "--enable-cuda Enable GPUDirect RDMA support"
223 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
224 cc="${CC-${cross_prefix}gcc}"
226 if check_define __ANDROID__ ; then
228 elif check_define __linux__ ; then
230 elif check_define __OpenBSD__ ; then
232 elif check_define __sun__ ; then
234 CFLAGS="$CFLAGS -D_REENTRANT"
235 elif check_define _WIN32 ; then
241 echo "# Automatically generated by configure - do not modify" > $config_host_mak
242 printf "# Configured with:" >> $config_host_mak
243 printf " '%s'" "$0" "$@" >> $config_host_mak
244 echo >> $config_host_mak
245 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
247 if test "$no_shm" = "yes" ; then
248 output_sym "CONFIG_NO_SHM"
251 if test "$disable_opt" = "yes" ; then
252 output_sym "CONFIG_FIO_NO_OPT"
255 # Some host OSes need non-standard checks for which CPU to use.
256 # Note that these checks are broken for cross-compilation: if you're
257 # cross-compiling to one of these OSes then you'll need to specify
258 # the correct CPU with the --cpu option.
261 # Unless explicitly enabled, turn off lex.
262 if test -z "$disable_lex" ; then
269 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
270 # we can run 64-bit userspace code.
271 # If the user didn't specify a CPU explicitly and the kernel says this is
272 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
274 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
277 # Error at compile time linking of weak/partial symbols if possible...
284 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
285 echo "Disabling weak symbols"
286 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
290 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
291 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
294 LIBS="-lnsl -lsocket"
297 # We still force some options, so keep this message here.
298 echo "Forcing some known good options on Windows"
299 if test -z "$CC" ; then
300 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
301 CC="i686-w64-mingw32-gcc"
302 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
303 echo "Building with zlib support"
304 output_sym "CONFIG_ZLIB"
305 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
308 CC="x86_64-w64-mingw32-gcc"
309 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
310 echo "Building with zlib support"
311 output_sym "CONFIG_ZLIB"
312 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
316 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
317 output_sym "CONFIG_32BIT"
319 output_sym "CONFIG_64BIT_LLP64"
321 # We need this to be output_sym'd here because this is Windows specific.
322 # The regular configure path never sets this config.
323 output_sym "CONFIG_WINDOWSAIO"
324 # We now take the regular configuration path without having exit 0 here.
325 # Flags below are still necessary mostly for MinGW.
330 clock_gettime="yes" # clock_monotonic probe has dependency on this
331 clock_monotonic="yes"
338 echo "CC=$CC" >> $config_host_mak
339 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
343 if test ! -z "$cpu" ; then
344 # command line argument
346 elif check_define __i386__ ; then
348 elif check_define __x86_64__ ; then
350 elif check_define __sparc__ ; then
351 if check_define __arch64__ ; then
356 elif check_define _ARCH_PPC ; then
357 if check_define _ARCH_PPC64 ; then
362 elif check_define __mips__ ; then
364 elif check_define __ia64__ ; then
366 elif check_define __s390__ ; then
367 if check_define __s390x__ ; then
372 elif check_define __arm__ ; then
374 elif check_define __aarch64__ ; then
376 elif check_define __hppa__ ; then
382 # Normalise host CPU name and set ARCH.
384 ia64|ppc|ppc64|s390|s390x|sparc64)
387 i386|i486|i586|i686|i86pc|BePC)
399 hppa|parisc|parisc64)
413 if test -z "$CC" ; then
414 if test "$targetos" = "FreeBSD"; then
423 cc="${CC-${cross_prefix}gcc}"
425 ##########################################
426 # check cross compile
428 if test "$cross_compile" != "yes" ; then
437 if compile_prog "" "" "cross"; then
438 $TMPE 2>/dev/null || cross_compile="yes"
440 fatal "compile test failed"
443 ##########################################
445 if test "$bigendian" != "yes" ; then
448 if test "$cross_compile" = "no" ; then
450 #include <inttypes.h>
453 volatile uint32_t i=0x01234567;
454 return (*((uint8_t*)(&i))) == 0x67;
457 if compile_prog "" "" "endian"; then
458 $TMPE && bigendian="yes"
461 # If we're cross compiling, try our best to work it out and rely on the
462 # run-time check to fail if we get it wrong.
467 #if __BYTE_ORDER != __BIG_ENDIAN
468 # error "Unknown endianness"
472 compile_prog "" "" "endian" && bigendian="yes"
473 check_define "__ARMEB__" && bigendian="yes"
474 check_define "__MIPSEB__" && bigendian="yes"
478 echo "Operating system $targetos"
480 echo "Big endian $bigendian"
482 echo "Cross compile $cross_compile"
485 ##########################################
486 # See if we need to build a static build
487 if test "$build_static" = "yes" ; then
488 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
489 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
493 echo "Static build $build_static"
495 ##########################################
500 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
503 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
507 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
509 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
512 fatal "Unknown wordsize"
514 echo "Wordsize $wordsize"
516 ##########################################
518 if test "$zlib" != "yes" ; then
526 if (inflateInit(&stream) != Z_OK)
531 if compile_prog "" "-lz" "zlib" ; then
537 ##########################################
539 if test "$libaio" != "yes" ; then
542 if test "$esx" != "yes" ; then
552 if compile_prog "" "-laio" "libaio" ; then
556 if test "$libaio" = "yes" ; then
557 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
562 echo "Linux AIO support $libaio"
564 ##########################################
566 if test "$posix_aio" != "yes" ; then
569 if test "$posix_aio_lrt" != "yes" ; then
581 if compile_prog "" "" "posixaio" ; then
583 elif compile_prog "" "-lrt" "posixaio"; then
588 echo "POSIX AIO support $posix_aio"
589 echo "POSIX AIO support needs -lrt $posix_aio_lrt"
591 ##########################################
592 # posix aio fsync probe
593 if test "$posix_aio_fsync" != "yes" ; then
596 if test "$posix_aio" = "yes" ; then
603 return aio_fsync(O_SYNC, &cb);
607 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
611 echo "POSIX AIO fsync $posix_aio_fsync"
613 ##########################################
614 # POSIX pshared attribute probe
620 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
621 # if defined(__CYGWIN__)
622 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
623 # elif defined(__APPLE__)
624 # include <AvailabilityMacros.h>
625 # include <TargetConditionals.h>
626 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
627 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
631 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
636 if compile_prog "" "$LIBS" "posix_pshared" ; then
639 echo "POSIX pshared support $posix_pshared"
641 ##########################################
643 if test "$solaris_aio" != "yes" ; then
647 #include <sys/types.h>
648 #include <sys/asynch.h>
653 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
657 if compile_prog "" "-laio" "solarisaio" ; then
661 echo "Solaris AIO support $solaris_aio"
663 ##########################################
664 # __sync_fetch_and_add test
665 if test "$sfaa" != "yes" ; then
669 #include <inttypes.h>
670 static int sfaa(uint64_t *ptr)
672 return __sync_fetch_and_add(ptr, 0);
675 int main(int argc, char **argv)
682 if compile_prog "" "" "__sync_fetch_and_add()" ; then
685 echo "__sync_fetch_and_add $sfaa"
687 ##########################################
689 if test "$libverbs" != "yes" ; then
694 #include <infiniband/arch.h>
695 int main(int argc, char **argv)
697 struct ibv_pd *pd = ibv_alloc_pd(NULL);
701 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
703 LIBS="-libverbs $LIBS"
705 echo "libverbs $libverbs"
707 ##########################################
709 if test "$rdmacm" != "yes" ; then
714 #include <rdma/rdma_cma.h>
715 int main(int argc, char **argv)
717 rdma_destroy_qp(NULL);
721 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
723 LIBS="-lrdmacm $LIBS"
725 echo "rdmacm $rdmacm"
727 ##########################################
728 # Linux fallocate probe
729 if test "$linux_fallocate" != "yes" ; then
735 #include <linux/falloc.h>
736 int main(int argc, char **argv)
738 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
742 if compile_prog "" "" "linux_fallocate"; then
743 linux_fallocate="yes"
745 echo "Linux fallocate $linux_fallocate"
747 ##########################################
748 # POSIX fadvise probe
749 if test "$posix_fadvise" != "yes" ; then
755 int main(int argc, char **argv)
757 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
761 if compile_prog "" "" "posix_fadvise"; then
764 echo "POSIX fadvise $posix_fadvise"
766 ##########################################
767 # POSIX fallocate probe
768 if test "$posix_fallocate" != "yes" ; then
774 int main(int argc, char **argv)
776 int r = posix_fallocate(0, 0, 1024);
780 if compile_prog "" "" "posix_fallocate"; then
781 posix_fallocate="yes"
783 echo "POSIX fallocate $posix_fallocate"
785 ##########################################
786 # sched_set/getaffinity 2 or 3 argument test
787 if test "$linux_2arg_affinity" != "yes" ; then
788 linux_2arg_affinity="no"
790 if test "$linux_3arg_affinity" != "yes" ; then
791 linux_3arg_affinity="no"
795 int main(int argc, char **argv)
798 return sched_setaffinity(0, sizeof(mask), &mask);
801 if compile_prog "" "" "sched_setaffinity(,,)"; then
802 linux_3arg_affinity="yes"
806 int main(int argc, char **argv)
809 return sched_setaffinity(0, &mask);
812 if compile_prog "" "" "sched_setaffinity(,)"; then
813 linux_2arg_affinity="yes"
816 echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
817 echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
819 ##########################################
820 # clock_gettime probe
821 if test "$clock_gettime" != "yes" ; then
827 int main(int argc, char **argv)
829 return clock_gettime(0, NULL);
832 if compile_prog "" "" "clock_gettime"; then
834 elif compile_prog "" "-lrt" "clock_gettime"; then
838 echo "clock_gettime $clock_gettime"
840 ##########################################
841 # CLOCK_MONOTONIC probe
842 if test "$clock_monotonic" != "yes" ; then
845 if test "$clock_gettime" = "yes" ; then
849 int main(int argc, char **argv)
851 return clock_gettime(CLOCK_MONOTONIC, NULL);
854 if compile_prog "" "$LIBS" "clock monotonic"; then
855 clock_monotonic="yes"
858 echo "CLOCK_MONOTONIC $clock_monotonic"
860 ##########################################
861 # CLOCK_MONOTONIC_RAW probe
862 if test "$clock_monotonic_raw" != "yes" ; then
863 clock_monotonic_raw="no"
865 if test "$clock_gettime" = "yes" ; then
869 int main(int argc, char **argv)
871 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
874 if compile_prog "" "$LIBS" "clock monotonic"; then
875 clock_monotonic_raw="yes"
878 echo "CLOCK_MONOTONIC_RAW $clock_monotonic_raw"
880 ##########################################
881 # CLOCK_MONOTONIC_PRECISE probe
882 if test "$clock_monotonic_precise" != "yes" ; then
883 clock_monotonic_precise="no"
885 if test "$clock_gettime" = "yes" ; then
889 int main(int argc, char **argv)
891 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
894 if compile_prog "" "$LIBS" "clock monotonic precise"; then
895 clock_monotonic_precise="yes"
898 echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
900 ##########################################
902 if test "$clockid_t" != "yes" ; then
907 int main(int argc, char **argv)
909 volatile clockid_t cid;
910 memset(&cid, 0, sizeof(cid));
914 if compile_prog "" "$LIBS" "clockid_t"; then
917 echo "clockid_t $clockid_t"
919 ##########################################
920 # gettimeofday() probe
921 if test "$gettimeofday" != "yes" ; then
925 #include <sys/time.h>
927 int main(int argc, char **argv)
930 return gettimeofday(&tv, NULL);
933 if compile_prog "" "" "gettimeofday"; then
936 echo "gettimeofday $gettimeofday"
938 ##########################################
940 if test "$fdatasync" != "yes" ; then
946 int main(int argc, char **argv)
951 if compile_prog "" "" "fdatasync"; then
954 echo "fdatasync $fdatasync"
956 ##########################################
957 # sync_file_range() probe
958 if test "$sync_file_range" != "yes" ; then
965 #include <linux/fs.h>
966 int main(int argc, char **argv)
968 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
969 SYNC_FILE_RANGE_WAIT_AFTER;
970 return sync_file_range(0, 0, 0, flags);
973 if compile_prog "" "" "sync_file_range"; then
974 sync_file_range="yes"
976 echo "sync_file_range $sync_file_range"
978 ##########################################
979 # ext4 move extent probe
980 if test "$ext4_me" != "yes" ; then
985 #include <sys/ioctl.h>
986 int main(int argc, char **argv)
988 struct move_extent me;
989 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
992 if compile_prog "" "" "ext4 move extent" ; then
994 elif test $targetos = "Linux" ; then
995 # On Linux, just default to it on and let it error at runtime if we really
996 # don't have it. None of my updated systems have it defined, but it does
997 # work. Takes a while to bubble back.
1000 echo "EXT4 move extent $ext4_me"
1002 ##########################################
1004 if test "$linux_splice" != "yes" ; then
1010 int main(int argc, char **argv)
1012 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1015 if compile_prog "" "" "linux splice"; then
1018 echo "Linux splice(2) $linux_splice"
1020 ##########################################
1022 if test "$guasi" != "yes" ; then
1027 #include <guasi_syscalls.h>
1028 int main(int argc, char **argv)
1030 guasi_t ctx = guasi_create(0, 0, 0);
1034 if compile_prog "" "" "guasi"; then
1039 ##########################################
1041 if test "$fusion_aw" != "yes" ; then
1045 #include <nvm/nvm_primitives.h>
1046 int main(int argc, char **argv)
1048 nvm_version_t ver_info;
1049 nvm_handle_t handle;
1051 handle = nvm_get_handle(0, &ver_info);
1052 return nvm_atomic_write(handle, 0, 0, 0);
1055 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1056 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1059 echo "Fusion-io atomic engine $fusion_aw"
1061 ##########################################
1063 if test "$libnuma" != "yes" ; then
1068 int main(int argc, char **argv)
1070 return numa_available();
1073 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1077 echo "libnuma $libnuma"
1079 ##########################################
1080 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1081 if test "$libnuma" = "yes" ; then
1085 int main(int argc, char **argv)
1087 struct bitmask *mask = numa_parse_nodestring(NULL);
1088 return mask->size == 0;
1091 if compile_prog "" "" "libnuma api"; then
1094 echo "libnuma v2 $libnuma_v2"
1097 ##########################################
1099 if test "$strsep" != "yes" ; then
1104 int main(int argc, char **argv)
1106 static char *string = "This is a string";
1107 strsep(&string, "needle");
1111 if compile_prog "" "" "strsep"; then
1114 echo "strsep $strsep"
1116 ##########################################
1117 # strcasestr() probe
1118 if test "$strcasestr" != "yes" ; then
1123 int main(int argc, char **argv)
1125 return strcasestr(argv[0], argv[1]) != NULL;
1128 if compile_prog "" "" "strcasestr"; then
1131 echo "strcasestr $strcasestr"
1133 ##########################################
1135 if test "$strlcat" != "yes" ; then
1140 int main(int argc, char **argv)
1142 static char dst[64];
1143 static char *string = "This is a string";
1144 memset(dst, 0, sizeof(dst));
1145 strlcat(dst, string, sizeof(dst));
1149 if compile_prog "" "" "strlcat"; then
1152 echo "strlcat $strlcat"
1154 ##########################################
1155 # getopt_long_only() probe
1156 if test "$getopt_long_only" != "yes" ; then
1157 getopt_long_only="no"
1163 int main(int argc, char **argv)
1165 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1169 if compile_prog "" "" "getopt_long_only"; then
1170 getopt_long_only="yes"
1172 echo "getopt_long_only() $getopt_long_only"
1174 ##########################################
1176 if test "$inet_aton" != "yes" ; then
1180 #include <sys/socket.h>
1181 #include <arpa/inet.h>
1183 int main(int argc, char **argv)
1186 return inet_aton(NULL, &in);
1189 if compile_prog "" "" "inet_aton"; then
1192 echo "inet_aton $inet_aton"
1194 ##########################################
1196 if test "$socklen_t" != "yes" ; then
1200 #include <sys/socket.h>
1201 int main(int argc, char **argv)
1207 if compile_prog "" "" "socklen_t"; then
1210 echo "socklen_t $socklen_t"
1212 ##########################################
1213 # Whether or not __thread is supported for TLS
1214 if test "$tls_thread" != "yes" ; then
1219 static __thread int ret;
1220 int main(int argc, char **argv)
1225 if compile_prog "" "" "__thread"; then
1228 echo "__thread $tls_thread"
1230 ##########################################
1231 # Check if we have required gtk/glib support for gfio
1232 if test "$gfio" != "yes" ; then
1235 if test "$gfio_check" = "yes" ; then
1239 #include <gtk/gtk.h>
1242 gdk_threads_enter();
1243 gdk_threads_leave();
1245 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
1248 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1249 ORG_LDFLAGS=$LDFLAGS
1250 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1251 if test "$?" != "0" ; then
1252 echo "configure: gtk and gthread not found"
1255 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1256 if test "$?" != "0" ; then
1257 echo "configure: gtk and gthread not found"
1260 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1262 if test "$r" != "0" ; then
1264 GFIO_LIBS="$LIBS $GTK_LIBS"
1265 CFLAGS="$CFLAGS $GTK_CFLAGS"
1267 echo "GTK found, but need version 2.18 or higher"
1271 echo "Please install gtk and gdk libraries"
1274 LDFLAGS=$ORG_LDFLAGS
1277 if test "$gfio_check" = "yes" ; then
1278 echo "gtk 2.18 or higher $gfio"
1281 # Check whether we have getrusage(RUSAGE_THREAD)
1282 if test "$rusage_thread" != "yes" ; then
1286 #include <sys/time.h>
1287 #include <sys/resource.h>
1288 int main(int argc, char **argv)
1291 getrusage(RUSAGE_THREAD, &ru);
1295 if compile_prog "" "" "RUSAGE_THREAD"; then
1298 echo "RUSAGE_THREAD $rusage_thread"
1300 ##########################################
1301 # Check whether we have SCHED_IDLE
1302 if test "$sched_idle" != "yes" ; then
1307 int main(int argc, char **argv)
1309 struct sched_param p;
1310 return sched_setscheduler(0, SCHED_IDLE, &p);
1313 if compile_prog "" "" "SCHED_IDLE"; then
1316 echo "SCHED_IDLE $sched_idle"
1318 ##########################################
1319 # Check whether we have TCP_NODELAY
1320 if test "$tcp_nodelay" != "yes" ; then
1325 #include <sys/types.h>
1326 #include <sys/socket.h>
1327 #include <netinet/tcp.h>
1328 int main(int argc, char **argv)
1330 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1333 if compile_prog "" "" "TCP_NODELAY"; then
1336 echo "TCP_NODELAY $tcp_nodelay"
1338 ##########################################
1339 # Check whether we have SO_SNDBUF
1340 if test "$window_size" != "yes" ; then
1345 #include <sys/types.h>
1346 #include <sys/socket.h>
1347 #include <netinet/tcp.h>
1348 int main(int argc, char **argv)
1350 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1351 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1354 if compile_prog "" "" "SO_SNDBUF"; then
1357 echo "Net engine window_size $window_size"
1359 ##########################################
1360 # Check whether we have TCP_MAXSEG
1361 if test "$mss" != "yes" ; then
1366 #include <sys/types.h>
1367 #include <sys/socket.h>
1368 #include <netinet/tcp.h>
1369 #include <arpa/inet.h>
1370 #include <netinet/in.h>
1371 int main(int argc, char **argv)
1373 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1376 if compile_prog "" "" "TCP_MAXSEG"; then
1379 echo "TCP_MAXSEG $mss"
1381 ##########################################
1382 # Check whether we have RLIMIT_MEMLOCK
1383 if test "$rlimit_memlock" != "yes" ; then
1387 #include <sys/time.h>
1388 #include <sys/resource.h>
1389 int main(int argc, char **argv)
1392 return getrlimit(RLIMIT_MEMLOCK, &rl);
1395 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1396 rlimit_memlock="yes"
1398 echo "RLIMIT_MEMLOCK $rlimit_memlock"
1400 ##########################################
1401 # Check whether we have pwritev/preadv
1402 if test "$pwritev" != "yes" ; then
1407 #include <sys/uio.h>
1408 int main(int argc, char **argv)
1410 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1413 if compile_prog "" "" "pwritev"; then
1416 echo "pwritev/preadv $pwritev"
1418 ##########################################
1419 # Check whether we have pwritev2/preadv2
1420 if test "$pwritev2" != "yes" ; then
1425 #include <sys/uio.h>
1426 int main(int argc, char **argv)
1428 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1431 if compile_prog "" "" "pwritev2"; then
1434 echo "pwritev2/preadv2 $pwritev2"
1436 ##########################################
1437 # Check whether we have the required functions for ipv6
1438 if test "$ipv6" != "yes" ; then
1442 #include <sys/types.h>
1443 #include <sys/socket.h>
1444 #include <netinet/in.h>
1447 int main(int argc, char **argv)
1449 struct addrinfo hints;
1450 struct in6_addr addr;
1453 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1455 printf("%s\n", gai_strerror(ret));
1460 if compile_prog "" "" "ipv6"; then
1463 echo "IPv6 helpers $ipv6"
1465 ##########################################
1467 if test "$rbd" != "yes" ; then
1471 #include <rbd/librbd.h>
1473 int main(int argc, char **argv)
1477 rados_ioctx_t io_ctx;
1478 const char pool[] = "rbd";
1480 int major, minor, extra;
1481 rbd_version(&major, &minor, &extra);
1483 rados_ioctx_create(cluster, pool, &io_ctx);
1487 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1488 LIBS="-lrbd -lrados $LIBS"
1491 echo "Rados Block Device engine $rbd"
1493 ##########################################
1494 # check for rbd_poll
1495 if test "$rbd_poll" != "yes" ; then
1498 if test "$rbd" = "yes"; then
1500 #include <rbd/librbd.h>
1501 #include <sys/eventfd.h>
1503 int main(int argc, char **argv)
1506 rbd_completion_t comp;
1508 int fd = eventfd(0, EFD_NONBLOCK);
1509 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1510 rbd_poll_io_events(image, comp, 1);
1515 if compile_prog "" "-lrbd -lrados" "rbd"; then
1518 echo "rbd_poll $rbd_poll"
1521 ##########################################
1522 # check for rbd_invaidate_cache()
1523 if test "$rbd_inval" != "yes" ; then
1526 if test "$rbd" = "yes"; then
1528 #include <rbd/librbd.h>
1530 int main(int argc, char **argv)
1534 return rbd_invalidate_cache(image);
1537 if compile_prog "" "-lrbd -lrados" "rbd"; then
1540 echo "rbd_invalidate_cache $rbd_inval"
1543 ##########################################
1545 if test "$rbd_blkin" != "yes" ; then
1549 #include <rbd/librbd.h>
1550 #include <zipkin_c.h>
1552 int main(int argc, char **argv)
1555 struct blkin_trace_info t_info;
1556 blkin_init_trace_info(&t_info);
1557 rbd_completion_t completion;
1562 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1566 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1567 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1568 LIBS="-lblkin $LIBS"
1571 echo "rbd blkin tracing $rbd_blkin"
1573 ##########################################
1574 # Check whether we have setvbuf
1575 if test "$setvbuf" != "yes" ; then
1580 int main(int argc, char **argv)
1584 setvbuf(f, buf, _IOFBF, sizeof(buf));
1588 if compile_prog "" "" "setvbuf"; then
1591 echo "setvbuf $setvbuf"
1594 if test "$gfapi" != "yes" ; then
1598 #include <glusterfs/api/glfs.h>
1600 int main(int argc, char **argv)
1603 glfs_t *g = glfs_new("foo");
1608 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1609 LIBS="-lgfapi -lglusterfs $LIBS"
1612 echo "Gluster API engine $gfapi"
1614 ##########################################
1615 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1616 if test "$gfapi" = "yes" ; then
1619 #include <glusterfs/api/glfs.h>
1621 int main(int argc, char **argv)
1624 int ret = glfs_fadvise(fd, 0, 0, 1);
1629 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1632 echo "Gluster API use fadvise $gf_fadvise"
1635 ##########################################
1636 # check for gfapi trim support
1637 if test "$gf_trim" != "yes" ; then
1640 if test "$gfapi" = "yes" ; then
1642 #include <glusterfs/api/glfs.h>
1644 int main(int argc, char **argv)
1646 return glfs_discard_async(NULL, 0, 0);
1649 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1652 echo "Gluster API trim support $gf_trim"
1655 ##########################################
1656 # Check if we support stckf on s390
1657 if test "$s390_z196_facilities" != "yes" ; then
1658 s390_z196_facilities="no"
1661 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1662 int main(int argc, char **argv)
1664 /* We want just 1 double word to be returned. */
1665 register unsigned long reg0 asm("0") = 0;
1666 unsigned long stfle_bits;
1667 asm volatile(".machine push" "\n\t"
1668 ".machine \"z9-109\"" "\n\t"
1671 : "=QS" (stfle_bits), "+d" (reg0)
1674 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1680 if compile_prog "" "" "s390_z196_facilities"; then
1682 if [[ $? -eq 0 ]]; then
1683 s390_z196_facilities="yes"
1686 echo "s390_z196_facilities $s390_z196_facilities"
1688 ##########################################
1689 # Check if we have required environment variables configured for libhdfs
1690 if test "$libhdfs" = "yes" ; then
1692 if test "$JAVA_HOME" = "" ; then
1693 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1696 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1697 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1700 if test "$FIO_LIBHDFS_LIB" = "" ; then
1701 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1704 if test "$hdfs_conf_error" = "1" ; then
1708 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1709 FIO_HDFS_CPU="amd64"
1712 echo "HDFS engine $libhdfs"
1714 ##########################################
1715 # Check whether we have MTD
1716 if test "$mtd" != "yes" ; then
1721 #include <mtd/mtd-user.h>
1722 #include <sys/ioctl.h>
1723 int main(int argc, char **argv)
1725 struct mtd_write_req ops;
1726 struct mtd_info_user info;
1727 memset(&ops, 0, sizeof(ops));
1728 info.type = MTD_MLCNANDFLASH;
1729 return ioctl(0, MEMGETINFO, &info);
1732 if compile_prog "" "" "mtd"; then
1737 ##########################################
1738 # Check whether we have libpmem
1739 if test "$libpmem" != "yes" ; then
1743 #include <libpmem.h>
1744 int main(int argc, char **argv)
1747 rc = pmem_is_pmem(0, 0);
1751 if compile_prog "" "-lpmem" "libpmem"; then
1755 echo "libpmem $libpmem"
1757 ##########################################
1758 # Check whether we have libpmemblk
1759 # libpmem is a prerequisite
1760 if test "$libpmemblk" != "yes" ; then
1763 if test "$libpmem" = "yes"; then
1765 #include <libpmemblk.h>
1766 int main(int argc, char **argv)
1769 pbp = pmemblk_open("", 0);
1773 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1775 LIBS="-lpmemblk $LIBS"
1778 echo "libpmemblk $libpmemblk"
1780 # Choose the ioengines
1781 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1783 if test "$libpmemblk" = "yes"; then
1788 ##########################################
1789 # Report whether pmemblk engine is enabled
1790 echo "NVML pmemblk engine $pmemblk"
1792 ##########################################
1793 # Report whether dev-dax engine is enabled
1794 echo "NVML dev-dax engine $devdax"
1796 # Check if we have lex/yacc available
1801 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1802 if test "$targetos" != "SunOS" ; then
1803 LEX=$(which lex 2> /dev/null)
1804 if test -x "$LEX" ; then
1807 YACC=$(which bison 2> /dev/null)
1808 if test -x "$YACC" ; then
1812 YACC=$(which yacc 2> /dev/null)
1813 if test -x "$YACC" ; then
1817 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1821 if test "$arith" = "yes" ; then
1823 extern int yywrap(void);
1825 int main(int argc, char **argv)
1831 if compile_prog "" "-ll" "lex"; then
1840 # Check if lex fails using -o
1841 if test "$arith" = "yes" ; then
1842 if test "$force_no_lex_o" = "yes" ; then
1845 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1846 if test "$?" = "0" ; then
1854 echo "lex/yacc for arithmetic $arith"
1856 ##########################################
1857 # Check whether we have setmntent/getmntent
1858 if test "$getmntent" != "yes" ; then
1864 int main(int argc, char **argv)
1866 FILE *mtab = setmntent(NULL, "r");
1867 struct mntent *mnt = getmntent(mtab);
1872 if compile_prog "" "" "getmntent"; then
1875 echo "getmntent $getmntent"
1877 ##########################################
1878 # Check whether we have getmntinfo
1879 # These are originally added for BSDs, but may also work
1880 # on other operating systems with getmntinfo(3).
1882 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1883 # Note that NetBSD needs -Werror to catch warning as error.
1884 if test "$getmntinfo" != "yes" ; then
1889 #include <sys/param.h>
1890 #include <sys/mount.h>
1891 int main(int argc, char **argv)
1894 return getmntinfo(&st, MNT_NOWAIT);
1897 if compile_prog "-Werror" "" "getmntinfo"; then
1900 echo "getmntinfo $getmntinfo"
1902 # getmntinfo(3) for NetBSD.
1903 if test "$getmntinfo_statvfs" != "yes" ; then
1904 getmntinfo_statvfs="no"
1908 #include <sys/statvfs.h>
1909 int main(int argc, char **argv)
1912 return getmntinfo(&st, MNT_NOWAIT);
1915 # Skip the test if the one with statfs arg is detected.
1916 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1917 getmntinfo_statvfs="yes"
1918 echo "getmntinfo_statvfs $getmntinfo_statvfs"
1921 ##########################################
1922 # Check whether we have _Static_assert
1923 if test "$static_assert" != "yes" ; then
1930 #ifdef __compiler_offsetof
1931 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
1933 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
1936 #define container_of(ptr, type, member) ({ \
1937 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
1938 (type *)( (char *)__mptr - offsetof(type,member) );})
1944 int main(int argc, char **argv)
1946 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
1950 if compile_prog "" "" "static_assert"; then
1953 echo "Static Assert $static_assert"
1955 ##########################################
1956 # Check whether we have bool / stdbool.h
1957 if test "$have_bool" != "yes" ; then
1961 #include <stdbool.h>
1962 int main(int argc, char **argv)
1965 return var != false;
1968 if compile_prog "" "" "bool"; then
1971 echo "bool $have_bool"
1973 ##########################################
1974 # check march=armv8-a+crc+crypto
1975 if test "$march_armv8_a_crc_crypto" != "yes" ; then
1976 march_armv8_a_crc_crypto="no"
1978 if test "$cpu" = "arm64" ; then
1980 #include <sys/auxv.h>
1981 #include <arm_acle.h>
1982 #include <arm_neon.h>
1989 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
1990 march_armv8_a_crc_crypto="yes"
1991 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
1994 echo "march_armv8_a_crc_crypto $march_armv8_a_crc_crypto"
1996 ##########################################
2001 int main(int argc, char **argv)
2006 if test "$enable_cuda" == "yes" && compile_prog "" "-lcuda" "cuda"; then
2012 #############################################################################
2014 if test "$wordsize" = "64" ; then
2015 output_sym "CONFIG_64BIT"
2016 elif test "$wordsize" = "32" ; then
2017 output_sym "CONFIG_32BIT"
2019 fatal "Unknown wordsize!"
2021 if test "$bigendian" = "yes" ; then
2022 output_sym "CONFIG_BIG_ENDIAN"
2024 output_sym "CONFIG_LITTLE_ENDIAN"
2026 if test "$zlib" = "yes" ; then
2027 output_sym "CONFIG_ZLIB"
2029 if test "$libaio" = "yes" ; then
2030 output_sym "CONFIG_LIBAIO"
2032 if test "$posix_aio" = "yes" ; then
2033 output_sym "CONFIG_POSIXAIO"
2035 if test "$posix_aio_fsync" = "yes" ; then
2036 output_sym "CONFIG_POSIXAIO_FSYNC"
2038 if test "$posix_pshared" = "yes" ; then
2039 output_sym "CONFIG_PSHARED"
2041 if test "$linux_fallocate" = "yes" ; then
2042 output_sym "CONFIG_LINUX_FALLOCATE"
2044 if test "$posix_fallocate" = "yes" ; then
2045 output_sym "CONFIG_POSIX_FALLOCATE"
2047 if test "$fdatasync" = "yes" ; then
2048 output_sym "CONFIG_FDATASYNC"
2050 if test "$sync_file_range" = "yes" ; then
2051 output_sym "CONFIG_SYNC_FILE_RANGE"
2053 if test "$sfaa" = "yes" ; then
2054 output_sym "CONFIG_SFAA"
2056 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2057 output_sym "CONFIG_RDMA"
2059 if test "$clock_gettime" = "yes" ; then
2060 output_sym "CONFIG_CLOCK_GETTIME"
2062 if test "$clock_monotonic" = "yes" ; then
2063 output_sym "CONFIG_CLOCK_MONOTONIC"
2065 if test "$clock_monotonic_raw" = "yes" ; then
2066 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2068 if test "$clock_monotonic_precise" = "yes" ; then
2069 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2071 if test "$clockid_t" = "yes"; then
2072 output_sym "CONFIG_CLOCKID_T"
2074 if test "$gettimeofday" = "yes" ; then
2075 output_sym "CONFIG_GETTIMEOFDAY"
2077 if test "$posix_fadvise" = "yes" ; then
2078 output_sym "CONFIG_POSIX_FADVISE"
2080 if test "$linux_3arg_affinity" = "yes" ; then
2081 output_sym "CONFIG_3ARG_AFFINITY"
2082 elif test "$linux_2arg_affinity" = "yes" ; then
2083 output_sym "CONFIG_2ARG_AFFINITY"
2085 if test "$strsep" = "yes" ; then
2086 output_sym "CONFIG_STRSEP"
2088 if test "$strcasestr" = "yes" ; then
2089 output_sym "CONFIG_STRCASESTR"
2091 if test "$strlcat" = "yes" ; then
2092 output_sym "CONFIG_STRLCAT"
2094 if test "$getopt_long_only" = "yes" ; then
2095 output_sym "CONFIG_GETOPT_LONG_ONLY"
2097 if test "$inet_aton" = "yes" ; then
2098 output_sym "CONFIG_INET_ATON"
2100 if test "$socklen_t" = "yes" ; then
2101 output_sym "CONFIG_SOCKLEN_T"
2103 if test "$ext4_me" = "yes" ; then
2104 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2106 if test "$linux_splice" = "yes" ; then
2107 output_sym "CONFIG_LINUX_SPLICE"
2109 if test "$guasi" = "yes" ; then
2110 output_sym "CONFIG_GUASI"
2112 if test "$fusion_aw" = "yes" ; then
2113 output_sym "CONFIG_FUSION_AW"
2115 if test "$libnuma_v2" = "yes" ; then
2116 output_sym "CONFIG_LIBNUMA"
2118 if test "$solaris_aio" = "yes" ; then
2119 output_sym "CONFIG_SOLARISAIO"
2121 if test "$tls_thread" = "yes" ; then
2122 output_sym "CONFIG_TLS_THREAD"
2124 if test "$rusage_thread" = "yes" ; then
2125 output_sym "CONFIG_RUSAGE_THREAD"
2127 if test "$gfio" = "yes" ; then
2128 echo "CONFIG_GFIO=y" >> $config_host_mak
2130 if test "$esx" = "yes" ; then
2131 output_sym "CONFIG_ESX"
2132 output_sym "CONFIG_NO_SHM"
2134 if test "$sched_idle" = "yes" ; then
2135 output_sym "CONFIG_SCHED_IDLE"
2137 if test "$tcp_nodelay" = "yes" ; then
2138 output_sym "CONFIG_TCP_NODELAY"
2140 if test "$window_size" = "yes" ; then
2141 output_sym "CONFIG_NET_WINDOWSIZE"
2143 if test "$mss" = "yes" ; then
2144 output_sym "CONFIG_NET_MSS"
2146 if test "$rlimit_memlock" = "yes" ; then
2147 output_sym "CONFIG_RLIMIT_MEMLOCK"
2149 if test "$pwritev" = "yes" ; then
2150 output_sym "CONFIG_PWRITEV"
2152 if test "$pwritev2" = "yes" ; then
2153 output_sym "CONFIG_PWRITEV2"
2155 if test "$ipv6" = "yes" ; then
2156 output_sym "CONFIG_IPV6"
2158 if test "$rbd" = "yes" ; then
2159 output_sym "CONFIG_RBD"
2161 if test "$rbd_poll" = "yes" ; then
2162 output_sym "CONFIG_RBD_POLL"
2164 if test "$rbd_inval" = "yes" ; then
2165 output_sym "CONFIG_RBD_INVAL"
2167 if test "$rbd_blkin" = "yes" ; then
2168 output_sym "CONFIG_RBD_BLKIN"
2170 if test "$setvbuf" = "yes" ; then
2171 output_sym "CONFIG_SETVBUF"
2173 if test "$s390_z196_facilities" = "yes" ; then
2174 output_sym "CONFIG_S390_Z196_FACILITIES"
2175 CFLAGS="$CFLAGS -march=z9-109"
2177 if test "$gfapi" = "yes" ; then
2178 output_sym "CONFIG_GFAPI"
2180 if test "$gf_fadvise" = "yes" ; then
2181 output_sym "CONFIG_GF_FADVISE"
2183 if test "$gf_trim" = "yes" ; then
2184 output_sym "CONFIG_GF_TRIM"
2186 if test "$libhdfs" = "yes" ; then
2187 output_sym "CONFIG_LIBHDFS"
2188 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2189 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2190 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2191 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2193 if test "$mtd" = "yes" ; then
2194 output_sym "CONFIG_MTD"
2196 if test "$pmemblk" = "yes" ; then
2197 output_sym "CONFIG_PMEMBLK"
2199 if test "$devdax" = "yes" ; then
2200 output_sym "CONFIG_LINUX_DEVDAX"
2202 if test "$arith" = "yes" ; then
2203 output_sym "CONFIG_ARITHMETIC"
2204 if test "$yacc_is_bison" = "yes" ; then
2205 echo "YACC=$YACC -y" >> $config_host_mak
2207 echo "YACC=$YACC" >> $config_host_mak
2209 if test "$lex_use_o" = "yes" ; then
2210 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2213 if test "$getmntent" = "yes" ; then
2214 output_sym "CONFIG_GETMNTENT"
2216 if test "$getmntinfo" = "yes" ; then
2217 output_sym "CONFIG_GETMNTINFO"
2219 if test "$getmntinfo_statvfs" = "yes" ; then
2220 output_sym "CONFIG_GETMNTINFO_STATVFS"
2222 if test "$static_assert" = "yes" ; then
2223 output_sym "CONFIG_STATIC_ASSERT"
2225 if test "$have_bool" = "yes" ; then
2226 output_sym "CONFIG_HAVE_BOOL"
2228 if test "$disable_opt" = "yes" ; then
2229 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2231 if test "$zlib" = "no" ; then
2232 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2234 if test "$cuda" = "yes" ; then
2235 output_sym "CONFIG_CUDA"
2238 echo "LIBS+=$LIBS" >> $config_host_mak
2239 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2240 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2241 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2242 echo "CC=$cc" >> $config_host_mak
2243 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2244 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2246 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2247 cat > Makefile <<EOF
2248 SRCDIR:=`dirname $0`
2249 include \$(SRCDIR)/Makefile