3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h $CFLAGS"
48 CONFIGURE_CFLAGS="-Werror-implicit-function-declaration"
51 # Print a helpful header at the top of config.log
52 echo "# FIO configure log $(date)" >> config.log
53 printf "# Configured with:" >> config.log
54 printf " '%s'" "$0" "$@" >> config.log
56 echo "#" >> config.log
58 # Print configure header at the top of $config_host_h
59 echo "/*" > $config_host_h
60 echo " * Automatically generated by configure - do not modify" >> $config_host_h
61 printf " * Configured with:" >> $config_host_h
62 printf " * '%s'" "$0" "$@" >> $config_host_h
63 echo "" >> $config_host_h
64 echo " */" >> $config_host_h
67 # Run the compiler, capturing its output to the log.
68 echo $cc "$@" >> config.log
69 $cc "$@" >> config.log 2>&1 || return $?
70 # Test passed. If this is an --enable-werror build, rerun
71 # the test with -Werror and bail out if it fails. This
72 # makes warning-generating-errors in configure test code
73 # obvious to developers.
74 if test "$werror" != "yes"; then
77 # Don't bother rerunning the compile if we were already using -Werror
83 echo $cc -Werror "$@" >> config.log
84 $cc -Werror "$@" >> config.log 2>&1 && return $?
85 echo "ERROR: configure test passed without -Werror but failed with -Werror."
86 echo "This is probably a bug in the configure script. The failing command"
87 echo "will be at the bottom of config.log."
88 fatal "You can run configure with --disable-werror to bypass this check."
92 do_cc $CFLAGS $CONFIGURE_CFLAGS -c -o $TMPO $TMPC
97 local_ldflags="$2 $LIBS"
98 echo "Compiling test case $3" >> config.log
99 do_cc $CFLAGS $CONFIGURE_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
102 feature_not_found() {
107 echo "ERROR: User requested feature $feature"
108 if test ! -z "$packages" ; then
109 echo "ERROR: That feature needs $packages installed"
111 echo "ERROR: configure was not able to find it"
116 type "$1" >/dev/null 2>&1
122 #error $1 not defined
133 echo "$1=y" >> $config_host_mak
134 echo "#define $1" >> $config_host_h
137 check_min_lib_version() {
140 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
143 : "${_feature:=${1}}"
144 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
145 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
146 feature_not_found "$_feature" "$1 >= $2"
149 print_config "$1" "missing pkg-config, can't check $_feature version"
181 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
183 --prefix=*) prefix="$optarg"
185 --cpu=*) cpu="$optarg"
187 # esx is cross compiled and cannot be detect through simple uname calls
193 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
195 --build-32bit-win) build_32bit_win="yes"
197 --target-win-ver=*) target_win_ver="$optarg"
199 --enable-pdb) pdb="yes"
201 --build-static) build_static="yes"
203 --enable-gfio) gfio_check="yes"
205 --disable-numa) disable_numa="yes"
207 --disable-rdma) disable_rdma="yes"
209 --disable-rados) disable_rados="yes"
211 --disable-rbd) disable_rbd="yes"
213 --disable-http) disable_http="yes"
215 --disable-gfapi) disable_gfapi="yes"
217 --enable-libhdfs) libhdfs="yes"
219 --disable-lex) disable_lex="yes"
221 --enable-lex) disable_lex="no"
223 --disable-shm) no_shm="yes"
225 --disable-optimizations) disable_opt="yes"
227 --disable-pmem) disable_pmem="yes"
229 --enable-cuda) cuda="yes"
231 --enable-libcufile) libcufile="yes"
233 --disable-native) disable_native="yes"
235 --with-ime=*) ime_path="$optarg"
237 --enable-libiscsi) libiscsi="yes"
239 --enable-libnbd) libnbd="yes"
241 --disable-libzbc) libzbc="no"
243 --disable-tcmalloc) disable_tcmalloc="yes"
245 --disable-nfs) disable_nfs="yes"
247 --dynamic-libengines) dynamic_engines="yes"
249 --disable-dfs) dfs="no"
251 --enable-asan) asan="yes"
257 echo "Bad option $opt"
263 if test "$show_help" = "yes" ; then
264 echo "--prefix= Use this directory as installation prefix"
265 echo "--cpu= Specify target CPU if auto-detect fails"
266 echo "--cc= Specify compiler to use"
267 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
268 echo "--build-32bit-win Enable 32-bit build on Windows"
269 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
270 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
271 echo "--build-static Build a static fio"
272 echo "--esx Configure build options for esx"
273 echo "--enable-gfio Enable building of gtk gfio"
274 echo "--disable-numa Disable libnuma even if found"
275 echo "--disable-rdma Disable RDMA support even if found"
276 echo "--disable-rados Disable Rados support even if found"
277 echo "--disable-rbd Disable Rados Block Device even if found"
278 echo "--disable-http Disable HTTP support even if found"
279 echo "--disable-nfs Disable userspace NFS support even if found"
280 echo "--disable-gfapi Disable gfapi"
281 echo "--enable-libhdfs Enable hdfs support"
282 echo "--enable-libnfs Enable nfs support"
283 echo "--disable-lex Disable use of lex/yacc for math"
284 echo "--disable-pmem Disable pmem based engines even if found"
285 echo "--enable-lex Enable use of lex/yacc for math"
286 echo "--disable-shm Disable SHM support"
287 echo "--disable-optimizations Don't enable compiler optimizations"
288 echo "--enable-cuda Enable GPUDirect RDMA support"
289 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
290 echo "--disable-native Don't build for native host"
291 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
292 echo "--enable-libiscsi Enable iscsi support"
293 echo "--enable-libnbd Enable libnbd (NBD engine) support"
294 echo "--disable-libzbc Disable libzbc even if found"
295 echo "--disable-tcmalloc Disable tcmalloc support"
296 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
297 echo "--disable-dfs Disable DAOS File System support even if found"
298 echo "--enable-asan Enable address sanitizer"
302 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
303 # Preferred compiler (can be overriden later after we know the platform):
305 # ${cross_prefix}gcc (if cross-prefix specified)
308 if test -z "${CC}${cross_prefix}"; then
315 cc="${CC-${cross_prefix}gcc}"
318 if check_define __ANDROID__ ; then
320 elif check_define __linux__ ; then
322 elif check_define __OpenBSD__ ; then
324 elif check_define __NetBSD__ ; then
326 elif check_define __sun__ ; then
328 CFLAGS="$CFLAGS -D_REENTRANT"
329 elif check_define _WIN32 ; then
335 echo "# Automatically generated by configure - do not modify" > $config_host_mak
336 printf "# Configured with:" >> $config_host_mak
337 printf " '%s'" "$0" "$@" >> $config_host_mak
338 echo >> $config_host_mak
339 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
341 if test "$no_shm" = "yes" ; then
342 output_sym "CONFIG_NO_SHM"
345 if test "$disable_opt" = "yes" ; then
346 output_sym "CONFIG_FIO_NO_OPT"
349 # Some host OSes need non-standard checks for which CPU to use.
350 # Note that these checks are broken for cross-compilation: if you're
351 # cross-compiling to one of these OSes then you'll need to specify
352 # the correct CPU with the --cpu option.
355 # Unless explicitly enabled, turn off lex.
356 # OpenBSD will hit syntax error when enabled.
357 if test -z "$disable_lex" ; then
364 CFLAGS="$CFLAGS -I/usr/local/include"
365 LDFLAGS="$LDFLAGS -L/usr/local/lib"
368 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
369 # we can run 64-bit userspace code.
370 # If the user didn't specify a CPU explicitly and the kernel says this is
371 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
373 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
376 # Avoid configure feature detection of features provided by weak symbols
383 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
384 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
388 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
389 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
392 LIBS="-lnsl -lsocket"
395 # We still force some options, so keep this message here.
396 echo "Forcing some known good options on Windows"
397 if test -z "${CC}${cross_prefix}"; then
398 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
399 cc="i686-w64-mingw32-gcc"
401 cc="x86_64-w64-mingw32-gcc"
405 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
406 if test -z "$target_win_ver"; then
407 # Default Windows API target
410 if test "$target_win_ver" = "7"; then
411 output_sym "CONFIG_WINDOWS_7"
412 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
414 fatal "Unknown target Windows version"
417 # We need this to be output_sym'd here because this is Windows specific.
418 # The regular configure path never sets this config.
419 output_sym "CONFIG_WINDOWSAIO"
420 # We now take the regular configuration path without having exit 0 here.
421 # Flags below are still necessary mostly for MinGW.
425 clock_gettime="yes" # clock_monotonic probe has dependency on this
426 clock_monotonic="yes"
428 pthread_condattr_setclock="no"
429 pthread_affinity="no"
433 # Now we know the target platform we can have another guess at the preferred
434 # compiler when it wasn't explictly set
435 if test -z "${CC}${cross_prefix}"; then
436 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
442 if test -z "$cc"; then
443 echo "configure: failed to find compiler"
447 if test ! -z "$cpu" ; then
448 # command line argument
450 elif check_define __i386__ ; then
452 elif check_define __x86_64__ ; then
454 elif check_define __sparc__ ; then
455 if check_define __arch64__ ; then
460 elif check_define _ARCH_PPC ; then
461 if check_define _ARCH_PPC64 ; then
466 elif check_define __mips__ ; then
468 elif check_define __ia64__ ; then
470 elif check_define __s390__ ; then
471 if check_define __s390x__ ; then
476 elif check_define __arm__ ; then
478 elif check_define __aarch64__ ; then
480 elif check_define __hppa__ ; then
486 # Normalise host CPU name and set ARCH.
488 ia64|ppc|ppc64|s390|s390x|sparc64)
491 i386|i486|i586|i686|i86pc|BePC)
503 hppa|parisc|parisc64)
517 ##########################################
518 # check cross compile
520 if test "$cross_compile" != "yes" ; then
529 if compile_prog "" "" "cross"; then
530 $TMPE 2>/dev/null || cross_compile="yes"
532 fatal "compile test failed"
535 ##########################################
537 if test "$bigendian" != "yes" ; then
540 if test "$cross_compile" = "no" ; then
542 #include <inttypes.h>
545 volatile uint32_t i=0x01234567;
546 return (*((uint8_t*)(&i))) == 0x67;
549 if compile_prog "" "" "endian"; then
550 $TMPE && bigendian="yes"
553 # If we're cross compiling, try our best to work it out and rely on the
554 # run-time check to fail if we get it wrong.
559 #if __BYTE_ORDER != __BIG_ENDIAN
560 # error "Unknown endianness"
564 compile_prog "" "" "endian" && bigendian="yes"
565 check_define "__ARMEB__" && bigendian="yes"
566 check_define "__MIPSEB__" && bigendian="yes"
570 print_config "Operating system" "$targetos"
571 print_config "CPU" "$cpu"
572 print_config "Big endian" "$bigendian"
573 if test ! -z "$target_win_ver"; then
574 print_config "Target Windows version" "$target_win_ver"
576 print_config "Compiler" "$cc"
577 print_config "Cross compile" "$cross_compile"
580 ##########################################
581 # See if we need to build a static build
582 if test "$build_static" = "yes" ; then
583 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
584 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
588 print_config "Static build" "$build_static"
590 ##########################################
591 # check for C11 atomics support
593 #include <stdatomic.h>
601 if ! compile_prog "" "" "C11 atomics"; then
603 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
604 echo "minimum versions with it - perhaps your compiler is too old?"
605 fatal "C11 atomics support not found"
609 ##########################################
614 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
617 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
621 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
623 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
626 fatal "Unknown wordsize"
628 print_config "Wordsize" "$wordsize"
630 ##########################################
632 if test "$zlib" != "yes" ; then
640 if (inflateInit(&stream) != Z_OK)
645 if compile_prog "" "-lz" "zlib" ; then
649 print_config "zlib" "$zlib"
651 ##########################################
652 # fcntl(F_FULLFSYNC) support
653 if test "$fcntl_sync" != "yes" ; then
660 int main(int argc, char **argv)
662 return fcntl(0, F_FULLFSYNC);
665 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
668 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
670 ##########################################
672 if test "$libaio" != "yes" ; then
675 if test "$esx" != "yes" ; then
685 if compile_prog "" "-laio" "libaio" ; then
688 if test "$libaio" = "yes" ; then
689 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
699 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
700 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
704 if compile_prog "" "" "libaio rw flags" ; then
710 print_config "Linux AIO support" "$libaio"
711 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
713 ##########################################
715 if test "$posix_aio" != "yes" ; then
718 if test "$posix_aio_lrt" != "yes" ; then
730 if compile_prog "" "" "posixaio" ; then
732 elif compile_prog "" "-lrt" "posixaio -lrt"; then
737 print_config "POSIX AIO support" "$posix_aio"
738 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
740 ##########################################
741 # posix aio fsync probe
742 if test "$posix_aio_fsync" != "yes" ; then
745 if test "$posix_aio" = "yes" ; then
752 return aio_fsync(O_SYNC, &cb);
756 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
760 print_config "POSIX AIO fsync" "$posix_aio_fsync"
762 ##########################################
763 # POSIX pshared attribute probe
764 if test "$posix_pshared" != "yes" ; then
771 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
772 # if defined(__CYGWIN__)
773 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
774 # elif defined(__APPLE__)
775 # include <AvailabilityMacros.h>
776 # include <TargetConditionals.h>
777 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
778 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
782 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
787 if compile_prog "" "$LIBS" "posix_pshared" ; then
790 print_config "POSIX pshared support" "$posix_pshared"
792 ##########################################
793 # POSIX pthread_condattr_setclock() probe
794 if test "$pthread_condattr_setclock" != "no" ; then
799 pthread_condattr_t condattr;
800 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
804 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
805 pthread_condattr_setclock=yes
806 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
807 pthread_condattr_setclock=yes
808 LIBS="$LIBS -lpthread"
811 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
813 ##########################################
814 # pthread_sigmask() probe
815 if test "$pthread_sigmask" != "yes" ; then
819 #include <stddef.h> /* NULL */
820 #include <signal.h> /* pthread_sigmask() */
823 return pthread_sigmask(0, NULL, NULL);
826 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
828 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
830 LIBS="$LIBS -lpthread"
832 print_config "pthread_sigmask()" "$pthread_sigmask"
834 ##########################################
835 # pthread_getaffinity_np() probe
836 if test "$pthread_getaffinity" != "yes" ; then
837 pthread_getaffinity="no"
840 #include <stddef.h> /* NULL */
841 #include <signal.h> /* pthread_sigmask() */
846 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
849 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
850 pthread_getaffinity="yes"
851 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
852 pthread_getaffinity="yes"
853 LIBS="$LIBS -lpthread"
855 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
857 ##########################################
859 if test "$solaris_aio" != "yes" ; then
863 #include <sys/types.h>
864 #include <sys/asynch.h>
869 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
873 if compile_prog "" "-laio" "solarisaio" ; then
877 print_config "Solaris AIO support" "$solaris_aio"
879 ##########################################
880 # __sync_fetch_and_add test
881 if test "$sfaa" != "yes" ; then
885 #include <inttypes.h>
886 static int sfaa(uint64_t *ptr)
888 return __sync_fetch_and_add(ptr, 0);
891 int main(int argc, char **argv)
898 if compile_prog "" "" "__sync_fetch_and_add()" ; then
901 print_config "__sync_fetch_and_add" "$sfaa"
903 ##########################################
904 # __sync_synchronize() test
905 if test "$sync_sync" != "yes" ; then
909 #include <inttypes.h>
911 int main(int argc, char **argv)
913 __sync_synchronize();
917 if compile_prog "" "" "__sync_synchronize()" ; then
920 print_config "__sync_synchronize" "$sync_sync"
922 ##########################################
923 # __sync_val_compare_and_swap() test
924 if test "$cmp_swap" != "yes" ; then
928 #include <inttypes.h>
930 int main(int argc, char **argv)
933 return __sync_val_compare_and_swap(&x, 1, 2);
936 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
939 print_config "__sync_val_compare_and_swap" "$cmp_swap"
941 ##########################################
943 if test "$libverbs" != "yes" ; then
947 #include <infiniband/verbs.h>
948 int main(int argc, char **argv)
950 struct ibv_pd *pd = ibv_alloc_pd(NULL);
954 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
957 print_config "libverbs" "$libverbs"
959 ##########################################
961 if test "$rdmacm" != "yes" ; then
966 #include <rdma/rdma_cma.h>
967 int main(int argc, char **argv)
969 rdma_destroy_qp(NULL);
973 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
976 print_config "rdmacm" "$rdmacm"
978 ##########################################
980 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
981 if test "$librpma" != "yes" ; then
988 void *ptr = rpma_cq_get_wc;
989 (void) ptr; /* unused */
993 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
996 print_config "librpma" "$librpma"
998 ##########################################
999 # libprotobuf-c probe
1000 if test "$libprotobuf_c" != "yes" ; then
1005 #include <protobuf-c/protobuf-c.h>
1006 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1007 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1009 int main(int argc, char **argv)
1011 (void)protobuf_c_message_check(NULL);
1015 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1018 print_config "libprotobuf_c" "$libprotobuf_c"
1020 ##########################################
1021 # asprintf() and vasprintf() probes
1022 if test "$have_asprintf" != "yes" ; then
1028 int main(int argc, char **argv)
1031 return asprintf(&buf, "%s", "str") == 0;
1034 if compile_prog "" "" "have_asprintf"; then
1037 print_config "asprintf()" "$have_asprintf"
1039 if test "$have_vasprintf" != "yes" ; then
1045 int main(int argc, char **argv)
1049 return vasprintf(&buf, "%s", ap) == 0;
1052 if compile_prog "" "" "have_vasprintf"; then
1053 have_vasprintf="yes"
1055 print_config "vasprintf()" "$have_vasprintf"
1057 ##########################################
1058 # Linux fallocate probe
1059 if test "$linux_fallocate" != "yes" ; then
1060 linux_fallocate="no"
1065 #include <linux/falloc.h>
1066 int main(int argc, char **argv)
1068 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1072 if compile_prog "" "" "linux_fallocate"; then
1073 linux_fallocate="yes"
1075 print_config "Linux fallocate" "$linux_fallocate"
1077 ##########################################
1078 # POSIX fadvise probe
1079 if test "$posix_fadvise" != "yes" ; then
1085 int main(int argc, char **argv)
1087 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1091 if compile_prog "" "" "posix_fadvise"; then
1094 print_config "POSIX fadvise" "$posix_fadvise"
1096 ##########################################
1097 # POSIX fallocate probe
1098 if test "$posix_fallocate" != "yes" ; then
1099 posix_fallocate="no"
1104 int main(int argc, char **argv)
1106 int r = posix_fallocate(0, 0, 1024);
1110 if compile_prog "" "" "posix_fallocate"; then
1111 posix_fallocate="yes"
1113 print_config "POSIX fallocate" "$posix_fallocate"
1115 ##########################################
1116 # sched_set/getaffinity 2 or 3 argument test
1117 if test "$linux_2arg_affinity" != "yes" ; then
1118 linux_2arg_affinity="no"
1120 if test "$linux_3arg_affinity" != "yes" ; then
1121 linux_3arg_affinity="no"
1125 int main(int argc, char **argv)
1128 return sched_setaffinity(0, sizeof(mask), &mask);
1131 if compile_prog "" "" "sched_setaffinity(,,)"; then
1132 linux_3arg_affinity="yes"
1136 int main(int argc, char **argv)
1139 return sched_setaffinity(0, &mask);
1142 if compile_prog "" "" "sched_setaffinity(,)"; then
1143 linux_2arg_affinity="yes"
1146 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1147 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1149 ##########################################
1150 # clock_gettime probe
1151 if test "$clock_gettime" != "yes" ; then
1157 int main(int argc, char **argv)
1159 return clock_gettime(0, NULL);
1162 if compile_prog "" "" "clock_gettime"; then
1164 elif compile_prog "" "-lrt" "clock_gettime"; then
1168 print_config "clock_gettime" "$clock_gettime"
1170 ##########################################
1171 # CLOCK_MONOTONIC probe
1172 if test "$clock_monotonic" != "yes" ; then
1173 clock_monotonic="no"
1175 if test "$clock_gettime" = "yes" ; then
1179 int main(int argc, char **argv)
1181 return clock_gettime(CLOCK_MONOTONIC, NULL);
1184 if compile_prog "" "$LIBS" "clock monotonic"; then
1185 clock_monotonic="yes"
1188 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1190 ##########################################
1192 if test "$clockid_t" != "yes" ; then
1198 int main(int argc, char **argv)
1200 volatile clockid_t cid;
1201 memset((void*)&cid, 0, sizeof(cid));
1205 if compile_prog "" "$LIBS" "clockid_t"; then
1208 print_config "clockid_t" "$clockid_t"
1210 ##########################################
1211 # gettimeofday() probe
1212 if test "$gettimeofday" != "yes" ; then
1216 #include <sys/time.h>
1218 int main(int argc, char **argv)
1221 return gettimeofday(&tv, NULL);
1224 if compile_prog "" "" "gettimeofday"; then
1227 print_config "gettimeofday" "$gettimeofday"
1229 ##########################################
1231 if test "$fdatasync" != "yes" ; then
1237 int main(int argc, char **argv)
1239 return fdatasync(0);
1242 if compile_prog "" "" "fdatasync"; then
1245 print_config "fdatasync" "$fdatasync"
1247 ##########################################
1249 if test "$pipe" != "yes" ; then
1254 int main(int argc, char **argv)
1260 if compile_prog "" "" "pipe"; then
1263 print_config "pipe()" "$pipe"
1265 ##########################################
1267 if test "$pipe2" != "yes" ; then
1272 int main(int argc, char **argv)
1275 return pipe2(fd, 0);
1278 if compile_prog "" "" "pipe2"; then
1281 print_config "pipe2()" "$pipe2"
1283 ##########################################
1285 if test "$pread" != "yes" ; then
1290 int main(int argc, char **argv)
1292 return pread(0, NULL, 0, 0);
1295 if compile_prog "" "" "pread"; then
1298 print_config "pread()" "$pread"
1300 ##########################################
1301 # sync_file_range() probe
1302 if test "$sync_file_range" != "yes" ; then
1303 sync_file_range="no"
1309 #include <linux/fs.h>
1310 int main(int argc, char **argv)
1312 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1313 SYNC_FILE_RANGE_WAIT_AFTER;
1314 return sync_file_range(0, 0, 0, flags);
1317 if compile_prog "" "" "sync_file_range"; then
1318 sync_file_range="yes"
1320 print_config "sync_file_range" "$sync_file_range"
1322 ##########################################
1323 # ext4 move extent probe
1324 if test "$ext4_me" != "yes" ; then
1329 #include <sys/ioctl.h>
1330 int main(int argc, char **argv)
1332 struct move_extent me;
1333 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1336 if compile_prog "" "" "ext4 move extent" ; then
1338 elif test $targetos = "Linux" ; then
1339 # On Linux, just default to it on and let it error at runtime if we really
1340 # don't have it. None of my updated systems have it defined, but it does
1341 # work. Takes a while to bubble back.
1344 print_config "EXT4 move extent" "$ext4_me"
1346 ##########################################
1348 if test "$linux_splice" != "yes" ; then
1354 int main(int argc, char **argv)
1356 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1359 if compile_prog "" "" "linux splice"; then
1362 print_config "Linux splice(2)" "$linux_splice"
1364 ##########################################
1366 if test "$libnuma" != "yes" ; then
1371 int main(int argc, char **argv)
1373 return numa_available();
1376 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1380 print_config "libnuma" "$libnuma"
1382 ##########################################
1383 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1384 if test "$libnuma" = "yes" ; then
1388 int main(int argc, char **argv)
1390 struct bitmask *mask = numa_parse_nodestring(NULL);
1391 return mask->size == 0;
1394 if compile_prog "" "" "libnuma api"; then
1397 print_config "libnuma v2" "$libnuma_v2"
1400 ##########################################
1402 if test "$strsep" != "yes" ; then
1407 int main(int argc, char **argv)
1409 static char *string = "This is a string";
1410 strsep(&string, "needle");
1414 if compile_prog "" "" "strsep"; then
1417 print_config "strsep" "$strsep"
1419 ##########################################
1420 # strcasestr() probe
1421 if test "$strcasestr" != "yes" ; then
1426 int main(int argc, char **argv)
1428 return strcasestr(argv[0], argv[1]) != NULL;
1431 if compile_prog "" "" "strcasestr"; then
1434 print_config "strcasestr" "$strcasestr"
1436 ##########################################
1438 if test "$strlcat" != "yes" ; then
1443 int main(int argc, char **argv)
1445 static char dst[64];
1446 static char *string = "This is a string";
1447 memset(dst, 0, sizeof(dst));
1448 strlcat(dst, string, sizeof(dst));
1452 if compile_prog "" "" "strlcat"; then
1455 print_config "strlcat" "$strlcat"
1457 ##########################################
1458 # getopt_long_only() probe
1459 if test "$getopt_long_only" != "yes" ; then
1460 getopt_long_only="no"
1466 int main(int argc, char **argv)
1468 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1472 if compile_prog "" "" "getopt_long_only"; then
1473 getopt_long_only="yes"
1475 print_config "getopt_long_only()" "$getopt_long_only"
1477 ##########################################
1479 if test "$inet_aton" != "yes" ; then
1484 #include <winsock2.h>
1486 #include <sys/socket.h>
1487 #include <arpa/inet.h>
1490 int main(int argc, char **argv)
1493 return inet_aton(NULL, &in);
1496 if compile_prog "" "" "inet_aton"; then
1499 print_config "inet_aton" "$inet_aton"
1501 ##########################################
1503 if test "$socklen_t" != "yes" ; then
1508 #include <winsock2.h>
1509 #include <ws2tcpip.h>
1511 #include <sys/socket.h>
1513 int main(int argc, char **argv)
1519 if compile_prog "" "" "socklen_t"; then
1522 print_config "socklen_t" "$socklen_t"
1524 ##########################################
1525 # Whether or not __thread is supported for TLS
1526 if test "$tls_thread" != "yes" ; then
1531 static __thread int ret;
1532 int main(int argc, char **argv)
1537 if compile_prog "" "" "__thread"; then
1540 print_config "__thread" "$tls_thread"
1542 ##########################################
1543 # Check if we have required gtk/glib support for gfio
1544 if test "$gfio" != "yes" ; then
1547 if test "$gfio_check" = "yes" ; then
1551 #include <gtk/gtk.h>
1554 gdk_threads_enter();
1555 gdk_threads_leave();
1557 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1560 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1561 ORG_LDFLAGS=$LDFLAGS
1562 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1563 if test "$?" != "0" ; then
1564 echo "configure: gtk and gthread not found"
1567 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1568 if test "$?" != "0" ; then
1569 echo "configure: gtk and gthread not found"
1573 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1574 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1575 GFIO_LIBS="$LIBS $GTK_LIBS"
1576 CFLAGS="$CFLAGS $GTK_CFLAGS"
1578 echo "Please install gtk and gdk libraries"
1584 LDFLAGS=$ORG_LDFLAGS
1587 if test "$gfio_check" = "yes" ; then
1588 print_config "gtk 2.18 or higher" "$gfio"
1591 ##########################################
1592 # Check whether we have getrusage(RUSAGE_THREAD)
1593 if test "$rusage_thread" != "yes" ; then
1597 #include <sys/time.h>
1598 #include <sys/resource.h>
1599 int main(int argc, char **argv)
1602 getrusage(RUSAGE_THREAD, &ru);
1606 if compile_prog "" "" "RUSAGE_THREAD"; then
1609 print_config "RUSAGE_THREAD" "$rusage_thread"
1611 ##########################################
1612 # Check whether we have SCHED_IDLE
1613 if test "$sched_idle" != "yes" ; then
1618 int main(int argc, char **argv)
1620 struct sched_param p;
1621 return sched_setscheduler(0, SCHED_IDLE, &p);
1624 if compile_prog "" "" "SCHED_IDLE"; then
1627 print_config "SCHED_IDLE" "$sched_idle"
1629 ##########################################
1630 # Check whether we have TCP_NODELAY
1631 if test "$tcp_nodelay" != "yes" ; then
1636 #include <winsock2.h>
1639 #include <sys/types.h>
1640 #include <sys/socket.h>
1641 #include <netinet/tcp.h>
1643 int main(int argc, char **argv)
1645 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1648 if compile_prog "" "" "TCP_NODELAY"; then
1650 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1652 LIBS="$LIBS -lws2_32"
1654 print_config "TCP_NODELAY" "$tcp_nodelay"
1656 ##########################################
1657 # Check whether we have SO_SNDBUF
1658 if test "$window_size" != "yes" ; then
1663 #include <winsock2.h>
1666 #include <sys/types.h>
1667 #include <sys/socket.h>
1668 #include <netinet/tcp.h>
1670 int main(int argc, char **argv)
1672 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1673 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1676 if compile_prog "" "" "SO_SNDBUF"; then
1678 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1680 LIBS="$LIBS -lws2_32"
1682 print_config "Net engine window_size" "$window_size"
1684 ##########################################
1685 # Check whether we have TCP_MAXSEG
1686 if test "$mss" != "yes" ; then
1691 #include <winsock2.h>
1694 #include <sys/types.h>
1695 #include <sys/socket.h>
1696 #include <netinet/tcp.h>
1697 #include <arpa/inet.h>
1698 #include <netinet/in.h>
1700 int main(int argc, char **argv)
1702 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1705 if compile_prog "" "" "TCP_MAXSEG"; then
1707 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1709 LIBS="$LIBS -lws2_32"
1711 print_config "TCP_MAXSEG" "$mss"
1713 ##########################################
1714 # Check whether we have RLIMIT_MEMLOCK
1715 if test "$rlimit_memlock" != "yes" ; then
1719 #include <sys/time.h>
1720 #include <sys/resource.h>
1721 int main(int argc, char **argv)
1724 return getrlimit(RLIMIT_MEMLOCK, &rl);
1727 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1728 rlimit_memlock="yes"
1730 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1732 ##########################################
1733 # Check whether we have pwritev/preadv
1734 if test "$pwritev" != "yes" ; then
1739 #include <sys/uio.h>
1740 int main(int argc, char **argv)
1742 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1745 if compile_prog "" "" "pwritev"; then
1748 print_config "pwritev/preadv" "$pwritev"
1750 ##########################################
1751 # Check whether we have pwritev2/preadv2
1752 if test "$pwritev2" != "yes" ; then
1757 #include <sys/uio.h>
1758 int main(int argc, char **argv)
1760 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1763 if compile_prog "" "" "pwritev2"; then
1766 print_config "pwritev2/preadv2" "$pwritev2"
1768 ##########################################
1769 # Check whether we have the required functions for ipv6
1770 if test "$ipv6" != "yes" ; then
1775 #include <winsock2.h>
1776 #include <ws2tcpip.h>
1778 #include <sys/types.h>
1779 #include <sys/socket.h>
1780 #include <netinet/in.h>
1784 int main(int argc, char **argv)
1786 struct addrinfo hints;
1787 struct in6_addr addr;
1790 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1792 printf("%s\n", gai_strerror(ret));
1797 if compile_prog "" "" "ipv6"; then
1800 print_config "IPv6 helpers" "$ipv6"
1802 ##########################################
1804 if test "$http" != "yes" ; then
1807 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1809 #include <curl/curl.h>
1810 #include <openssl/hmac.h>
1812 int main(int argc, char **argv)
1817 curl = curl_easy_init();
1818 curl_easy_cleanup(curl);
1820 ctx = HMAC_CTX_new();
1821 HMAC_CTX_reset(ctx);
1826 # openssl < 1.1.0 uses the HMAC_CTX type directly
1828 #include <curl/curl.h>
1829 #include <openssl/hmac.h>
1831 int main(int argc, char **argv)
1836 curl = curl_easy_init();
1837 curl_easy_cleanup(curl);
1839 HMAC_CTX_init(&ctx);
1840 HMAC_CTX_cleanup(&ctx);
1844 if test "$disable_http" != "yes"; then
1845 HTTP_LIBS="-lcurl -lssl -lcrypto"
1846 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1847 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1849 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1853 print_config "http engine" "$http"
1855 ##########################################
1857 if test "$rados" != "yes" ; then
1861 #include <rados/librados.h>
1863 int main(int argc, char **argv)
1866 rados_ioctx_t io_ctx;
1867 const char cluster_name[] = "ceph";
1868 const char user_name[] = "client.admin";
1869 const char pool[] = "rados";
1871 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1872 rados_create2(&cluster, cluster_name, user_name, 0);
1873 rados_ioctx_create(cluster, pool, &io_ctx);
1878 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1881 print_config "Rados engine" "$rados"
1883 ##########################################
1885 if test "$rbd" != "yes" ; then
1889 #include <rbd/librbd.h>
1891 int main(int argc, char **argv)
1894 rados_ioctx_t io_ctx;
1895 const char cluster_name[] = "ceph";
1896 const char user_name[] = "client.admin";
1897 const char pool[] = "rbd";
1898 int major, minor, extra;
1900 rbd_version(&major, &minor, &extra);
1901 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1902 rados_create2(&cluster, cluster_name, user_name, 0);
1903 rados_ioctx_create(cluster, pool, &io_ctx);
1908 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1911 print_config "Rados Block Device engine" "$rbd"
1913 ##########################################
1914 # check for rbd_poll
1915 if test "$rbd_poll" != "yes" ; then
1918 if test "$rbd" = "yes"; then
1920 #include <rbd/librbd.h>
1921 #include <sys/eventfd.h>
1923 int main(int argc, char **argv)
1926 rbd_completion_t comp;
1928 int fd = eventfd(0, EFD_NONBLOCK);
1929 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1930 rbd_poll_io_events(image, comp, 1);
1935 if compile_prog "" "-lrbd -lrados" "rbd"; then
1938 print_config "rbd_poll" "$rbd_poll"
1941 ##########################################
1942 # check for rbd_invalidate_cache()
1943 if test "$rbd_inval" != "yes" ; then
1946 if test "$rbd" = "yes"; then
1948 #include <rbd/librbd.h>
1950 int main(int argc, char **argv)
1954 return rbd_invalidate_cache(image);
1957 if compile_prog "" "-lrbd -lrados" "rbd"; then
1960 print_config "rbd_invalidate_cache" "$rbd_inval"
1963 ##########################################
1964 # Check whether we have setvbuf
1965 if test "$setvbuf" != "yes" ; then
1970 int main(int argc, char **argv)
1974 setvbuf(f, buf, _IOFBF, sizeof(buf));
1978 if compile_prog "" "" "setvbuf"; then
1981 print_config "setvbuf" "$setvbuf"
1983 ##########################################
1985 if test "$gfapi" != "yes" ; then
1989 #include <glusterfs/api/glfs.h>
1991 int main(int argc, char **argv)
1993 glfs_t *g = glfs_new("foo");
1998 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2001 print_config "Gluster API engine" "$gfapi"
2003 ##########################################
2004 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2005 if test "$gfapi" = "yes" ; then
2008 #include <glusterfs/api/glfs.h>
2010 int main(int argc, char **argv)
2013 int ret = glfs_fadvise(fd, 0, 0, 1);
2018 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2021 print_config "Gluster API use fadvise" "$gf_fadvise"
2024 ##########################################
2025 # check for newer gfapi
2026 if test "$gfapi" = "yes" ; then
2029 #include <glusterfs/api/glfs.h>
2031 int main(int argc, char **argv)
2033 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2036 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2039 print_config "Gluster new API" "$gf_new"
2042 ##########################################
2043 # check for gfapi trim support
2044 if test "$gf_trim" != "yes" ; then
2047 if test "$gfapi" = "yes" ; then
2049 #include <glusterfs/api/glfs.h>
2051 int main(int argc, char **argv)
2053 return glfs_discard_async(NULL, 0, 0);
2056 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2059 print_config "Gluster API trim support" "$gf_trim"
2062 ##########################################
2063 # Check if we support stckf on s390
2064 if test "$s390_z196_facilities" != "yes" ; then
2065 s390_z196_facilities="no"
2068 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2069 int main(int argc, char **argv)
2071 /* We want just 1 double word to be returned. */
2072 register unsigned long reg0 asm("0") = 0;
2073 unsigned long stfle_bits;
2074 asm volatile(".machine push" "\n\t"
2075 ".machine \"z9-109\"" "\n\t"
2078 : "=QS" (stfle_bits), "+d" (reg0)
2081 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2087 if compile_prog "" "" "s390_z196_facilities"; then
2089 if [ $? -eq 0 ]; then
2090 s390_z196_facilities="yes"
2093 print_config "s390_z196_facilities" "$s390_z196_facilities"
2095 ##########################################
2096 # Check if we have required environment variables configured for libhdfs
2097 if test "$libhdfs" = "yes" ; then
2099 if test "$JAVA_HOME" = "" ; then
2100 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2103 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2104 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2107 if test "$FIO_LIBHDFS_LIB" = "" ; then
2108 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2111 if test "$hdfs_conf_error" = "1" ; then
2112 feature_not_found "libhdfs" ""
2115 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2116 FIO_HDFS_CPU="amd64"
2119 print_config "HDFS engine" "$libhdfs"
2121 ##########################################
2122 # Check whether we have MTD
2123 if test "$mtd" != "yes" ; then
2128 #include <mtd/mtd-user.h>
2129 #include <sys/ioctl.h>
2130 int main(int argc, char **argv)
2132 struct mtd_write_req ops;
2133 struct mtd_info_user info;
2134 memset(&ops, 0, sizeof(ops));
2135 info.type = MTD_MLCNANDFLASH;
2136 return ioctl(0, MEMGETINFO, &info);
2139 if compile_prog "" "" "mtd"; then
2142 print_config "MTD" "$mtd"
2144 ##########################################
2145 # Check whether we have libpmem
2146 if test "$libpmem" != "yes" ; then
2150 #include <libpmem.h>
2152 int main(int argc, char **argv)
2155 rc = pmem_is_pmem(NULL, 0);
2159 if compile_prog "" "-lpmem" "libpmem"; then
2162 print_config "libpmem" "$libpmem"
2164 ##########################################
2165 # Check whether libpmem's version >= 1.5
2166 if test "$libpmem1_5" != "yes" ; then
2169 if test "$libpmem" = "yes"; then
2171 #include <libpmem.h>
2173 int main(int argc, char **argv)
2175 pmem_memcpy(NULL, NULL, NULL, NULL);
2179 if compile_prog "" "-lpmem" "libpmem1_5"; then
2183 print_config "libpmem1_5" "$libpmem1_5"
2185 ##########################################
2186 # Check whether we have libpmemblk
2187 # libpmem is a prerequisite
2188 if test "$libpmemblk" != "yes" ; then
2191 if test "$libpmem" = "yes"; then
2193 #include <libpmemblk.h>
2194 int main(int argc, char **argv)
2197 pbp = pmemblk_open("", 0);
2201 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2205 print_config "libpmemblk" "$libpmemblk"
2207 # Choose libpmem-based ioengines
2208 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2210 if test "$libpmem1_5" = "yes"; then
2213 if test "$libpmemblk" = "yes"; then
2218 ##########################################
2219 # Report whether pmemblk engine is enabled
2220 print_config "PMDK pmemblk engine" "$pmemblk"
2222 ##########################################
2223 # Report whether dev-dax engine is enabled
2224 print_config "PMDK dev-dax engine" "$devdax"
2226 ##########################################
2227 # Report whether libpmem engine is enabled
2228 print_config "PMDK libpmem engine" "$pmem"
2230 ##########################################
2231 # Check whether we support DDN's IME
2232 if test "$libime" != "yes" ; then
2236 #include <ime_native.h>
2237 int main(int argc, char **argv)
2241 rc = ime_native_finalize();
2245 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2247 CFLAGS="-I${ime_path}/include $CFLAGS"
2248 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2249 LIBS="-lim_client $LIBS"
2251 print_config "DDN's Infinite Memory Engine" "$libime"
2253 ##########################################
2254 # Check if we have libiscsi
2255 if test "$libiscsi" != "no" ; then
2256 if check_min_lib_version libiscsi 1.9.0; then
2258 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2259 libiscsi_libs=$(pkg-config --libs libiscsi)
2264 print_config "iscsi engine" "$libiscsi"
2266 ##########################################
2267 # Check if we have libnbd (for NBD support)
2268 if test "$libnbd" != "no" ; then
2269 if check_min_lib_version libnbd 0.9.8; then
2271 libnbd_cflags=$(pkg-config --cflags libnbd)
2272 libnbd_libs=$(pkg-config --libs libnbd)
2277 print_config "NBD engine" "$libnbd"
2279 ##########################################
2280 # check for dfs (DAOS File System)
2281 if test "$dfs" != "no" ; then
2285 #include <daos_fs.h>
2287 int main(int argc, char **argv)
2293 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2298 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2304 print_config "DAOS File System (dfs) Engine" "$dfs"
2306 ##########################################
2307 # Check if we have libnfs (for userspace nfs support).
2308 if test "$disable_nfs" != "yes"; then
2309 if $(pkg-config libnfs > /dev/null 2>&1); then
2311 libnfs_cflags=$(pkg-config --cflags libnfs)
2312 libnfs_libs=$(pkg-config --libs libnfs)
2314 if test "$libnfs" = "yes" ; then
2315 echo "libnfs" "Install libnfs"
2319 print_config "NFS engine" "$libnfs"
2321 ##########################################
2322 # Check if we have lex/yacc available
2327 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2328 if test "$targetos" != "SunOS" ; then
2338 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2342 if test "$arith" = "yes" ; then
2344 extern int yywrap(void);
2346 int main(int argc, char **argv)
2352 if compile_prog "" "-lfl" "flex"; then
2354 elif compile_prog "" "-ll" "lex"; then
2363 # Check if lex fails using -o
2364 if test "$arith" = "yes" ; then
2365 if test "$force_no_lex_o" = "yes" ; then
2368 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2376 print_config "lex/yacc for arithmetic" "$arith"
2378 ##########################################
2379 # Check whether we have setmntent/getmntent
2380 if test "$getmntent" != "yes" ; then
2386 int main(int argc, char **argv)
2388 FILE *mtab = setmntent(NULL, "r");
2389 struct mntent *mnt = getmntent(mtab);
2394 if compile_prog "" "" "getmntent"; then
2397 print_config "getmntent" "$getmntent"
2399 ##########################################
2400 # Check whether we have getmntinfo
2401 # These are originally added for BSDs, but may also work
2402 # on other operating systems with getmntinfo(3).
2404 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2405 # Note that NetBSD needs -Werror to catch warning as error.
2406 if test "$getmntinfo" != "yes" ; then
2411 #include <sys/param.h>
2412 #include <sys/mount.h>
2413 int main(int argc, char **argv)
2416 return getmntinfo(&st, MNT_NOWAIT);
2419 if compile_prog "-Werror" "" "getmntinfo"; then
2422 print_config "getmntinfo" "$getmntinfo"
2424 # getmntinfo(3) for NetBSD.
2425 if test "$getmntinfo_statvfs" != "yes" ; then
2426 getmntinfo_statvfs="no"
2430 #include <sys/statvfs.h>
2431 int main(int argc, char **argv)
2434 return getmntinfo(&st, MNT_NOWAIT);
2437 # Skip the test if the one with statfs arg is detected.
2438 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2439 getmntinfo_statvfs="yes"
2440 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2443 ##########################################
2444 # Check whether we have _Static_assert
2445 if test "$static_assert" != "yes" ; then
2457 int main(int argc, char **argv)
2459 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2463 if compile_prog "" "" "static_assert"; then
2466 print_config "Static Assert" "$static_assert"
2468 ##########################################
2469 # Check whether we have bool / stdbool.h
2470 if test "$have_bool" != "yes" ; then
2474 #include <stdbool.h>
2475 int main(int argc, char **argv)
2478 return var != false;
2481 if compile_prog "" "" "bool"; then
2484 print_config "bool" "$have_bool"
2486 ##########################################
2487 # Check whether we have strndup()
2492 int main(int argc, char **argv)
2494 char *res = strndup("test string", 8);
2500 if compile_prog "" "" "strndup"; then
2503 print_config "strndup" "$strndup"
2505 ##########################################
2506 # <valgrind/drd.h> probe
2507 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2508 # also available but not the other way around.
2509 if test "$valgrind_dev" != "yes" ; then
2513 #include <valgrind/drd.h>
2514 int main(int argc, char **argv)
2519 if compile_prog "" "" "valgrind_dev"; then
2522 print_config "Valgrind headers" "$valgrind_dev"
2524 if test "$targetos" = "Linux" ; then
2525 ##########################################
2526 # <linux/blkzoned.h> probe
2527 if test "$linux_blkzoned" != "yes" ; then
2531 #include <linux/blkzoned.h>
2532 int main(int argc, char **argv)
2537 if compile_prog "" "" "linux_blkzoned"; then
2538 linux_blkzoned="yes"
2540 print_config "Zoned block device support" "$linux_blkzoned"
2542 ##########################################
2543 # Check BLK_ZONE_REP_CAPACITY
2545 #include <linux/blkzoned.h>
2548 return BLK_ZONE_REP_CAPACITY;
2551 if compile_prog "" "" "blkzoned report capacity"; then
2552 output_sym "CONFIG_HAVE_REP_CAPACITY"
2557 print_config "Zoned block device capacity" "$rep_capacity"
2560 ##########################################
2563 #include <libzbc/zbc.h>
2564 int main(int argc, char **argv)
2566 struct zbc_device *dev = NULL;
2568 return zbc_open("foo=bar", O_RDONLY, &dev);
2571 if test "$libzbc" != "no" ; then
2572 if compile_prog "" "-lzbc" "libzbc"; then
2574 if ! check_min_lib_version libzbc 5; then
2578 if test "$libzbc" = "yes" ; then
2579 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2584 print_config "libzbc engine" "$libzbc"
2586 ##########################################
2587 # check march=armv8-a+crc+crypto
2588 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2589 march_armv8_a_crc_crypto="no"
2591 if test "$cpu" = "arm64" ; then
2593 #include <arm_acle.h>
2594 #include <arm_neon.h>
2595 #include <sys/auxv.h>
2599 /* Can we also do a runtime probe? */
2601 return getauxval(AT_HWCAP);
2603 # error "Don't know how to do runtime probe for ARM CRC32c"
2607 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2608 march_armv8_a_crc_crypto="yes"
2609 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2613 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2615 ##########################################
2617 if test "$cuda" != "no" ; then
2620 int main(int argc, char **argv)
2625 if compile_prog "" "-lcuda" "cuda"; then
2629 if test "$cuda" = "yes" ; then
2630 feature_not_found "cuda" ""
2635 print_config "cuda" "$cuda"
2637 ##########################################
2639 if test "$libcufile" != "no" ; then
2643 int main(int argc, char* argv[]) {
2648 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2650 LIBS="-lcuda -lcudart -lcufile $LIBS"
2652 if test "$libcufile" = "yes" ; then
2653 feature_not_found "libcufile" ""
2658 print_config "libcufile" "$libcufile"
2660 ##########################################
2661 # check for cc -march=native
2664 int main(int argc, char **argv)
2669 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2670 compile_prog "-march=native" "" "march=native"; then
2673 print_config "Build march=native" "$build_native"
2675 ##########################################
2677 if test "$cunit" != "yes" ; then
2681 #include <CUnit/CUnit.h>
2682 #include <CUnit/Basic.h>
2685 if (CU_initialize_registry() != CUE_SUCCESS)
2686 return CU_get_error();
2687 CU_basic_set_mode(CU_BRM_VERBOSE);
2688 CU_basic_run_tests();
2689 CU_cleanup_registry();
2690 return CU_get_error();
2693 if compile_prog "" "-lcunit" "CUnit"; then
2696 print_config "CUnit" "$cunit"
2698 ##########################################
2699 # check for __kernel_rwf_t
2702 #include <linux/fs.h>
2703 int main(int argc, char **argv)
2710 if compile_prog "" "" "__kernel_rwf_t"; then
2711 __kernel_rwf_t="yes"
2713 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2715 ##########################################
2716 # check if gcc has -Wimplicit-fallthrough=2
2719 int main(int argc, char **argv)
2724 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2727 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2729 ##########################################
2730 # check for MADV_HUGEPAGE support
2731 if test "$thp" != "yes" ; then
2734 if test "$esx" != "yes" ; then
2736 #include <sys/mman.h>
2739 return madvise(0, 0x1000, MADV_HUGEPAGE);
2742 if compile_prog "" "" "thp" ; then
2745 if test "$thp" = "yes" ; then
2746 feature_not_found "Transparent Huge Page" ""
2751 print_config "MADV_HUGEPAGE" "$thp"
2753 ##########################################
2754 # check for gettid()
2758 int main(int argc, char **argv)
2763 if compile_prog "" "" "gettid"; then
2766 print_config "gettid" "$gettid"
2768 ##########################################
2769 # check for statx(2) support by libc
2773 #include <sys/stat.h>
2775 int main(int argc, char **argv)
2778 return statx(-1, *argv, 0, 0, &st);
2781 if compile_prog "" "" "statx"; then
2784 print_config "statx(2)/libc" "$statx"
2786 ##########################################
2787 # check for statx(2) support by kernel
2791 #include <linux/stat.h>
2792 #include <sys/stat.h>
2793 #include <sys/syscall.h>
2795 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2796 struct statx *buffer)
2798 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2801 int main(int argc, char **argv)
2804 return _statx(-1, *argv, 0, 0, &st);
2807 if compile_prog "" "" "statx_syscall"; then
2810 print_config "statx(2)/syscall" "$statx_syscall"
2812 ##########################################
2813 # check for Windows PDB generation support
2814 if test "pdb" != "no" ; then
2821 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2824 if test "$pdb" = "yes"; then
2825 feature_not_found "PDB" "clang and lld"
2832 print_config "Windows PDB generation" "$pdb"
2834 ##########################################
2835 # check for timerfd support
2837 if test "$esx" != "yes" ; then
2839 #include <sys/time.h>
2840 #include <sys/timerfd.h>
2842 int main(int argc, char **argv)
2844 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2847 if compile_prog "" "" "timerfd_create"; then
2848 timerfd_create="yes"
2851 print_config "timerfd_create" "$timerfd_create"
2853 #############################################################################
2855 if test "$wordsize" = "64" ; then
2856 output_sym "CONFIG_64BIT"
2857 elif test "$wordsize" = "32" ; then
2858 output_sym "CONFIG_32BIT"
2860 fatal "Unknown wordsize!"
2862 if test "$bigendian" = "yes" ; then
2863 output_sym "CONFIG_BIG_ENDIAN"
2865 output_sym "CONFIG_LITTLE_ENDIAN"
2867 if test "$zlib" = "yes" ; then
2868 output_sym "CONFIG_ZLIB"
2870 if test "$libaio" = "yes" ; then
2871 output_sym "CONFIG_LIBAIO"
2872 if test "$libaio_rw_flags" = "yes" ; then
2873 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2876 if test "$posix_aio" = "yes" ; then
2877 output_sym "CONFIG_POSIXAIO"
2879 if test "$posix_aio_fsync" = "yes" ; then
2880 output_sym "CONFIG_POSIXAIO_FSYNC"
2882 if test "$posix_pshared" = "yes" ; then
2883 output_sym "CONFIG_PSHARED"
2885 if test "$pthread_condattr_setclock" = "yes" ; then
2886 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2888 if test "$pthread_sigmask" = "yes" ; then
2889 output_sym "CONFIG_PTHREAD_SIGMASK"
2891 if test "$pthread_getaffinity" = "yes" ; then
2892 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2894 if test "$have_asprintf" = "yes" ; then
2895 output_sym "CONFIG_HAVE_ASPRINTF"
2897 if test "$have_vasprintf" = "yes" ; then
2898 output_sym "CONFIG_HAVE_VASPRINTF"
2900 if test "$linux_fallocate" = "yes" ; then
2901 output_sym "CONFIG_LINUX_FALLOCATE"
2903 if test "$posix_fallocate" = "yes" ; then
2904 output_sym "CONFIG_POSIX_FALLOCATE"
2906 if test "$fdatasync" = "yes" ; then
2907 output_sym "CONFIG_FDATASYNC"
2909 if test "$pipe" = "yes" ; then
2910 output_sym "CONFIG_PIPE"
2912 if test "$pipe2" = "yes" ; then
2913 output_sym "CONFIG_PIPE2"
2915 if test "$pread" = "yes" ; then
2916 output_sym "CONFIG_PREAD"
2918 if test "$sync_file_range" = "yes" ; then
2919 output_sym "CONFIG_SYNC_FILE_RANGE"
2921 if test "$sfaa" = "yes" ; then
2922 output_sym "CONFIG_SFAA"
2924 if test "$sync_sync" = "yes" ; then
2925 output_sym "CONFIG_SYNC_SYNC"
2927 if test "$cmp_swap" = "yes" ; then
2928 output_sym "CONFIG_CMP_SWAP"
2930 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2931 output_sym "CONFIG_RDMA"
2933 # librpma is supported on the 'x86_64' architecture for now
2934 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2935 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2936 output_sym "CONFIG_LIBRPMA_APM"
2938 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2939 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2940 output_sym "CONFIG_LIBRPMA_GPSPM"
2942 if test "$clock_gettime" = "yes" ; then
2943 output_sym "CONFIG_CLOCK_GETTIME"
2945 if test "$clock_monotonic" = "yes" ; then
2946 output_sym "CONFIG_CLOCK_MONOTONIC"
2948 if test "$clockid_t" = "yes"; then
2949 output_sym "CONFIG_CLOCKID_T"
2951 if test "$gettimeofday" = "yes" ; then
2952 output_sym "CONFIG_GETTIMEOFDAY"
2954 if test "$posix_fadvise" = "yes" ; then
2955 output_sym "CONFIG_POSIX_FADVISE"
2957 if test "$linux_3arg_affinity" = "yes" ; then
2958 output_sym "CONFIG_3ARG_AFFINITY"
2959 elif test "$linux_2arg_affinity" = "yes" ; then
2960 output_sym "CONFIG_2ARG_AFFINITY"
2962 if test "$strsep" = "yes" ; then
2963 output_sym "CONFIG_STRSEP"
2965 if test "$strcasestr" = "yes" ; then
2966 output_sym "CONFIG_STRCASESTR"
2968 if test "$strlcat" = "yes" ; then
2969 output_sym "CONFIG_STRLCAT"
2971 if test "$getopt_long_only" = "yes" ; then
2972 output_sym "CONFIG_GETOPT_LONG_ONLY"
2974 if test "$inet_aton" = "yes" ; then
2975 output_sym "CONFIG_INET_ATON"
2977 if test "$socklen_t" = "yes" ; then
2978 output_sym "CONFIG_SOCKLEN_T"
2980 if test "$ext4_me" = "yes" ; then
2981 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2983 if test "$linux_splice" = "yes" ; then
2984 output_sym "CONFIG_LINUX_SPLICE"
2986 if test "$libnuma_v2" = "yes" ; then
2987 output_sym "CONFIG_LIBNUMA"
2989 if test "$solaris_aio" = "yes" ; then
2990 output_sym "CONFIG_SOLARISAIO"
2992 if test "$tls_thread" = "yes" ; then
2993 output_sym "CONFIG_TLS_THREAD"
2995 if test "$rusage_thread" = "yes" ; then
2996 output_sym "CONFIG_RUSAGE_THREAD"
2998 if test "$gfio" = "yes" ; then
2999 output_sym "CONFIG_GFIO"
3001 if test "$esx" = "yes" ; then
3002 output_sym "CONFIG_ESX"
3003 output_sym "CONFIG_NO_SHM"
3005 if test "$sched_idle" = "yes" ; then
3006 output_sym "CONFIG_SCHED_IDLE"
3008 if test "$tcp_nodelay" = "yes" ; then
3009 output_sym "CONFIG_TCP_NODELAY"
3011 if test "$window_size" = "yes" ; then
3012 output_sym "CONFIG_NET_WINDOWSIZE"
3014 if test "$mss" = "yes" ; then
3015 output_sym "CONFIG_NET_MSS"
3017 if test "$rlimit_memlock" = "yes" ; then
3018 output_sym "CONFIG_RLIMIT_MEMLOCK"
3020 if test "$pwritev" = "yes" ; then
3021 output_sym "CONFIG_PWRITEV"
3023 if test "$pwritev2" = "yes" ; then
3024 output_sym "CONFIG_PWRITEV2"
3026 if test "$ipv6" = "yes" ; then
3027 output_sym "CONFIG_IPV6"
3029 if test "$http" = "yes" ; then
3030 output_sym "CONFIG_HTTP"
3032 if test "$rados" = "yes" ; then
3033 output_sym "CONFIG_RADOS"
3035 if test "$rbd" = "yes" ; then
3036 output_sym "CONFIG_RBD"
3038 if test "$rbd_poll" = "yes" ; then
3039 output_sym "CONFIG_RBD_POLL"
3041 if test "$rbd_inval" = "yes" ; then
3042 output_sym "CONFIG_RBD_INVAL"
3044 if test "$setvbuf" = "yes" ; then
3045 output_sym "CONFIG_SETVBUF"
3047 if test "$s390_z196_facilities" = "yes" ; then
3048 output_sym "CONFIG_S390_Z196_FACILITIES"
3049 CFLAGS="$CFLAGS -march=z9-109"
3052 if test "$gfapi" = "yes" ; then
3053 output_sym "CONFIG_GFAPI"
3055 if test "$gf_fadvise" = "yes" ; then
3056 output_sym "CONFIG_GF_FADVISE"
3058 if test "$gf_trim" = "yes" ; then
3059 output_sym "CONFIG_GF_TRIM"
3061 if test "$gf_new" = "yes" ; then
3062 output_sym "CONFIG_GF_NEW_API"
3064 if test "$libhdfs" = "yes" ; then
3065 output_sym "CONFIG_LIBHDFS"
3066 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3067 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3068 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3069 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3071 if test "$mtd" = "yes" ; then
3072 output_sym "CONFIG_MTD"
3074 if test "$pmemblk" = "yes" ; then
3075 output_sym "CONFIG_PMEMBLK"
3077 if test "$devdax" = "yes" ; then
3078 output_sym "CONFIG_LINUX_DEVDAX"
3080 if test "$pmem" = "yes" ; then
3081 output_sym "CONFIG_LIBPMEM"
3083 if test "$libime" = "yes" ; then
3084 output_sym "CONFIG_IME"
3086 if test "$arith" = "yes" ; then
3087 output_sym "CONFIG_ARITHMETIC"
3088 if test "$yacc_is_bison" = "yes" ; then
3089 echo "YACC=bison -y" >> $config_host_mak
3091 echo "YACC=yacc" >> $config_host_mak
3093 if test "$lex_use_o" = "yes" ; then
3094 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3097 if test "$getmntent" = "yes" ; then
3098 output_sym "CONFIG_GETMNTENT"
3100 if test "$getmntinfo" = "yes" ; then
3101 output_sym "CONFIG_GETMNTINFO"
3103 if test "$getmntinfo_statvfs" = "yes" ; then
3104 output_sym "CONFIG_GETMNTINFO_STATVFS"
3106 if test "$static_assert" = "yes" ; then
3107 output_sym "CONFIG_STATIC_ASSERT"
3109 if test "$have_bool" = "yes" ; then
3110 output_sym "CONFIG_HAVE_BOOL"
3112 if test "$strndup" = "yes" ; then
3113 output_sym "CONFIG_HAVE_STRNDUP"
3115 if test "$disable_opt" = "yes" ; then
3116 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3118 if test "$valgrind_dev" = "yes"; then
3119 output_sym "CONFIG_VALGRIND_DEV"
3121 if test "$linux_blkzoned" = "yes" ; then
3122 output_sym "CONFIG_HAS_BLKZONED"
3124 if test "$libzbc" = "yes" ; then
3125 output_sym "CONFIG_LIBZBC"
3127 if test "$zlib" = "no" ; then
3128 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
3129 if test "$build_static" = "yes"; then
3130 echo "Note that some distros have separate packages for static libraries."
3133 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3134 output_sym "ARCH_HAVE_CRC_CRYPTO"
3136 if test "$cuda" = "yes" ; then
3137 output_sym "CONFIG_CUDA"
3139 if test "$libcufile" = "yes" ; then
3140 output_sym "CONFIG_LIBCUFILE"
3142 if test "$dfs" = "yes" ; then
3143 output_sym "CONFIG_DFS"
3145 if test "$libnfs" = "yes" ; then
3146 output_sym "CONFIG_NFS"
3148 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3149 output_sym "CONFIG_BUILD_NATIVE"
3151 if test "$cunit" = "yes" ; then
3152 output_sym "CONFIG_HAVE_CUNIT"
3154 if test "$__kernel_rwf_t" = "yes"; then
3155 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3157 if test "$gettid" = "yes"; then
3158 output_sym "CONFIG_HAVE_GETTID"
3160 if test "$statx" = "yes"; then
3161 output_sym "CONFIG_HAVE_STATX"
3163 if test "$statx_syscall" = "yes"; then
3164 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3166 if test "$timerfd_create" = "yes"; then
3167 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3169 if test "$fallthrough" = "yes"; then
3170 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3172 if test "$thp" = "yes" ; then
3173 output_sym "CONFIG_HAVE_THP"
3175 if test "$libiscsi" = "yes" ; then
3176 output_sym "CONFIG_LIBISCSI"
3177 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3178 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3179 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3181 if test "$libnbd" = "yes" ; then
3182 output_sym "CONFIG_LIBNBD"
3183 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3184 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3185 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3187 if test "$libnfs" = "yes" ; then
3188 output_sym "CONFIG_LIBNFS"
3189 echo "CONFIG_LIBNFS=m" >> $config_host_mak
3190 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3191 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3193 if test "$dynamic_engines" = "yes" ; then
3194 output_sym "CONFIG_DYNAMIC_ENGINES"
3196 if test "$pdb" = yes; then
3197 output_sym "CONFIG_PDB"
3199 if test "$fcntl_sync" = "yes" ; then
3200 output_sym "CONFIG_FCNTL_SYNC"
3202 if test "$asan" = "yes"; then
3203 CFLAGS="$CFLAGS -fsanitize=address"
3204 LDFLAGS="$LDFLAGS -fsanitize=address"
3206 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3208 int main(int argc, char **argv)
3213 if test "$disable_tcmalloc" != "yes"; then
3214 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3216 LIBS="-ltcmalloc $LIBS"
3217 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3219 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3224 print_config "TCMalloc support" "$tcmalloc"
3226 echo "LIBS+=$LIBS" >> $config_host_mak
3227 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3228 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3229 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3230 echo "CC=$cc" >> $config_host_mak
3231 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3232 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3234 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3235 cat > Makefile <<EOF
3236 SRCDIR:=`dirname $0`
3237 include \$(SRCDIR)/Makefile