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
41 CFLAGS="-D_GNU_SOURCE -include config-host.h"
44 # Print a helpful header at the top of config.log
45 echo "# FIO configure log $(date)" >> config.log
46 printf "# Configured with:" >> config.log
47 printf " '%s'" "$0" "$@" >> config.log
49 echo "#" >> config.log
51 # Print configure header at the top of $config_host_h
52 echo "/*" > $config_host_h
53 echo " * Automatically generated by configure - do not modify" >> $config_host_h
54 printf " * Configured with:" >> $config_host_h
55 printf " * '%s'" "$0" "$@" >> $config_host_h
56 echo "" >> $config_host_h
57 echo " */" >> $config_host_h
60 # Run the compiler, capturing its output to the log.
61 echo $cc "$@" >> config.log
62 $cc "$@" >> config.log 2>&1 || return $?
63 # Test passed. If this is an --enable-werror build, rerun
64 # the test with -Werror and bail out if it fails. This
65 # makes warning-generating-errors in configure test code
66 # obvious to developers.
67 if test "$werror" != "yes"; then
70 # Don't bother rerunning the compile if we were already using -Werror
76 echo $cc -Werror "$@" >> config.log
77 $cc -Werror "$@" >> config.log 2>&1 && return $?
78 echo "ERROR: configure test passed without -Werror but failed with -Werror."
79 echo "This is probably a bug in the configure script. The failing command"
80 echo "will be at the bottom of config.log."
81 fatal "You can run configure with --disable-werror to bypass this check."
85 do_cc $CFLAGS -c -o $TMPO $TMPC
90 local_ldflags="$2 $LIBS"
91 echo "Compiling test case $3" >> config.log
92 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
100 echo "ERROR: User requested feature $feature"
101 if test ! -z "$packages" ; then
102 echo "ERROR: That feature needs $packages installed"
104 echo "ERROR: configure was not able to find it"
109 type "$1" >/dev/null 2>&1
115 #error $1 not defined
126 echo "$1=y" >> $config_host_mak
127 echo "#define $1" >> $config_host_h
146 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
148 --prefix=*) prefix="$optarg"
150 --cpu=*) cpu="$optarg"
152 # esx is cross compiled and cannot be detect through simple uname calls
158 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
160 --build-32bit-win) build_32bit_win="yes"
162 --build-static) build_static="yes"
167 --disable-numa) disable_numa="yes"
169 --disable-rbd) disable_rbd="yes"
171 --disable-rbd-blkin) disable_rbd_blkin="yes"
173 --disable-gfapi) disable_gfapi="yes"
175 --enable-libhdfs) libhdfs="yes"
177 --disable-lex) disable_lex="yes"
179 --enable-lex) disable_lex="no"
181 --disable-shm) no_shm="yes"
183 --disable-optimizations) disable_opt="yes"
185 --disable-pmem) disable_pmem="yes"
191 echo "Bad option $opt"
197 if test "$show_help" = "yes" ; then
198 echo "--prefix= Use this directory as installation prefix"
199 echo "--cpu= Specify target CPU if auto-detect fails"
200 echo "--cc= Specify compiler to use"
201 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
202 echo "--build-32bit-win Enable 32-bit build on Windows"
203 echo "--build-static Build a static fio"
204 echo "--esx Configure build options for esx"
205 echo "--enable-gfio Enable building of gtk gfio"
206 echo "--disable-numa Disable libnuma even if found"
207 echo "--disable-gfapi Disable gfapi"
208 echo "--enable-libhdfs Enable hdfs support"
209 echo "--disable-lex Disable use of lex/yacc for math"
210 echo "--disable-pmem Disable pmem based engines even if found"
211 echo "--enable-lex Enable use of lex/yacc for math"
212 echo "--disable-shm Disable SHM support"
213 echo "--disable-optimizations Don't enable compiler optimizations"
217 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
218 cc="${CC-${cross_prefix}gcc}"
220 if check_define __ANDROID__ ; then
222 elif check_define __linux__ ; then
224 elif check_define __OpenBSD__ ; then
226 elif check_define __sun__ ; then
228 CFLAGS="$CFLAGS -D_REENTRANT"
229 elif check_define _WIN32 ; then
235 echo "# Automatically generated by configure - do not modify" > $config_host_mak
236 printf "# Configured with:" >> $config_host_mak
237 printf " '%s'" "$0" "$@" >> $config_host_mak
238 echo >> $config_host_mak
239 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
241 if test "$no_shm" = "yes" ; then
242 output_sym "CONFIG_NO_SHM"
245 if test "$disable_opt" = "yes" ; then
246 output_sym "CONFIG_FIO_NO_OPT"
249 # Some host OSes need non-standard checks for which CPU to use.
250 # Note that these checks are broken for cross-compilation: if you're
251 # cross-compiling to one of these OSes then you'll need to specify
252 # the correct CPU with the --cpu option.
255 # Unless explicitly enabled, turn off lex.
256 if test -z "$disable_lex" ; then
263 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
264 # we can run 64-bit userspace code.
265 # If the user didn't specify a CPU explicitly and the kernel says this is
266 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
268 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
271 # Error at compile time linking of weak/partial symbols if possible...
278 if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then
279 echo "Disabling weak symbols"
280 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
284 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
285 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
288 LIBS="-lnsl -lsocket"
291 # We still force some options, so keep this message here.
292 echo "Forcing some known good options on Windows"
293 if test -z "$CC" ; then
294 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
295 CC="i686-w64-mingw32-gcc"
296 if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
297 echo "Building with zlib support"
298 output_sym "CONFIG_ZLIB"
299 echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
302 CC="x86_64-w64-mingw32-gcc"
303 if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then
304 echo "Building with zlib support"
305 output_sym "CONFIG_ZLIB"
306 echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak
310 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
311 output_sym "CONFIG_32BIT"
313 output_sym "CONFIG_64BIT_LLP64"
315 # We need this to be output_sym'd here because this is Windows specific.
316 # The regular configure path never sets this config.
317 output_sym "CONFIG_WINDOWSAIO"
318 # We now take the regular configuration path without having exit 0 here.
319 # Flags below are still necessary mostly for MinGW.
324 clock_gettime="yes" # clock_monotonic probe has dependency on this
325 clock_monotonic="yes"
332 echo "CC=$CC" >> $config_host_mak
333 echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
337 if test ! -z "$cpu" ; then
338 # command line argument
340 elif check_define __i386__ ; then
342 elif check_define __x86_64__ ; then
344 elif check_define __sparc__ ; then
345 if check_define __arch64__ ; then
350 elif check_define _ARCH_PPC ; then
351 if check_define _ARCH_PPC64 ; then
356 elif check_define __mips__ ; then
358 elif check_define __ia64__ ; then
360 elif check_define __s390__ ; then
361 if check_define __s390x__ ; then
366 elif check_define __arm__ ; then
368 elif check_define __aarch64__ ; then
370 elif check_define __hppa__ ; then
376 # Normalise host CPU name and set ARCH.
378 ia64|ppc|ppc64|s390|s390x|sparc64)
381 i386|i486|i586|i686|i86pc|BePC)
393 hppa|parisc|parisc64)
407 if test -z "$CC" ; then
408 if test "$targetos" = "FreeBSD"; then
417 cc="${CC-${cross_prefix}gcc}"
419 ##########################################
420 # check cross compile
422 if test "$cross_compile" != "yes" ; then
431 if compile_prog "" "" "cross"; then
432 $TMPE 2>/dev/null || cross_compile="yes"
434 fatal "compile test failed"
437 ##########################################
439 if test "$bigendian" != "yes" ; then
442 if test "$cross_compile" = "no" ; then
444 #include <inttypes.h>
447 volatile uint32_t i=0x01234567;
448 return (*((uint8_t*)(&i))) == 0x67;
451 if compile_prog "" "" "endian"; then
452 $TMPE && bigendian="yes"
455 # If we're cross compiling, try our best to work it out and rely on the
456 # run-time check to fail if we get it wrong.
461 #if __BYTE_ORDER != __BIG_ENDIAN
462 # error "Unknown endianness"
466 compile_prog "" "" "endian" && bigendian="yes"
467 check_define "__ARMEB__" && bigendian="yes"
468 check_define "__MIPSEB__" && bigendian="yes"
472 echo "Operating system $targetos"
474 echo "Big endian $bigendian"
476 echo "Cross compile $cross_compile"
479 ##########################################
480 # See if we need to build a static build
481 if test "$build_static" = "yes" ; then
482 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
483 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
487 echo "Static build $build_static"
489 ##########################################
494 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
497 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
501 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
503 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
506 fatal "Unknown wordsize"
508 echo "Wordsize $wordsize"
510 ##########################################
512 if test "$zlib" != "yes" ; then
520 if (inflateInit(&stream) != Z_OK)
525 if compile_prog "" "-lz" "zlib" ; then
531 ##########################################
533 if test "$libaio" != "yes" ; then
536 if test "$esx" != "yes" ; then
546 if compile_prog "" "-laio" "libaio" ; then
550 if test "$libaio" = "yes" ; then
551 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
556 echo "Linux AIO support $libaio"
558 ##########################################
560 if test "$posix_aio" != "yes" ; then
563 if test "$posix_aio_lrt" != "yes" ; then
575 if compile_prog "" "" "posixaio" ; then
577 elif compile_prog "" "-lrt" "posixaio"; then
582 echo "POSIX AIO support $posix_aio"
583 echo "POSIX AIO support needs -lrt $posix_aio_lrt"
585 ##########################################
586 # posix aio fsync probe
587 if test "$posix_aio_fsync" != "yes" ; then
590 if test "$posix_aio" = "yes" ; then
597 return aio_fsync(O_SYNC, &cb);
601 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
605 echo "POSIX AIO fsync $posix_aio_fsync"
607 ##########################################
608 # POSIX pshared attribute probe
614 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
615 # if defined(__CYGWIN__)
616 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
617 # elif defined(__APPLE__)
618 # include <AvailabilityMacros.h>
619 # include <TargetConditionals.h>
620 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
621 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
625 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
630 if compile_prog "" "$LIBS" "posix_pshared" ; then
633 echo "POSIX pshared support $posix_pshared"
635 ##########################################
637 if test "$solaris_aio" != "yes" ; then
641 #include <sys/types.h>
642 #include <sys/asynch.h>
647 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
651 if compile_prog "" "-laio" "solarisaio" ; then
655 echo "Solaris AIO support $solaris_aio"
657 ##########################################
658 # __sync_fetch_and_add test
659 if test "$sfaa" != "yes" ; then
663 #include <inttypes.h>
664 static int sfaa(uint64_t *ptr)
666 return __sync_fetch_and_add(ptr, 0);
669 int main(int argc, char **argv)
676 if compile_prog "" "" "__sync_fetch_and_add()" ; then
679 echo "__sync_fetch_and_add $sfaa"
681 ##########################################
683 if test "$libverbs" != "yes" ; then
688 #include <infiniband/arch.h>
689 int main(int argc, char **argv)
691 struct ibv_pd *pd = ibv_alloc_pd(NULL);
695 if compile_prog "" "-libverbs" "libverbs" ; then
697 LIBS="-libverbs $LIBS"
699 echo "libverbs $libverbs"
701 ##########################################
703 if test "$rdmacm" != "yes" ; then
708 #include <rdma/rdma_cma.h>
709 int main(int argc, char **argv)
711 rdma_destroy_qp(NULL);
715 if compile_prog "" "-lrdmacm" "rdma"; then
717 LIBS="-lrdmacm $LIBS"
719 echo "rdmacm $rdmacm"
721 ##########################################
722 # Linux fallocate probe
723 if test "$linux_fallocate" != "yes" ; then
729 #include <linux/falloc.h>
730 int main(int argc, char **argv)
732 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
736 if compile_prog "" "" "linux_fallocate"; then
737 linux_fallocate="yes"
739 echo "Linux fallocate $linux_fallocate"
741 ##########################################
742 # POSIX fadvise probe
743 if test "$posix_fadvise" != "yes" ; then
749 int main(int argc, char **argv)
751 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
755 if compile_prog "" "" "posix_fadvise"; then
758 echo "POSIX fadvise $posix_fadvise"
760 ##########################################
761 # POSIX fallocate probe
762 if test "$posix_fallocate" != "yes" ; then
768 int main(int argc, char **argv)
770 int r = posix_fallocate(0, 0, 1024);
774 if compile_prog "" "" "posix_fallocate"; then
775 posix_fallocate="yes"
777 echo "POSIX fallocate $posix_fallocate"
779 ##########################################
780 # sched_set/getaffinity 2 or 3 argument test
781 if test "$linux_2arg_affinity" != "yes" ; then
782 linux_2arg_affinity="no"
784 if test "$linux_3arg_affinity" != "yes" ; then
785 linux_3arg_affinity="no"
789 int main(int argc, char **argv)
792 return sched_setaffinity(0, sizeof(mask), &mask);
795 if compile_prog "" "" "sched_setaffinity(,,)"; then
796 linux_3arg_affinity="yes"
800 int main(int argc, char **argv)
803 return sched_setaffinity(0, &mask);
806 if compile_prog "" "" "sched_setaffinity(,)"; then
807 linux_2arg_affinity="yes"
810 echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
811 echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
813 ##########################################
814 # clock_gettime probe
815 if test "$clock_gettime" != "yes" ; then
821 int main(int argc, char **argv)
823 return clock_gettime(0, NULL);
826 if compile_prog "" "" "clock_gettime"; then
828 elif compile_prog "" "-lrt" "clock_gettime"; then
832 echo "clock_gettime $clock_gettime"
834 ##########################################
835 # CLOCK_MONOTONIC probe
836 if test "$clock_monotonic" != "yes" ; then
839 if test "$clock_gettime" = "yes" ; then
843 int main(int argc, char **argv)
845 return clock_gettime(CLOCK_MONOTONIC, NULL);
848 if compile_prog "" "$LIBS" "clock monotonic"; then
849 clock_monotonic="yes"
852 echo "CLOCK_MONOTONIC $clock_monotonic"
854 ##########################################
855 # CLOCK_MONOTONIC_RAW probe
856 if test "$clock_monotonic_raw" != "yes" ; then
857 clock_monotonic_raw="no"
859 if test "$clock_gettime" = "yes" ; then
863 int main(int argc, char **argv)
865 return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
868 if compile_prog "" "$LIBS" "clock monotonic"; then
869 clock_monotonic_raw="yes"
872 echo "CLOCK_MONOTONIC_RAW $clock_monotonic_raw"
874 ##########################################
875 # CLOCK_MONOTONIC_PRECISE probe
876 if test "$clock_monotonic_precise" != "yes" ; then
877 clock_monotonic_precise="no"
879 if test "$clock_gettime" = "yes" ; then
883 int main(int argc, char **argv)
885 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
888 if compile_prog "" "$LIBS" "clock monotonic precise"; then
889 clock_monotonic_precise="yes"
892 echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
894 ##########################################
896 if test "$clockid_t" != "yes" ; then
901 int main(int argc, char **argv)
903 volatile clockid_t cid;
904 memset(&cid, 0, sizeof(cid));
908 if compile_prog "" "$LIBS" "clockid_t"; then
911 echo "clockid_t $clockid_t"
913 ##########################################
914 # gettimeofday() probe
915 if test "$gettimeofday" != "yes" ; then
919 #include <sys/time.h>
921 int main(int argc, char **argv)
924 return gettimeofday(&tv, NULL);
927 if compile_prog "" "" "gettimeofday"; then
930 echo "gettimeofday $gettimeofday"
932 ##########################################
934 if test "$fdatasync" != "yes" ; then
940 int main(int argc, char **argv)
945 if compile_prog "" "" "fdatasync"; then
948 echo "fdatasync $fdatasync"
950 ##########################################
951 # sync_file_range() probe
952 if test "$sync_file_range" != "yes" ; then
959 #include <linux/fs.h>
960 int main(int argc, char **argv)
962 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
963 SYNC_FILE_RANGE_WAIT_AFTER;
964 return sync_file_range(0, 0, 0, flags);
967 if compile_prog "" "" "sync_file_range"; then
968 sync_file_range="yes"
970 echo "sync_file_range $sync_file_range"
972 ##########################################
973 # ext4 move extent probe
974 if test "$ext4_me" != "yes" ; then
979 #include <sys/ioctl.h>
980 int main(int argc, char **argv)
982 struct move_extent me;
983 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
986 if compile_prog "" "" "ext4 move extent" ; then
988 elif test $targetos = "Linux" ; then
989 # On Linux, just default to it on and let it error at runtime if we really
990 # don't have it. None of my updated systems have it defined, but it does
991 # work. Takes a while to bubble back.
994 echo "EXT4 move extent $ext4_me"
996 ##########################################
998 if test "$linux_splice" != "yes" ; then
1004 int main(int argc, char **argv)
1006 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1009 if compile_prog "" "" "linux splice"; then
1012 echo "Linux splice(2) $linux_splice"
1014 ##########################################
1016 if test "$guasi" != "yes" ; then
1021 #include <guasi_syscalls.h>
1022 int main(int argc, char **argv)
1024 guasi_t ctx = guasi_create(0, 0, 0);
1028 if compile_prog "" "" "guasi"; then
1033 ##########################################
1035 if test "$fusion_aw" != "yes" ; then
1039 #include <nvm/nvm_primitives.h>
1040 int main(int argc, char **argv)
1042 nvm_version_t ver_info;
1043 nvm_handle_t handle;
1045 handle = nvm_get_handle(0, &ver_info);
1046 return nvm_atomic_write(handle, 0, 0, 0);
1049 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
1050 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
1053 echo "Fusion-io atomic engine $fusion_aw"
1055 ##########################################
1057 if test "$libnuma" != "yes" ; then
1062 int main(int argc, char **argv)
1064 return numa_available();
1067 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1071 echo "libnuma $libnuma"
1073 ##########################################
1074 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1075 if test "$libnuma" = "yes" ; then
1079 int main(int argc, char **argv)
1081 struct bitmask *mask = numa_parse_nodestring(NULL);
1082 return mask->size == 0;
1085 if compile_prog "" "" "libnuma api"; then
1088 echo "libnuma v2 $libnuma_v2"
1091 ##########################################
1093 if test "$strsep" != "yes" ; then
1098 int main(int argc, char **argv)
1100 static char *string = "This is a string";
1101 strsep(&string, "needle");
1105 if compile_prog "" "" "strsep"; then
1108 echo "strsep $strsep"
1110 ##########################################
1111 # strcasestr() probe
1112 if test "$strcasestr" != "yes" ; then
1117 int main(int argc, char **argv)
1119 return strcasestr(argv[0], argv[1]) != NULL;
1122 if compile_prog "" "" "strcasestr"; then
1125 echo "strcasestr $strcasestr"
1127 ##########################################
1129 if test "$strlcat" != "yes" ; then
1134 int main(int argc, char **argv)
1136 static char dst[64];
1137 static char *string = "This is a string";
1138 memset(dst, 0, sizeof(dst));
1139 strlcat(dst, string, sizeof(dst));
1143 if compile_prog "" "" "strlcat"; then
1146 echo "strlcat $strlcat"
1148 ##########################################
1149 # getopt_long_only() probe
1150 if test "$getopt_long_only" != "yes" ; then
1151 getopt_long_only="no"
1157 int main(int argc, char **argv)
1159 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
1163 if compile_prog "" "" "getopt_long_only"; then
1164 getopt_long_only="yes"
1166 echo "getopt_long_only() $getopt_long_only"
1168 ##########################################
1170 if test "$inet_aton" != "yes" ; then
1174 #include <sys/socket.h>
1175 #include <arpa/inet.h>
1177 int main(int argc, char **argv)
1180 return inet_aton(NULL, &in);
1183 if compile_prog "" "" "inet_aton"; then
1186 echo "inet_aton $inet_aton"
1188 ##########################################
1190 if test "$socklen_t" != "yes" ; then
1194 #include <sys/socket.h>
1195 int main(int argc, char **argv)
1201 if compile_prog "" "" "socklen_t"; then
1204 echo "socklen_t $socklen_t"
1206 ##########################################
1207 # Whether or not __thread is supported for TLS
1208 if test "$tls_thread" != "yes" ; then
1213 static __thread int ret;
1214 int main(int argc, char **argv)
1219 if compile_prog "" "" "__thread"; then
1222 echo "__thread $tls_thread"
1224 ##########################################
1225 # Check if we have required gtk/glib support for gfio
1226 if test "$gfio" != "yes" ; then
1229 if test "$gfio_check" = "yes" ; then
1233 #include <gtk/gtk.h>
1236 gdk_threads_enter();
1237 gdk_threads_leave();
1239 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
1242 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1243 ORG_LDFLAGS=$LDFLAGS
1244 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1245 if test "$?" != "0" ; then
1246 echo "configure: gtk and gthread not found"
1249 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1250 if test "$?" != "0" ; then
1251 echo "configure: gtk and gthread not found"
1254 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1256 if test "$r" != "0" ; then
1258 GFIO_LIBS="$LIBS $GTK_LIBS"
1259 CFLAGS="$CFLAGS $GTK_CFLAGS"
1261 echo "GTK found, but need version 2.18 or higher"
1265 echo "Please install gtk and gdk libraries"
1268 LDFLAGS=$ORG_LDFLAGS
1271 if test "$gfio_check" = "yes" ; then
1272 echo "gtk 2.18 or higher $gfio"
1275 # Check whether we have getrusage(RUSAGE_THREAD)
1276 if test "$rusage_thread" != "yes" ; then
1280 #include <sys/time.h>
1281 #include <sys/resource.h>
1282 int main(int argc, char **argv)
1285 getrusage(RUSAGE_THREAD, &ru);
1289 if compile_prog "" "" "RUSAGE_THREAD"; then
1292 echo "RUSAGE_THREAD $rusage_thread"
1294 ##########################################
1295 # Check whether we have SCHED_IDLE
1296 if test "$sched_idle" != "yes" ; then
1301 int main(int argc, char **argv)
1303 struct sched_param p;
1304 return sched_setscheduler(0, SCHED_IDLE, &p);
1307 if compile_prog "" "" "SCHED_IDLE"; then
1310 echo "SCHED_IDLE $sched_idle"
1312 ##########################################
1313 # Check whether we have TCP_NODELAY
1314 if test "$tcp_nodelay" != "yes" ; then
1319 #include <sys/types.h>
1320 #include <sys/socket.h>
1321 #include <netinet/tcp.h>
1322 int main(int argc, char **argv)
1324 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1327 if compile_prog "" "" "TCP_NODELAY"; then
1330 echo "TCP_NODELAY $tcp_nodelay"
1332 ##########################################
1333 # Check whether we have SO_SNDBUF
1334 if test "$window_size" != "yes" ; then
1339 #include <sys/types.h>
1340 #include <sys/socket.h>
1341 #include <netinet/tcp.h>
1342 int main(int argc, char **argv)
1344 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1345 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1348 if compile_prog "" "" "SO_SNDBUF"; then
1351 echo "Net engine window_size $window_size"
1353 ##########################################
1354 # Check whether we have TCP_MAXSEG
1355 if test "$mss" != "yes" ; then
1360 #include <sys/types.h>
1361 #include <sys/socket.h>
1362 #include <netinet/tcp.h>
1363 #include <arpa/inet.h>
1364 #include <netinet/in.h>
1365 int main(int argc, char **argv)
1367 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1370 if compile_prog "" "" "TCP_MAXSEG"; then
1373 echo "TCP_MAXSEG $mss"
1375 ##########################################
1376 # Check whether we have RLIMIT_MEMLOCK
1377 if test "$rlimit_memlock" != "yes" ; then
1381 #include <sys/time.h>
1382 #include <sys/resource.h>
1383 int main(int argc, char **argv)
1386 return getrlimit(RLIMIT_MEMLOCK, &rl);
1389 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1390 rlimit_memlock="yes"
1392 echo "RLIMIT_MEMLOCK $rlimit_memlock"
1394 ##########################################
1395 # Check whether we have pwritev/preadv
1396 if test "$pwritev" != "yes" ; then
1401 #include <sys/uio.h>
1402 int main(int argc, char **argv)
1404 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1407 if compile_prog "" "" "pwritev"; then
1410 echo "pwritev/preadv $pwritev"
1412 ##########################################
1413 # Check whether we have pwritev2/preadv2
1414 if test "$pwritev2" != "yes" ; then
1419 #include <sys/uio.h>
1420 int main(int argc, char **argv)
1422 return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0);
1425 if compile_prog "" "" "pwritev2"; then
1428 echo "pwritev2/preadv2 $pwritev2"
1430 ##########################################
1431 # Check whether we have the required functions for ipv6
1432 if test "$ipv6" != "yes" ; then
1436 #include <sys/types.h>
1437 #include <sys/socket.h>
1438 #include <netinet/in.h>
1441 int main(int argc, char **argv)
1443 struct addrinfo hints;
1444 struct in6_addr addr;
1447 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1449 printf("%s\n", gai_strerror(ret));
1454 if compile_prog "" "" "ipv6"; then
1457 echo "IPv6 helpers $ipv6"
1459 ##########################################
1461 if test "$rbd" != "yes" ; then
1465 #include <rbd/librbd.h>
1467 int main(int argc, char **argv)
1471 rados_ioctx_t io_ctx;
1472 const char pool[] = "rbd";
1474 int major, minor, extra;
1475 rbd_version(&major, &minor, &extra);
1477 rados_ioctx_create(cluster, pool, &io_ctx);
1481 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1482 LIBS="-lrbd -lrados $LIBS"
1485 echo "Rados Block Device engine $rbd"
1487 ##########################################
1488 # check for rbd_poll
1489 if test "$rbd_poll" != "yes" ; then
1492 if test "$rbd" = "yes"; then
1494 #include <rbd/librbd.h>
1495 #include <sys/eventfd.h>
1497 int main(int argc, char **argv)
1500 rbd_completion_t comp;
1502 int fd = eventfd(0, EFD_NONBLOCK);
1503 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1504 rbd_poll_io_events(image, comp, 1);
1509 if compile_prog "" "-lrbd -lrados" "rbd"; then
1512 echo "rbd_poll $rbd_poll"
1515 ##########################################
1516 # check for rbd_invaidate_cache()
1517 if test "$rbd_inval" != "yes" ; then
1520 if test "$rbd" = "yes"; then
1522 #include <rbd/librbd.h>
1524 int main(int argc, char **argv)
1528 return rbd_invalidate_cache(image);
1531 if compile_prog "" "-lrbd -lrados" "rbd"; then
1534 echo "rbd_invalidate_cache $rbd_inval"
1537 ##########################################
1539 if test "$rbd_blkin" != "yes" ; then
1543 #include <rbd/librbd.h>
1544 #include <zipkin_c.h>
1546 int main(int argc, char **argv)
1549 struct blkin_trace_info t_info;
1550 blkin_init_trace_info(&t_info);
1551 rbd_completion_t completion;
1556 r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info);
1560 if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
1561 && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then
1562 LIBS="-lblkin $LIBS"
1565 echo "rbd blkin tracing $rbd_blkin"
1567 ##########################################
1568 # Check whether we have setvbuf
1569 if test "$setvbuf" != "yes" ; then
1574 int main(int argc, char **argv)
1578 setvbuf(f, buf, _IOFBF, sizeof(buf));
1582 if compile_prog "" "" "setvbuf"; then
1585 echo "setvbuf $setvbuf"
1588 if test "$gfapi" != "yes" ; then
1592 #include <glusterfs/api/glfs.h>
1594 int main(int argc, char **argv)
1597 glfs_t *g = glfs_new("foo");
1602 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1603 LIBS="-lgfapi -lglusterfs $LIBS"
1606 echo "Gluster API engine $gfapi"
1608 ##########################################
1609 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
1610 if test "$gfapi" = "yes" ; then
1613 #include <glusterfs/api/glfs.h>
1615 int main(int argc, char **argv)
1618 int ret = glfs_fadvise(fd, 0, 0, 1);
1623 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1626 echo "Gluster API use fadvise $gf_fadvise"
1629 ##########################################
1630 # check for gfapi trim support
1631 if test "$gf_trim" != "yes" ; then
1634 if test "$gfapi" = "yes" ; then
1636 #include <glusterfs/api/glfs.h>
1638 int main(int argc, char **argv)
1640 return glfs_discard_async(NULL, 0, 0);
1643 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1646 echo "Gluster API trim support $gf_trim"
1649 ##########################################
1650 # Check if we support stckf on s390
1651 if test "$s390_z196_facilities" != "yes" ; then
1652 s390_z196_facilities="no"
1655 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1656 int main(int argc, char **argv)
1658 /* We want just 1 double word to be returned. */
1659 register unsigned long reg0 asm("0") = 0;
1660 unsigned long stfle_bits;
1661 asm volatile(".machine push" "\n\t"
1662 ".machine \"z9-109\"" "\n\t"
1665 : "=QS" (stfle_bits), "+d" (reg0)
1668 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1674 if compile_prog "" "" "s390_z196_facilities"; then
1676 if [[ $? -eq 0 ]]; then
1677 s390_z196_facilities="yes"
1680 echo "s390_z196_facilities $s390_z196_facilities"
1682 ##########################################
1683 # Check if we have required environment variables configured for libhdfs
1684 if test "$libhdfs" = "yes" ; then
1686 if test "$JAVA_HOME" = "" ; then
1687 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1690 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1691 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1694 if test "$FIO_LIBHDFS_LIB" = "" ; then
1695 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1698 if test "$hdfs_conf_error" = "1" ; then
1702 if test "$FIO_HDFS_CPU" = "x86_64" ; then
1703 FIO_HDFS_CPU="amd64"
1706 echo "HDFS engine $libhdfs"
1708 ##########################################
1709 # Check whether we have MTD
1710 if test "$mtd" != "yes" ; then
1715 #include <mtd/mtd-user.h>
1716 #include <sys/ioctl.h>
1717 int main(int argc, char **argv)
1719 struct mtd_write_req ops;
1720 struct mtd_info_user info;
1721 memset(&ops, 0, sizeof(ops));
1722 info.type = MTD_MLCNANDFLASH;
1723 return ioctl(0, MEMGETINFO, &info);
1726 if compile_prog "" "" "mtd"; then
1731 ##########################################
1732 # Check whether we have libpmem
1733 if test "$libpmem" != "yes" ; then
1737 #include <libpmem.h>
1738 int main(int argc, char **argv)
1741 rc = pmem_is_pmem(0, 0);
1745 if compile_prog "" "-lpmem" "libpmem"; then
1749 echo "libpmem $libpmem"
1751 ##########################################
1752 # Check whether we have libpmemblk
1753 # libpmem is a prerequisite
1754 if test "$libpmemblk" != "yes" ; then
1757 if test "$libpmem" = "yes"; then
1759 #include <libpmemblk.h>
1760 int main(int argc, char **argv)
1763 pbp = pmemblk_open("", 0);
1767 if compile_prog "" "-lpmemblk" "libpmemblk"; then
1769 LIBS="-lpmemblk $LIBS"
1772 echo "libpmemblk $libpmemblk"
1774 # Choose the ioengines
1775 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
1777 if test "$libpmemblk" = "yes"; then
1782 ##########################################
1783 # Report whether pmemblk engine is enabled
1784 echo "NVML pmemblk engine $pmemblk"
1786 ##########################################
1787 # Report whether dev-dax engine is enabled
1788 echo "NVML dev-dax engine $devdax"
1790 # Check if we have lex/yacc available
1795 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
1796 if test "$targetos" != "SunOS" ; then
1797 LEX=$(which lex 2> /dev/null)
1798 if test -x "$LEX" ; then
1801 YACC=$(which bison 2> /dev/null)
1802 if test -x "$YACC" ; then
1806 YACC=$(which yacc 2> /dev/null)
1807 if test -x "$YACC" ; then
1811 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1815 if test "$arith" = "yes" ; then
1817 extern int yywrap(void);
1819 int main(int argc, char **argv)
1825 if compile_prog "" "-ll" "lex"; then
1834 # Check if lex fails using -o
1835 if test "$arith" = "yes" ; then
1836 if test "$force_no_lex_o" = "yes" ; then
1839 $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
1840 if test "$?" = "0" ; then
1848 echo "lex/yacc for arithmetic $arith"
1850 ##########################################
1851 # Check whether we have setmntent/getmntent
1852 if test "$getmntent" != "yes" ; then
1858 int main(int argc, char **argv)
1860 FILE *mtab = setmntent(NULL, "r");
1861 struct mntent *mnt = getmntent(mtab);
1866 if compile_prog "" "" "getmntent"; then
1869 echo "getmntent $getmntent"
1871 ##########################################
1872 # Check whether we have getmntinfo
1873 # These are originally added for BSDs, but may also work
1874 # on other operating systems with getmntinfo(3).
1876 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
1877 # Note that NetBSD needs -Werror to catch warning as error.
1878 if test "$getmntinfo" != "yes" ; then
1883 #include <sys/param.h>
1884 #include <sys/mount.h>
1885 int main(int argc, char **argv)
1888 return getmntinfo(&st, MNT_NOWAIT);
1891 if compile_prog "-Werror" "" "getmntinfo"; then
1894 echo "getmntinfo $getmntinfo"
1896 # getmntinfo(3) for NetBSD.
1897 if test "$getmntinfo_statvfs" != "yes" ; then
1898 getmntinfo_statvfs="no"
1902 #include <sys/statvfs.h>
1903 int main(int argc, char **argv)
1906 return getmntinfo(&st, MNT_NOWAIT);
1909 # Skip the test if the one with statfs arg is detected.
1910 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
1911 getmntinfo_statvfs="yes"
1912 echo "getmntinfo_statvfs $getmntinfo_statvfs"
1915 ##########################################
1916 # Check whether we have _Static_assert
1917 if test "$static_assert" != "yes" ; then
1924 #ifdef __compiler_offsetof
1925 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
1927 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
1930 #define container_of(ptr, type, member) ({ \
1931 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
1932 (type *)( (char *)__mptr - offsetof(type,member) );})
1938 int main(int argc, char **argv)
1940 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
1944 if compile_prog "" "" "static_assert"; then
1947 echo "Static Assert $static_assert"
1949 ##########################################
1950 # Check whether we have bool / stdbool.h
1951 if test "$have_bool" != "yes" ; then
1955 #include <stdbool.h>
1956 int main(int argc, char **argv)
1959 return var != false;
1962 if compile_prog "" "" "bool"; then
1965 echo "bool $have_bool"
1967 ##########################################
1968 # check march=armv8-a+crc+crypto
1969 if test "$march_armv8_a_crc_crypto" != "yes" ; then
1970 march_armv8_a_crc_crypto="no"
1972 if test "$cpu" = "arm64" ; then
1974 #include <sys/auxv.h>
1975 #include <arm_acle.h>
1976 #include <arm_neon.h>
1983 if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
1984 march_armv8_a_crc_crypto="yes"
1985 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
1988 echo "march_armv8_a_crc_crypto $march_armv8_a_crc_crypto"
1991 #############################################################################
1993 if test "$wordsize" = "64" ; then
1994 output_sym "CONFIG_64BIT"
1995 elif test "$wordsize" = "32" ; then
1996 output_sym "CONFIG_32BIT"
1998 fatal "Unknown wordsize!"
2000 if test "$bigendian" = "yes" ; then
2001 output_sym "CONFIG_BIG_ENDIAN"
2003 output_sym "CONFIG_LITTLE_ENDIAN"
2005 if test "$zlib" = "yes" ; then
2006 output_sym "CONFIG_ZLIB"
2008 if test "$libaio" = "yes" ; then
2009 output_sym "CONFIG_LIBAIO"
2011 if test "$posix_aio" = "yes" ; then
2012 output_sym "CONFIG_POSIXAIO"
2014 if test "$posix_aio_fsync" = "yes" ; then
2015 output_sym "CONFIG_POSIXAIO_FSYNC"
2017 if test "$posix_pshared" = "yes" ; then
2018 output_sym "CONFIG_PSHARED"
2020 if test "$linux_fallocate" = "yes" ; then
2021 output_sym "CONFIG_LINUX_FALLOCATE"
2023 if test "$posix_fallocate" = "yes" ; then
2024 output_sym "CONFIG_POSIX_FALLOCATE"
2026 if test "$fdatasync" = "yes" ; then
2027 output_sym "CONFIG_FDATASYNC"
2029 if test "$sync_file_range" = "yes" ; then
2030 output_sym "CONFIG_SYNC_FILE_RANGE"
2032 if test "$sfaa" = "yes" ; then
2033 output_sym "CONFIG_SFAA"
2035 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
2036 output_sym "CONFIG_RDMA"
2038 if test "$clock_gettime" = "yes" ; then
2039 output_sym "CONFIG_CLOCK_GETTIME"
2041 if test "$clock_monotonic" = "yes" ; then
2042 output_sym "CONFIG_CLOCK_MONOTONIC"
2044 if test "$clock_monotonic_raw" = "yes" ; then
2045 output_sym "CONFIG_CLOCK_MONOTONIC_RAW"
2047 if test "$clock_monotonic_precise" = "yes" ; then
2048 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
2050 if test "$clockid_t" = "yes"; then
2051 output_sym "CONFIG_CLOCKID_T"
2053 if test "$gettimeofday" = "yes" ; then
2054 output_sym "CONFIG_GETTIMEOFDAY"
2056 if test "$posix_fadvise" = "yes" ; then
2057 output_sym "CONFIG_POSIX_FADVISE"
2059 if test "$linux_3arg_affinity" = "yes" ; then
2060 output_sym "CONFIG_3ARG_AFFINITY"
2061 elif test "$linux_2arg_affinity" = "yes" ; then
2062 output_sym "CONFIG_2ARG_AFFINITY"
2064 if test "$strsep" = "yes" ; then
2065 output_sym "CONFIG_STRSEP"
2067 if test "$strcasestr" = "yes" ; then
2068 output_sym "CONFIG_STRCASESTR"
2070 if test "$strlcat" = "yes" ; then
2071 output_sym "CONFIG_STRLCAT"
2073 if test "$getopt_long_only" = "yes" ; then
2074 output_sym "CONFIG_GETOPT_LONG_ONLY"
2076 if test "$inet_aton" = "yes" ; then
2077 output_sym "CONFIG_INET_ATON"
2079 if test "$socklen_t" = "yes" ; then
2080 output_sym "CONFIG_SOCKLEN_T"
2082 if test "$ext4_me" = "yes" ; then
2083 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
2085 if test "$linux_splice" = "yes" ; then
2086 output_sym "CONFIG_LINUX_SPLICE"
2088 if test "$guasi" = "yes" ; then
2089 output_sym "CONFIG_GUASI"
2091 if test "$fusion_aw" = "yes" ; then
2092 output_sym "CONFIG_FUSION_AW"
2094 if test "$libnuma_v2" = "yes" ; then
2095 output_sym "CONFIG_LIBNUMA"
2097 if test "$solaris_aio" = "yes" ; then
2098 output_sym "CONFIG_SOLARISAIO"
2100 if test "$tls_thread" = "yes" ; then
2101 output_sym "CONFIG_TLS_THREAD"
2103 if test "$rusage_thread" = "yes" ; then
2104 output_sym "CONFIG_RUSAGE_THREAD"
2106 if test "$gfio" = "yes" ; then
2107 echo "CONFIG_GFIO=y" >> $config_host_mak
2109 if test "$esx" = "yes" ; then
2110 output_sym "CONFIG_ESX"
2111 output_sym "CONFIG_NO_SHM"
2113 if test "$sched_idle" = "yes" ; then
2114 output_sym "CONFIG_SCHED_IDLE"
2116 if test "$tcp_nodelay" = "yes" ; then
2117 output_sym "CONFIG_TCP_NODELAY"
2119 if test "$window_size" = "yes" ; then
2120 output_sym "CONFIG_NET_WINDOWSIZE"
2122 if test "$mss" = "yes" ; then
2123 output_sym "CONFIG_NET_MSS"
2125 if test "$rlimit_memlock" = "yes" ; then
2126 output_sym "CONFIG_RLIMIT_MEMLOCK"
2128 if test "$pwritev" = "yes" ; then
2129 output_sym "CONFIG_PWRITEV"
2131 if test "$pwritev2" = "yes" ; then
2132 output_sym "CONFIG_PWRITEV2"
2134 if test "$ipv6" = "yes" ; then
2135 output_sym "CONFIG_IPV6"
2137 if test "$rbd" = "yes" ; then
2138 output_sym "CONFIG_RBD"
2140 if test "$rbd_poll" = "yes" ; then
2141 output_sym "CONFIG_RBD_POLL"
2143 if test "$rbd_inval" = "yes" ; then
2144 output_sym "CONFIG_RBD_INVAL"
2146 if test "$rbd_blkin" = "yes" ; then
2147 output_sym "CONFIG_RBD_BLKIN"
2149 if test "$setvbuf" = "yes" ; then
2150 output_sym "CONFIG_SETVBUF"
2152 if test "$s390_z196_facilities" = "yes" ; then
2153 output_sym "CONFIG_S390_Z196_FACILITIES"
2154 CFLAGS="$CFLAGS -march=z9-109"
2156 if test "$gfapi" = "yes" ; then
2157 output_sym "CONFIG_GFAPI"
2159 if test "$gf_fadvise" = "yes" ; then
2160 output_sym "CONFIG_GF_FADVISE"
2162 if test "$gf_trim" = "yes" ; then
2163 output_sym "CONFIG_GF_TRIM"
2165 if test "$libhdfs" = "yes" ; then
2166 output_sym "CONFIG_LIBHDFS"
2167 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
2168 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
2169 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
2170 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
2172 if test "$mtd" = "yes" ; then
2173 output_sym "CONFIG_MTD"
2175 if test "$pmemblk" = "yes" ; then
2176 output_sym "CONFIG_PMEMBLK"
2178 if test "$devdax" = "yes" ; then
2179 output_sym "CONFIG_LINUX_DEVDAX"
2181 if test "$arith" = "yes" ; then
2182 output_sym "CONFIG_ARITHMETIC"
2183 if test "$yacc_is_bison" = "yes" ; then
2184 echo "YACC=$YACC -y" >> $config_host_mak
2186 echo "YACC=$YACC" >> $config_host_mak
2188 if test "$lex_use_o" = "yes" ; then
2189 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
2192 if test "$getmntent" = "yes" ; then
2193 output_sym "CONFIG_GETMNTENT"
2195 if test "$getmntinfo" = "yes" ; then
2196 output_sym "CONFIG_GETMNTINFO"
2198 if test "$getmntinfo_statvfs" = "yes" ; then
2199 output_sym "CONFIG_GETMNTINFO_STATVFS"
2201 if test "$static_assert" = "yes" ; then
2202 output_sym "CONFIG_STATIC_ASSERT"
2204 if test "$have_bool" = "yes" ; then
2205 output_sym "CONFIG_HAVE_BOOL"
2207 if test "$disable_opt" = "yes" ; then
2208 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
2211 if test "$zlib" = "no" ; then
2212 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
2215 echo "LIBS+=$LIBS" >> $config_host_mak
2216 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
2217 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
2218 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
2219 echo "CC=$cc" >> $config_host_mak
2220 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
2221 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
2223 if [ `dirname $0` != "." -a ! -e Makefile ]; then
2224 cat > Makefile <<EOF
2225 SRCDIR:=`dirname $0`
2226 include \$(SRCDIR)/Makefile