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"
255 echo "Bad option $opt"
261 if test "$show_help" = "yes" ; then
262 echo "--prefix= Use this directory as installation prefix"
263 echo "--cpu= Specify target CPU if auto-detect fails"
264 echo "--cc= Specify compiler to use"
265 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
266 echo "--build-32bit-win Enable 32-bit build on Windows"
267 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
268 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
269 echo "--build-static Build a static fio"
270 echo "--esx Configure build options for esx"
271 echo "--enable-gfio Enable building of gtk gfio"
272 echo "--disable-numa Disable libnuma even if found"
273 echo "--disable-rdma Disable RDMA support even if found"
274 echo "--disable-rados Disable Rados support even if found"
275 echo "--disable-rbd Disable Rados Block Device even if found"
276 echo "--disable-http Disable HTTP support even if found"
277 echo "--disable-nfs Disable userspace NFS support even if found"
278 echo "--disable-gfapi Disable gfapi"
279 echo "--enable-libhdfs Enable hdfs support"
280 echo "--enable-libnfs Enable nfs support"
281 echo "--disable-lex Disable use of lex/yacc for math"
282 echo "--disable-pmem Disable pmem based engines even if found"
283 echo "--enable-lex Enable use of lex/yacc for math"
284 echo "--disable-shm Disable SHM support"
285 echo "--disable-optimizations Don't enable compiler optimizations"
286 echo "--enable-cuda Enable GPUDirect RDMA support"
287 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
288 echo "--disable-native Don't build for native host"
289 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
290 echo "--enable-libiscsi Enable iscsi support"
291 echo "--enable-libnbd Enable libnbd (NBD engine) support"
292 echo "--disable-libzbc Disable libzbc even if found"
293 echo "--disable-tcmalloc Disable tcmalloc support"
294 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
295 echo "--disable-dfs Disable DAOS File System support even if found"
299 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
300 # Preferred compiler (can be overriden later after we know the platform):
302 # ${cross_prefix}gcc (if cross-prefix specified)
305 if test -z "${CC}${cross_prefix}"; then
312 cc="${CC-${cross_prefix}gcc}"
315 if check_define __ANDROID__ ; then
317 elif check_define __linux__ ; then
319 elif check_define __OpenBSD__ ; then
321 elif check_define __NetBSD__ ; then
323 elif check_define __sun__ ; then
325 CFLAGS="$CFLAGS -D_REENTRANT"
326 elif check_define _WIN32 ; then
332 echo "# Automatically generated by configure - do not modify" > $config_host_mak
333 printf "# Configured with:" >> $config_host_mak
334 printf " '%s'" "$0" "$@" >> $config_host_mak
335 echo >> $config_host_mak
336 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
338 if test "$no_shm" = "yes" ; then
339 output_sym "CONFIG_NO_SHM"
342 if test "$disable_opt" = "yes" ; then
343 output_sym "CONFIG_FIO_NO_OPT"
346 # Some host OSes need non-standard checks for which CPU to use.
347 # Note that these checks are broken for cross-compilation: if you're
348 # cross-compiling to one of these OSes then you'll need to specify
349 # the correct CPU with the --cpu option.
352 # Unless explicitly enabled, turn off lex.
353 # OpenBSD will hit syntax error when enabled.
354 if test -z "$disable_lex" ; then
361 CFLAGS="$CFLAGS -I/usr/local/include"
362 LDFLAGS="$LDFLAGS -L/usr/local/lib"
365 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
366 # we can run 64-bit userspace code.
367 # If the user didn't specify a CPU explicitly and the kernel says this is
368 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
370 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
373 # Avoid configure feature detection of features provided by weak symbols
380 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
381 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
385 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
386 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
389 LIBS="-lnsl -lsocket"
392 # We still force some options, so keep this message here.
393 echo "Forcing some known good options on Windows"
394 if test -z "${CC}${cross_prefix}"; then
395 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
396 cc="i686-w64-mingw32-gcc"
398 cc="x86_64-w64-mingw32-gcc"
402 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
403 if test -z "$target_win_ver"; then
404 # Default Windows API target
407 if test "$target_win_ver" = "7"; then
408 output_sym "CONFIG_WINDOWS_7"
409 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
411 fatal "Unknown target Windows version"
414 # We need this to be output_sym'd here because this is Windows specific.
415 # The regular configure path never sets this config.
416 output_sym "CONFIG_WINDOWSAIO"
417 # We now take the regular configuration path without having exit 0 here.
418 # Flags below are still necessary mostly for MinGW.
422 clock_gettime="yes" # clock_monotonic probe has dependency on this
423 clock_monotonic="yes"
425 pthread_condattr_setclock="no"
426 pthread_affinity="no"
430 # Now we know the target platform we can have another guess at the preferred
431 # compiler when it wasn't explictly set
432 if test -z "${CC}${cross_prefix}"; then
433 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
439 if test -z "$cc"; then
440 echo "configure: failed to find compiler"
444 if test ! -z "$cpu" ; then
445 # command line argument
447 elif check_define __i386__ ; then
449 elif check_define __x86_64__ ; then
451 elif check_define __sparc__ ; then
452 if check_define __arch64__ ; then
457 elif check_define _ARCH_PPC ; then
458 if check_define _ARCH_PPC64 ; then
463 elif check_define __mips__ ; then
465 elif check_define __ia64__ ; then
467 elif check_define __s390__ ; then
468 if check_define __s390x__ ; then
473 elif check_define __arm__ ; then
475 elif check_define __aarch64__ ; then
477 elif check_define __hppa__ ; then
483 # Normalise host CPU name and set ARCH.
485 ia64|ppc|ppc64|s390|s390x|sparc64)
488 i386|i486|i586|i686|i86pc|BePC)
500 hppa|parisc|parisc64)
514 ##########################################
515 # check cross compile
517 if test "$cross_compile" != "yes" ; then
526 if compile_prog "" "" "cross"; then
527 $TMPE 2>/dev/null || cross_compile="yes"
529 fatal "compile test failed"
532 ##########################################
534 if test "$bigendian" != "yes" ; then
537 if test "$cross_compile" = "no" ; then
539 #include <inttypes.h>
542 volatile uint32_t i=0x01234567;
543 return (*((uint8_t*)(&i))) == 0x67;
546 if compile_prog "" "" "endian"; then
547 $TMPE && bigendian="yes"
550 # If we're cross compiling, try our best to work it out and rely on the
551 # run-time check to fail if we get it wrong.
556 #if __BYTE_ORDER != __BIG_ENDIAN
557 # error "Unknown endianness"
561 compile_prog "" "" "endian" && bigendian="yes"
562 check_define "__ARMEB__" && bigendian="yes"
563 check_define "__MIPSEB__" && bigendian="yes"
567 print_config "Operating system" "$targetos"
568 print_config "CPU" "$cpu"
569 print_config "Big endian" "$bigendian"
570 if test ! -z "$target_win_ver"; then
571 print_config "Target Windows version" "$target_win_ver"
573 print_config "Compiler" "$cc"
574 print_config "Cross compile" "$cross_compile"
577 ##########################################
578 # See if we need to build a static build
579 if test "$build_static" = "yes" ; then
580 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
581 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
585 print_config "Static build" "$build_static"
587 ##########################################
588 # check for C11 atomics support
590 #include <stdatomic.h>
598 if ! compile_prog "" "" "C11 atomics"; then
600 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
601 echo "minimum versions with it - perhaps your compiler is too old?"
602 fatal "C11 atomics support not found"
606 ##########################################
611 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
614 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
618 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
620 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
623 fatal "Unknown wordsize"
625 print_config "Wordsize" "$wordsize"
627 ##########################################
629 if test "$zlib" != "yes" ; then
637 if (inflateInit(&stream) != Z_OK)
642 if compile_prog "" "-lz" "zlib" ; then
646 print_config "zlib" "$zlib"
648 ##########################################
650 if test "$libaio" != "yes" ; then
653 if test "$esx" != "yes" ; then
663 if compile_prog "" "-laio" "libaio" ; then
666 if test "$libaio" = "yes" ; then
667 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
677 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
678 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
682 if compile_prog "" "" "libaio rw flags" ; then
688 print_config "Linux AIO support" "$libaio"
689 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
691 ##########################################
693 if test "$posix_aio" != "yes" ; then
696 if test "$posix_aio_lrt" != "yes" ; then
708 if compile_prog "" "" "posixaio" ; then
710 elif compile_prog "" "-lrt" "posixaio -lrt"; then
715 print_config "POSIX AIO support" "$posix_aio"
716 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
718 ##########################################
719 # posix aio fsync probe
720 if test "$posix_aio_fsync" != "yes" ; then
723 if test "$posix_aio" = "yes" ; then
730 return aio_fsync(O_SYNC, &cb);
734 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
738 print_config "POSIX AIO fsync" "$posix_aio_fsync"
740 ##########################################
741 # POSIX pshared attribute probe
742 if test "$posix_pshared" != "yes" ; then
749 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
750 # if defined(__CYGWIN__)
751 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
752 # elif defined(__APPLE__)
753 # include <AvailabilityMacros.h>
754 # include <TargetConditionals.h>
755 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
756 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
760 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
765 if compile_prog "" "$LIBS" "posix_pshared" ; then
768 print_config "POSIX pshared support" "$posix_pshared"
770 ##########################################
771 # POSIX pthread_condattr_setclock() probe
772 if test "$pthread_condattr_setclock" != "no" ; then
777 pthread_condattr_t condattr;
778 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
782 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
783 pthread_condattr_setclock=yes
784 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
785 pthread_condattr_setclock=yes
786 LIBS="$LIBS -lpthread"
789 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
791 ##########################################
792 # pthread_sigmask() probe
793 if test "$pthread_sigmask" != "yes" ; then
797 #include <stddef.h> /* NULL */
798 #include <signal.h> /* pthread_sigmask() */
801 return pthread_sigmask(0, NULL, NULL);
804 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
806 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
808 LIBS="$LIBS -lpthread"
810 print_config "pthread_sigmask()" "$pthread_sigmask"
812 ##########################################
813 # pthread_getaffinity_np() probe
814 if test "$pthread_getaffinity" != "yes" ; then
815 pthread_getaffinity="no"
818 #include <stddef.h> /* NULL */
819 #include <signal.h> /* pthread_sigmask() */
824 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
827 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
828 pthread_getaffinity="yes"
829 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
830 pthread_getaffinity="yes"
831 LIBS="$LIBS -lpthread"
833 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
835 ##########################################
837 if test "$solaris_aio" != "yes" ; then
841 #include <sys/types.h>
842 #include <sys/asynch.h>
847 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
851 if compile_prog "" "-laio" "solarisaio" ; then
855 print_config "Solaris AIO support" "$solaris_aio"
857 ##########################################
858 # __sync_fetch_and_add test
859 if test "$sfaa" != "yes" ; then
863 #include <inttypes.h>
864 static int sfaa(uint64_t *ptr)
866 return __sync_fetch_and_add(ptr, 0);
869 int main(int argc, char **argv)
876 if compile_prog "" "" "__sync_fetch_and_add()" ; then
879 print_config "__sync_fetch_and_add" "$sfaa"
881 ##########################################
882 # __sync_synchronize() test
883 if test "$sync_sync" != "yes" ; then
887 #include <inttypes.h>
889 int main(int argc, char **argv)
891 __sync_synchronize();
895 if compile_prog "" "" "__sync_synchronize()" ; then
898 print_config "__sync_synchronize" "$sync_sync"
900 ##########################################
901 # __sync_val_compare_and_swap() test
902 if test "$cmp_swap" != "yes" ; then
906 #include <inttypes.h>
908 int main(int argc, char **argv)
911 return __sync_val_compare_and_swap(&x, 1, 2);
914 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
917 print_config "__sync_val_compare_and_swap" "$cmp_swap"
919 ##########################################
921 if test "$libverbs" != "yes" ; then
925 #include <infiniband/verbs.h>
926 int main(int argc, char **argv)
928 struct ibv_pd *pd = ibv_alloc_pd(NULL);
932 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
935 print_config "libverbs" "$libverbs"
937 ##########################################
939 if test "$rdmacm" != "yes" ; then
944 #include <rdma/rdma_cma.h>
945 int main(int argc, char **argv)
947 rdma_destroy_qp(NULL);
951 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
954 print_config "rdmacm" "$rdmacm"
956 ##########################################
958 # The librpma engine requires librpma>=v0.10.0 with rpma_mr_advise().
959 if test "$librpma" != "yes" ; then
966 void *ptr = rpma_mr_advise;
967 (void) ptr; /* unused */
971 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
974 print_config "librpma" "$librpma"
976 ##########################################
977 # libprotobuf-c probe
978 if test "$libprotobuf_c" != "yes" ; then
983 #include <protobuf-c/protobuf-c.h>
984 #if !defined(PROTOBUF_C_VERSION_NUMBER)
985 # error PROTOBUF_C_VERSION_NUMBER is not defined!
987 int main(int argc, char **argv)
989 (void)protobuf_c_message_check(NULL);
993 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
996 print_config "libprotobuf_c" "$libprotobuf_c"
998 ##########################################
999 # asprintf() and vasprintf() probes
1000 if test "$have_asprintf" != "yes" ; then
1006 int main(int argc, char **argv)
1009 return asprintf(&buf, "%s", "str") == 0;
1012 if compile_prog "" "" "have_asprintf"; then
1015 print_config "asprintf()" "$have_asprintf"
1017 if test "$have_vasprintf" != "yes" ; then
1023 int main(int argc, char **argv)
1027 return vasprintf(&buf, "%s", ap) == 0;
1030 if compile_prog "" "" "have_vasprintf"; then
1031 have_vasprintf="yes"
1033 print_config "vasprintf()" "$have_vasprintf"
1035 ##########################################
1036 # Linux fallocate probe
1037 if test "$linux_fallocate" != "yes" ; then
1038 linux_fallocate="no"
1043 #include <linux/falloc.h>
1044 int main(int argc, char **argv)
1046 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1050 if compile_prog "" "" "linux_fallocate"; then
1051 linux_fallocate="yes"
1053 print_config "Linux fallocate" "$linux_fallocate"
1055 ##########################################
1056 # POSIX fadvise probe
1057 if test "$posix_fadvise" != "yes" ; then
1063 int main(int argc, char **argv)
1065 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1069 if compile_prog "" "" "posix_fadvise"; then
1072 print_config "POSIX fadvise" "$posix_fadvise"
1074 ##########################################
1075 # POSIX fallocate probe
1076 if test "$posix_fallocate" != "yes" ; then
1077 posix_fallocate="no"
1082 int main(int argc, char **argv)
1084 int r = posix_fallocate(0, 0, 1024);
1088 if compile_prog "" "" "posix_fallocate"; then
1089 posix_fallocate="yes"
1091 print_config "POSIX fallocate" "$posix_fallocate"
1093 ##########################################
1094 # sched_set/getaffinity 2 or 3 argument test
1095 if test "$linux_2arg_affinity" != "yes" ; then
1096 linux_2arg_affinity="no"
1098 if test "$linux_3arg_affinity" != "yes" ; then
1099 linux_3arg_affinity="no"
1103 int main(int argc, char **argv)
1106 return sched_setaffinity(0, sizeof(mask), &mask);
1109 if compile_prog "" "" "sched_setaffinity(,,)"; then
1110 linux_3arg_affinity="yes"
1114 int main(int argc, char **argv)
1117 return sched_setaffinity(0, &mask);
1120 if compile_prog "" "" "sched_setaffinity(,)"; then
1121 linux_2arg_affinity="yes"
1124 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1125 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1127 ##########################################
1128 # clock_gettime probe
1129 if test "$clock_gettime" != "yes" ; then
1135 int main(int argc, char **argv)
1137 return clock_gettime(0, NULL);
1140 if compile_prog "" "" "clock_gettime"; then
1142 elif compile_prog "" "-lrt" "clock_gettime"; then
1146 print_config "clock_gettime" "$clock_gettime"
1148 ##########################################
1149 # CLOCK_MONOTONIC probe
1150 if test "$clock_monotonic" != "yes" ; then
1151 clock_monotonic="no"
1153 if test "$clock_gettime" = "yes" ; then
1157 int main(int argc, char **argv)
1159 return clock_gettime(CLOCK_MONOTONIC, NULL);
1162 if compile_prog "" "$LIBS" "clock monotonic"; then
1163 clock_monotonic="yes"
1166 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1168 ##########################################
1170 if test "$clockid_t" != "yes" ; then
1176 int main(int argc, char **argv)
1178 volatile clockid_t cid;
1179 memset((void*)&cid, 0, sizeof(cid));
1183 if compile_prog "" "$LIBS" "clockid_t"; then
1186 print_config "clockid_t" "$clockid_t"
1188 ##########################################
1189 # gettimeofday() probe
1190 if test "$gettimeofday" != "yes" ; then
1194 #include <sys/time.h>
1196 int main(int argc, char **argv)
1199 return gettimeofday(&tv, NULL);
1202 if compile_prog "" "" "gettimeofday"; then
1205 print_config "gettimeofday" "$gettimeofday"
1207 ##########################################
1209 if test "$fdatasync" != "yes" ; then
1215 int main(int argc, char **argv)
1217 return fdatasync(0);
1220 if compile_prog "" "" "fdatasync"; then
1223 print_config "fdatasync" "$fdatasync"
1225 ##########################################
1227 if test "$pipe" != "yes" ; then
1232 int main(int argc, char **argv)
1238 if compile_prog "" "" "pipe"; then
1241 print_config "pipe()" "$pipe"
1243 ##########################################
1245 if test "$pipe2" != "yes" ; then
1250 int main(int argc, char **argv)
1253 return pipe2(fd, 0);
1256 if compile_prog "" "" "pipe2"; then
1259 print_config "pipe2()" "$pipe2"
1261 ##########################################
1263 if test "$pread" != "yes" ; then
1268 int main(int argc, char **argv)
1270 return pread(0, NULL, 0, 0);
1273 if compile_prog "" "" "pread"; then
1276 print_config "pread()" "$pread"
1278 ##########################################
1279 # sync_file_range() probe
1280 if test "$sync_file_range" != "yes" ; then
1281 sync_file_range="no"
1287 #include <linux/fs.h>
1288 int main(int argc, char **argv)
1290 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1291 SYNC_FILE_RANGE_WAIT_AFTER;
1292 return sync_file_range(0, 0, 0, flags);
1295 if compile_prog "" "" "sync_file_range"; then
1296 sync_file_range="yes"
1298 print_config "sync_file_range" "$sync_file_range"
1300 ##########################################
1301 # ext4 move extent probe
1302 if test "$ext4_me" != "yes" ; then
1307 #include <sys/ioctl.h>
1308 int main(int argc, char **argv)
1310 struct move_extent me;
1311 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1314 if compile_prog "" "" "ext4 move extent" ; then
1316 elif test $targetos = "Linux" ; then
1317 # On Linux, just default to it on and let it error at runtime if we really
1318 # don't have it. None of my updated systems have it defined, but it does
1319 # work. Takes a while to bubble back.
1322 print_config "EXT4 move extent" "$ext4_me"
1324 ##########################################
1326 if test "$linux_splice" != "yes" ; then
1332 int main(int argc, char **argv)
1334 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1337 if compile_prog "" "" "linux splice"; then
1340 print_config "Linux splice(2)" "$linux_splice"
1342 ##########################################
1344 if test "$libnuma" != "yes" ; then
1349 int main(int argc, char **argv)
1351 return numa_available();
1354 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1358 print_config "libnuma" "$libnuma"
1360 ##########################################
1361 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1362 if test "$libnuma" = "yes" ; then
1366 int main(int argc, char **argv)
1368 struct bitmask *mask = numa_parse_nodestring(NULL);
1369 return mask->size == 0;
1372 if compile_prog "" "" "libnuma api"; then
1375 print_config "libnuma v2" "$libnuma_v2"
1378 ##########################################
1380 if test "$strsep" != "yes" ; then
1385 int main(int argc, char **argv)
1387 static char *string = "This is a string";
1388 strsep(&string, "needle");
1392 if compile_prog "" "" "strsep"; then
1395 print_config "strsep" "$strsep"
1397 ##########################################
1398 # strcasestr() probe
1399 if test "$strcasestr" != "yes" ; then
1404 int main(int argc, char **argv)
1406 return strcasestr(argv[0], argv[1]) != NULL;
1409 if compile_prog "" "" "strcasestr"; then
1412 print_config "strcasestr" "$strcasestr"
1414 ##########################################
1416 if test "$strlcat" != "yes" ; then
1421 int main(int argc, char **argv)
1423 static char dst[64];
1424 static char *string = "This is a string";
1425 memset(dst, 0, sizeof(dst));
1426 strlcat(dst, string, sizeof(dst));
1430 if compile_prog "" "" "strlcat"; then
1433 print_config "strlcat" "$strlcat"
1435 ##########################################
1436 # getopt_long_only() probe
1437 if test "$getopt_long_only" != "yes" ; then
1438 getopt_long_only="no"
1444 int main(int argc, char **argv)
1446 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1450 if compile_prog "" "" "getopt_long_only"; then
1451 getopt_long_only="yes"
1453 print_config "getopt_long_only()" "$getopt_long_only"
1455 ##########################################
1457 if test "$inet_aton" != "yes" ; then
1462 #include <winsock2.h>
1464 #include <sys/socket.h>
1465 #include <arpa/inet.h>
1468 int main(int argc, char **argv)
1471 return inet_aton(NULL, &in);
1474 if compile_prog "" "" "inet_aton"; then
1477 print_config "inet_aton" "$inet_aton"
1479 ##########################################
1481 if test "$socklen_t" != "yes" ; then
1486 #include <winsock2.h>
1487 #include <ws2tcpip.h>
1489 #include <sys/socket.h>
1491 int main(int argc, char **argv)
1497 if compile_prog "" "" "socklen_t"; then
1500 print_config "socklen_t" "$socklen_t"
1502 ##########################################
1503 # Whether or not __thread is supported for TLS
1504 if test "$tls_thread" != "yes" ; then
1509 static __thread int ret;
1510 int main(int argc, char **argv)
1515 if compile_prog "" "" "__thread"; then
1518 print_config "__thread" "$tls_thread"
1520 ##########################################
1521 # Check if we have required gtk/glib support for gfio
1522 if test "$gfio" != "yes" ; then
1525 if test "$gfio_check" = "yes" ; then
1529 #include <gtk/gtk.h>
1532 gdk_threads_enter();
1533 gdk_threads_leave();
1535 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1538 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1539 ORG_LDFLAGS=$LDFLAGS
1540 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1541 if test "$?" != "0" ; then
1542 echo "configure: gtk and gthread not found"
1545 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1546 if test "$?" != "0" ; then
1547 echo "configure: gtk and gthread not found"
1551 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1552 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1553 GFIO_LIBS="$LIBS $GTK_LIBS"
1554 CFLAGS="$CFLAGS $GTK_CFLAGS"
1556 echo "Please install gtk and gdk libraries"
1562 LDFLAGS=$ORG_LDFLAGS
1565 if test "$gfio_check" = "yes" ; then
1566 print_config "gtk 2.18 or higher" "$gfio"
1569 ##########################################
1570 # Check whether we have getrusage(RUSAGE_THREAD)
1571 if test "$rusage_thread" != "yes" ; then
1575 #include <sys/time.h>
1576 #include <sys/resource.h>
1577 int main(int argc, char **argv)
1580 getrusage(RUSAGE_THREAD, &ru);
1584 if compile_prog "" "" "RUSAGE_THREAD"; then
1587 print_config "RUSAGE_THREAD" "$rusage_thread"
1589 ##########################################
1590 # Check whether we have SCHED_IDLE
1591 if test "$sched_idle" != "yes" ; then
1596 int main(int argc, char **argv)
1598 struct sched_param p;
1599 return sched_setscheduler(0, SCHED_IDLE, &p);
1602 if compile_prog "" "" "SCHED_IDLE"; then
1605 print_config "SCHED_IDLE" "$sched_idle"
1607 ##########################################
1608 # Check whether we have TCP_NODELAY
1609 if test "$tcp_nodelay" != "yes" ; then
1614 #include <winsock2.h>
1617 #include <sys/types.h>
1618 #include <sys/socket.h>
1619 #include <netinet/tcp.h>
1621 int main(int argc, char **argv)
1623 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1626 if compile_prog "" "" "TCP_NODELAY"; then
1628 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1630 LIBS="$LIBS -lws2_32"
1632 print_config "TCP_NODELAY" "$tcp_nodelay"
1634 ##########################################
1635 # Check whether we have SO_SNDBUF
1636 if test "$window_size" != "yes" ; then
1641 #include <winsock2.h>
1644 #include <sys/types.h>
1645 #include <sys/socket.h>
1646 #include <netinet/tcp.h>
1648 int main(int argc, char **argv)
1650 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1651 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1654 if compile_prog "" "" "SO_SNDBUF"; then
1656 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1658 LIBS="$LIBS -lws2_32"
1660 print_config "Net engine window_size" "$window_size"
1662 ##########################################
1663 # Check whether we have TCP_MAXSEG
1664 if test "$mss" != "yes" ; then
1669 #include <winsock2.h>
1672 #include <sys/types.h>
1673 #include <sys/socket.h>
1674 #include <netinet/tcp.h>
1675 #include <arpa/inet.h>
1676 #include <netinet/in.h>
1678 int main(int argc, char **argv)
1680 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1683 if compile_prog "" "" "TCP_MAXSEG"; then
1685 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1687 LIBS="$LIBS -lws2_32"
1689 print_config "TCP_MAXSEG" "$mss"
1691 ##########################################
1692 # Check whether we have RLIMIT_MEMLOCK
1693 if test "$rlimit_memlock" != "yes" ; then
1697 #include <sys/time.h>
1698 #include <sys/resource.h>
1699 int main(int argc, char **argv)
1702 return getrlimit(RLIMIT_MEMLOCK, &rl);
1705 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1706 rlimit_memlock="yes"
1708 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1710 ##########################################
1711 # Check whether we have pwritev/preadv
1712 if test "$pwritev" != "yes" ; then
1717 #include <sys/uio.h>
1718 int main(int argc, char **argv)
1720 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1723 if compile_prog "" "" "pwritev"; then
1726 print_config "pwritev/preadv" "$pwritev"
1728 ##########################################
1729 # Check whether we have pwritev2/preadv2
1730 if test "$pwritev2" != "yes" ; then
1735 #include <sys/uio.h>
1736 int main(int argc, char **argv)
1738 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1741 if compile_prog "" "" "pwritev2"; then
1744 print_config "pwritev2/preadv2" "$pwritev2"
1746 ##########################################
1747 # Check whether we have the required functions for ipv6
1748 if test "$ipv6" != "yes" ; then
1753 #include <winsock2.h>
1754 #include <ws2tcpip.h>
1756 #include <sys/types.h>
1757 #include <sys/socket.h>
1758 #include <netinet/in.h>
1762 int main(int argc, char **argv)
1764 struct addrinfo hints;
1765 struct in6_addr addr;
1768 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1770 printf("%s\n", gai_strerror(ret));
1775 if compile_prog "" "" "ipv6"; then
1778 print_config "IPv6 helpers" "$ipv6"
1780 ##########################################
1782 if test "$http" != "yes" ; then
1785 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1787 #include <curl/curl.h>
1788 #include <openssl/hmac.h>
1790 int main(int argc, char **argv)
1795 curl = curl_easy_init();
1796 curl_easy_cleanup(curl);
1798 ctx = HMAC_CTX_new();
1799 HMAC_CTX_reset(ctx);
1804 # openssl < 1.1.0 uses the HMAC_CTX type directly
1806 #include <curl/curl.h>
1807 #include <openssl/hmac.h>
1809 int main(int argc, char **argv)
1814 curl = curl_easy_init();
1815 curl_easy_cleanup(curl);
1817 HMAC_CTX_init(&ctx);
1818 HMAC_CTX_cleanup(&ctx);
1822 if test "$disable_http" != "yes"; then
1823 HTTP_LIBS="-lcurl -lssl -lcrypto"
1824 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1825 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1827 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1831 print_config "http engine" "$http"
1833 ##########################################
1835 if test "$rados" != "yes" ; then
1839 #include <rados/librados.h>
1841 int main(int argc, char **argv)
1844 rados_ioctx_t io_ctx;
1845 const char cluster_name[] = "ceph";
1846 const char user_name[] = "client.admin";
1847 const char pool[] = "rados";
1849 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1850 rados_create2(&cluster, cluster_name, user_name, 0);
1851 rados_ioctx_create(cluster, pool, &io_ctx);
1856 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1859 print_config "Rados engine" "$rados"
1861 ##########################################
1863 if test "$rbd" != "yes" ; then
1867 #include <rbd/librbd.h>
1869 int main(int argc, char **argv)
1872 rados_ioctx_t io_ctx;
1873 const char cluster_name[] = "ceph";
1874 const char user_name[] = "client.admin";
1875 const char pool[] = "rbd";
1876 int major, minor, extra;
1878 rbd_version(&major, &minor, &extra);
1879 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1880 rados_create2(&cluster, cluster_name, user_name, 0);
1881 rados_ioctx_create(cluster, pool, &io_ctx);
1886 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1889 print_config "Rados Block Device engine" "$rbd"
1891 ##########################################
1892 # check for rbd_poll
1893 if test "$rbd_poll" != "yes" ; then
1896 if test "$rbd" = "yes"; then
1898 #include <rbd/librbd.h>
1899 #include <sys/eventfd.h>
1901 int main(int argc, char **argv)
1904 rbd_completion_t comp;
1906 int fd = eventfd(0, EFD_NONBLOCK);
1907 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1908 rbd_poll_io_events(image, comp, 1);
1913 if compile_prog "" "-lrbd -lrados" "rbd"; then
1916 print_config "rbd_poll" "$rbd_poll"
1919 ##########################################
1920 # check for rbd_invalidate_cache()
1921 if test "$rbd_inval" != "yes" ; then
1924 if test "$rbd" = "yes"; then
1926 #include <rbd/librbd.h>
1928 int main(int argc, char **argv)
1932 return rbd_invalidate_cache(image);
1935 if compile_prog "" "-lrbd -lrados" "rbd"; then
1938 print_config "rbd_invalidate_cache" "$rbd_inval"
1941 ##########################################
1942 # Check whether we have setvbuf
1943 if test "$setvbuf" != "yes" ; then
1948 int main(int argc, char **argv)
1952 setvbuf(f, buf, _IOFBF, sizeof(buf));
1956 if compile_prog "" "" "setvbuf"; then
1959 print_config "setvbuf" "$setvbuf"
1961 ##########################################
1963 if test "$gfapi" != "yes" ; then
1967 #include <glusterfs/api/glfs.h>
1969 int main(int argc, char **argv)
1971 glfs_t *g = glfs_new("foo");
1976 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1979 print_config "Gluster API engine" "$gfapi"
1981 ##########################################
1982 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1983 if test "$gfapi" = "yes" ; then
1986 #include <glusterfs/api/glfs.h>
1988 int main(int argc, char **argv)
1991 int ret = glfs_fadvise(fd, 0, 0, 1);
1996 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1999 print_config "Gluster API use fadvise" "$gf_fadvise"
2002 ##########################################
2003 # check for newer gfapi
2004 if test "$gfapi" = "yes" ; then
2007 #include <glusterfs/api/glfs.h>
2009 int main(int argc, char **argv)
2011 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2014 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2017 print_config "Gluster new API" "$gf_new"
2020 ##########################################
2021 # check for gfapi trim support
2022 if test "$gf_trim" != "yes" ; then
2025 if test "$gfapi" = "yes" ; then
2027 #include <glusterfs/api/glfs.h>
2029 int main(int argc, char **argv)
2031 return glfs_discard_async(NULL, 0, 0);
2034 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2037 print_config "Gluster API trim support" "$gf_trim"
2040 ##########################################
2041 # Check if we support stckf on s390
2042 if test "$s390_z196_facilities" != "yes" ; then
2043 s390_z196_facilities="no"
2046 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2047 int main(int argc, char **argv)
2049 /* We want just 1 double word to be returned. */
2050 register unsigned long reg0 asm("0") = 0;
2051 unsigned long stfle_bits;
2052 asm volatile(".machine push" "\n\t"
2053 ".machine \"z9-109\"" "\n\t"
2056 : "=QS" (stfle_bits), "+d" (reg0)
2059 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2065 if compile_prog "" "" "s390_z196_facilities"; then
2067 if [ $? -eq 0 ]; then
2068 s390_z196_facilities="yes"
2071 print_config "s390_z196_facilities" "$s390_z196_facilities"
2073 ##########################################
2074 # Check if we have required environment variables configured for libhdfs
2075 if test "$libhdfs" = "yes" ; then
2077 if test "$JAVA_HOME" = "" ; then
2078 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2081 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2082 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
2085 if test "$FIO_LIBHDFS_LIB" = "" ; then
2086 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2089 if test "$hdfs_conf_error" = "1" ; then
2090 feature_not_found "libhdfs" ""
2093 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2094 FIO_HDFS_CPU="amd64"
2097 print_config "HDFS engine" "$libhdfs"
2099 ##########################################
2100 # Check whether we have MTD
2101 if test "$mtd" != "yes" ; then
2106 #include <mtd/mtd-user.h>
2107 #include <sys/ioctl.h>
2108 int main(int argc, char **argv)
2110 struct mtd_write_req ops;
2111 struct mtd_info_user info;
2112 memset(&ops, 0, sizeof(ops));
2113 info.type = MTD_MLCNANDFLASH;
2114 return ioctl(0, MEMGETINFO, &info);
2117 if compile_prog "" "" "mtd"; then
2120 print_config "MTD" "$mtd"
2122 ##########################################
2123 # Check whether we have libpmem
2124 if test "$libpmem" != "yes" ; then
2128 #include <libpmem.h>
2130 int main(int argc, char **argv)
2133 rc = pmem_is_pmem(NULL, 0);
2137 if compile_prog "" "-lpmem" "libpmem"; then
2140 print_config "libpmem" "$libpmem"
2142 ##########################################
2143 # Check whether libpmem's version >= 1.5
2144 if test "$libpmem1_5" != "yes" ; then
2147 if test "$libpmem" = "yes"; then
2149 #include <libpmem.h>
2151 int main(int argc, char **argv)
2153 pmem_memcpy(NULL, NULL, NULL, NULL);
2157 if compile_prog "" "-lpmem" "libpmem1_5"; then
2161 print_config "libpmem1_5" "$libpmem1_5"
2163 ##########################################
2164 # Check whether we have libpmemblk
2165 # libpmem is a prerequisite
2166 if test "$libpmemblk" != "yes" ; then
2169 if test "$libpmem" = "yes"; then
2171 #include <libpmemblk.h>
2172 int main(int argc, char **argv)
2175 pbp = pmemblk_open("", 0);
2179 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2183 print_config "libpmemblk" "$libpmemblk"
2185 # Choose libpmem-based ioengines
2186 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2188 if test "$libpmem1_5" = "yes"; then
2191 if test "$libpmemblk" = "yes"; then
2196 ##########################################
2197 # Report whether pmemblk engine is enabled
2198 print_config "PMDK pmemblk engine" "$pmemblk"
2200 ##########################################
2201 # Report whether dev-dax engine is enabled
2202 print_config "PMDK dev-dax engine" "$devdax"
2204 ##########################################
2205 # Report whether libpmem engine is enabled
2206 print_config "PMDK libpmem engine" "$pmem"
2208 ##########################################
2209 # Check whether we support DDN's IME
2210 if test "$libime" != "yes" ; then
2214 #include <ime_native.h>
2215 int main(int argc, char **argv)
2219 rc = ime_native_finalize();
2223 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2225 CFLAGS="-I${ime_path}/include $CFLAGS"
2226 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2227 LIBS="-lim_client $LIBS"
2229 print_config "DDN's Infinite Memory Engine" "$libime"
2231 ##########################################
2232 # Check if we have libiscsi
2233 if test "$libiscsi" != "no" ; then
2234 if check_min_lib_version libiscsi 1.9.0; then
2236 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2237 libiscsi_libs=$(pkg-config --libs libiscsi)
2242 print_config "iscsi engine" "$libiscsi"
2244 ##########################################
2245 # Check if we have libnbd (for NBD support)
2246 if test "$libnbd" != "no" ; then
2247 if check_min_lib_version libnbd 0.9.8; then
2249 libnbd_cflags=$(pkg-config --cflags libnbd)
2250 libnbd_libs=$(pkg-config --libs libnbd)
2255 print_config "NBD engine" "$libnbd"
2257 ##########################################
2258 # check for dfs (DAOS File System)
2259 if test "$dfs" != "no" ; then
2263 #include <daos_fs.h>
2265 int main(int argc, char **argv)
2271 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2276 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2282 print_config "DAOS File System (dfs) Engine" "$dfs"
2284 ##########################################
2285 # Check if we have libnfs (for userspace nfs support).
2286 if test "$disable_nfs" != "yes"; then
2287 if $(pkg-config libnfs > /dev/null 2>&1); then
2289 libnfs_cflags=$(pkg-config --cflags libnfs)
2290 libnfs_libs=$(pkg-config --libs libnfs)
2292 if test "$libnfs" = "yes" ; then
2293 echo "libnfs" "Install libnfs"
2297 print_config "NFS engine" "$libnfs"
2299 ##########################################
2300 # Check if we have lex/yacc available
2305 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2306 if test "$targetos" != "SunOS" ; then
2316 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2320 if test "$arith" = "yes" ; then
2322 extern int yywrap(void);
2324 int main(int argc, char **argv)
2330 if compile_prog "" "-lfl" "flex"; then
2332 elif compile_prog "" "-ll" "lex"; then
2341 # Check if lex fails using -o
2342 if test "$arith" = "yes" ; then
2343 if test "$force_no_lex_o" = "yes" ; then
2346 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2354 print_config "lex/yacc for arithmetic" "$arith"
2356 ##########################################
2357 # Check whether we have setmntent/getmntent
2358 if test "$getmntent" != "yes" ; then
2364 int main(int argc, char **argv)
2366 FILE *mtab = setmntent(NULL, "r");
2367 struct mntent *mnt = getmntent(mtab);
2372 if compile_prog "" "" "getmntent"; then
2375 print_config "getmntent" "$getmntent"
2377 ##########################################
2378 # Check whether we have getmntinfo
2379 # These are originally added for BSDs, but may also work
2380 # on other operating systems with getmntinfo(3).
2382 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2383 # Note that NetBSD needs -Werror to catch warning as error.
2384 if test "$getmntinfo" != "yes" ; then
2389 #include <sys/param.h>
2390 #include <sys/mount.h>
2391 int main(int argc, char **argv)
2394 return getmntinfo(&st, MNT_NOWAIT);
2397 if compile_prog "-Werror" "" "getmntinfo"; then
2400 print_config "getmntinfo" "$getmntinfo"
2402 # getmntinfo(3) for NetBSD.
2403 if test "$getmntinfo_statvfs" != "yes" ; then
2404 getmntinfo_statvfs="no"
2408 #include <sys/statvfs.h>
2409 int main(int argc, char **argv)
2412 return getmntinfo(&st, MNT_NOWAIT);
2415 # Skip the test if the one with statfs arg is detected.
2416 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2417 getmntinfo_statvfs="yes"
2418 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2421 ##########################################
2422 # Check whether we have _Static_assert
2423 if test "$static_assert" != "yes" ; then
2435 int main(int argc, char **argv)
2437 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2441 if compile_prog "" "" "static_assert"; then
2444 print_config "Static Assert" "$static_assert"
2446 ##########################################
2447 # Check whether we have bool / stdbool.h
2448 if test "$have_bool" != "yes" ; then
2452 #include <stdbool.h>
2453 int main(int argc, char **argv)
2456 return var != false;
2459 if compile_prog "" "" "bool"; then
2462 print_config "bool" "$have_bool"
2464 ##########################################
2465 # Check whether we have strndup()
2470 int main(int argc, char **argv)
2472 char *res = strndup("test string", 8);
2478 if compile_prog "" "" "strndup"; then
2481 print_config "strndup" "$strndup"
2483 ##########################################
2484 # <valgrind/drd.h> probe
2485 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2486 # also available but not the other way around.
2487 if test "$valgrind_dev" != "yes" ; then
2491 #include <valgrind/drd.h>
2492 int main(int argc, char **argv)
2497 if compile_prog "" "" "valgrind_dev"; then
2500 print_config "Valgrind headers" "$valgrind_dev"
2502 if test "$targetos" = "Linux" ; then
2503 ##########################################
2504 # <linux/blkzoned.h> probe
2505 if test "$linux_blkzoned" != "yes" ; then
2509 #include <linux/blkzoned.h>
2510 int main(int argc, char **argv)
2515 if compile_prog "" "" "linux_blkzoned"; then
2516 linux_blkzoned="yes"
2518 print_config "Zoned block device support" "$linux_blkzoned"
2520 ##########################################
2521 # Check BLK_ZONE_REP_CAPACITY
2523 #include <linux/blkzoned.h>
2526 return BLK_ZONE_REP_CAPACITY;
2529 if compile_prog "" "" "blkzoned report capacity"; then
2530 output_sym "CONFIG_HAVE_REP_CAPACITY"
2535 print_config "Zoned block device capacity" "$rep_capacity"
2538 ##########################################
2541 #include <libzbc/zbc.h>
2542 int main(int argc, char **argv)
2544 struct zbc_device *dev = NULL;
2546 return zbc_open("foo=bar", O_RDONLY, &dev);
2549 if test "$libzbc" != "no" ; then
2550 if compile_prog "" "-lzbc" "libzbc"; then
2552 if ! check_min_lib_version libzbc 5; then
2556 if test "$libzbc" = "yes" ; then
2557 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2562 print_config "libzbc engine" "$libzbc"
2564 ##########################################
2565 # check march=armv8-a+crc+crypto
2566 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2567 march_armv8_a_crc_crypto="no"
2569 if test "$cpu" = "arm64" ; then
2571 #include <arm_acle.h>
2572 #include <arm_neon.h>
2573 #include <sys/auxv.h>
2577 /* Can we also do a runtime probe? */
2579 return getauxval(AT_HWCAP);
2581 # error "Don't know how to do runtime probe for ARM CRC32c"
2585 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2586 march_armv8_a_crc_crypto="yes"
2587 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2591 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2593 ##########################################
2595 if test "$cuda" != "no" ; then
2598 int main(int argc, char **argv)
2603 if compile_prog "" "-lcuda" "cuda"; then
2607 if test "$cuda" = "yes" ; then
2608 feature_not_found "cuda" ""
2613 print_config "cuda" "$cuda"
2615 ##########################################
2617 if test "$libcufile" != "no" ; then
2621 int main(int argc, char* argv[]) {
2626 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2628 LIBS="-lcuda -lcudart -lcufile $LIBS"
2630 if test "$libcufile" = "yes" ; then
2631 feature_not_found "libcufile" ""
2636 print_config "libcufile" "$libcufile"
2638 ##########################################
2639 # check for cc -march=native
2642 int main(int argc, char **argv)
2647 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2648 compile_prog "-march=native" "" "march=native"; then
2651 print_config "Build march=native" "$build_native"
2653 ##########################################
2655 if test "$cunit" != "yes" ; then
2659 #include <CUnit/CUnit.h>
2660 #include <CUnit/Basic.h>
2663 if (CU_initialize_registry() != CUE_SUCCESS)
2664 return CU_get_error();
2665 CU_basic_set_mode(CU_BRM_VERBOSE);
2666 CU_basic_run_tests();
2667 CU_cleanup_registry();
2668 return CU_get_error();
2671 if compile_prog "" "-lcunit" "CUnit"; then
2674 print_config "CUnit" "$cunit"
2676 ##########################################
2677 # check for __kernel_rwf_t
2680 #include <linux/fs.h>
2681 int main(int argc, char **argv)
2688 if compile_prog "" "" "__kernel_rwf_t"; then
2689 __kernel_rwf_t="yes"
2691 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2693 ##########################################
2694 # check if gcc has -Wimplicit-fallthrough=2
2697 int main(int argc, char **argv)
2702 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2705 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2707 ##########################################
2708 # check for MADV_HUGEPAGE support
2709 if test "$thp" != "yes" ; then
2712 if test "$esx" != "yes" ; then
2714 #include <sys/mman.h>
2717 return madvise(0, 0x1000, MADV_HUGEPAGE);
2720 if compile_prog "" "" "thp" ; then
2723 if test "$thp" = "yes" ; then
2724 feature_not_found "Transparent Huge Page" ""
2729 print_config "MADV_HUGEPAGE" "$thp"
2731 ##########################################
2732 # check for gettid()
2736 int main(int argc, char **argv)
2741 if compile_prog "" "" "gettid"; then
2744 print_config "gettid" "$gettid"
2746 ##########################################
2747 # check for statx(2) support by libc
2751 #include <sys/stat.h>
2753 int main(int argc, char **argv)
2756 return statx(-1, *argv, 0, 0, &st);
2759 if compile_prog "" "" "statx"; then
2762 print_config "statx(2)/libc" "$statx"
2764 ##########################################
2765 # check for statx(2) support by kernel
2769 #include <linux/stat.h>
2770 #include <sys/stat.h>
2771 #include <sys/syscall.h>
2773 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2774 struct statx *buffer)
2776 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2779 int main(int argc, char **argv)
2782 return _statx(-1, *argv, 0, 0, &st);
2785 if compile_prog "" "" "statx_syscall"; then
2788 print_config "statx(2)/syscall" "$statx_syscall"
2790 ##########################################
2791 # check for Windows PDB generation support
2792 if test "pdb" != "no" ; then
2799 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2802 if test "$pdb" = "yes"; then
2803 feature_not_found "PDB" "clang and lld"
2810 print_config "Windows PDB generation" "$pdb"
2812 ##########################################
2813 # check for timerfd support
2815 if test "$esx" != "yes" ; then
2817 #include <sys/time.h>
2818 #include <sys/timerfd.h>
2820 int main(int argc, char **argv)
2822 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2825 if compile_prog "" "" "timerfd_create"; then
2826 timerfd_create="yes"
2829 print_config "timerfd_create" "$timerfd_create"
2831 #############################################################################
2833 if test "$wordsize" = "64" ; then
2834 output_sym "CONFIG_64BIT"
2835 elif test "$wordsize" = "32" ; then
2836 output_sym "CONFIG_32BIT"
2838 fatal "Unknown wordsize!"
2840 if test "$bigendian" = "yes" ; then
2841 output_sym "CONFIG_BIG_ENDIAN"
2843 output_sym "CONFIG_LITTLE_ENDIAN"
2845 if test "$zlib" = "yes" ; then
2846 output_sym "CONFIG_ZLIB"
2848 if test "$libaio" = "yes" ; then
2849 output_sym "CONFIG_LIBAIO"
2850 if test "$libaio_rw_flags" = "yes" ; then
2851 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2854 if test "$posix_aio" = "yes" ; then
2855 output_sym "CONFIG_POSIXAIO"
2857 if test "$posix_aio_fsync" = "yes" ; then
2858 output_sym "CONFIG_POSIXAIO_FSYNC"
2860 if test "$posix_pshared" = "yes" ; then
2861 output_sym "CONFIG_PSHARED"
2863 if test "$pthread_condattr_setclock" = "yes" ; then
2864 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2866 if test "$pthread_sigmask" = "yes" ; then
2867 output_sym "CONFIG_PTHREAD_SIGMASK"
2869 if test "$pthread_getaffinity" = "yes" ; then
2870 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2872 if test "$have_asprintf" = "yes" ; then
2873 output_sym "CONFIG_HAVE_ASPRINTF"
2875 if test "$have_vasprintf" = "yes" ; then
2876 output_sym "CONFIG_HAVE_VASPRINTF"
2878 if test "$linux_fallocate" = "yes" ; then
2879 output_sym "CONFIG_LINUX_FALLOCATE"
2881 if test "$posix_fallocate" = "yes" ; then
2882 output_sym "CONFIG_POSIX_FALLOCATE"
2884 if test "$fdatasync" = "yes" ; then
2885 output_sym "CONFIG_FDATASYNC"
2887 if test "$pipe" = "yes" ; then
2888 output_sym "CONFIG_PIPE"
2890 if test "$pipe2" = "yes" ; then
2891 output_sym "CONFIG_PIPE2"
2893 if test "$pread" = "yes" ; then
2894 output_sym "CONFIG_PREAD"
2896 if test "$sync_file_range" = "yes" ; then
2897 output_sym "CONFIG_SYNC_FILE_RANGE"
2899 if test "$sfaa" = "yes" ; then
2900 output_sym "CONFIG_SFAA"
2902 if test "$sync_sync" = "yes" ; then
2903 output_sym "CONFIG_SYNC_SYNC"
2905 if test "$cmp_swap" = "yes" ; then
2906 output_sym "CONFIG_CMP_SWAP"
2908 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2909 output_sym "CONFIG_RDMA"
2911 # librpma is supported on the 'x86_64' architecture for now
2912 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2913 -a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
2914 output_sym "CONFIG_LIBRPMA_APM"
2916 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
2917 -a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
2918 output_sym "CONFIG_LIBRPMA_GPSPM"
2920 if test "$clock_gettime" = "yes" ; then
2921 output_sym "CONFIG_CLOCK_GETTIME"
2923 if test "$clock_monotonic" = "yes" ; then
2924 output_sym "CONFIG_CLOCK_MONOTONIC"
2926 if test "$clockid_t" = "yes"; then
2927 output_sym "CONFIG_CLOCKID_T"
2929 if test "$gettimeofday" = "yes" ; then
2930 output_sym "CONFIG_GETTIMEOFDAY"
2932 if test "$posix_fadvise" = "yes" ; then
2933 output_sym "CONFIG_POSIX_FADVISE"
2935 if test "$linux_3arg_affinity" = "yes" ; then
2936 output_sym "CONFIG_3ARG_AFFINITY"
2937 elif test "$linux_2arg_affinity" = "yes" ; then
2938 output_sym "CONFIG_2ARG_AFFINITY"
2940 if test "$strsep" = "yes" ; then
2941 output_sym "CONFIG_STRSEP"
2943 if test "$strcasestr" = "yes" ; then
2944 output_sym "CONFIG_STRCASESTR"
2946 if test "$strlcat" = "yes" ; then
2947 output_sym "CONFIG_STRLCAT"
2949 if test "$getopt_long_only" = "yes" ; then
2950 output_sym "CONFIG_GETOPT_LONG_ONLY"
2952 if test "$inet_aton" = "yes" ; then
2953 output_sym "CONFIG_INET_ATON"
2955 if test "$socklen_t" = "yes" ; then
2956 output_sym "CONFIG_SOCKLEN_T"
2958 if test "$ext4_me" = "yes" ; then
2959 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2961 if test "$linux_splice" = "yes" ; then
2962 output_sym "CONFIG_LINUX_SPLICE"
2964 if test "$libnuma_v2" = "yes" ; then
2965 output_sym "CONFIG_LIBNUMA"
2967 if test "$solaris_aio" = "yes" ; then
2968 output_sym "CONFIG_SOLARISAIO"
2970 if test "$tls_thread" = "yes" ; then
2971 output_sym "CONFIG_TLS_THREAD"
2973 if test "$rusage_thread" = "yes" ; then
2974 output_sym "CONFIG_RUSAGE_THREAD"
2976 if test "$gfio" = "yes" ; then
2977 output_sym "CONFIG_GFIO"
2979 if test "$esx" = "yes" ; then
2980 output_sym "CONFIG_ESX"
2981 output_sym "CONFIG_NO_SHM"
2983 if test "$sched_idle" = "yes" ; then
2984 output_sym "CONFIG_SCHED_IDLE"
2986 if test "$tcp_nodelay" = "yes" ; then
2987 output_sym "CONFIG_TCP_NODELAY"
2989 if test "$window_size" = "yes" ; then
2990 output_sym "CONFIG_NET_WINDOWSIZE"
2992 if test "$mss" = "yes" ; then
2993 output_sym "CONFIG_NET_MSS"
2995 if test "$rlimit_memlock" = "yes" ; then
2996 output_sym "CONFIG_RLIMIT_MEMLOCK"
2998 if test "$pwritev" = "yes" ; then
2999 output_sym "CONFIG_PWRITEV"
3001 if test "$pwritev2" = "yes" ; then
3002 output_sym "CONFIG_PWRITEV2"
3004 if test "$ipv6" = "yes" ; then
3005 output_sym "CONFIG_IPV6"
3007 if test "$http" = "yes" ; then
3008 output_sym "CONFIG_HTTP"
3010 if test "$rados" = "yes" ; then
3011 output_sym "CONFIG_RADOS"
3013 if test "$rbd" = "yes" ; then
3014 output_sym "CONFIG_RBD"
3016 if test "$rbd_poll" = "yes" ; then
3017 output_sym "CONFIG_RBD_POLL"
3019 if test "$rbd_inval" = "yes" ; then
3020 output_sym "CONFIG_RBD_INVAL"
3022 if test "$setvbuf" = "yes" ; then
3023 output_sym "CONFIG_SETVBUF"
3025 if test "$s390_z196_facilities" = "yes" ; then
3026 output_sym "CONFIG_S390_Z196_FACILITIES"
3027 CFLAGS="$CFLAGS -march=z9-109"
3030 if test "$gfapi" = "yes" ; then
3031 output_sym "CONFIG_GFAPI"
3033 if test "$gf_fadvise" = "yes" ; then
3034 output_sym "CONFIG_GF_FADVISE"
3036 if test "$gf_trim" = "yes" ; then
3037 output_sym "CONFIG_GF_TRIM"
3039 if test "$gf_new" = "yes" ; then
3040 output_sym "CONFIG_GF_NEW_API"
3042 if test "$libhdfs" = "yes" ; then
3043 output_sym "CONFIG_LIBHDFS"
3044 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3045 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3046 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3047 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3049 if test "$mtd" = "yes" ; then
3050 output_sym "CONFIG_MTD"
3052 if test "$pmemblk" = "yes" ; then
3053 output_sym "CONFIG_PMEMBLK"
3055 if test "$devdax" = "yes" ; then
3056 output_sym "CONFIG_LINUX_DEVDAX"
3058 if test "$pmem" = "yes" ; then
3059 output_sym "CONFIG_LIBPMEM"
3061 if test "$libime" = "yes" ; then
3062 output_sym "CONFIG_IME"
3064 if test "$arith" = "yes" ; then
3065 output_sym "CONFIG_ARITHMETIC"
3066 if test "$yacc_is_bison" = "yes" ; then
3067 echo "YACC=bison -y" >> $config_host_mak
3069 echo "YACC=yacc" >> $config_host_mak
3071 if test "$lex_use_o" = "yes" ; then
3072 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3075 if test "$getmntent" = "yes" ; then
3076 output_sym "CONFIG_GETMNTENT"
3078 if test "$getmntinfo" = "yes" ; then
3079 output_sym "CONFIG_GETMNTINFO"
3081 if test "$getmntinfo_statvfs" = "yes" ; then
3082 output_sym "CONFIG_GETMNTINFO_STATVFS"
3084 if test "$static_assert" = "yes" ; then
3085 output_sym "CONFIG_STATIC_ASSERT"
3087 if test "$have_bool" = "yes" ; then
3088 output_sym "CONFIG_HAVE_BOOL"
3090 if test "$strndup" = "yes" ; then
3091 output_sym "CONFIG_HAVE_STRNDUP"
3093 if test "$disable_opt" = "yes" ; then
3094 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3096 if test "$valgrind_dev" = "yes"; then
3097 output_sym "CONFIG_VALGRIND_DEV"
3099 if test "$linux_blkzoned" = "yes" ; then
3100 output_sym "CONFIG_HAS_BLKZONED"
3102 if test "$libzbc" = "yes" ; then
3103 output_sym "CONFIG_LIBZBC"
3105 if test "$zlib" = "no" ; then
3106 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
3107 if test "$build_static" = "yes"; then
3108 echo "Note that some distros have separate packages for static libraries."
3111 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3112 output_sym "ARCH_HAVE_CRC_CRYPTO"
3114 if test "$cuda" = "yes" ; then
3115 output_sym "CONFIG_CUDA"
3117 if test "$libcufile" = "yes" ; then
3118 output_sym "CONFIG_LIBCUFILE"
3120 if test "$dfs" = "yes" ; then
3121 output_sym "CONFIG_DFS"
3123 if test "$libnfs" = "yes" ; then
3124 output_sym "CONFIG_NFS"
3126 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3127 output_sym "CONFIG_BUILD_NATIVE"
3129 if test "$cunit" = "yes" ; then
3130 output_sym "CONFIG_HAVE_CUNIT"
3132 if test "$__kernel_rwf_t" = "yes"; then
3133 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3135 if test "$gettid" = "yes"; then
3136 output_sym "CONFIG_HAVE_GETTID"
3138 if test "$statx" = "yes"; then
3139 output_sym "CONFIG_HAVE_STATX"
3141 if test "$statx_syscall" = "yes"; then
3142 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3144 if test "$timerfd_create" = "yes"; then
3145 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3147 if test "$fallthrough" = "yes"; then
3148 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3150 if test "$thp" = "yes" ; then
3151 output_sym "CONFIG_HAVE_THP"
3153 if test "$libiscsi" = "yes" ; then
3154 output_sym "CONFIG_LIBISCSI"
3155 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3156 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3157 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3159 if test "$libnbd" = "yes" ; then
3160 output_sym "CONFIG_LIBNBD"
3161 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3162 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3163 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3165 if test "$libnfs" = "yes" ; then
3166 output_sym "CONFIG_LIBNFS"
3167 echo "CONFIG_LIBNFS=m" >> $config_host_mak
3168 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3169 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3171 if test "$dynamic_engines" = "yes" ; then
3172 output_sym "CONFIG_DYNAMIC_ENGINES"
3174 if test "$pdb" = yes; then
3175 output_sym "CONFIG_PDB"
3178 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3180 int main(int argc, char **argv)
3185 if test "$disable_tcmalloc" != "yes"; then
3186 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3188 LIBS="-ltcmalloc $LIBS"
3189 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3191 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3196 print_config "TCMalloc support" "$tcmalloc"
3198 echo "LIBS+=$LIBS" >> $config_host_mak
3199 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3200 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3201 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3202 echo "CC=$cc" >> $config_host_mak
3203 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3204 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3206 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3207 cat > Makefile <<EOF
3208 SRCDIR:=`dirname $0`
3209 include \$(SRCDIR)/Makefile