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
153 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
155 --prefix=*) prefix="$optarg"
157 --cpu=*) cpu="$optarg"
159 # esx is cross compiled and cannot be detect through simple uname calls
165 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
167 --build-32bit-win) build_32bit_win="yes"
169 --build-static) build_static="yes"
171 --enable-gfio) gfio_check="yes"
173 --disable-numa) disable_numa="yes"
175 --disable-rdma) disable_rdma="yes"
177 --disable-rados) disable_rados="yes"
179 --disable-rbd) disable_rbd="yes"
181 --disable-gfapi) disable_gfapi="yes"
183 --enable-libhdfs) libhdfs="yes"
185 --disable-lex) disable_lex="yes"
187 --enable-lex) disable_lex="no"
189 --disable-shm) no_shm="yes"
191 --disable-optimizations) disable_opt="yes"
193 --disable-pmem) disable_pmem="yes"
195 --enable-cuda) enable_cuda="yes"
197 --disable-native) disable_native="yes"
203 echo "Bad option $opt"
209 if test "$show_help" = "yes" ; then
210 echo "--prefix= Use this directory as installation prefix"
211 echo "--cpu= Specify target CPU if auto-detect fails"
212 echo "--cc= Specify compiler to use"
213 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
214 echo "--build-32bit-win Enable 32-bit build on Windows"
215 echo "--build-static Build a static fio"
216 echo "--esx Configure build options for esx"
217 echo "--enable-gfio Enable building of gtk gfio"
218 echo "--disable-numa Disable libnuma even if found"
219 echo "--disable-rdma Disable RDMA support even if found"
220 echo "--disable-gfapi Disable gfapi"
221 echo "--enable-libhdfs Enable hdfs support"
222 echo "--disable-lex Disable use of lex/yacc for math"
223 echo "--disable-pmem Disable pmem based engines even if found"
224 echo "--enable-lex Enable use of lex/yacc for math"
225 echo "--disable-shm Disable SHM support"
226 echo "--disable-optimizations Don't enable compiler optimizations"
227 echo "--enable-cuda Enable GPUDirect RDMA support"
228 echo "--disable-native Don't build for native host"
232 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
233 # Preferred compiler (can be overriden later after we know the platform):
235 # ${cross_prefix}gcc (if cross-prefix specified)
238 if test -z "${CC}${cross_prefix}"; then
245 cc="${CC-${cross_prefix}gcc}"
248 if check_define __ANDROID__ ; then
250 elif check_define __linux__ ; then
252 elif check_define __OpenBSD__ ; then
254 elif check_define __sun__ ; then
256 CFLAGS="$CFLAGS -D_REENTRANT"
257 elif check_define _WIN32 ; then
263 echo "# Automatically generated by configure - do not modify" > $config_host_mak
264 printf "# Configured with:" >> $config_host_mak
265 printf " '%s'" "$0" "$@" >> $config_host_mak
266 echo >> $config_host_mak
267 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
269 if test "$no_shm" = "yes" ; then
270 output_sym "CONFIG_NO_SHM"
273 if test "$disable_opt" = "yes" ; then
274 output_sym "CONFIG_FIO_NO_OPT"
277 # Some host OSes need non-standard checks for which CPU to use.
278 # Note that these checks are broken for cross-compilation: if you're
279 # cross-compiling to one of these OSes then you'll need to specify
280 # the correct CPU with the --cpu option.
283 # Unless explicitly enabled, turn off lex.
284 # OpenBSD will hit syntax error when enabled.
285 if test -z "$disable_lex" ; then
292 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
293 # we can run 64-bit userspace code.
294 # If the user didn't specify a CPU explicitly and the kernel says this is
295 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
297 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
300 # Error at compile time linking of weak/partial symbols if possible...
307 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
308 echo "Disabling weak symbols"
309 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
313 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
314 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
317 LIBS="-lnsl -lsocket"
320 # We still force some options, so keep this message here.
321 echo "Forcing some known good options on Windows"
322 if test -z "${CC}${cross_prefix}"; then
323 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
324 cc="i686-w64-mingw32-gcc"
326 cc="x86_64-w64-mingw32-gcc"
329 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
330 output_sym "CONFIG_32BIT"
332 output_sym "CONFIG_64BIT_LLP64"
334 # We need this to be output_sym'd here because this is Windows specific.
335 # The regular configure path never sets this config.
336 output_sym "CONFIG_WINDOWSAIO"
337 # We now take the regular configuration path without having exit 0 here.
338 # Flags below are still necessary mostly for MinGW.
345 clock_gettime="yes" # clock_monotonic probe has dependency on this
346 clock_monotonic="yes"
354 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
358 # Now we know the target platform we can have another guess at the preferred
359 # compiler when it wasn't explictly set
360 if test -z "${CC}${cross_prefix}"; then
361 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
367 if test -z "$cc"; then
368 echo "configure: failed to find compiler"
372 if test ! -z "$cpu" ; then
373 # command line argument
375 elif check_define __i386__ ; then
377 elif check_define __x86_64__ ; then
379 elif check_define __sparc__ ; then
380 if check_define __arch64__ ; then
385 elif check_define _ARCH_PPC ; then
386 if check_define _ARCH_PPC64 ; then
391 elif check_define __mips__ ; then
393 elif check_define __ia64__ ; then
395 elif check_define __s390__ ; then
396 if check_define __s390x__ ; then
401 elif check_define __arm__ ; then
403 elif check_define __aarch64__ ; then
405 elif check_define __hppa__ ; then
411 # Normalise host CPU name and set ARCH.
413 ia64|ppc|ppc64|s390|s390x|sparc64)
416 i386|i486|i586|i686|i86pc|BePC)
428 hppa|parisc|parisc64)
442 ##########################################
443 # check cross compile
445 if test "$cross_compile" != "yes" ; then
454 if compile_prog "" "" "cross"; then
455 $TMPE 2>/dev/null || cross_compile="yes"
457 fatal "compile test failed"
460 ##########################################
462 if test "$bigendian" != "yes" ; then
465 if test "$cross_compile" = "no" ; then
467 #include <inttypes.h>
470 volatile uint32_t i=0x01234567;
471 return (*((uint8_t*)(&i))) == 0x67;
474 if compile_prog "" "" "endian"; then
475 $TMPE && bigendian="yes"
478 # If we're cross compiling, try our best to work it out and rely on the
479 # run-time check to fail if we get it wrong.
484 #if __BYTE_ORDER != __BIG_ENDIAN
485 # error "Unknown endianness"
489 compile_prog "" "" "endian" && bigendian="yes"
490 check_define "__ARMEB__" && bigendian="yes"
491 check_define "__MIPSEB__" && bigendian="yes"
495 print_config "Operating system" "$targetos"
496 print_config "CPU" "$cpu"
497 print_config "Big endian" "$bigendian"
498 print_config "Compiler" "$cc"
499 print_config "Cross compile" "$cross_compile"
502 ##########################################
503 # See if we need to build a static build
504 if test "$build_static" = "yes" ; then
505 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
506 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
510 print_config "Static build" "$build_static"
512 ##########################################
517 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
520 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
524 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
526 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
529 fatal "Unknown wordsize"
531 print_config "Wordsize" "$wordsize"
533 ##########################################
535 if test "$zlib" != "yes" ; then
543 if (inflateInit(&stream) != Z_OK)
548 if compile_prog "" "-lz" "zlib" ; then
552 print_config "zlib" "$zlib"
554 ##########################################
556 if test "$libaio" != "yes" ; then
559 if test "$esx" != "yes" ; then
569 if compile_prog "" "-laio" "libaio" ; then
573 if test "$libaio" = "yes" ; then
574 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
579 print_config "Linux AIO support" "$libaio"
581 ##########################################
583 if test "$posix_aio" != "yes" ; then
586 if test "$posix_aio_lrt" != "yes" ; then
598 if compile_prog "" "" "posixaio" ; then
600 elif compile_prog "" "-lrt" "posixaio"; then
605 print_config "POSIX AIO support" "$posix_aio"
606 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
608 ##########################################
609 # posix aio fsync probe
610 if test "$posix_aio_fsync" != "yes" ; then
613 if test "$posix_aio" = "yes" ; then
620 return aio_fsync(O_SYNC, &cb);
624 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
628 print_config "POSIX AIO fsync" "$posix_aio_fsync"
630 ##########################################
631 # POSIX pshared attribute probe
632 if test "$posix_pshared" != "yes" ; then
639 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
640 # if defined(__CYGWIN__)
641 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
642 # elif defined(__APPLE__)
643 # include <AvailabilityMacros.h>
644 # include <TargetConditionals.h>
645 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
646 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
650 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
655 if compile_prog "" "$LIBS" "posix_pshared" ; then
658 print_config "POSIX pshared support" "$posix_pshared"
660 ##########################################
662 if test "$solaris_aio" != "yes" ; then
666 #include <sys/types.h>
667 #include <sys/asynch.h>
672 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
676 if compile_prog "" "-laio" "solarisaio" ; then
680 print_config "Solaris AIO support" "$solaris_aio"
682 ##########################################
683 # __sync_fetch_and_add test
684 if test "$sfaa" != "yes" ; then
688 #include <inttypes.h>
689 static int sfaa(uint64_t *ptr)
691 return __sync_fetch_and_add(ptr, 0);
694 int main(int argc, char **argv)
701 if compile_prog "" "" "__sync_fetch_and_add()" ; then
704 print_config "__sync_fetch_and_add" "$sfaa"
706 ##########################################
707 # __sync_synchronize() test
708 if test "$sync_sync" != "yes" ; then
712 #include <inttypes.h>
714 int main(int argc, char **argv)
716 __sync_synchronize();
720 if compile_prog "" "" "__sync_synchronize()" ; then
723 print_config "__sync_synchronize" "$sync_sync"
725 ##########################################
726 # __sync_val_compare_and_swap() test
727 if test "$cmp_swap" != "yes" ; then
731 #include <inttypes.h>
733 int main(int argc, char **argv)
736 return __sync_val_compare_and_swap(&x, 1, 2);
739 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
742 print_config "__sync_val_compare_and_swap" "$cmp_swap"
744 ##########################################
746 if test "$libverbs" != "yes" ; then
750 #include <infiniband/verbs.h>
751 int main(int argc, char **argv)
753 struct ibv_pd *pd = ibv_alloc_pd(NULL);
757 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
759 LIBS="-libverbs $LIBS"
761 print_config "libverbs" "$libverbs"
763 ##########################################
765 if test "$rdmacm" != "yes" ; then
770 #include <rdma/rdma_cma.h>
771 int main(int argc, char **argv)
773 rdma_destroy_qp(NULL);
777 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
779 LIBS="-lrdmacm $LIBS"
781 print_config "rdmacm" "$rdmacm"
783 ##########################################
784 # Linux fallocate probe
785 if test "$linux_fallocate" != "yes" ; then
791 #include <linux/falloc.h>
792 int main(int argc, char **argv)
794 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
798 if compile_prog "" "" "linux_fallocate"; then
799 linux_fallocate="yes"
801 print_config "Linux fallocate" "$linux_fallocate"
803 ##########################################
804 # POSIX fadvise probe
805 if test "$posix_fadvise" != "yes" ; then
811 int main(int argc, char **argv)
813 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
817 if compile_prog "" "" "posix_fadvise"; then
820 print_config "POSIX fadvise" "$posix_fadvise"
822 ##########################################
823 # POSIX fallocate probe
824 if test "$posix_fallocate" != "yes" ; then
830 int main(int argc, char **argv)
832 int r = posix_fallocate(0, 0, 1024);
836 if compile_prog "" "" "posix_fallocate"; then
837 posix_fallocate="yes"
839 print_config "POSIX fallocate" "$posix_fallocate"
841 ##########################################
842 # sched_set/getaffinity 2 or 3 argument test
843 if test "$linux_2arg_affinity" != "yes" ; then
844 linux_2arg_affinity="no"
846 if test "$linux_3arg_affinity" != "yes" ; then
847 linux_3arg_affinity="no"
851 int main(int argc, char **argv)
854 return sched_setaffinity(0, sizeof(mask), &mask);
857 if compile_prog "" "" "sched_setaffinity(,,)"; then
858 linux_3arg_affinity="yes"
862 int main(int argc, char **argv)
865 return sched_setaffinity(0, &mask);
868 if compile_prog "" "" "sched_setaffinity(,)"; then
869 linux_2arg_affinity="yes"
872 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
873 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
875 ##########################################
876 # clock_gettime probe
877 if test "$clock_gettime" != "yes" ; then
883 int main(int argc, char **argv)
885 return clock_gettime(0, NULL);
888 if compile_prog "" "" "clock_gettime"; then
890 elif compile_prog "" "-lrt" "clock_gettime"; then
894 print_config "clock_gettime" "$clock_gettime"
896 ##########################################
897 # CLOCK_MONOTONIC probe
898 if test "$clock_monotonic" != "yes" ; then
901 if test "$clock_gettime" = "yes" ; then
905 int main(int argc, char **argv)
907 return clock_gettime(CLOCK_MONOTONIC, NULL);
910 if compile_prog "" "$LIBS" "clock monotonic"; then
911 clock_monotonic="yes"
914 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
916 ##########################################
917 # CLOCK_MONOTONIC_RAW probe
918 if test "$clock_monotonic_raw" != "yes" ; then
919 clock_monotonic_raw="no"
921 if test "$clock_gettime" = "yes" ; then
925 int main(int argc, char **argv)
927 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
930 if compile_prog "" "$LIBS" "clock monotonic"; then
931 clock_monotonic_raw="yes"
934 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
936 ##########################################
937 # CLOCK_MONOTONIC_PRECISE probe
938 if test "$clock_monotonic_precise" != "yes" ; then
939 clock_monotonic_precise="no"
941 if test "$clock_gettime" = "yes" ; then
945 int main(int argc, char **argv)
947 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
950 if compile_prog "" "$LIBS" "clock monotonic precise"; then
951 clock_monotonic_precise="yes"
954 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
956 ##########################################
958 if test "$clockid_t" != "yes" ; then
964 int main(int argc, char **argv)
966 volatile clockid_t cid;
967 memset((void*)&cid, 0, sizeof(cid));
971 if compile_prog "" "$LIBS" "clockid_t"; then
974 print_config "clockid_t" "$clockid_t"
976 ##########################################
977 # gettimeofday() probe
978 if test "$gettimeofday" != "yes" ; then
982 #include <sys/time.h>
984 int main(int argc, char **argv)
987 return gettimeofday(&tv, NULL);
990 if compile_prog "" "" "gettimeofday"; then
993 print_config "gettimeofday" "$gettimeofday"
995 ##########################################
997 if test "$fdatasync" != "yes" ; then
1003 int main(int argc, char **argv)
1005 return fdatasync(0);
1008 if compile_prog "" "" "fdatasync"; then
1011 print_config "fdatasync" "$fdatasync"
1013 ##########################################
1014 # sync_file_range() probe
1015 if test "$sync_file_range" != "yes" ; then
1016 sync_file_range="no"
1022 #include <linux/fs.h>
1023 int main(int argc, char **argv)
1025 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1026 SYNC_FILE_RANGE_WAIT_AFTER;
1027 return sync_file_range(0, 0, 0, flags);
1030 if compile_prog "" "" "sync_file_range"; then
1031 sync_file_range="yes"
1033 print_config "sync_file_range" "$sync_file_range"
1035 ##########################################
1036 # ext4 move extent probe
1037 if test "$ext4_me" != "yes" ; then
1042 #include <sys/ioctl.h>
1043 int main(int argc, char **argv)
1045 struct move_extent me;
1046 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1049 if compile_prog "" "" "ext4 move extent" ; then
1051 elif test $targetos = "Linux" ; then
1052 # On Linux, just default to it on and let it error at runtime if we really
1053 # don't have it. None of my updated systems have it defined, but it does
1054 # work. Takes a while to bubble back.
1057 print_config "EXT4 move extent" "$ext4_me"
1059 ##########################################
1061 if test "$linux_splice" != "yes" ; then
1067 int main(int argc, char **argv)
1069 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1072 if compile_prog "" "" "linux splice"; then
1075 print_config "Linux splice(2)" "$linux_splice"
1077 ##########################################
1079 if test "$guasi" != "yes" ; then
1084 #include <guasi_syscalls.h>
1085 int main(int argc, char **argv)
1087 guasi_t ctx = guasi_create(0, 0, 0);
1091 if compile_prog "" "" "guasi"; then
1094 print_config "GUASI" "$guasi"
1096 ##########################################
1098 if test "$fusion_aw" != "yes" ; then
1102 #include <nvm/nvm_primitives.h>
1103 int main(int argc, char **argv)
1105 nvm_version_t ver_info;
1106 nvm_handle_t handle;
1108 handle = nvm_get_handle(0, &ver_info);
1109 return nvm_atomic_write(handle, 0, 0, 0);
1112 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1113 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1116 print_config "Fusion-io atomic engine" "$fusion_aw"
1118 ##########################################
1120 if test "$libnuma" != "yes" ; then
1125 int main(int argc, char **argv)
1127 return numa_available();
1130 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1134 print_config "libnuma" "$libnuma"
1136 ##########################################
1137 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1138 if test "$libnuma" = "yes" ; then
1142 int main(int argc, char **argv)
1144 struct bitmask *mask = numa_parse_nodestring(NULL);
1145 return mask->size == 0;
1148 if compile_prog "" "" "libnuma api"; then
1151 print_config "libnuma v2" "$libnuma_v2"
1154 ##########################################
1156 if test "$strsep" != "yes" ; then
1161 int main(int argc, char **argv)
1163 static char *string = "This is a string";
1164 strsep(&string, "needle");
1168 if compile_prog "" "" "strsep"; then
1171 print_config "strsep" "$strsep"
1173 ##########################################
1174 # strcasestr() probe
1175 if test "$strcasestr" != "yes" ; then
1180 int main(int argc, char **argv)
1182 return strcasestr(argv[0], argv[1]) != NULL;
1185 if compile_prog "" "" "strcasestr"; then
1188 print_config "strcasestr" "$strcasestr"
1190 ##########################################
1192 if test "$strlcat" != "yes" ; then
1197 int main(int argc, char **argv)
1199 static char dst[64];
1200 static char *string = "This is a string";
1201 memset(dst, 0, sizeof(dst));
1202 strlcat(dst, string, sizeof(dst));
1206 if compile_prog "" "" "strlcat"; then
1209 print_config "strlcat" "$strlcat"
1211 ##########################################
1212 # getopt_long_only() probe
1213 if test "$getopt_long_only" != "yes" ; then
1214 getopt_long_only="no"
1220 int main(int argc, char **argv)
1222 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1226 if compile_prog "" "" "getopt_long_only"; then
1227 getopt_long_only="yes"
1229 print_config "getopt_long_only()" "$getopt_long_only"
1231 ##########################################
1233 if test "$inet_aton" != "yes" ; then
1237 #include <sys/socket.h>
1238 #include <arpa/inet.h>
1240 int main(int argc, char **argv)
1243 return inet_aton(NULL, &in);
1246 if compile_prog "" "" "inet_aton"; then
1249 print_config "inet_aton" "$inet_aton"
1251 ##########################################
1253 if test "$socklen_t" != "yes" ; then
1257 #include <sys/socket.h>
1258 int main(int argc, char **argv)
1264 if compile_prog "" "" "socklen_t"; then
1267 print_config "socklen_t" "$socklen_t"
1269 ##########################################
1270 # Whether or not __thread is supported for TLS
1271 if test "$tls_thread" != "yes" ; then
1276 static __thread int ret;
1277 int main(int argc, char **argv)
1282 if compile_prog "" "" "__thread"; then
1285 print_config "__thread" "$tls_thread"
1287 ##########################################
1288 # Check if we have required gtk/glib support for gfio
1289 if test "$gfio" != "yes" ; then
1292 if test "$gfio_check" = "yes" ; then
1296 #include <gtk/gtk.h>
1299 gdk_threads_enter();
1300 gdk_threads_leave();
1302 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1305 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1306 ORG_LDFLAGS=$LDFLAGS
1307 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1308 if test "$?" != "0" ; then
1309 echo "configure: gtk and gthread not found"
1312 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1313 if test "$?" != "0" ; then
1314 echo "configure: gtk and gthread not found"
1317 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1319 if test "$?" = "0" ; then
1321 GFIO_LIBS="$LIBS $GTK_LIBS"
1322 CFLAGS="$CFLAGS $GTK_CFLAGS"
1324 echo "GTK found, but need version 2.18 or higher"
1328 echo "Please install gtk and gdk libraries"
1331 LDFLAGS=$ORG_LDFLAGS
1334 if test "$gfio_check" = "yes" ; then
1335 print_config "gtk 2.18 or higher" "$gfio"
1338 ##########################################
1339 # Check whether we have getrusage(RUSAGE_THREAD)
1340 if test "$rusage_thread" != "yes" ; then
1344 #include <sys/time.h>
1345 #include <sys/resource.h>
1346 int main(int argc, char **argv)
1349 getrusage(RUSAGE_THREAD, &ru);
1353 if compile_prog "" "" "RUSAGE_THREAD"; then
1356 print_config "RUSAGE_THREAD" "$rusage_thread"
1358 ##########################################
1359 # Check whether we have SCHED_IDLE
1360 if test "$sched_idle" != "yes" ; then
1365 int main(int argc, char **argv)
1367 struct sched_param p;
1368 return sched_setscheduler(0, SCHED_IDLE, &p);
1371 if compile_prog "" "" "SCHED_IDLE"; then
1374 print_config "SCHED_IDLE" "$sched_idle"
1376 ##########################################
1377 # Check whether we have TCP_NODELAY
1378 if test "$tcp_nodelay" != "yes" ; then
1383 #include <sys/types.h>
1384 #include <sys/socket.h>
1385 #include <netinet/tcp.h>
1386 int main(int argc, char **argv)
1388 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1391 if compile_prog "" "" "TCP_NODELAY"; then
1394 print_config "TCP_NODELAY" "$tcp_nodelay"
1396 ##########################################
1397 # Check whether we have SO_SNDBUF
1398 if test "$window_size" != "yes" ; then
1403 #include <sys/types.h>
1404 #include <sys/socket.h>
1405 #include <netinet/tcp.h>
1406 int main(int argc, char **argv)
1408 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1409 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1412 if compile_prog "" "" "SO_SNDBUF"; then
1415 print_config "Net engine window_size" "$window_size"
1417 ##########################################
1418 # Check whether we have TCP_MAXSEG
1419 if test "$mss" != "yes" ; then
1424 #include <sys/types.h>
1425 #include <sys/socket.h>
1426 #include <netinet/tcp.h>
1427 #include <arpa/inet.h>
1428 #include <netinet/in.h>
1429 int main(int argc, char **argv)
1431 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1434 if compile_prog "" "" "TCP_MAXSEG"; then
1437 print_config "TCP_MAXSEG" "$mss"
1439 ##########################################
1440 # Check whether we have RLIMIT_MEMLOCK
1441 if test "$rlimit_memlock" != "yes" ; then
1445 #include <sys/time.h>
1446 #include <sys/resource.h>
1447 int main(int argc, char **argv)
1450 return getrlimit(RLIMIT_MEMLOCK, &rl);
1453 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1454 rlimit_memlock="yes"
1456 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1458 ##########################################
1459 # Check whether we have pwritev/preadv
1460 if test "$pwritev" != "yes" ; then
1465 #include <sys/uio.h>
1466 int main(int argc, char **argv)
1468 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1471 if compile_prog "" "" "pwritev"; then
1474 print_config "pwritev/preadv" "$pwritev"
1476 ##########################################
1477 # Check whether we have pwritev2/preadv2
1478 if test "$pwritev2" != "yes" ; then
1483 #include <sys/uio.h>
1484 int main(int argc, char **argv)
1486 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1489 if compile_prog "" "" "pwritev2"; then
1492 print_config "pwritev2/preadv2" "$pwritev2"
1494 ##########################################
1495 # Check whether we have the required functions for ipv6
1496 if test "$ipv6" != "yes" ; then
1500 #include <sys/types.h>
1501 #include <sys/socket.h>
1502 #include <netinet/in.h>
1505 int main(int argc, char **argv)
1507 struct addrinfo hints;
1508 struct in6_addr addr;
1511 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1513 printf("%s\n", gai_strerror(ret));
1518 if compile_prog "" "" "ipv6"; then
1521 print_config "IPv6 helpers" "$ipv6"
1523 ##########################################
1525 if test "$rados" != "yes" ; then
1529 #include <rados/librados.h>
1531 int main(int argc, char **argv)
1534 rados_ioctx_t io_ctx;
1535 const char cluster_name[] = "ceph";
1536 const char user_name[] = "client.admin";
1537 const char pool[] = "rados";
1539 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1540 rados_create2(&cluster, cluster_name, user_name, 0);
1541 rados_ioctx_create(cluster, pool, &io_ctx);
1546 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1547 LIBS="-lrados $LIBS"
1550 print_config "Rados engine" "$rados"
1552 ##########################################
1554 if test "$rbd" != "yes" ; then
1558 #include <rbd/librbd.h>
1560 int main(int argc, char **argv)
1563 rados_ioctx_t io_ctx;
1564 const char cluster_name[] = "ceph";
1565 const char user_name[] = "client.admin";
1566 const char pool[] = "rbd";
1567 int major, minor, extra;
1569 rbd_version(&major, &minor, &extra);
1570 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1571 rados_create2(&cluster, cluster_name, user_name, 0);
1572 rados_ioctx_create(cluster, pool, &io_ctx);
1577 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1578 LIBS="-lrbd -lrados $LIBS"
1581 print_config "Rados Block Device engine" "$rbd"
1583 ##########################################
1584 # check for rbd_poll
1585 if test "$rbd_poll" != "yes" ; then
1588 if test "$rbd" = "yes"; then
1590 #include <rbd/librbd.h>
1591 #include <sys/eventfd.h>
1593 int main(int argc, char **argv)
1596 rbd_completion_t comp;
1598 int fd = eventfd(0, EFD_NONBLOCK);
1599 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1600 rbd_poll_io_events(image, comp, 1);
1605 if compile_prog "" "-lrbd -lrados" "rbd"; then
1608 print_config "rbd_poll" "$rbd_poll"
1611 ##########################################
1612 # check for rbd_invalidate_cache()
1613 if test "$rbd_inval" != "yes" ; then
1616 if test "$rbd" = "yes"; then
1618 #include <rbd/librbd.h>
1620 int main(int argc, char **argv)
1624 return rbd_invalidate_cache(image);
1627 if compile_prog "" "-lrbd -lrados" "rbd"; then
1630 print_config "rbd_invalidate_cache" "$rbd_inval"
1633 ##########################################
1634 # Check whether we have setvbuf
1635 if test "$setvbuf" != "yes" ; then
1640 int main(int argc, char **argv)
1644 setvbuf(f, buf, _IOFBF, sizeof(buf));
1648 if compile_prog "" "" "setvbuf"; then
1651 print_config "setvbuf" "$setvbuf"
1653 ##########################################
1655 if test "$gfapi" != "yes" ; then
1659 #include <glusterfs/api/glfs.h>
1661 int main(int argc, char **argv)
1663 glfs_t *g = glfs_new("foo");
1668 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1669 LIBS="-lgfapi -lglusterfs $LIBS"
1672 print_config "Gluster API engine" "$gfapi"
1674 ##########################################
1675 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1676 if test "$gfapi" = "yes" ; then
1679 #include <glusterfs/api/glfs.h>
1681 int main(int argc, char **argv)
1684 int ret = glfs_fadvise(fd, 0, 0, 1);
1689 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1692 print_config "Gluster API use fadvise" "$gf_fadvise"
1695 ##########################################
1696 # check for gfapi trim support
1697 if test "$gf_trim" != "yes" ; then
1700 if test "$gfapi" = "yes" ; then
1702 #include <glusterfs/api/glfs.h>
1704 int main(int argc, char **argv)
1706 return glfs_discard_async(NULL, 0, 0);
1709 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1712 print_config "Gluster API trim support" "$gf_trim"
1715 ##########################################
1716 # Check if we support stckf on s390
1717 if test "$s390_z196_facilities" != "yes" ; then
1718 s390_z196_facilities="no"
1721 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1722 int main(int argc, char **argv)
1724 /* We want just 1 double word to be returned. */
1725 register unsigned long reg0 asm("0") = 0;
1726 unsigned long stfle_bits;
1727 asm volatile(".machine push" "\n\t"
1728 ".machine \"z9-109\"" "\n\t"
1731 : "=QS" (stfle_bits), "+d" (reg0)
1734 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1740 if compile_prog "" "" "s390_z196_facilities"; then
1742 if [ $? -eq 0 ]; then
1743 s390_z196_facilities="yes"
1746 print_config "s390_z196_facilities" "$s390_z196_facilities"
1748 ##########################################
1749 # Check if we have required environment variables configured for libhdfs
1750 if test "$libhdfs" = "yes" ; then
1752 if test "$JAVA_HOME" = "" ; then
1753 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1756 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1757 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1760 if test "$FIO_LIBHDFS_LIB" = "" ; then
1761 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1764 if test "$hdfs_conf_error" = "1" ; then
1768 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1769 FIO_HDFS_CPU="amd64"
1772 print_config "HDFS engine" "$libhdfs"
1774 ##########################################
1775 # Check whether we have MTD
1776 if test "$mtd" != "yes" ; then
1781 #include <mtd/mtd-user.h>
1782 #include <sys/ioctl.h>
1783 int main(int argc, char **argv)
1785 struct mtd_write_req ops;
1786 struct mtd_info_user info;
1787 memset(&ops, 0, sizeof(ops));
1788 info.type = MTD_MLCNANDFLASH;
1789 return ioctl(0, MEMGETINFO, &info);
1792 if compile_prog "" "" "mtd"; then
1795 print_config "MTD" "$mtd"
1797 ##########################################
1798 # Check whether we have libpmem
1799 if test "$libpmem" != "yes" ; then
1803 #include <libpmem.h>
1804 int main(int argc, char **argv)
1807 rc = pmem_is_pmem(0, 0);
1811 if compile_prog "" "-lpmem" "libpmem"; then
1815 print_config "libpmem" "$libpmem"
1817 ##########################################
1818 # Check whether we have libpmemblk
1819 # libpmem is a prerequisite
1820 if test "$libpmemblk" != "yes" ; then
1823 if test "$libpmem" = "yes"; then
1825 #include <libpmemblk.h>
1826 int main(int argc, char **argv)
1829 pbp = pmemblk_open("", 0);
1833 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1835 LIBS="-lpmemblk $LIBS"
1838 print_config "libpmemblk" "$libpmemblk"
1840 # Choose the ioengines
1841 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1844 if test "$libpmemblk" = "yes"; then
1849 ##########################################
1850 # Report whether pmemblk engine is enabled
1851 print_config "NVML pmemblk engine" "$pmemblk"
1853 ##########################################
1854 # Report whether dev-dax engine is enabled
1855 print_config "NVML dev-dax engine" "$devdax"
1857 ##########################################
1858 # Report whether libpmem engine is enabled
1859 print_config "NVML libpmem engine" "$pmem"
1861 ##########################################
1862 # Check if we have lex/yacc available
1867 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1868 if test "$targetos" != "SunOS" ; then
1869 LEX=$(which lex 2> /dev/null)
1870 if test -x "$LEX" ; then
1873 YACC=$(which bison 2> /dev/null)
1874 if test -x "$YACC" ; then
1878 YACC=$(which yacc 2> /dev/null)
1879 if test -x "$YACC" ; then
1883 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1887 if test "$arith" = "yes" ; then
1889 extern int yywrap(void);
1891 int main(int argc, char **argv)
1897 if compile_prog "" "-ll" "lex"; then
1906 # Check if lex fails using -o
1907 if test "$arith" = "yes" ; then
1908 if test "$force_no_lex_o" = "yes" ; then
1911 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1912 if test "$?" = "0" ; then
1920 print_config "lex/yacc for arithmetic" "$arith"
1922 ##########################################
1923 # Check whether we have setmntent/getmntent
1924 if test "$getmntent" != "yes" ; then
1930 int main(int argc, char **argv)
1932 FILE *mtab = setmntent(NULL, "r");
1933 struct mntent *mnt = getmntent(mtab);
1938 if compile_prog "" "" "getmntent"; then
1941 print_config "getmntent" "$getmntent"
1943 ##########################################
1944 # Check whether we have getmntinfo
1945 # These are originally added for BSDs, but may also work
1946 # on other operating systems with getmntinfo(3).
1948 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1949 # Note that NetBSD needs -Werror to catch warning as error.
1950 if test "$getmntinfo" != "yes" ; then
1955 #include <sys/param.h>
1956 #include <sys/mount.h>
1957 int main(int argc, char **argv)
1960 return getmntinfo(&st, MNT_NOWAIT);
1963 if compile_prog "-Werror" "" "getmntinfo"; then
1966 print_config "getmntinfo" "$getmntinfo"
1968 # getmntinfo(3) for NetBSD.
1969 if test "$getmntinfo_statvfs" != "yes" ; then
1970 getmntinfo_statvfs="no"
1974 #include <sys/statvfs.h>
1975 int main(int argc, char **argv)
1978 return getmntinfo(&st, MNT_NOWAIT);
1981 # Skip the test if the one with statfs arg is detected.
1982 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1983 getmntinfo_statvfs="yes"
1984 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
1987 ##########################################
1988 # Check whether we have _Static_assert
1989 if test "$static_assert" != "yes" ; then
2001 int main(int argc, char **argv)
2003 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2007 if compile_prog "" "" "static_assert"; then
2010 print_config "Static Assert" "$static_assert"
2012 ##########################################
2013 # Check whether we have bool / stdbool.h
2014 if test "$have_bool" != "yes" ; then
2018 #include <stdbool.h>
2019 int main(int argc, char **argv)
2022 return var != false;
2025 if compile_prog "" "" "bool"; then
2028 print_config "bool" "$have_bool"
2030 ##########################################
2031 # Check whether we have strndup()
2036 int main(int argc, char **argv)
2038 char *res = strndup("test string", 8);
2044 if compile_prog "" "" "strndup"; then
2047 print_config "strndup" "$strndup"
2049 ##########################################
2050 # check march=armv8-a+crc+crypto
2051 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2052 march_armv8_a_crc_crypto="no"
2054 if test "$cpu" = "arm64" ; then
2056 #include <sys/auxv.h>
2057 #include <arm_acle.h>
2058 #include <arm_neon.h>
2065 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
2066 march_armv8_a_crc_crypto="yes"
2067 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
2070 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2072 ##########################################
2074 if test "$cuda" != "yes" ; then
2079 int main(int argc, char **argv)
2084 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2088 print_config "cuda" "$cuda"
2090 ##########################################
2091 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2094 #include <sys/stat.h>
2095 #include <sys/types.h>
2096 int main(int argc, char **argv)
2098 return mkdir("/tmp/bla", 0600);
2101 if compile_prog "" "" "mkdir(a, b)"; then
2104 print_config "mkdir(a, b)" "$mkdir_two"
2106 ##########################################
2107 # check for cc -march=native
2110 int main(int argc, char **argv)
2115 if test "$disable_native" = "no" && compile_prog "-march=native" "" "march=native"; then
2118 print_config "Build march=native" "$build_native"
2120 #############################################################################
2122 if test "$wordsize" = "64" ; then
2123 output_sym "CONFIG_64BIT"
2124 elif test "$wordsize" = "32" ; then
2125 output_sym "CONFIG_32BIT"
2127 fatal "Unknown wordsize!"
2129 if test "$bigendian" = "yes" ; then
2130 output_sym "CONFIG_BIG_ENDIAN"
2132 output_sym "CONFIG_LITTLE_ENDIAN"
2134 if test "$zlib" = "yes" ; then
2135 output_sym "CONFIG_ZLIB"
2137 if test "$libaio" = "yes" ; then
2138 output_sym "CONFIG_LIBAIO"
2140 if test "$posix_aio" = "yes" ; then
2141 output_sym "CONFIG_POSIXAIO"
2143 if test "$posix_aio_fsync" = "yes" ; then
2144 output_sym "CONFIG_POSIXAIO_FSYNC"
2146 if test "$posix_pshared" = "yes" ; then
2147 output_sym "CONFIG_PSHARED"
2149 if test "$linux_fallocate" = "yes" ; then
2150 output_sym "CONFIG_LINUX_FALLOCATE"
2152 if test "$posix_fallocate" = "yes" ; then
2153 output_sym "CONFIG_POSIX_FALLOCATE"
2155 if test "$fdatasync" = "yes" ; then
2156 output_sym "CONFIG_FDATASYNC"
2158 if test "$sync_file_range" = "yes" ; then
2159 output_sym "CONFIG_SYNC_FILE_RANGE"
2161 if test "$sfaa" = "yes" ; then
2162 output_sym "CONFIG_SFAA"
2164 if test "$sync_sync" = "yes" ; then
2165 output_sym "CONFIG_SYNC_SYNC"
2167 if test "$cmp_swap" = "yes" ; then
2168 output_sym "CONFIG_CMP_SWAP"
2170 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2171 output_sym "CONFIG_RDMA"
2173 if test "$clock_gettime" = "yes" ; then
2174 output_sym "CONFIG_CLOCK_GETTIME"
2176 if test "$clock_monotonic" = "yes" ; then
2177 output_sym "CONFIG_CLOCK_MONOTONIC"
2179 if test "$clock_monotonic_raw" = "yes" ; then
2180 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2182 if test "$clock_monotonic_precise" = "yes" ; then
2183 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2185 if test "$clockid_t" = "yes"; then
2186 output_sym "CONFIG_CLOCKID_T"
2188 if test "$gettimeofday" = "yes" ; then
2189 output_sym "CONFIG_GETTIMEOFDAY"
2191 if test "$posix_fadvise" = "yes" ; then
2192 output_sym "CONFIG_POSIX_FADVISE"
2194 if test "$linux_3arg_affinity" = "yes" ; then
2195 output_sym "CONFIG_3ARG_AFFINITY"
2196 elif test "$linux_2arg_affinity" = "yes" ; then
2197 output_sym "CONFIG_2ARG_AFFINITY"
2199 if test "$strsep" = "yes" ; then
2200 output_sym "CONFIG_STRSEP"
2202 if test "$strcasestr" = "yes" ; then
2203 output_sym "CONFIG_STRCASESTR"
2205 if test "$strlcat" = "yes" ; then
2206 output_sym "CONFIG_STRLCAT"
2208 if test "$getopt_long_only" = "yes" ; then
2209 output_sym "CONFIG_GETOPT_LONG_ONLY"
2211 if test "$inet_aton" = "yes" ; then
2212 output_sym "CONFIG_INET_ATON"
2214 if test "$socklen_t" = "yes" ; then
2215 output_sym "CONFIG_SOCKLEN_T"
2217 if test "$ext4_me" = "yes" ; then
2218 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2220 if test "$linux_splice" = "yes" ; then
2221 output_sym "CONFIG_LINUX_SPLICE"
2223 if test "$guasi" = "yes" ; then
2224 output_sym "CONFIG_GUASI"
2226 if test "$fusion_aw" = "yes" ; then
2227 output_sym "CONFIG_FUSION_AW"
2229 if test "$libnuma_v2" = "yes" ; then
2230 output_sym "CONFIG_LIBNUMA"
2232 if test "$solaris_aio" = "yes" ; then
2233 output_sym "CONFIG_SOLARISAIO"
2235 if test "$tls_thread" = "yes" ; then
2236 output_sym "CONFIG_TLS_THREAD"
2238 if test "$rusage_thread" = "yes" ; then
2239 output_sym "CONFIG_RUSAGE_THREAD"
2241 if test "$gfio" = "yes" ; then
2242 output_sym "CONFIG_GFIO"
2244 if test "$esx" = "yes" ; then
2245 output_sym "CONFIG_ESX"
2246 output_sym "CONFIG_NO_SHM"
2248 if test "$sched_idle" = "yes" ; then
2249 output_sym "CONFIG_SCHED_IDLE"
2251 if test "$tcp_nodelay" = "yes" ; then
2252 output_sym "CONFIG_TCP_NODELAY"
2254 if test "$window_size" = "yes" ; then
2255 output_sym "CONFIG_NET_WINDOWSIZE"
2257 if test "$mss" = "yes" ; then
2258 output_sym "CONFIG_NET_MSS"
2260 if test "$rlimit_memlock" = "yes" ; then
2261 output_sym "CONFIG_RLIMIT_MEMLOCK"
2263 if test "$pwritev" = "yes" ; then
2264 output_sym "CONFIG_PWRITEV"
2266 if test "$pwritev2" = "yes" ; then
2267 output_sym "CONFIG_PWRITEV2"
2269 if test "$ipv6" = "yes" ; then
2270 output_sym "CONFIG_IPV6"
2272 if test "$rados" = "yes" ; then
2273 output_sym "CONFIG_RADOS"
2275 if test "$rbd" = "yes" ; then
2276 output_sym "CONFIG_RBD"
2278 if test "$rbd_poll" = "yes" ; then
2279 output_sym "CONFIG_RBD_POLL"
2281 if test "$rbd_inval" = "yes" ; then
2282 output_sym "CONFIG_RBD_INVAL"
2284 if test "$setvbuf" = "yes" ; then
2285 output_sym "CONFIG_SETVBUF"
2287 if test "$s390_z196_facilities" = "yes" ; then
2288 output_sym "CONFIG_S390_Z196_FACILITIES"
2289 CFLAGS="$CFLAGS -march=z9-109"
2291 if test "$gfapi" = "yes" ; then
2292 output_sym "CONFIG_GFAPI"
2294 if test "$gf_fadvise" = "yes" ; then
2295 output_sym "CONFIG_GF_FADVISE"
2297 if test "$gf_trim" = "yes" ; then
2298 output_sym "CONFIG_GF_TRIM"
2300 if test "$libhdfs" = "yes" ; then
2301 output_sym "CONFIG_LIBHDFS"
2302 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2303 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2304 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2305 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2307 if test "$mtd" = "yes" ; then
2308 output_sym "CONFIG_MTD"
2310 if test "$pmemblk" = "yes" ; then
2311 output_sym "CONFIG_PMEMBLK"
2313 if test "$devdax" = "yes" ; then
2314 output_sym "CONFIG_LINUX_DEVDAX"
2316 if test "$pmem" = "yes" ; then
2317 output_sym "CONFIG_LIBPMEM"
2319 if test "$arith" = "yes" ; then
2320 output_sym "CONFIG_ARITHMETIC"
2321 if test "$yacc_is_bison" = "yes" ; then
2322 echo "YACC=$YACC -y" >> $config_host_mak
2324 echo "YACC=$YACC" >> $config_host_mak
2326 if test "$lex_use_o" = "yes" ; then
2327 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2330 if test "$getmntent" = "yes" ; then
2331 output_sym "CONFIG_GETMNTENT"
2333 if test "$getmntinfo" = "yes" ; then
2334 output_sym "CONFIG_GETMNTINFO"
2336 if test "$getmntinfo_statvfs" = "yes" ; then
2337 output_sym "CONFIG_GETMNTINFO_STATVFS"
2339 if test "$static_assert" = "yes" ; then
2340 output_sym "CONFIG_STATIC_ASSERT"
2342 if test "$have_bool" = "yes" ; then
2343 output_sym "CONFIG_HAVE_BOOL"
2345 if test "$strndup" = "yes" ; then
2346 output_sym "CONFIG_HAVE_STRNDUP"
2348 if test "$disable_opt" = "yes" ; then
2349 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2351 if test "$zlib" = "no" ; then
2352 echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it."
2353 if test "$build_static" = "yes"; then
2354 echo "Note that some distros have separate packages for static libraries."
2357 if test "$cuda" = "yes" ; then
2358 output_sym "CONFIG_CUDA"
2360 if test "$mkdir_two" = "yes" ; then
2361 output_sym "CONFIG_HAVE_MKDIR_TWO"
2363 if test "$build_native" = "yes" ; then
2364 output_sym "CONFIG_BUILD_NATIVE"
2367 echo "LIBS+=$LIBS" >> $config_host_mak
2368 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2369 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2370 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2371 echo "CC=$cc" >> $config_host_mak
2372 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2373 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2375 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2376 cat > Makefile <<EOF
2377 SRCDIR:=`dirname $0`
2378 include \$(SRCDIR)/Makefile