3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
20 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
21 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
22 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
26 config_host_mak="config-host.mak"
27 config_host_h="config-host.h"
29 rm -rf $config_host_mak
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
40 # Print result for each configuration test
42 printf "%-30s%s\n" "$1" "$2"
46 CFLAGS="-D_GNU_SOURCE -include config-host.h"
49 # Print a helpful header at the top of config.log
50 echo "# FIO configure log $(date)" >> config.log
51 printf "# Configured with:" >> config.log
52 printf " '%s'" "$0" "$@" >> config.log
54 echo "#" >> config.log
56 # Print configure header at the top of $config_host_h
57 echo "/*" > $config_host_h
58 echo " * Automatically generated by configure - do not modify" >> $config_host_h
59 printf " * Configured with:" >> $config_host_h
60 printf " * '%s'" "$0" "$@" >> $config_host_h
61 echo "" >> $config_host_h
62 echo " */" >> $config_host_h
65 # Run the compiler, capturing its output to the log.
66 echo $cc "$@" >> config.log
67 $cc "$@" >> config.log 2>&1 || return $?
68 # Test passed. If this is an --enable-werror build, rerun
69 # the test with -Werror and bail out if it fails. This
70 # makes warning-generating-errors in configure test code
71 # obvious to developers.
72 if test "$werror" != "yes"; then
75 # Don't bother rerunning the compile if we were already using -Werror
81 echo $cc -Werror "$@" >> config.log
82 $cc -Werror "$@" >> config.log 2>&1 && return $?
83 echo "ERROR: configure test passed without -Werror but failed with -Werror."
84 echo "This is probably a bug in the configure script. The failing command"
85 echo "will be at the bottom of config.log."
86 fatal "You can run configure with --disable-werror to bypass this check."
90 do_cc $CFLAGS -c -o $TMPO $TMPC
95 local_ldflags="$2 $LIBS"
96 echo "Compiling test case $3" >> config.log
97 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 feature_not_found() {
105 echo "ERROR: User requested feature $feature"
106 if test ! -z "$packages" ; then
107 echo "ERROR: That feature needs $packages installed"
109 echo "ERROR: configure was not able to find it"
114 type "$1" >/dev/null 2>&1
120 #error $1 not defined
131 echo "$1=y" >> $config_host_mak
132 echo "#define $1" >> $config_host_h
154 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
156 --prefix=*) prefix="$optarg"
158 --cpu=*) cpu="$optarg"
160 # esx is cross compiled and cannot be detect through simple uname calls
166 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
168 --build-32bit-win) build_32bit_win="yes"
170 --build-static) build_static="yes"
172 --enable-gfio) gfio_check="yes"
174 --disable-numa) disable_numa="yes"
176 --disable-rdma) disable_rdma="yes"
178 --disable-rados) disable_rados="yes"
180 --disable-rbd) disable_rbd="yes"
182 --disable-gfapi) disable_gfapi="yes"
184 --enable-libhdfs) libhdfs="yes"
186 --disable-lex) disable_lex="yes"
188 --enable-lex) disable_lex="no"
190 --disable-shm) no_shm="yes"
192 --disable-optimizations) disable_opt="yes"
194 --disable-pmem) disable_pmem="yes"
196 --enable-cuda) enable_cuda="yes"
198 --disable-native) disable_native="yes"
204 echo "Bad option $opt"
210 if test "$show_help" = "yes" ; then
211 echo "--prefix= Use this directory as installation prefix"
212 echo "--cpu= Specify target CPU if auto-detect fails"
213 echo "--cc= Specify compiler to use"
214 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
215 echo "--build-32bit-win Enable 32-bit build on Windows"
216 echo "--build-static Build a static fio"
217 echo "--esx Configure build options for esx"
218 echo "--enable-gfio Enable building of gtk gfio"
219 echo "--disable-numa Disable libnuma even if found"
220 echo "--disable-rdma Disable RDMA support even if found"
221 echo "--disable-gfapi Disable gfapi"
222 echo "--enable-libhdfs Enable hdfs support"
223 echo "--disable-lex Disable use of lex/yacc for math"
224 echo "--disable-pmem Disable pmem based engines even if found"
225 echo "--enable-lex Enable use of lex/yacc for math"
226 echo "--disable-shm Disable SHM support"
227 echo "--disable-optimizations Don't enable compiler optimizations"
228 echo "--enable-cuda Enable GPUDirect RDMA support"
229 echo "--disable-native Don't build for native host"
233 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
234 # Preferred compiler (can be overriden later after we know the platform):
236 # ${cross_prefix}gcc (if cross-prefix specified)
239 if test -z "${CC}${cross_prefix}"; then
246 cc="${CC-${cross_prefix}gcc}"
249 if check_define __ANDROID__ ; then
251 elif check_define __linux__ ; then
253 elif check_define __OpenBSD__ ; then
255 elif check_define __sun__ ; then
257 CFLAGS="$CFLAGS -D_REENTRANT"
258 elif check_define _WIN32 ; then
264 echo "# Automatically generated by configure - do not modify" > $config_host_mak
265 printf "# Configured with:" >> $config_host_mak
266 printf " '%s'" "$0" "$@" >> $config_host_mak
267 echo >> $config_host_mak
268 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
270 if test "$no_shm" = "yes" ; then
271 output_sym "CONFIG_NO_SHM"
274 if test "$disable_opt" = "yes" ; then
275 output_sym "CONFIG_FIO_NO_OPT"
278 # Some host OSes need non-standard checks for which CPU to use.
279 # Note that these checks are broken for cross-compilation: if you're
280 # cross-compiling to one of these OSes then you'll need to specify
281 # the correct CPU with the --cpu option.
284 # Unless explicitly enabled, turn off lex.
285 # OpenBSD will hit syntax error when enabled.
286 if test -z "$disable_lex" ; then
293 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
294 # we can run 64-bit userspace code.
295 # If the user didn't specify a CPU explicitly and the kernel says this is
296 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
298 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
301 # Error at compile time linking of weak/partial symbols if possible...
308 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
309 echo "Disabling weak symbols"
310 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
314 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
315 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
318 LIBS="-lnsl -lsocket"
321 # We still force some options, so keep this message here.
322 echo "Forcing some known good options on Windows"
323 if test -z "${CC}${cross_prefix}"; then
324 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
325 cc="i686-w64-mingw32-gcc"
327 cc="x86_64-w64-mingw32-gcc"
330 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
331 output_sym "CONFIG_32BIT"
333 output_sym "CONFIG_64BIT_LLP64"
335 # We need this to be output_sym'd here because this is Windows specific.
336 # The regular configure path never sets this config.
337 output_sym "CONFIG_WINDOWSAIO"
338 # We now take the regular configuration path without having exit 0 here.
339 # Flags below are still necessary mostly for MinGW.
346 clock_gettime="yes" # clock_monotonic probe has dependency on this
347 clock_monotonic="yes"
355 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
359 # Now we know the target platform we can have another guess at the preferred
360 # compiler when it wasn't explictly set
361 if test -z "${CC}${cross_prefix}"; then
362 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
368 if test -z "$cc"; then
369 echo "configure: failed to find compiler"
373 if test ! -z "$cpu" ; then
374 # command line argument
376 elif check_define __i386__ ; then
378 elif check_define __x86_64__ ; then
380 elif check_define __sparc__ ; then
381 if check_define __arch64__ ; then
386 elif check_define _ARCH_PPC ; then
387 if check_define _ARCH_PPC64 ; then
392 elif check_define __mips__ ; then
394 elif check_define __ia64__ ; then
396 elif check_define __s390__ ; then
397 if check_define __s390x__ ; then
402 elif check_define __arm__ ; then
404 elif check_define __aarch64__ ; then
406 elif check_define __hppa__ ; then
412 # Normalise host CPU name and set ARCH.
414 ia64|ppc|ppc64|s390|s390x|sparc64)
417 i386|i486|i586|i686|i86pc|BePC)
429 hppa|parisc|parisc64)
443 ##########################################
444 # check cross compile
446 if test "$cross_compile" != "yes" ; then
455 if compile_prog "" "" "cross"; then
456 $TMPE 2>/dev/null || cross_compile="yes"
458 fatal "compile test failed"
461 ##########################################
463 if test "$bigendian" != "yes" ; then
466 if test "$cross_compile" = "no" ; then
468 #include <inttypes.h>
471 volatile uint32_t i=0x01234567;
472 return (*((uint8_t*)(&i))) == 0x67;
475 if compile_prog "" "" "endian"; then
476 $TMPE && bigendian="yes"
479 # If we're cross compiling, try our best to work it out and rely on the
480 # run-time check to fail if we get it wrong.
485 #if __BYTE_ORDER != __BIG_ENDIAN
486 # error "Unknown endianness"
490 compile_prog "" "" "endian" && bigendian="yes"
491 check_define "__ARMEB__" && bigendian="yes"
492 check_define "__MIPSEB__" && bigendian="yes"
496 print_config "Operating system" "$targetos"
497 print_config "CPU" "$cpu"
498 print_config "Big endian" "$bigendian"
499 print_config "Compiler" "$cc"
500 print_config "Cross compile" "$cross_compile"
503 ##########################################
504 # See if we need to build a static build
505 if test "$build_static" = "yes" ; then
506 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
507 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
511 print_config "Static build" "$build_static"
513 ##########################################
518 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
521 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
525 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
527 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
530 fatal "Unknown wordsize"
532 print_config "Wordsize" "$wordsize"
534 ##########################################
536 if test "$zlib" != "yes" ; then
544 if (inflateInit(&stream) != Z_OK)
549 if compile_prog "" "-lz" "zlib" ; then
553 print_config "zlib" "$zlib"
555 ##########################################
557 if test "$libaio" != "yes" ; then
560 if test "$esx" != "yes" ; then
570 if compile_prog "" "-laio" "libaio" ; then
574 if test "$libaio" = "yes" ; then
575 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
580 print_config "Linux AIO support" "$libaio"
582 ##########################################
584 if test "$posix_aio" != "yes" ; then
587 if test "$posix_aio_lrt" != "yes" ; then
599 if compile_prog "" "" "posixaio" ; then
601 elif compile_prog "" "-lrt" "posixaio"; then
606 print_config "POSIX AIO support" "$posix_aio"
607 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
609 ##########################################
610 # posix aio fsync probe
611 if test "$posix_aio_fsync" != "yes" ; then
614 if test "$posix_aio" = "yes" ; then
621 return aio_fsync(O_SYNC, &cb);
625 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
629 print_config "POSIX AIO fsync" "$posix_aio_fsync"
631 ##########################################
632 # POSIX pshared attribute probe
633 if test "$posix_pshared" != "yes" ; then
640 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
641 # if defined(__CYGWIN__)
642 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
643 # elif defined(__APPLE__)
644 # include <AvailabilityMacros.h>
645 # include <TargetConditionals.h>
646 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
647 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
651 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
656 if compile_prog "" "$LIBS" "posix_pshared" ; then
659 print_config "POSIX pshared support" "$posix_pshared"
661 ##########################################
663 if test "$solaris_aio" != "yes" ; then
667 #include <sys/types.h>
668 #include <sys/asynch.h>
673 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
677 if compile_prog "" "-laio" "solarisaio" ; then
681 print_config "Solaris AIO support" "$solaris_aio"
683 ##########################################
684 # __sync_fetch_and_add test
685 if test "$sfaa" != "yes" ; then
689 #include <inttypes.h>
690 static int sfaa(uint64_t *ptr)
692 return __sync_fetch_and_add(ptr, 0);
695 int main(int argc, char **argv)
702 if compile_prog "" "" "__sync_fetch_and_add()" ; then
705 print_config "__sync_fetch_and_add" "$sfaa"
707 ##########################################
708 # __sync_synchronize() test
709 if test "$sync_sync" != "yes" ; then
713 #include <inttypes.h>
715 int main(int argc, char **argv)
717 __sync_synchronize();
721 if compile_prog "" "" "__sync_synchronize()" ; then
724 print_config "__sync_synchronize" "$sync_sync"
726 ##########################################
727 # __sync_val_compare_and_swap() test
728 if test "$cmp_swap" != "yes" ; then
732 #include <inttypes.h>
734 int main(int argc, char **argv)
737 return __sync_val_compare_and_swap(&x, 1, 2);
740 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
743 print_config "__sync_val_compare_and_swap" "$cmp_swap"
745 ##########################################
747 if test "$libverbs" != "yes" ; then
751 #include <infiniband/verbs.h>
752 int main(int argc, char **argv)
754 struct ibv_pd *pd = ibv_alloc_pd(NULL);
758 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
760 LIBS="-libverbs $LIBS"
762 print_config "libverbs" "$libverbs"
764 ##########################################
766 if test "$rdmacm" != "yes" ; then
771 #include <rdma/rdma_cma.h>
772 int main(int argc, char **argv)
774 rdma_destroy_qp(NULL);
778 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
780 LIBS="-lrdmacm $LIBS"
782 print_config "rdmacm" "$rdmacm"
784 ##########################################
785 # Linux fallocate probe
786 if test "$linux_fallocate" != "yes" ; then
792 #include <linux/falloc.h>
793 int main(int argc, char **argv)
795 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
799 if compile_prog "" "" "linux_fallocate"; then
800 linux_fallocate="yes"
802 print_config "Linux fallocate" "$linux_fallocate"
804 ##########################################
805 # POSIX fadvise probe
806 if test "$posix_fadvise" != "yes" ; then
812 int main(int argc, char **argv)
814 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
818 if compile_prog "" "" "posix_fadvise"; then
821 print_config "POSIX fadvise" "$posix_fadvise"
823 ##########################################
824 # POSIX fallocate probe
825 if test "$posix_fallocate" != "yes" ; then
831 int main(int argc, char **argv)
833 int r = posix_fallocate(0, 0, 1024);
837 if compile_prog "" "" "posix_fallocate"; then
838 posix_fallocate="yes"
840 print_config "POSIX fallocate" "$posix_fallocate"
842 ##########################################
843 # sched_set/getaffinity 2 or 3 argument test
844 if test "$linux_2arg_affinity" != "yes" ; then
845 linux_2arg_affinity="no"
847 if test "$linux_3arg_affinity" != "yes" ; then
848 linux_3arg_affinity="no"
852 int main(int argc, char **argv)
855 return sched_setaffinity(0, sizeof(mask), &mask);
858 if compile_prog "" "" "sched_setaffinity(,,)"; then
859 linux_3arg_affinity="yes"
863 int main(int argc, char **argv)
866 return sched_setaffinity(0, &mask);
869 if compile_prog "" "" "sched_setaffinity(,)"; then
870 linux_2arg_affinity="yes"
873 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
874 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
876 ##########################################
877 # clock_gettime probe
878 if test "$clock_gettime" != "yes" ; then
884 int main(int argc, char **argv)
886 return clock_gettime(0, NULL);
889 if compile_prog "" "" "clock_gettime"; then
891 elif compile_prog "" "-lrt" "clock_gettime"; then
895 print_config "clock_gettime" "$clock_gettime"
897 ##########################################
898 # CLOCK_MONOTONIC probe
899 if test "$clock_monotonic" != "yes" ; then
902 if test "$clock_gettime" = "yes" ; then
906 int main(int argc, char **argv)
908 return clock_gettime(CLOCK_MONOTONIC, NULL);
911 if compile_prog "" "$LIBS" "clock monotonic"; then
912 clock_monotonic="yes"
915 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
917 ##########################################
918 # CLOCK_MONOTONIC_RAW probe
919 if test "$clock_monotonic_raw" != "yes" ; then
920 clock_monotonic_raw="no"
922 if test "$clock_gettime" = "yes" ; then
926 int main(int argc, char **argv)
928 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
931 if compile_prog "" "$LIBS" "clock monotonic"; then
932 clock_monotonic_raw="yes"
935 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
937 ##########################################
938 # CLOCK_MONOTONIC_PRECISE probe
939 if test "$clock_monotonic_precise" != "yes" ; then
940 clock_monotonic_precise="no"
942 if test "$clock_gettime" = "yes" ; then
946 int main(int argc, char **argv)
948 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
951 if compile_prog "" "$LIBS" "clock monotonic precise"; then
952 clock_monotonic_precise="yes"
955 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
957 ##########################################
959 if test "$clockid_t" != "yes" ; then
965 int main(int argc, char **argv)
967 volatile clockid_t cid;
968 memset((void*)&cid, 0, sizeof(cid));
972 if compile_prog "" "$LIBS" "clockid_t"; then
975 print_config "clockid_t" "$clockid_t"
977 ##########################################
978 # gettimeofday() probe
979 if test "$gettimeofday" != "yes" ; then
983 #include <sys/time.h>
985 int main(int argc, char **argv)
988 return gettimeofday(&tv, NULL);
991 if compile_prog "" "" "gettimeofday"; then
994 print_config "gettimeofday" "$gettimeofday"
996 ##########################################
998 if test "$fdatasync" != "yes" ; then
1004 int main(int argc, char **argv)
1006 return fdatasync(0);
1009 if compile_prog "" "" "fdatasync"; then
1012 print_config "fdatasync" "$fdatasync"
1014 ##########################################
1015 # sync_file_range() probe
1016 if test "$sync_file_range" != "yes" ; then
1017 sync_file_range="no"
1023 #include <linux/fs.h>
1024 int main(int argc, char **argv)
1026 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1027 SYNC_FILE_RANGE_WAIT_AFTER;
1028 return sync_file_range(0, 0, 0, flags);
1031 if compile_prog "" "" "sync_file_range"; then
1032 sync_file_range="yes"
1034 print_config "sync_file_range" "$sync_file_range"
1036 ##########################################
1037 # ext4 move extent probe
1038 if test "$ext4_me" != "yes" ; then
1043 #include <sys/ioctl.h>
1044 int main(int argc, char **argv)
1046 struct move_extent me;
1047 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1050 if compile_prog "" "" "ext4 move extent" ; then
1052 elif test $targetos = "Linux" ; then
1053 # On Linux, just default to it on and let it error at runtime if we really
1054 # don't have it. None of my updated systems have it defined, but it does
1055 # work. Takes a while to bubble back.
1058 print_config "EXT4 move extent" "$ext4_me"
1060 ##########################################
1062 if test "$linux_splice" != "yes" ; then
1068 int main(int argc, char **argv)
1070 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1073 if compile_prog "" "" "linux splice"; then
1076 print_config "Linux splice(2)" "$linux_splice"
1078 ##########################################
1080 if test "$guasi" != "yes" ; then
1085 #include <guasi_syscalls.h>
1086 int main(int argc, char **argv)
1088 guasi_t ctx = guasi_create(0, 0, 0);
1092 if compile_prog "" "" "guasi"; then
1095 print_config "GUASI" "$guasi"
1097 ##########################################
1099 if test "$fusion_aw" != "yes" ; then
1103 #include <nvm/nvm_primitives.h>
1104 int main(int argc, char **argv)
1106 nvm_version_t ver_info;
1107 nvm_handle_t handle;
1109 handle = nvm_get_handle(0, &ver_info);
1110 return nvm_atomic_write(handle, 0, 0, 0);
1113 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1114 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1117 print_config "Fusion-io atomic engine" "$fusion_aw"
1119 ##########################################
1121 if test "$libnuma" != "yes" ; then
1126 int main(int argc, char **argv)
1128 return numa_available();
1131 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1135 print_config "libnuma" "$libnuma"
1137 ##########################################
1138 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1139 if test "$libnuma" = "yes" ; then
1143 int main(int argc, char **argv)
1145 struct bitmask *mask = numa_parse_nodestring(NULL);
1146 return mask->size == 0;
1149 if compile_prog "" "" "libnuma api"; then
1152 print_config "libnuma v2" "$libnuma_v2"
1155 ##########################################
1157 if test "$strsep" != "yes" ; then
1162 int main(int argc, char **argv)
1164 static char *string = "This is a string";
1165 strsep(&string, "needle");
1169 if compile_prog "" "" "strsep"; then
1172 print_config "strsep" "$strsep"
1174 ##########################################
1175 # strcasestr() probe
1176 if test "$strcasestr" != "yes" ; then
1181 int main(int argc, char **argv)
1183 return strcasestr(argv[0], argv[1]) != NULL;
1186 if compile_prog "" "" "strcasestr"; then
1189 print_config "strcasestr" "$strcasestr"
1191 ##########################################
1193 if test "$strlcat" != "yes" ; then
1198 int main(int argc, char **argv)
1200 static char dst[64];
1201 static char *string = "This is a string";
1202 memset(dst, 0, sizeof(dst));
1203 strlcat(dst, string, sizeof(dst));
1207 if compile_prog "" "" "strlcat"; then
1210 print_config "strlcat" "$strlcat"
1212 ##########################################
1213 # getopt_long_only() probe
1214 if test "$getopt_long_only" != "yes" ; then
1215 getopt_long_only="no"
1221 int main(int argc, char **argv)
1223 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1227 if compile_prog "" "" "getopt_long_only"; then
1228 getopt_long_only="yes"
1230 print_config "getopt_long_only()" "$getopt_long_only"
1232 ##########################################
1234 if test "$inet_aton" != "yes" ; then
1238 #include <sys/socket.h>
1239 #include <arpa/inet.h>
1241 int main(int argc, char **argv)
1244 return inet_aton(NULL, &in);
1247 if compile_prog "" "" "inet_aton"; then
1250 print_config "inet_aton" "$inet_aton"
1252 ##########################################
1254 if test "$socklen_t" != "yes" ; then
1258 #include <sys/socket.h>
1259 int main(int argc, char **argv)
1265 if compile_prog "" "" "socklen_t"; then
1268 print_config "socklen_t" "$socklen_t"
1270 ##########################################
1271 # Whether or not __thread is supported for TLS
1272 if test "$tls_thread" != "yes" ; then
1277 static __thread int ret;
1278 int main(int argc, char **argv)
1283 if compile_prog "" "" "__thread"; then
1286 print_config "__thread" "$tls_thread"
1288 ##########################################
1289 # Check if we have required gtk/glib support for gfio
1290 if test "$gfio" != "yes" ; then
1293 if test "$gfio_check" = "yes" ; then
1297 #include <gtk/gtk.h>
1300 gdk_threads_enter();
1301 gdk_threads_leave();
1303 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1306 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1307 ORG_LDFLAGS=$LDFLAGS
1308 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1309 if test "$?" != "0" ; then
1310 echo "configure: gtk and gthread not found"
1313 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1314 if test "$?" != "0" ; then
1315 echo "configure: gtk and gthread not found"
1318 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1320 if test "$?" = "0" ; then
1322 GFIO_LIBS="$LIBS $GTK_LIBS"
1323 CFLAGS="$CFLAGS $GTK_CFLAGS"
1325 echo "GTK found, but need version 2.18 or higher"
1329 echo "Please install gtk and gdk libraries"
1332 LDFLAGS=$ORG_LDFLAGS
1335 if test "$gfio_check" = "yes" ; then
1336 print_config "gtk 2.18 or higher" "$gfio"
1339 ##########################################
1340 # Check whether we have getrusage(RUSAGE_THREAD)
1341 if test "$rusage_thread" != "yes" ; then
1345 #include <sys/time.h>
1346 #include <sys/resource.h>
1347 int main(int argc, char **argv)
1350 getrusage(RUSAGE_THREAD, &ru);
1354 if compile_prog "" "" "RUSAGE_THREAD"; then
1357 print_config "RUSAGE_THREAD" "$rusage_thread"
1359 ##########################################
1360 # Check whether we have SCHED_IDLE
1361 if test "$sched_idle" != "yes" ; then
1366 int main(int argc, char **argv)
1368 struct sched_param p;
1369 return sched_setscheduler(0, SCHED_IDLE, &p);
1372 if compile_prog "" "" "SCHED_IDLE"; then
1375 print_config "SCHED_IDLE" "$sched_idle"
1377 ##########################################
1378 # Check whether we have TCP_NODELAY
1379 if test "$tcp_nodelay" != "yes" ; then
1384 #include <sys/types.h>
1385 #include <sys/socket.h>
1386 #include <netinet/tcp.h>
1387 int main(int argc, char **argv)
1389 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1392 if compile_prog "" "" "TCP_NODELAY"; then
1395 print_config "TCP_NODELAY" "$tcp_nodelay"
1397 ##########################################
1398 # Check whether we have SO_SNDBUF
1399 if test "$window_size" != "yes" ; then
1404 #include <sys/types.h>
1405 #include <sys/socket.h>
1406 #include <netinet/tcp.h>
1407 int main(int argc, char **argv)
1409 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1410 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1413 if compile_prog "" "" "SO_SNDBUF"; then
1416 print_config "Net engine window_size" "$window_size"
1418 ##########################################
1419 # Check whether we have TCP_MAXSEG
1420 if test "$mss" != "yes" ; then
1425 #include <sys/types.h>
1426 #include <sys/socket.h>
1427 #include <netinet/tcp.h>
1428 #include <arpa/inet.h>
1429 #include <netinet/in.h>
1430 int main(int argc, char **argv)
1432 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1435 if compile_prog "" "" "TCP_MAXSEG"; then
1438 print_config "TCP_MAXSEG" "$mss"
1440 ##########################################
1441 # Check whether we have RLIMIT_MEMLOCK
1442 if test "$rlimit_memlock" != "yes" ; then
1446 #include <sys/time.h>
1447 #include <sys/resource.h>
1448 int main(int argc, char **argv)
1451 return getrlimit(RLIMIT_MEMLOCK, &rl);
1454 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1455 rlimit_memlock="yes"
1457 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1459 ##########################################
1460 # Check whether we have pwritev/preadv
1461 if test "$pwritev" != "yes" ; then
1466 #include <sys/uio.h>
1467 int main(int argc, char **argv)
1469 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1472 if compile_prog "" "" "pwritev"; then
1475 print_config "pwritev/preadv" "$pwritev"
1477 ##########################################
1478 # Check whether we have pwritev2/preadv2
1479 if test "$pwritev2" != "yes" ; then
1484 #include <sys/uio.h>
1485 int main(int argc, char **argv)
1487 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1490 if compile_prog "" "" "pwritev2"; then
1493 print_config "pwritev2/preadv2" "$pwritev2"
1495 ##########################################
1496 # Check whether we have the required functions for ipv6
1497 if test "$ipv6" != "yes" ; then
1501 #include <sys/types.h>
1502 #include <sys/socket.h>
1503 #include <netinet/in.h>
1506 int main(int argc, char **argv)
1508 struct addrinfo hints;
1509 struct in6_addr addr;
1512 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1514 printf("%s\n", gai_strerror(ret));
1519 if compile_prog "" "" "ipv6"; then
1522 print_config "IPv6 helpers" "$ipv6"
1524 ##########################################
1526 if test "$rados" != "yes" ; then
1530 #include <rados/librados.h>
1532 int main(int argc, char **argv)
1535 rados_ioctx_t io_ctx;
1536 const char cluster_name[] = "ceph";
1537 const char user_name[] = "client.admin";
1538 const char pool[] = "rados";
1540 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1541 rados_create2(&cluster, cluster_name, user_name, 0);
1542 rados_ioctx_create(cluster, pool, &io_ctx);
1547 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1548 LIBS="-lrados $LIBS"
1551 print_config "Rados engine" "$rados"
1553 ##########################################
1555 if test "$rbd" != "yes" ; then
1559 #include <rbd/librbd.h>
1561 int main(int argc, char **argv)
1564 rados_ioctx_t io_ctx;
1565 const char cluster_name[] = "ceph";
1566 const char user_name[] = "client.admin";
1567 const char pool[] = "rbd";
1568 int major, minor, extra;
1570 rbd_version(&major, &minor, &extra);
1571 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1572 rados_create2(&cluster, cluster_name, user_name, 0);
1573 rados_ioctx_create(cluster, pool, &io_ctx);
1578 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1579 LIBS="-lrbd -lrados $LIBS"
1582 print_config "Rados Block Device engine" "$rbd"
1584 ##########################################
1585 # check for rbd_poll
1586 if test "$rbd_poll" != "yes" ; then
1589 if test "$rbd" = "yes"; then
1591 #include <rbd/librbd.h>
1592 #include <sys/eventfd.h>
1594 int main(int argc, char **argv)
1597 rbd_completion_t comp;
1599 int fd = eventfd(0, EFD_NONBLOCK);
1600 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1601 rbd_poll_io_events(image, comp, 1);
1606 if compile_prog "" "-lrbd -lrados" "rbd"; then
1609 print_config "rbd_poll" "$rbd_poll"
1612 ##########################################
1613 # check for rbd_invalidate_cache()
1614 if test "$rbd_inval" != "yes" ; then
1617 if test "$rbd" = "yes"; then
1619 #include <rbd/librbd.h>
1621 int main(int argc, char **argv)
1625 return rbd_invalidate_cache(image);
1628 if compile_prog "" "-lrbd -lrados" "rbd"; then
1631 print_config "rbd_invalidate_cache" "$rbd_inval"
1634 ##########################################
1635 # Check whether we have setvbuf
1636 if test "$setvbuf" != "yes" ; then
1641 int main(int argc, char **argv)
1645 setvbuf(f, buf, _IOFBF, sizeof(buf));
1649 if compile_prog "" "" "setvbuf"; then
1652 print_config "setvbuf" "$setvbuf"
1654 ##########################################
1656 if test "$gfapi" != "yes" ; then
1660 #include <glusterfs/api/glfs.h>
1662 int main(int argc, char **argv)
1664 glfs_t *g = glfs_new("foo");
1669 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1670 LIBS="-lgfapi -lglusterfs $LIBS"
1673 print_config "Gluster API engine" "$gfapi"
1675 ##########################################
1676 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1677 if test "$gfapi" = "yes" ; then
1680 #include <glusterfs/api/glfs.h>
1682 int main(int argc, char **argv)
1685 int ret = glfs_fadvise(fd, 0, 0, 1);
1690 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1693 print_config "Gluster API use fadvise" "$gf_fadvise"
1696 ##########################################
1697 # check for gfapi trim support
1698 if test "$gf_trim" != "yes" ; then
1701 if test "$gfapi" = "yes" ; then
1703 #include <glusterfs/api/glfs.h>
1705 int main(int argc, char **argv)
1707 return glfs_discard_async(NULL, 0, 0);
1710 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1713 print_config "Gluster API trim support" "$gf_trim"
1716 ##########################################
1717 # Check if we support stckf on s390
1718 if test "$s390_z196_facilities" != "yes" ; then
1719 s390_z196_facilities="no"
1722 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1723 int main(int argc, char **argv)
1725 /* We want just 1 double word to be returned. */
1726 register unsigned long reg0 asm("0") = 0;
1727 unsigned long stfle_bits;
1728 asm volatile(".machine push" "\n\t"
1729 ".machine \"z9-109\"" "\n\t"
1732 : "=QS" (stfle_bits), "+d" (reg0)
1735 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1741 if compile_prog "" "" "s390_z196_facilities"; then
1743 if [ $? -eq 0 ]; then
1744 s390_z196_facilities="yes"
1747 print_config "s390_z196_facilities" "$s390_z196_facilities"
1749 ##########################################
1750 # Check if we have required environment variables configured for libhdfs
1751 if test "$libhdfs" = "yes" ; then
1753 if test "$JAVA_HOME" = "" ; then
1754 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1757 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1758 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1761 if test "$FIO_LIBHDFS_LIB" = "" ; then
1762 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1765 if test "$hdfs_conf_error" = "1" ; then
1769 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1770 FIO_HDFS_CPU="amd64"
1773 print_config "HDFS engine" "$libhdfs"
1775 ##########################################
1776 # Check whether we have MTD
1777 if test "$mtd" != "yes" ; then
1782 #include <mtd/mtd-user.h>
1783 #include <sys/ioctl.h>
1784 int main(int argc, char **argv)
1786 struct mtd_write_req ops;
1787 struct mtd_info_user info;
1788 memset(&ops, 0, sizeof(ops));
1789 info.type = MTD_MLCNANDFLASH;
1790 return ioctl(0, MEMGETINFO, &info);
1793 if compile_prog "" "" "mtd"; then
1796 print_config "MTD" "$mtd"
1798 ##########################################
1799 # Check whether we have libpmem
1800 if test "$libpmem" != "yes" ; then
1804 #include <libpmem.h>
1805 int main(int argc, char **argv)
1808 rc = pmem_is_pmem(0, 0);
1812 if compile_prog "" "-lpmem" "libpmem"; then
1816 print_config "libpmem" "$libpmem"
1818 ##########################################
1819 # Check whether we have libpmemblk
1820 # libpmem is a prerequisite
1821 if test "$libpmemblk" != "yes" ; then
1824 if test "$libpmem" = "yes"; then
1826 #include <libpmemblk.h>
1827 int main(int argc, char **argv)
1830 pbp = pmemblk_open("", 0);
1834 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1836 LIBS="-lpmemblk $LIBS"
1839 print_config "libpmemblk" "$libpmemblk"
1841 # Choose the ioengines
1842 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1845 if test "$libpmemblk" = "yes"; then
1850 ##########################################
1851 # Report whether pmemblk engine is enabled
1852 print_config "NVML pmemblk engine" "$pmemblk"
1854 ##########################################
1855 # Report whether dev-dax engine is enabled
1856 print_config "NVML dev-dax engine" "$devdax"
1858 ##########################################
1859 # Report whether libpmem engine is enabled
1860 print_config "NVML libpmem engine" "$pmem"
1862 ##########################################
1863 # Check if we have lex/yacc available
1868 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1869 if test "$targetos" != "SunOS" ; then
1870 LEX=$(which lex 2> /dev/null)
1871 if test -x "$LEX" ; then
1874 YACC=$(which bison 2> /dev/null)
1875 if test -x "$YACC" ; then
1879 YACC=$(which yacc 2> /dev/null)
1880 if test -x "$YACC" ; then
1884 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1888 if test "$arith" = "yes" ; then
1890 extern int yywrap(void);
1892 int main(int argc, char **argv)
1898 if compile_prog "" "-ll" "lex"; then
1907 # Check if lex fails using -o
1908 if test "$arith" = "yes" ; then
1909 if test "$force_no_lex_o" = "yes" ; then
1912 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1913 if test "$?" = "0" ; then
1921 print_config "lex/yacc for arithmetic" "$arith"
1923 ##########################################
1924 # Check whether we have setmntent/getmntent
1925 if test "$getmntent" != "yes" ; then
1931 int main(int argc, char **argv)
1933 FILE *mtab = setmntent(NULL, "r");
1934 struct mntent *mnt = getmntent(mtab);
1939 if compile_prog "" "" "getmntent"; then
1942 print_config "getmntent" "$getmntent"
1944 ##########################################
1945 # Check whether we have getmntinfo
1946 # These are originally added for BSDs, but may also work
1947 # on other operating systems with getmntinfo(3).
1949 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1950 # Note that NetBSD needs -Werror to catch warning as error.
1951 if test "$getmntinfo" != "yes" ; then
1956 #include <sys/param.h>
1957 #include <sys/mount.h>
1958 int main(int argc, char **argv)
1961 return getmntinfo(&st, MNT_NOWAIT);
1964 if compile_prog "-Werror" "" "getmntinfo"; then
1967 print_config "getmntinfo" "$getmntinfo"
1969 # getmntinfo(3) for NetBSD.
1970 if test "$getmntinfo_statvfs" != "yes" ; then
1971 getmntinfo_statvfs="no"
1975 #include <sys/statvfs.h>
1976 int main(int argc, char **argv)
1979 return getmntinfo(&st, MNT_NOWAIT);
1982 # Skip the test if the one with statfs arg is detected.
1983 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1984 getmntinfo_statvfs="yes"
1985 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
1988 ##########################################
1989 # Check whether we have _Static_assert
1990 if test "$static_assert" != "yes" ; then
2002 int main(int argc, char **argv)
2004 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2008 if compile_prog "" "" "static_assert"; then
2011 print_config "Static Assert" "$static_assert"
2013 ##########################################
2014 # Check whether we have bool / stdbool.h
2015 if test "$have_bool" != "yes" ; then
2019 #include <stdbool.h>
2020 int main(int argc, char **argv)
2023 return var != false;
2026 if compile_prog "" "" "bool"; then
2029 print_config "bool" "$have_bool"
2031 ##########################################
2032 # Check whether we have strndup()
2037 int main(int argc, char **argv)
2039 char *res = strndup("test string", 8);
2045 if compile_prog "" "" "strndup"; then
2048 print_config "strndup" "$strndup"
2050 ##########################################
2051 # check march=armv8-a+crc+crypto
2052 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2053 march_armv8_a_crc_crypto="no"
2055 if test "$cpu" = "arm64" ; then
2057 #include <sys/auxv.h>
2058 #include <arm_acle.h>
2059 #include <arm_neon.h>
2066 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2067 march_armv8_a_crc_crypto="yes"
2068 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2072 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2074 ##########################################
2076 if test "$cuda" != "yes" ; then
2081 int main(int argc, char **argv)
2086 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2090 print_config "cuda" "$cuda"
2092 ##########################################
2093 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2096 #include <sys/stat.h>
2097 #include <sys/types.h>
2098 int main(int argc, char **argv)
2100 return mkdir("/tmp/bla", 0600);
2103 if compile_prog "" "" "mkdir(a, b)"; then
2106 print_config "mkdir(a, b)" "$mkdir_two"
2108 ##########################################
2109 # check for cc -march=native
2112 int main(int argc, char **argv)
2117 if test "$disable_native" = "no" && compile_prog "-march=native" "" "march=native"; then
2120 print_config "Build march=native" "$build_native"
2122 #############################################################################
2124 if test "$wordsize" = "64" ; then
2125 output_sym "CONFIG_64BIT"
2126 elif test "$wordsize" = "32" ; then
2127 output_sym "CONFIG_32BIT"
2129 fatal "Unknown wordsize!"
2131 if test "$bigendian" = "yes" ; then
2132 output_sym "CONFIG_BIG_ENDIAN"
2134 output_sym "CONFIG_LITTLE_ENDIAN"
2136 if test "$zlib" = "yes" ; then
2137 output_sym "CONFIG_ZLIB"
2139 if test "$libaio" = "yes" ; then
2140 output_sym "CONFIG_LIBAIO"
2142 if test "$posix_aio" = "yes" ; then
2143 output_sym "CONFIG_POSIXAIO"
2145 if test "$posix_aio_fsync" = "yes" ; then
2146 output_sym "CONFIG_POSIXAIO_FSYNC"
2148 if test "$posix_pshared" = "yes" ; then
2149 output_sym "CONFIG_PSHARED"
2151 if test "$linux_fallocate" = "yes" ; then
2152 output_sym "CONFIG_LINUX_FALLOCATE"
2154 if test "$posix_fallocate" = "yes" ; then
2155 output_sym "CONFIG_POSIX_FALLOCATE"
2157 if test "$fdatasync" = "yes" ; then
2158 output_sym "CONFIG_FDATASYNC"
2160 if test "$sync_file_range" = "yes" ; then
2161 output_sym "CONFIG_SYNC_FILE_RANGE"
2163 if test "$sfaa" = "yes" ; then
2164 output_sym "CONFIG_SFAA"
2166 if test "$sync_sync" = "yes" ; then
2167 output_sym "CONFIG_SYNC_SYNC"
2169 if test "$cmp_swap" = "yes" ; then
2170 output_sym "CONFIG_CMP_SWAP"
2172 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2173 output_sym "CONFIG_RDMA"
2175 if test "$clock_gettime" = "yes" ; then
2176 output_sym "CONFIG_CLOCK_GETTIME"
2178 if test "$clock_monotonic" = "yes" ; then
2179 output_sym "CONFIG_CLOCK_MONOTONIC"
2181 if test "$clock_monotonic_raw" = "yes" ; then
2182 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2184 if test "$clock_monotonic_precise" = "yes" ; then
2185 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2187 if test "$clockid_t" = "yes"; then
2188 output_sym "CONFIG_CLOCKID_T"
2190 if test "$gettimeofday" = "yes" ; then
2191 output_sym "CONFIG_GETTIMEOFDAY"
2193 if test "$posix_fadvise" = "yes" ; then
2194 output_sym "CONFIG_POSIX_FADVISE"
2196 if test "$linux_3arg_affinity" = "yes" ; then
2197 output_sym "CONFIG_3ARG_AFFINITY"
2198 elif test "$linux_2arg_affinity" = "yes" ; then
2199 output_sym "CONFIG_2ARG_AFFINITY"
2201 if test "$strsep" = "yes" ; then
2202 output_sym "CONFIG_STRSEP"
2204 if test "$strcasestr" = "yes" ; then
2205 output_sym "CONFIG_STRCASESTR"
2207 if test "$strlcat" = "yes" ; then
2208 output_sym "CONFIG_STRLCAT"
2210 if test "$getopt_long_only" = "yes" ; then
2211 output_sym "CONFIG_GETOPT_LONG_ONLY"
2213 if test "$inet_aton" = "yes" ; then
2214 output_sym "CONFIG_INET_ATON"
2216 if test "$socklen_t" = "yes" ; then
2217 output_sym "CONFIG_SOCKLEN_T"
2219 if test "$ext4_me" = "yes" ; then
2220 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2222 if test "$linux_splice" = "yes" ; then
2223 output_sym "CONFIG_LINUX_SPLICE"
2225 if test "$guasi" = "yes" ; then
2226 output_sym "CONFIG_GUASI"
2228 if test "$fusion_aw" = "yes" ; then
2229 output_sym "CONFIG_FUSION_AW"
2231 if test "$libnuma_v2" = "yes" ; then
2232 output_sym "CONFIG_LIBNUMA"
2234 if test "$solaris_aio" = "yes" ; then
2235 output_sym "CONFIG_SOLARISAIO"
2237 if test "$tls_thread" = "yes" ; then
2238 output_sym "CONFIG_TLS_THREAD"
2240 if test "$rusage_thread" = "yes" ; then
2241 output_sym "CONFIG_RUSAGE_THREAD"
2243 if test "$gfio" = "yes" ; then
2244 output_sym "CONFIG_GFIO"
2246 if test "$esx" = "yes" ; then
2247 output_sym "CONFIG_ESX"
2248 output_sym "CONFIG_NO_SHM"
2250 if test "$sched_idle" = "yes" ; then
2251 output_sym "CONFIG_SCHED_IDLE"
2253 if test "$tcp_nodelay" = "yes" ; then
2254 output_sym "CONFIG_TCP_NODELAY"
2256 if test "$window_size" = "yes" ; then
2257 output_sym "CONFIG_NET_WINDOWSIZE"
2259 if test "$mss" = "yes" ; then
2260 output_sym "CONFIG_NET_MSS"
2262 if test "$rlimit_memlock" = "yes" ; then
2263 output_sym "CONFIG_RLIMIT_MEMLOCK"
2265 if test "$pwritev" = "yes" ; then
2266 output_sym "CONFIG_PWRITEV"
2268 if test "$pwritev2" = "yes" ; then
2269 output_sym "CONFIG_PWRITEV2"
2271 if test "$ipv6" = "yes" ; then
2272 output_sym "CONFIG_IPV6"
2274 if test "$rados" = "yes" ; then
2275 output_sym "CONFIG_RADOS"
2277 if test "$rbd" = "yes" ; then
2278 output_sym "CONFIG_RBD"
2280 if test "$rbd_poll" = "yes" ; then
2281 output_sym "CONFIG_RBD_POLL"
2283 if test "$rbd_inval" = "yes" ; then
2284 output_sym "CONFIG_RBD_INVAL"
2286 if test "$setvbuf" = "yes" ; then
2287 output_sym "CONFIG_SETVBUF"
2289 if test "$s390_z196_facilities" = "yes" ; then
2290 output_sym "CONFIG_S390_Z196_FACILITIES"
2291 CFLAGS="$CFLAGS -march=z9-109"
2294 if test "$gfapi" = "yes" ; then
2295 output_sym "CONFIG_GFAPI"
2297 if test "$gf_fadvise" = "yes" ; then
2298 output_sym "CONFIG_GF_FADVISE"
2300 if test "$gf_trim" = "yes" ; then
2301 output_sym "CONFIG_GF_TRIM"
2303 if test "$libhdfs" = "yes" ; then
2304 output_sym "CONFIG_LIBHDFS"
2305 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2306 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2307 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2308 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2310 if test "$mtd" = "yes" ; then
2311 output_sym "CONFIG_MTD"
2313 if test "$pmemblk" = "yes" ; then
2314 output_sym "CONFIG_PMEMBLK"
2316 if test "$devdax" = "yes" ; then
2317 output_sym "CONFIG_LINUX_DEVDAX"
2319 if test "$pmem" = "yes" ; then
2320 output_sym "CONFIG_LIBPMEM"
2322 if test "$arith" = "yes" ; then
2323 output_sym "CONFIG_ARITHMETIC"
2324 if test "$yacc_is_bison" = "yes" ; then
2325 echo "YACC=$YACC -y" >> $config_host_mak
2327 echo "YACC=$YACC" >> $config_host_mak
2329 if test "$lex_use_o" = "yes" ; then
2330 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2333 if test "$getmntent" = "yes" ; then
2334 output_sym "CONFIG_GETMNTENT"
2336 if test "$getmntinfo" = "yes" ; then
2337 output_sym "CONFIG_GETMNTINFO"
2339 if test "$getmntinfo_statvfs" = "yes" ; then
2340 output_sym "CONFIG_GETMNTINFO_STATVFS"
2342 if test "$static_assert" = "yes" ; then
2343 output_sym "CONFIG_STATIC_ASSERT"
2345 if test "$have_bool" = "yes" ; then
2346 output_sym "CONFIG_HAVE_BOOL"
2348 if test "$strndup" = "yes" ; then
2349 output_sym "CONFIG_HAVE_STRNDUP"
2351 if test "$disable_opt" = "yes" ; then
2352 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2354 if test "$zlib" = "no" ; then
2355 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2356 if test "$build_static" = "yes"; then
2357 echo "Note that some distros have separate packages for static libraries."
2360 if test "$cuda" = "yes" ; then
2361 output_sym "CONFIG_CUDA"
2363 if test "$mkdir_two" = "yes" ; then
2364 output_sym "CONFIG_HAVE_MKDIR_TWO"
2366 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
2367 output_sym "CONFIG_BUILD_NATIVE"
2370 echo "LIBS+=$LIBS" >> $config_host_mak
2371 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2372 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2373 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2374 echo "CC=$cc" >> $config_host_mak
2375 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2376 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2378 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2379 cat > Makefile <<EOF
2380 SRCDIR:=`dirname $0`
2381 include \$(SRCDIR)/Makefile