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
151 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
153 --prefix=*) prefix="$optarg"
155 --cpu=*) cpu="$optarg"
157 # esx is cross compiled and cannot be detect through simple uname calls
163 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
165 --build-32bit-win) build_32bit_win="yes"
167 --build-static) build_static="yes"
169 --enable-gfio) gfio_check="yes"
171 --disable-numa) disable_numa="yes"
173 --disable-rdma) disable_rdma="yes"
175 --disable-rbd) disable_rbd="yes"
177 --disable-rbd-blkin) disable_rbd_blkin="yes"
179 --disable-gfapi) disable_gfapi="yes"
181 --enable-libhdfs) libhdfs="yes"
183 --disable-lex) disable_lex="yes"
185 --enable-lex) disable_lex="no"
187 --disable-shm) no_shm="yes"
189 --disable-optimizations) disable_opt="yes"
191 --disable-pmem) disable_pmem="yes"
193 --enable-cuda) enable_cuda="yes"
199 echo "Bad option $opt"
205 if test "$show_help" = "yes" ; then
206 echo "--prefix= Use this directory as installation prefix"
207 echo "--cpu= Specify target CPU if auto-detect fails"
208 echo "--cc= Specify compiler to use"
209 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
210 echo "--build-32bit-win Enable 32-bit build on Windows"
211 echo "--build-static Build a static fio"
212 echo "--esx Configure build options for esx"
213 echo "--enable-gfio Enable building of gtk gfio"
214 echo "--disable-numa Disable libnuma even if found"
215 echo "--disable-rdma Disable RDMA support even if found"
216 echo "--disable-gfapi Disable gfapi"
217 echo "--enable-libhdfs Enable hdfs support"
218 echo "--disable-lex Disable use of lex/yacc for math"
219 echo "--disable-pmem Disable pmem based engines even if found"
220 echo "--enable-lex Enable use of lex/yacc for math"
221 echo "--disable-shm Disable SHM support"
222 echo "--disable-optimizations Don't enable compiler optimizations"
223 echo "--enable-cuda Enable GPUDirect RDMA support"
227 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
228 # Preferred compiler (can be overriden later after we know the platform):
230 # ${cross_prefix}gcc (if cross-prefix specified)
233 if test -z "${CC}${cross_prefix}"; then
240 cc="${CC-${cross_prefix}gcc}"
243 if check_define __ANDROID__ ; then
245 elif check_define __linux__ ; then
247 elif check_define __OpenBSD__ ; then
249 elif check_define __sun__ ; then
251 CFLAGS="$CFLAGS -D_REENTRANT"
252 elif check_define _WIN32 ; then
258 echo "# Automatically generated by configure - do not modify" > $config_host_mak
259 printf "# Configured with:" >> $config_host_mak
260 printf " '%s'" "$0" "$@" >> $config_host_mak
261 echo >> $config_host_mak
262 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
264 if test "$no_shm" = "yes" ; then
265 output_sym "CONFIG_NO_SHM"
268 if test "$disable_opt" = "yes" ; then
269 output_sym "CONFIG_FIO_NO_OPT"
272 # Some host OSes need non-standard checks for which CPU to use.
273 # Note that these checks are broken for cross-compilation: if you're
274 # cross-compiling to one of these OSes then you'll need to specify
275 # the correct CPU with the --cpu option.
278 # Unless explicitly enabled, turn off lex.
279 # OpenBSD will hit syntax error when enabled.
280 if test -z "$disable_lex" ; then
287 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
288 # we can run 64-bit userspace code.
289 # If the user didn't specify a CPU explicitly and the kernel says this is
290 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
292 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
295 # Error at compile time linking of weak/partial symbols if possible...
302 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
303 echo "Disabling weak symbols"
304 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
308 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
309 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
312 LIBS="-lnsl -lsocket"
315 # We still force some options, so keep this message here.
316 echo "Forcing some known good options on Windows"
317 if test -z "${CC}${cross_prefix}"; then
318 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
319 cc="i686-w64-mingw32-gcc"
320 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
321 echo "Building with zlib support"
322 output_sym "CONFIG_ZLIB"
323 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
326 cc="x86_64-w64-mingw32-gcc"
327 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
328 echo "Building with zlib support"
329 output_sym "CONFIG_ZLIB"
330 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
334 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
335 output_sym "CONFIG_32BIT"
337 output_sym "CONFIG_64BIT_LLP64"
339 # We need this to be output_sym'd here because this is Windows specific.
340 # The regular configure path never sets this config.
341 output_sym "CONFIG_WINDOWSAIO"
342 # We now take the regular configuration path without having exit 0 here.
343 # Flags below are still necessary mostly for MinGW.
350 clock_gettime="yes" # clock_monotonic probe has dependency on this
351 clock_monotonic="yes"
359 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
363 # Now we know the target platform we can have another guess at the preferred
364 # compiler when it wasn't explictly set
365 if test -z "${CC}${cross_prefix}"; then
366 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
372 if test -z "$cc"; then
373 echo "configure: failed to find compiler"
377 if test ! -z "$cpu" ; then
378 # command line argument
380 elif check_define __i386__ ; then
382 elif check_define __x86_64__ ; then
384 elif check_define __sparc__ ; then
385 if check_define __arch64__ ; then
390 elif check_define _ARCH_PPC ; then
391 if check_define _ARCH_PPC64 ; then
396 elif check_define __mips__ ; then
398 elif check_define __ia64__ ; then
400 elif check_define __s390__ ; then
401 if check_define __s390x__ ; then
406 elif check_define __arm__ ; then
408 elif check_define __aarch64__ ; then
410 elif check_define __hppa__ ; then
416 # Normalise host CPU name and set ARCH.
418 ia64|ppc|ppc64|s390|s390x|sparc64)
421 i386|i486|i586|i686|i86pc|BePC)
433 hppa|parisc|parisc64)
447 ##########################################
448 # check cross compile
450 if test "$cross_compile" != "yes" ; then
459 if compile_prog "" "" "cross"; then
460 $TMPE 2>/dev/null || cross_compile="yes"
462 fatal "compile test failed"
465 ##########################################
467 if test "$bigendian" != "yes" ; then
470 if test "$cross_compile" = "no" ; then
472 #include <inttypes.h>
475 volatile uint32_t i=0x01234567;
476 return (*((uint8_t*)(&i))) == 0x67;
479 if compile_prog "" "" "endian"; then
480 $TMPE && bigendian="yes"
483 # If we're cross compiling, try our best to work it out and rely on the
484 # run-time check to fail if we get it wrong.
489 #if __BYTE_ORDER != __BIG_ENDIAN
490 # error "Unknown endianness"
494 compile_prog "" "" "endian" && bigendian="yes"
495 check_define "__ARMEB__" && bigendian="yes"
496 check_define "__MIPSEB__" && bigendian="yes"
500 print_config "Operating system" "$targetos"
501 print_config "CPU" "$cpu"
502 print_config "Big endian" "$bigendian"
503 print_config "Compiler" "$cc"
504 print_config "Cross compile" "$cross_compile"
507 ##########################################
508 # See if we need to build a static build
509 if test "$build_static" = "yes" ; then
510 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
511 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
515 print_config "Static build" "$build_static"
517 ##########################################
522 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
525 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
529 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
531 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
534 fatal "Unknown wordsize"
536 print_config "Wordsize" "$wordsize"
538 ##########################################
540 if test "$zlib" != "yes" ; then
548 if (inflateInit(&stream) != Z_OK)
553 if compile_prog "" "-lz" "zlib" ; then
557 print_config "zlib" "$zlib"
559 ##########################################
561 if test "$libaio" != "yes" ; then
564 if test "$esx" != "yes" ; then
574 if compile_prog "" "-laio" "libaio" ; then
578 if test "$libaio" = "yes" ; then
579 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
584 print_config "Linux AIO support" "$libaio"
586 ##########################################
588 if test "$posix_aio" != "yes" ; then
591 if test "$posix_aio_lrt" != "yes" ; then
603 if compile_prog "" "" "posixaio" ; then
605 elif compile_prog "" "-lrt" "posixaio"; then
610 print_config "POSIX AIO support" "$posix_aio"
611 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
613 ##########################################
614 # posix aio fsync probe
615 if test "$posix_aio_fsync" != "yes" ; then
618 if test "$posix_aio" = "yes" ; then
625 return aio_fsync(O_SYNC, &cb);
629 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
633 print_config "POSIX AIO fsync" "$posix_aio_fsync"
635 ##########################################
636 # POSIX pshared attribute probe
637 if test "$posix_pshared" != "yes" ; then
644 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
645 # if defined(__CYGWIN__)
646 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
647 # elif defined(__APPLE__)
648 # include <AvailabilityMacros.h>
649 # include <TargetConditionals.h>
650 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
651 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
655 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
660 if compile_prog "" "$LIBS" "posix_pshared" ; then
663 print_config "POSIX pshared support" "$posix_pshared"
665 ##########################################
667 if test "$solaris_aio" != "yes" ; then
671 #include <sys/types.h>
672 #include <sys/asynch.h>
677 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
681 if compile_prog "" "-laio" "solarisaio" ; then
685 print_config "Solaris AIO support" "$solaris_aio"
687 ##########################################
688 # __sync_fetch_and_add test
689 if test "$sfaa" != "yes" ; then
693 #include <inttypes.h>
694 static int sfaa(uint64_t *ptr)
696 return __sync_fetch_and_add(ptr, 0);
699 int main(int argc, char **argv)
706 if compile_prog "" "" "__sync_fetch_and_add()" ; then
709 print_config "__sync_fetch_and_add" "$sfaa"
711 ##########################################
712 # __sync_synchronize() test
713 if test "$sync_sync" != "yes" ; then
717 #include <inttypes.h>
719 int main(int argc, char **argv)
721 __sync_synchronize();
725 if compile_prog "" "" "__sync_synchronize()" ; then
728 print_config "__sync_synchronize" "$sync_sync"
730 ##########################################
731 # __sync_val_compare_and_swap() test
732 if test "$cmp_swap" != "yes" ; then
736 #include <inttypes.h>
738 int main(int argc, char **argv)
741 return __sync_val_compare_and_swap(&x, 1, 2);
744 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
747 print_config "__sync_val_compare_and_swap" "$cmp_swap"
749 ##########################################
751 if test "$libverbs" != "yes" ; then
755 #include <infiniband/verbs.h>
756 int main(int argc, char **argv)
758 struct ibv_pd *pd = ibv_alloc_pd(NULL);
762 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
764 LIBS="-libverbs $LIBS"
766 print_config "libverbs" "$libverbs"
768 ##########################################
770 if test "$rdmacm" != "yes" ; then
775 #include <rdma/rdma_cma.h>
776 int main(int argc, char **argv)
778 rdma_destroy_qp(NULL);
782 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
784 LIBS="-lrdmacm $LIBS"
786 print_config "rdmacm" "$rdmacm"
788 ##########################################
789 # Linux fallocate probe
790 if test "$linux_fallocate" != "yes" ; then
796 #include <linux/falloc.h>
797 int main(int argc, char **argv)
799 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
803 if compile_prog "" "" "linux_fallocate"; then
804 linux_fallocate="yes"
806 print_config "Linux fallocate" "$linux_fallocate"
808 ##########################################
809 # POSIX fadvise probe
810 if test "$posix_fadvise" != "yes" ; then
816 int main(int argc, char **argv)
818 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
822 if compile_prog "" "" "posix_fadvise"; then
825 print_config "POSIX fadvise" "$posix_fadvise"
827 ##########################################
828 # POSIX fallocate probe
829 if test "$posix_fallocate" != "yes" ; then
835 int main(int argc, char **argv)
837 int r = posix_fallocate(0, 0, 1024);
841 if compile_prog "" "" "posix_fallocate"; then
842 posix_fallocate="yes"
844 print_config "POSIX fallocate" "$posix_fallocate"
846 ##########################################
847 # sched_set/getaffinity 2 or 3 argument test
848 if test "$linux_2arg_affinity" != "yes" ; then
849 linux_2arg_affinity="no"
851 if test "$linux_3arg_affinity" != "yes" ; then
852 linux_3arg_affinity="no"
856 int main(int argc, char **argv)
859 return sched_setaffinity(0, sizeof(mask), &mask);
862 if compile_prog "" "" "sched_setaffinity(,,)"; then
863 linux_3arg_affinity="yes"
867 int main(int argc, char **argv)
870 return sched_setaffinity(0, &mask);
873 if compile_prog "" "" "sched_setaffinity(,)"; then
874 linux_2arg_affinity="yes"
877 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
878 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
880 ##########################################
881 # clock_gettime probe
882 if test "$clock_gettime" != "yes" ; then
888 int main(int argc, char **argv)
890 return clock_gettime(0, NULL);
893 if compile_prog "" "" "clock_gettime"; then
895 elif compile_prog "" "-lrt" "clock_gettime"; then
899 print_config "clock_gettime" "$clock_gettime"
901 ##########################################
902 # CLOCK_MONOTONIC probe
903 if test "$clock_monotonic" != "yes" ; then
906 if test "$clock_gettime" = "yes" ; then
910 int main(int argc, char **argv)
912 return clock_gettime(CLOCK_MONOTONIC, NULL);
915 if compile_prog "" "$LIBS" "clock monotonic"; then
916 clock_monotonic="yes"
919 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
921 ##########################################
922 # CLOCK_MONOTONIC_RAW probe
923 if test "$clock_monotonic_raw" != "yes" ; then
924 clock_monotonic_raw="no"
926 if test "$clock_gettime" = "yes" ; then
930 int main(int argc, char **argv)
932 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
935 if compile_prog "" "$LIBS" "clock monotonic"; then
936 clock_monotonic_raw="yes"
939 print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
941 ##########################################
942 # CLOCK_MONOTONIC_PRECISE probe
943 if test "$clock_monotonic_precise" != "yes" ; then
944 clock_monotonic_precise="no"
946 if test "$clock_gettime" = "yes" ; then
950 int main(int argc, char **argv)
952 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
955 if compile_prog "" "$LIBS" "clock monotonic precise"; then
956 clock_monotonic_precise="yes"
959 print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
961 ##########################################
963 if test "$clockid_t" != "yes" ; then
969 int main(int argc, char **argv)
971 volatile clockid_t cid;
972 memset((void*)&cid, 0, sizeof(cid));
976 if compile_prog "" "$LIBS" "clockid_t"; then
979 print_config "clockid_t" "$clockid_t"
981 ##########################################
982 # gettimeofday() probe
983 if test "$gettimeofday" != "yes" ; then
987 #include <sys/time.h>
989 int main(int argc, char **argv)
992 return gettimeofday(&tv, NULL);
995 if compile_prog "" "" "gettimeofday"; then
998 print_config "gettimeofday" "$gettimeofday"
1000 ##########################################
1002 if test "$fdatasync" != "yes" ; then
1008 int main(int argc, char **argv)
1010 return fdatasync(0);
1013 if compile_prog "" "" "fdatasync"; then
1016 print_config "fdatasync" "$fdatasync"
1018 ##########################################
1019 # sync_file_range() probe
1020 if test "$sync_file_range" != "yes" ; then
1021 sync_file_range="no"
1027 #include <linux/fs.h>
1028 int main(int argc, char **argv)
1030 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1031 SYNC_FILE_RANGE_WAIT_AFTER;
1032 return sync_file_range(0, 0, 0, flags);
1035 if compile_prog "" "" "sync_file_range"; then
1036 sync_file_range="yes"
1038 print_config "sync_file_range" "$sync_file_range"
1040 ##########################################
1041 # ext4 move extent probe
1042 if test "$ext4_me" != "yes" ; then
1047 #include <sys/ioctl.h>
1048 int main(int argc, char **argv)
1050 struct move_extent me;
1051 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1054 if compile_prog "" "" "ext4 move extent" ; then
1056 elif test $targetos = "Linux" ; then
1057 # On Linux, just default to it on and let it error at runtime if we really
1058 # don't have it. None of my updated systems have it defined, but it does
1059 # work. Takes a while to bubble back.
1062 print_config "EXT4 move extent" "$ext4_me"
1064 ##########################################
1066 if test "$linux_splice" != "yes" ; then
1072 int main(int argc, char **argv)
1074 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1077 if compile_prog "" "" "linux splice"; then
1080 print_config "Linux splice(2)" "$linux_splice"
1082 ##########################################
1084 if test "$guasi" != "yes" ; then
1089 #include <guasi_syscalls.h>
1090 int main(int argc, char **argv)
1092 guasi_t ctx = guasi_create(0, 0, 0);
1096 if compile_prog "" "" "guasi"; then
1099 print_config "GUASI" "$guasi"
1101 ##########################################
1103 if test "$fusion_aw" != "yes" ; then
1107 #include <nvm/nvm_primitives.h>
1108 int main(int argc, char **argv)
1110 nvm_version_t ver_info;
1111 nvm_handle_t handle;
1113 handle = nvm_get_handle(0, &ver_info);
1114 return nvm_atomic_write(handle, 0, 0, 0);
1117 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1118 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1121 print_config "Fusion-io atomic engine" "$fusion_aw"
1123 ##########################################
1125 if test "$libnuma" != "yes" ; then
1130 int main(int argc, char **argv)
1132 return numa_available();
1135 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1139 print_config "libnuma" "$libnuma"
1141 ##########################################
1142 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1143 if test "$libnuma" = "yes" ; then
1147 int main(int argc, char **argv)
1149 struct bitmask *mask = numa_parse_nodestring(NULL);
1150 return mask->size == 0;
1153 if compile_prog "" "" "libnuma api"; then
1156 print_config "libnuma v2" "$libnuma_v2"
1159 ##########################################
1161 if test "$strsep" != "yes" ; then
1166 int main(int argc, char **argv)
1168 static char *string = "This is a string";
1169 strsep(&string, "needle");
1173 if compile_prog "" "" "strsep"; then
1176 print_config "strsep" "$strsep"
1178 ##########################################
1179 # strcasestr() probe
1180 if test "$strcasestr" != "yes" ; then
1185 int main(int argc, char **argv)
1187 return strcasestr(argv[0], argv[1]) != NULL;
1190 if compile_prog "" "" "strcasestr"; then
1193 print_config "strcasestr" "$strcasestr"
1195 ##########################################
1197 if test "$strlcat" != "yes" ; then
1202 int main(int argc, char **argv)
1204 static char dst[64];
1205 static char *string = "This is a string";
1206 memset(dst, 0, sizeof(dst));
1207 strlcat(dst, string, sizeof(dst));
1211 if compile_prog "" "" "strlcat"; then
1214 print_config "strlcat" "$strlcat"
1216 ##########################################
1217 # getopt_long_only() probe
1218 if test "$getopt_long_only" != "yes" ; then
1219 getopt_long_only="no"
1225 int main(int argc, char **argv)
1227 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1231 if compile_prog "" "" "getopt_long_only"; then
1232 getopt_long_only="yes"
1234 print_config "getopt_long_only()" "$getopt_long_only"
1236 ##########################################
1238 if test "$inet_aton" != "yes" ; then
1242 #include <sys/socket.h>
1243 #include <arpa/inet.h>
1245 int main(int argc, char **argv)
1248 return inet_aton(NULL, &in);
1251 if compile_prog "" "" "inet_aton"; then
1254 print_config "inet_aton" "$inet_aton"
1256 ##########################################
1258 if test "$socklen_t" != "yes" ; then
1262 #include <sys/socket.h>
1263 int main(int argc, char **argv)
1269 if compile_prog "" "" "socklen_t"; then
1272 print_config "socklen_t" "$socklen_t"
1274 ##########################################
1275 # Whether or not __thread is supported for TLS
1276 if test "$tls_thread" != "yes" ; then
1281 static __thread int ret;
1282 int main(int argc, char **argv)
1287 if compile_prog "" "" "__thread"; then
1290 print_config "__thread" "$tls_thread"
1292 ##########################################
1293 # Check if we have required gtk/glib support for gfio
1294 if test "$gfio" != "yes" ; then
1297 if test "$gfio_check" = "yes" ; then
1301 #include <gtk/gtk.h>
1304 gdk_threads_enter();
1305 gdk_threads_leave();
1307 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1310 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1311 ORG_LDFLAGS=$LDFLAGS
1312 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1313 if test "$?" != "0" ; then
1314 echo "configure: gtk and gthread not found"
1317 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1318 if test "$?" != "0" ; then
1319 echo "configure: gtk and gthread not found"
1322 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1324 if test "$?" = "0" ; then
1326 GFIO_LIBS="$LIBS $GTK_LIBS"
1327 CFLAGS="$CFLAGS $GTK_CFLAGS"
1329 echo "GTK found, but need version 2.18 or higher"
1333 echo "Please install gtk and gdk libraries"
1336 LDFLAGS=$ORG_LDFLAGS
1339 if test "$gfio_check" = "yes" ; then
1340 print_config "gtk 2.18 or higher" "$gfio"
1343 ##########################################
1344 # Check whether we have getrusage(RUSAGE_THREAD)
1345 if test "$rusage_thread" != "yes" ; then
1349 #include <sys/time.h>
1350 #include <sys/resource.h>
1351 int main(int argc, char **argv)
1354 getrusage(RUSAGE_THREAD, &ru);
1358 if compile_prog "" "" "RUSAGE_THREAD"; then
1361 print_config "RUSAGE_THREAD" "$rusage_thread"
1363 ##########################################
1364 # Check whether we have SCHED_IDLE
1365 if test "$sched_idle" != "yes" ; then
1370 int main(int argc, char **argv)
1372 struct sched_param p;
1373 return sched_setscheduler(0, SCHED_IDLE, &p);
1376 if compile_prog "" "" "SCHED_IDLE"; then
1379 print_config "SCHED_IDLE" "$sched_idle"
1381 ##########################################
1382 # Check whether we have TCP_NODELAY
1383 if test "$tcp_nodelay" != "yes" ; then
1388 #include <sys/types.h>
1389 #include <sys/socket.h>
1390 #include <netinet/tcp.h>
1391 int main(int argc, char **argv)
1393 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1396 if compile_prog "" "" "TCP_NODELAY"; then
1399 print_config "TCP_NODELAY" "$tcp_nodelay"
1401 ##########################################
1402 # Check whether we have SO_SNDBUF
1403 if test "$window_size" != "yes" ; then
1408 #include <sys/types.h>
1409 #include <sys/socket.h>
1410 #include <netinet/tcp.h>
1411 int main(int argc, char **argv)
1413 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1414 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1417 if compile_prog "" "" "SO_SNDBUF"; then
1420 print_config "Net engine window_size" "$window_size"
1422 ##########################################
1423 # Check whether we have TCP_MAXSEG
1424 if test "$mss" != "yes" ; then
1429 #include <sys/types.h>
1430 #include <sys/socket.h>
1431 #include <netinet/tcp.h>
1432 #include <arpa/inet.h>
1433 #include <netinet/in.h>
1434 int main(int argc, char **argv)
1436 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1439 if compile_prog "" "" "TCP_MAXSEG"; then
1442 print_config "TCP_MAXSEG" "$mss"
1444 ##########################################
1445 # Check whether we have RLIMIT_MEMLOCK
1446 if test "$rlimit_memlock" != "yes" ; then
1450 #include <sys/time.h>
1451 #include <sys/resource.h>
1452 int main(int argc, char **argv)
1455 return getrlimit(RLIMIT_MEMLOCK, &rl);
1458 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1459 rlimit_memlock="yes"
1461 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1463 ##########################################
1464 # Check whether we have pwritev/preadv
1465 if test "$pwritev" != "yes" ; then
1470 #include <sys/uio.h>
1471 int main(int argc, char **argv)
1473 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1476 if compile_prog "" "" "pwritev"; then
1479 print_config "pwritev/preadv" "$pwritev"
1481 ##########################################
1482 # Check whether we have pwritev2/preadv2
1483 if test "$pwritev2" != "yes" ; then
1488 #include <sys/uio.h>
1489 int main(int argc, char **argv)
1491 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1494 if compile_prog "" "" "pwritev2"; then
1497 print_config "pwritev2/preadv2" "$pwritev2"
1499 ##########################################
1500 # Check whether we have the required functions for ipv6
1501 if test "$ipv6" != "yes" ; then
1505 #include <sys/types.h>
1506 #include <sys/socket.h>
1507 #include <netinet/in.h>
1510 int main(int argc, char **argv)
1512 struct addrinfo hints;
1513 struct in6_addr addr;
1516 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1518 printf("%s\n", gai_strerror(ret));
1523 if compile_prog "" "" "ipv6"; then
1526 print_config "IPv6 helpers" "$ipv6"
1528 ##########################################
1530 if test "$rbd" != "yes" ; then
1534 #include <rbd/librbd.h>
1536 int main(int argc, char **argv)
1539 rados_ioctx_t io_ctx;
1540 const char cluster_name[] = "ceph";
1541 const char user_name[] = "client.admin";
1542 const char pool[] = "rbd";
1543 int major, minor, extra;
1545 rbd_version(&major, &minor, &extra);
1546 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1547 rados_create2(&cluster, cluster_name, user_name, 0);
1548 rados_ioctx_create(cluster, pool, &io_ctx);
1553 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1554 LIBS="-lrbd -lrados $LIBS"
1557 print_config "Rados Block Device engine" "$rbd"
1559 ##########################################
1560 # check for rbd_poll
1561 if test "$rbd_poll" != "yes" ; then
1564 if test "$rbd" = "yes"; then
1566 #include <rbd/librbd.h>
1567 #include <sys/eventfd.h>
1569 int main(int argc, char **argv)
1572 rbd_completion_t comp;
1574 int fd = eventfd(0, EFD_NONBLOCK);
1575 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1576 rbd_poll_io_events(image, comp, 1);
1581 if compile_prog "" "-lrbd -lrados" "rbd"; then
1584 print_config "rbd_poll" "$rbd_poll"
1587 ##########################################
1588 # check for rbd_invaidate_cache()
1589 if test "$rbd_inval" != "yes" ; then
1592 if test "$rbd" = "yes"; then
1594 #include <rbd/librbd.h>
1596 int main(int argc, char **argv)
1600 return rbd_invalidate_cache(image);
1603 if compile_prog "" "-lrbd -lrados" "rbd"; then
1606 print_config "rbd_invalidate_cache" "$rbd_inval"
1609 ##########################################
1611 if test "$rbd_blkin" != "yes" ; then
1615 #include <rbd/librbd.h>
1616 #include <zipkin_c.h>
1618 int main(int argc, char **argv)
1621 struct blkin_trace_info t_info;
1622 blkin_init_trace_info(&t_info);
1623 rbd_completion_t completion;
1628 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1632 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1633 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1634 LIBS="-lblkin $LIBS"
1637 print_config "rbd blkin tracing" "$rbd_blkin"
1639 ##########################################
1640 # Check whether we have setvbuf
1641 if test "$setvbuf" != "yes" ; then
1646 int main(int argc, char **argv)
1650 setvbuf(f, buf, _IOFBF, sizeof(buf));
1654 if compile_prog "" "" "setvbuf"; then
1657 print_config "setvbuf" "$setvbuf"
1659 ##########################################
1661 if test "$gfapi" != "yes" ; then
1665 #include <glusterfs/api/glfs.h>
1667 int main(int argc, char **argv)
1669 glfs_t *g = glfs_new("foo");
1674 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1675 LIBS="-lgfapi -lglusterfs $LIBS"
1678 print_config "Gluster API engine" "$gfapi"
1680 ##########################################
1681 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1682 if test "$gfapi" = "yes" ; then
1685 #include <glusterfs/api/glfs.h>
1687 int main(int argc, char **argv)
1690 int ret = glfs_fadvise(fd, 0, 0, 1);
1695 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1698 print_config "Gluster API use fadvise" "$gf_fadvise"
1701 ##########################################
1702 # check for gfapi trim support
1703 if test "$gf_trim" != "yes" ; then
1706 if test "$gfapi" = "yes" ; then
1708 #include <glusterfs/api/glfs.h>
1710 int main(int argc, char **argv)
1712 return glfs_discard_async(NULL, 0, 0);
1715 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1718 print_config "Gluster API trim support" "$gf_trim"
1721 ##########################################
1722 # Check if we support stckf on s390
1723 if test "$s390_z196_facilities" != "yes" ; then
1724 s390_z196_facilities="no"
1727 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1728 int main(int argc, char **argv)
1730 /* We want just 1 double word to be returned. */
1731 register unsigned long reg0 asm("0") = 0;
1732 unsigned long stfle_bits;
1733 asm volatile(".machine push" "\n\t"
1734 ".machine \"z9-109\"" "\n\t"
1737 : "=QS" (stfle_bits), "+d" (reg0)
1740 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1746 if compile_prog "" "" "s390_z196_facilities"; then
1748 if [ $? -eq 0 ]; then
1749 s390_z196_facilities="yes"
1752 print_config "s390_z196_facilities" "$s390_z196_facilities"
1754 ##########################################
1755 # Check if we have required environment variables configured for libhdfs
1756 if test "$libhdfs" = "yes" ; then
1758 if test "$JAVA_HOME" = "" ; then
1759 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1762 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1763 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1766 if test "$FIO_LIBHDFS_LIB" = "" ; then
1767 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1770 if test "$hdfs_conf_error" = "1" ; then
1774 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1775 FIO_HDFS_CPU="amd64"
1778 print_config "HDFS engine" "$libhdfs"
1780 ##########################################
1781 # Check whether we have MTD
1782 if test "$mtd" != "yes" ; then
1787 #include <mtd/mtd-user.h>
1788 #include <sys/ioctl.h>
1789 int main(int argc, char **argv)
1791 struct mtd_write_req ops;
1792 struct mtd_info_user info;
1793 memset(&ops, 0, sizeof(ops));
1794 info.type = MTD_MLCNANDFLASH;
1795 return ioctl(0, MEMGETINFO, &info);
1798 if compile_prog "" "" "mtd"; then
1801 print_config "MTD" "$mtd"
1803 ##########################################
1804 # Check whether we have libpmem
1805 if test "$libpmem" != "yes" ; then
1809 #include <libpmem.h>
1810 int main(int argc, char **argv)
1813 rc = pmem_is_pmem(0, 0);
1817 if compile_prog "" "-lpmem" "libpmem"; then
1821 print_config "libpmem" "$libpmem"
1823 ##########################################
1824 # Check whether we have libpmemblk
1825 # libpmem is a prerequisite
1826 if test "$libpmemblk" != "yes" ; then
1829 if test "$libpmem" = "yes"; then
1831 #include <libpmemblk.h>
1832 int main(int argc, char **argv)
1835 pbp = pmemblk_open("", 0);
1839 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1841 LIBS="-lpmemblk $LIBS"
1844 print_config "libpmemblk" "$libpmemblk"
1846 # Choose the ioengines
1847 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1849 if test "$libpmemblk" = "yes"; then
1854 ##########################################
1855 # Report whether pmemblk engine is enabled
1856 print_config "NVML pmemblk engine" "$pmemblk"
1858 ##########################################
1859 # Report whether dev-dax engine is enabled
1860 print_config "NVML dev-dax engine" "$devdax"
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"
2071 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2073 ##########################################
2075 if test "$cuda" != "yes" ; then
2080 int main(int argc, char **argv)
2085 if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
2089 print_config "cuda" "$cuda"
2091 ##########################################
2092 # mkdir() probe. mingw apparently has a one-argument mkdir :/
2095 #include <sys/stat.h>
2096 #include <sys/types.h>
2097 int main(int argc, char **argv)
2099 return mkdir("/tmp/bla", 0600);
2102 if compile_prog "" "" "mkdir(a, b)"; then
2105 print_config "mkdir(a, b)" "$mkdir_two"
2107 #############################################################################
2109 if test "$wordsize" = "64" ; then
2110 output_sym "CONFIG_64BIT"
2111 elif test "$wordsize" = "32" ; then
2112 output_sym "CONFIG_32BIT"
2114 fatal "Unknown wordsize!"
2116 if test "$bigendian" = "yes" ; then
2117 output_sym "CONFIG_BIG_ENDIAN"
2119 output_sym "CONFIG_LITTLE_ENDIAN"
2121 if test "$zlib" = "yes" ; then
2122 output_sym "CONFIG_ZLIB"
2124 if test "$libaio" = "yes" ; then
2125 output_sym "CONFIG_LIBAIO"
2127 if test "$posix_aio" = "yes" ; then
2128 output_sym "CONFIG_POSIXAIO"
2130 if test "$posix_aio_fsync" = "yes" ; then
2131 output_sym "CONFIG_POSIXAIO_FSYNC"
2133 if test "$posix_pshared" = "yes" ; then
2134 output_sym "CONFIG_PSHARED"
2136 if test "$linux_fallocate" = "yes" ; then
2137 output_sym "CONFIG_LINUX_FALLOCATE"
2139 if test "$posix_fallocate" = "yes" ; then
2140 output_sym "CONFIG_POSIX_FALLOCATE"
2142 if test "$fdatasync" = "yes" ; then
2143 output_sym "CONFIG_FDATASYNC"
2145 if test "$sync_file_range" = "yes" ; then
2146 output_sym "CONFIG_SYNC_FILE_RANGE"
2148 if test "$sfaa" = "yes" ; then
2149 output_sym "CONFIG_SFAA"
2151 if test "$sync_sync" = "yes" ; then
2152 output_sym "CONFIG_SYNC_SYNC"
2154 if test "$cmp_swap" = "yes" ; then
2155 output_sym "CONFIG_CMP_SWAP"
2157 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2158 output_sym "CONFIG_RDMA"
2160 if test "$clock_gettime" = "yes" ; then
2161 output_sym "CONFIG_CLOCK_GETTIME"
2163 if test "$clock_monotonic" = "yes" ; then
2164 output_sym "CONFIG_CLOCK_MONOTONIC"
2166 if test "$clock_monotonic_raw" = "yes" ; then
2167 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2169 if test "$clock_monotonic_precise" = "yes" ; then
2170 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2172 if test "$clockid_t" = "yes"; then
2173 output_sym "CONFIG_CLOCKID_T"
2175 if test "$gettimeofday" = "yes" ; then
2176 output_sym "CONFIG_GETTIMEOFDAY"
2178 if test "$posix_fadvise" = "yes" ; then
2179 output_sym "CONFIG_POSIX_FADVISE"
2181 if test "$linux_3arg_affinity" = "yes" ; then
2182 output_sym "CONFIG_3ARG_AFFINITY"
2183 elif test "$linux_2arg_affinity" = "yes" ; then
2184 output_sym "CONFIG_2ARG_AFFINITY"
2186 if test "$strsep" = "yes" ; then
2187 output_sym "CONFIG_STRSEP"
2189 if test "$strcasestr" = "yes" ; then
2190 output_sym "CONFIG_STRCASESTR"
2192 if test "$strlcat" = "yes" ; then
2193 output_sym "CONFIG_STRLCAT"
2195 if test "$getopt_long_only" = "yes" ; then
2196 output_sym "CONFIG_GETOPT_LONG_ONLY"
2198 if test "$inet_aton" = "yes" ; then
2199 output_sym "CONFIG_INET_ATON"
2201 if test "$socklen_t" = "yes" ; then
2202 output_sym "CONFIG_SOCKLEN_T"
2204 if test "$ext4_me" = "yes" ; then
2205 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2207 if test "$linux_splice" = "yes" ; then
2208 output_sym "CONFIG_LINUX_SPLICE"
2210 if test "$guasi" = "yes" ; then
2211 output_sym "CONFIG_GUASI"
2213 if test "$fusion_aw" = "yes" ; then
2214 output_sym "CONFIG_FUSION_AW"
2216 if test "$libnuma_v2" = "yes" ; then
2217 output_sym "CONFIG_LIBNUMA"
2219 if test "$solaris_aio" = "yes" ; then
2220 output_sym "CONFIG_SOLARISAIO"
2222 if test "$tls_thread" = "yes" ; then
2223 output_sym "CONFIG_TLS_THREAD"
2225 if test "$rusage_thread" = "yes" ; then
2226 output_sym "CONFIG_RUSAGE_THREAD"
2228 if test "$gfio" = "yes" ; then
2229 output_sym "CONFIG_GFIO"
2231 if test "$esx" = "yes" ; then
2232 output_sym "CONFIG_ESX"
2233 output_sym "CONFIG_NO_SHM"
2235 if test "$sched_idle" = "yes" ; then
2236 output_sym "CONFIG_SCHED_IDLE"
2238 if test "$tcp_nodelay" = "yes" ; then
2239 output_sym "CONFIG_TCP_NODELAY"
2241 if test "$window_size" = "yes" ; then
2242 output_sym "CONFIG_NET_WINDOWSIZE"
2244 if test "$mss" = "yes" ; then
2245 output_sym "CONFIG_NET_MSS"
2247 if test "$rlimit_memlock" = "yes" ; then
2248 output_sym "CONFIG_RLIMIT_MEMLOCK"
2250 if test "$pwritev" = "yes" ; then
2251 output_sym "CONFIG_PWRITEV"
2253 if test "$pwritev2" = "yes" ; then
2254 output_sym "CONFIG_PWRITEV2"
2256 if test "$ipv6" = "yes" ; then
2257 output_sym "CONFIG_IPV6"
2259 if test "$rbd" = "yes" ; then
2260 output_sym "CONFIG_RBD"
2262 if test "$rbd_poll" = "yes" ; then
2263 output_sym "CONFIG_RBD_POLL"
2265 if test "$rbd_inval" = "yes" ; then
2266 output_sym "CONFIG_RBD_INVAL"
2268 if test "$rbd_blkin" = "yes" ; then
2269 output_sym "CONFIG_RBD_BLKIN"
2271 if test "$setvbuf" = "yes" ; then
2272 output_sym "CONFIG_SETVBUF"
2274 if test "$s390_z196_facilities" = "yes" ; then
2275 output_sym "CONFIG_S390_Z196_FACILITIES"
2276 CFLAGS="$CFLAGS -march=z9-109"
2278 if test "$gfapi" = "yes" ; then
2279 output_sym "CONFIG_GFAPI"
2281 if test "$gf_fadvise" = "yes" ; then
2282 output_sym "CONFIG_GF_FADVISE"
2284 if test "$gf_trim" = "yes" ; then
2285 output_sym "CONFIG_GF_TRIM"
2287 if test "$libhdfs" = "yes" ; then
2288 output_sym "CONFIG_LIBHDFS"
2289 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2290 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2291 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2292 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2294 if test "$mtd" = "yes" ; then
2295 output_sym "CONFIG_MTD"
2297 if test "$pmemblk" = "yes" ; then
2298 output_sym "CONFIG_PMEMBLK"
2300 if test "$devdax" = "yes" ; then
2301 output_sym "CONFIG_LINUX_DEVDAX"
2303 if test "$arith" = "yes" ; then
2304 output_sym "CONFIG_ARITHMETIC"
2305 if test "$yacc_is_bison" = "yes" ; then
2306 echo "YACC=$YACC -y" >> $config_host_mak
2308 echo "YACC=$YACC" >> $config_host_mak
2310 if test "$lex_use_o" = "yes" ; then
2311 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2314 if test "$getmntent" = "yes" ; then
2315 output_sym "CONFIG_GETMNTENT"
2317 if test "$getmntinfo" = "yes" ; then
2318 output_sym "CONFIG_GETMNTINFO"
2320 if test "$getmntinfo_statvfs" = "yes" ; then
2321 output_sym "CONFIG_GETMNTINFO_STATVFS"
2323 if test "$static_assert" = "yes" ; then
2324 output_sym "CONFIG_STATIC_ASSERT"
2326 if test "$have_bool" = "yes" ; then
2327 output_sym "CONFIG_HAVE_BOOL"
2329 if test "$strndup" = "yes" ; then
2330 output_sym "CONFIG_HAVE_STRNDUP"
2332 if test "$disable_opt" = "yes" ; then
2333 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2335 if test "$zlib" = "no" ; then
2336 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2338 if test "$cuda" = "yes" ; then
2339 output_sym "CONFIG_CUDA"
2341 if test "$mkdir_two" = "yes" ; then
2342 output_sym "CONFIG_HAVE_MKDIR_TWO"
2345 echo "LIBS+=$LIBS" >> $config_host_mak
2346 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2347 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2348 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2349 echo "CC=$cc" >> $config_host_mak
2350 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2351 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2353 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2354 cat > Makefile <<EOF
2355 SRCDIR:=`dirname $0`
2356 include \$(SRCDIR)/Makefile