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
140 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
142 --cpu=*) cpu="$optarg"
146 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
148 --build-32bit-win) build_32bit_win="yes"
153 --disable-numa) disable_numa="yes"
159 echo "Bad option $opt"
165 if test "$show_help" = "yes" ; then
166 echo "--cpu= Specify target CPU if auto-detect fails"
167 echo "--cc= Specify compiler to use"
168 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
169 echo "--build-32bit-win Enable 32-bit build on Windows"
170 echo "--enable-gfio Enable building of gtk gfio"
171 echo "--disable-numa Disable libnuma even if found"
175 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
176 cc="${CC-${cross_prefix}gcc}"
178 if check_define __ANDROID__ ; then
180 elif check_define __linux__ ; then
182 elif check_define __OpenBSD__ ; then
184 elif check_define __sun__ ; then
186 CFLAGS="$CFLAGS -D_REENTRANT"
187 elif check_define _WIN32 ; then
193 echo "# Automatically generated by configure - do not modify" > $config_host_mak
194 printf "# Configured with:" >> $config_host_mak
195 printf " '%s'" "$0" "$@" >> $config_host_mak
196 echo >> $config_host_mak
197 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
199 # Some host OSes need non-standard checks for which CPU to use.
200 # Note that these checks are broken for cross-compilation: if you're
201 # cross-compiling to one of these OSes then you'll need to specify
202 # the correct CPU with the --cpu option.
205 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
206 # we can run 64-bit userspace code.
207 # If the user didn't specify a CPU explicitly and the kernel says this is
208 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
210 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
215 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
216 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
219 LIBS="-lnsl -lsocket"
222 echo "Forcing known good options on Windows"
223 if test -z "$CC" ; then
224 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
225 CC="i686-w64-mingw32-gcc"
227 CC="x86_64-w64-mingw32-gcc"
230 output_sym "CONFIG_LITTLE_ENDIAN"
231 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
232 output_sym "CONFIG_32BIT"
234 output_sym "CONFIG_64BIT_LLP64"
236 output_sym "CONFIG_FADVISE"
237 output_sym "CONFIG_SOCKLEN_T"
238 output_sym "CONFIG_FADVISE"
239 output_sym "CONFIG_SFAA"
240 output_sym "CONFIG_RUSAGE_THREAD"
241 output_sym "CONFIG_WINDOWSAIO"
242 output_sym "CONFIG_FDATASYNC"
243 output_sym "CONFIG_CLOCK_MONOTONIC"
244 output_sym "CONFIG_GETTIMEOFDAY"
245 output_sym "CONFIG_CLOCK_GETTIME"
246 output_sym "CONFIG_SCHED_IDLE"
247 output_sym "CONFIG_TCP_NODELAY"
248 output_sym "CONFIG_TLS_THREAD"
249 output_sym "CONFIG_IPV6"
250 echo "CC=$CC" >> $config_host_mak
251 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
256 if test ! -z "$cpu" ; then
257 # command line argument
259 elif check_define __i386__ ; then
261 elif check_define __x86_64__ ; then
263 elif check_define __sparc__ ; then
264 if check_define __arch64__ ; then
269 elif check_define _ARCH_PPC ; then
270 if check_define _ARCH_PPC64 ; then
275 elif check_define __mips__ ; then
277 elif check_define __ia64__ ; then
279 elif check_define __s390__ ; then
280 if check_define __s390x__ ; then
285 elif check_define __arm__ ; then
287 elif check_define __hppa__ ; then
293 # Normalise host CPU name and set ARCH.
295 ia64|ppc|ppc64|s390|s390x|sparc64)
298 i386|i486|i586|i686|i86pc|BePC)
307 hppa|parisc|parisc64)
321 if test -z "$CC" ; then
322 if test "$targetos" = "FreeBSD"; then
331 cc="${CC-${cross_prefix}gcc}"
333 ##########################################
334 # check cross compile
343 if compile_prog "" "" "cross"; then
344 $TMPE 2>/dev/null || cross_compile="yes"
346 fatal "compile test failed"
349 ##########################################
352 if test "$cross_compile" = "no" ; then
354 #include <inttypes.h>
357 volatile uint32_t i=0x01234567;
358 return (*((uint8_t*)(&i))) == 0x67;
361 if compile_prog "" "" "endian"; then
362 $TMPE && bigendian="yes"
365 # If we're cross compiling, try our best to work it out and rely on the
366 # run-time check to fail if we get it wrong.
371 #if __BYTE_ORDER != __BIG_ENDIAN
372 # error "Unknown endianness"
376 compile_prog "" "" "endian" && bigendian="yes"
377 check_define "__ARMEB__" && bigendian="yes"
378 check_define "__MIPSEB__" && bigendian="yes"
382 echo "Operating system $targetos"
384 echo "Big endian $bigendian"
386 echo "Cross compile $cross_compile"
389 ##########################################
394 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
397 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
401 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
403 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
406 fatal "Unknown wordsize"
408 echo "Wordsize $wordsize"
410 ##########################################
418 if (inflateInit(&stream) != Z_OK)
423 if compile_prog "" "-lz" "zlib" ; then
429 ##########################################
441 if compile_prog "" "-laio" "libaio" ; then
445 if test "$libaio" = "yes" ; then
446 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
450 echo "Linux AIO support $libaio"
452 ##########################################
465 if compile_prog "" "" "posixaio" ; then
467 elif compile_prog "" "-lrt" "posixaio"; then
472 echo "POSIX AIO support $posix_aio"
473 echo "POSIX AIO support needs -lrt $posix_aio_lrt"
475 ##########################################
476 # posix aio fsync probe
478 if test "$posix_aio" = "yes" ; then
485 return aio_fsync(O_SYNC, &cb);
489 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
493 echo "POSIX AIO fsync $posix_aio_fsync"
495 ##########################################
499 #include <sys/types.h>
500 #include <sys/asynch.h>
505 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
509 if compile_prog "" "-laio" "solarisaio" ; then
513 echo "Solaris AIO support $solaris_aio"
515 ##########################################
516 # __sync_fetch_and_and test
519 static int sfaa(int *ptr)
521 return __sync_fetch_and_add(ptr, 0);
524 int main(int argc, char **argv)
531 if compile_prog "" "" "__sync_fetch_and_add()" ; then
534 echo "__sync_fetch_and_add $sfaa"
536 ##########################################
541 #include <infiniband/arch.h>
542 int main(int argc, char **argv)
544 struct ibv_pd *pd = ibv_alloc_pd(NULL);
548 if compile_prog "" "-libverbs" "libverbs" ; then
550 LIBS="-libverbs $LIBS"
552 echo "libverbs $libverbs"
554 ##########################################
559 #include <rdma/rdma_cma.h>
560 int main(int argc, char **argv)
562 rdma_destroy_qp(NULL);
566 if compile_prog "" "-lrdmacm" "rdma"; then
568 LIBS="-lrdmacm $LIBS"
570 echo "rdmacm $rdmacm"
572 ##########################################
573 # Linux fallocate probe
578 #include <linux/falloc.h>
579 int main(int argc, char **argv)
581 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
585 if compile_prog "" "" "linux_fallocate"; then
586 linux_fallocate="yes"
588 echo "Linux fallocate $linux_fallocate"
590 ##########################################
591 # POSIX fadvise probe
596 int main(int argc, char **argv)
598 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
602 if compile_prog "" "" "posix_fadvise"; then
605 echo "POSIX fadvise $posix_fadvise"
607 ##########################################
608 # POSIX fallocate probe
613 int main(int argc, char **argv)
615 int r = posix_fallocate(0, 0, 1024);
619 if compile_prog "" "" "posix_fallocate"; then
620 posix_fallocate="yes"
622 echo "POSIX fallocate $posix_fallocate"
624 ##########################################
625 # sched_set/getaffinity 2 or 3 argument test
626 linux_2arg_affinity="no"
627 linux_3arg_affinity="no"
630 int main(int argc, char **argv)
633 return sched_setaffinity(0, sizeof(mask), &mask);
636 if compile_prog "" "" "sched_setaffinity(,,)"; then
637 linux_3arg_affinity="yes"
641 int main(int argc, char **argv)
644 return sched_setaffinity(0, &mask);
647 if compile_prog "" "" "sched_setaffinity(,)"; then
648 linux_2arg_affinity="yes"
651 echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
652 echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
654 ##########################################
659 int main(int argc, char **argv)
662 return CPU_COUNT(&mask);
665 if compile_prog "" "" "cpu_count"; then
668 echo "CPU_COUNT $cpu_count"
670 ##########################################
671 # clock_gettime probe
676 int main(int argc, char **argv)
678 return clock_gettime(0, NULL);
681 if compile_prog "" "" "clock_gettime"; then
683 elif compile_prog "" "-lrt" "clock_gettime"; then
687 echo "clock_gettime $clock_gettime"
689 ##########################################
690 # CLOCK_MONOTONIC probe
692 if test "$clock_gettime" = "yes" ; then
696 int main(int argc, char **argv)
698 return clock_gettime(CLOCK_MONOTONIC, NULL);
701 if compile_prog "" "$LIBS" "clock monotonic"; then
702 clock_monotonic="yes"
705 echo "CLOCK_MONOTONIC $clock_monotonic"
707 ##########################################
708 # CLOCK_MONOTONIC_PRECISE probe
709 clock_monotonic_precise="no"
710 if test "$clock_gettime" = "yes" ; then
714 int main(int argc, char **argv)
716 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
719 if compile_prog "" "$LIBS" "clock monotonic precise"; then
720 clock_monotonic_precise="yes"
723 echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
725 ##########################################
726 # gettimeofday() probe
729 #include <sys/time.h>
731 int main(int argc, char **argv)
734 return gettimeofday(&tv, NULL);
737 if compile_prog "" "" "gettimeofday"; then
740 echo "gettimeofday $gettimeofday"
742 ##########################################
748 int main(int argc, char **argv)
753 if compile_prog "" "" "fdatasync"; then
756 echo "fdatasync $fdatasync"
758 ##########################################
759 # sync_file_range() probe
765 #include <linux/fs.h>
766 int main(int argc, char **argv)
768 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
769 SYNC_FILE_RANGE_WAIT_AFTER;
770 return sync_file_range(0, 0, 0, flags);
773 if compile_prog "" "" "sync_file_range"; then
774 sync_file_range="yes"
776 echo "sync_file_range $sync_file_range"
778 ##########################################
779 # ext4 move extent probe
783 #include <sys/ioctl.h>
784 int main(int argc, char **argv)
786 struct move_extent me;
787 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
790 if compile_prog "" "" "ext4 move extent" ; then
792 elif test $targetos = "Linux" ; then
793 # On Linux, just default to it on and let it error at runtime if we really
794 # don't have it. None of my updated systems have it defined, but it does
795 # work. Takes a while to bubble back.
798 echo "EXT4 move extent $ext4_me"
800 ##########################################
806 int main(int argc, char **argv)
808 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
811 if compile_prog "" "" "linux splice"; then
814 echo "Linux splice(2) $linux_splice"
816 ##########################################
821 #include <guasi_syscalls.h>
822 int main(int argc, char **argv)
824 guasi_t ctx = guasi_create(0, 0, 0);
828 if compile_prog "" "" "guasi"; then
833 ##########################################
837 #include <nvm/nvm_primitives.h>
838 int main(int argc, char **argv)
840 nvm_version_t ver_info;
843 handle = nvm_get_handle(0, &ver_info);
844 return nvm_atomic_write(handle, 0, 0, 0);
847 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
848 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
851 echo "Fusion-io atomic engine $fusion_aw"
853 ##########################################
858 int main(int argc, char **argv)
860 return numa_available();
863 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
867 echo "libnuma $libnuma"
869 ##########################################
870 # libnuma 2.x version API
871 if test "$libnuma" = "yes" ; then
875 int main(int argc, char **argv)
877 struct bitmask *mask = numa_parse_nodestring(NULL);
881 if compile_prog "" "" "libnuma api"; then
884 echo "libnuma v2 $libnuma_v2"
887 ##########################################
892 int main(int argc, char **argv)
898 if compile_prog "" "" "strsep"; then
901 echo "strsep $strsep"
903 ##########################################
908 int main(int argc, char **argv)
910 return strcasestr(argv[0], argv[1]) != NULL;
913 if compile_prog "" "" "strcasestr"; then
916 echo "strcasestr $strcasestr"
918 ##########################################
919 # getopt_long_only() probe
920 getopt_long_only="no"
925 int main(int argc, char **argv)
927 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
931 if compile_prog "" "" "getopt_long_only"; then
932 getopt_long_only="yes"
934 echo "getopt_long_only() $getopt_long_only"
936 ##########################################
940 #include <sys/socket.h>
941 #include <arpa/inet.h>
943 int main(int argc, char **argv)
946 return inet_aton(NULL, &in);
949 if compile_prog "" "" "inet_aton"; then
952 echo "inet_aton $inet_aton"
954 ##########################################
958 #include <sys/socket.h>
959 int main(int argc, char **argv)
965 if compile_prog "" "" "socklen_t"; then
968 echo "socklen_t $socklen_t"
970 ##########################################
971 # Whether or not __thread is supported for TLS
975 static __thread int ret;
976 int main(int argc, char **argv)
981 if compile_prog "" "" "__thread"; then
984 echo "__thread $tls_thread"
986 ##########################################
987 # Check if we have required gtk/glib support for gfio
988 if test "$gfio" = "yes" ; then
998 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
1001 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1002 if test "$?" != "0" ; then
1003 echo "configure: gtk and gthread not found"
1006 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1007 if test "$?" != "0" ; then
1008 echo "configure: gtk and gthread not found"
1011 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1013 if test "$r" != "0" ; then
1015 LIBS="$LIBS $GTK_LIBS"
1016 CFLAGS="$CFLAGS $GTK_CFLAGS"
1018 echo "GTK found, but need version 2.18 or higher"
1022 echo "Please install gtk and gdk libraries"
1027 echo "gtk 2.18 or higher $gfio"
1029 # Check whether we have getrusage(RUSAGE_THREAD)
1032 #include <sys/time.h>
1033 #include <sys/resource.h>
1034 int main(int argc, char **argv)
1037 getrusage(RUSAGE_THREAD, &ru);
1041 if compile_prog "" "" "RUSAGE_THREAD"; then
1044 echo "RUSAGE_THREAD $rusage_thread"
1046 ##########################################
1047 # Check whether we have SCHED_IDLE
1051 int main(int argc, char **argv)
1053 struct sched_param p;
1054 return sched_setscheduler(0, SCHED_IDLE, &p);
1057 if compile_prog "" "" "SCHED_IDLE"; then
1060 echo "SCHED_IDLE $sched_idle"
1062 ##########################################
1063 # Check whether we have TCP_NODELAY
1067 #include <sys/types.h>
1068 #include <sys/socket.h>
1069 #include <netinet/tcp.h>
1070 int main(int argc, char **argv)
1072 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1075 if compile_prog "" "" "TCP_NODELAY"; then
1078 echo "TCP_NODELAY $tcp_nodelay"
1080 ##########################################
1081 # Check whether we have RLIMIT_MEMLOCK
1084 #include <sys/time.h>
1085 #include <sys/resource.h>
1086 int main(int argc, char **argv)
1089 return getrlimit(RLIMIT_MEMLOCK, &rl);
1092 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1093 rlimit_memlock="yes"
1095 echo "RLIMIT_MEMLOCK $rlimit_memlock"
1097 ##########################################
1098 # Check whether we have pwritev/preadv
1102 #include <sys/uio.h>
1103 int main(int argc, char **argv)
1105 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1108 if compile_prog "" "" "pwritev"; then
1111 echo "pwritev/preadv $pwritev"
1113 ##########################################
1114 # Check whether we have the required functions for ipv6
1117 #include <sys/types.h>
1118 #include <sys/socket.h>
1119 #include <netinet/in.h>
1122 int main(int argc, char **argv)
1124 struct addrinfo hints;
1125 struct in6_addr addr;
1128 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1130 printf("%s\n", gai_strerror(ret));
1135 if compile_prog "" "" "ipv6"; then
1138 echo "IPv6 helpers $ipv6"
1140 ##########################################
1144 #include <rbd/librbd.h>
1146 int main(int argc, char **argv)
1150 rados_ioctx_t io_ctx;
1151 const char pool[] = "rbd";
1153 int major, minor, extra;
1154 rbd_version(&major, &minor, &extra);
1156 rados_ioctx_create(cluster, pool, &io_ctx);
1160 if compile_prog "" "-lrbd -lrados" "rbd"; then
1161 LIBS="-lrbd -lrados $LIBS"
1164 echo "Rados Block Device engine $rbd"
1166 ##########################################
1167 # Check whether we have setvbuf
1171 int main(int argc, char **argv)
1175 setvbuf(f, buf, _IOFBF, sizeof(buf));
1179 if compile_prog "" "" "setvbuf"; then
1182 echo "setvbuf $setvbuf"
1184 ##########################################
1185 # Check if we support stckf on s390
1186 s390_z196_facilities="no"
1188 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1189 int main(int argc, char **argv)
1191 /* We want just 1 double word to be returned. */
1192 register unsigned long reg0 asm("0") = 0;
1193 unsigned long stfle_bits;
1194 asm volatile(".machine push" "\n\t"
1195 ".machine \"z9-109\"" "\n\t"
1198 : "=QS" (stfle_bits), "+d" (reg0)
1201 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1207 if compile_prog "" "" "s390_z196_facilities"; then
1209 if [[ $? -eq 0 ]]; then
1210 s390_z196_facilities="yes"
1213 echo "s390_z196_facilities $s390_z196_facilities"
1214 #############################################################################
1216 if test "$wordsize" = "64" ; then
1217 output_sym "CONFIG_64BIT"
1218 elif test "$wordsize" = "32" ; then
1219 output_sym "CONFIG_32BIT"
1221 fatal "Unknown wordsize!"
1223 if test "$bigendian" = "yes" ; then
1224 output_sym "CONFIG_BIG_ENDIAN"
1226 output_sym "CONFIG_LITTLE_ENDIAN"
1228 if test "$zlib" = "yes" ; then
1229 output_sym "CONFIG_ZLIB"
1231 if test "$libaio" = "yes" ; then
1232 output_sym "CONFIG_LIBAIO"
1234 if test "$posix_aio" = "yes" ; then
1235 output_sym "CONFIG_POSIXAIO"
1237 if test "$posix_aio_fsync" = "yes" ; then
1238 output_sym "CONFIG_POSIXAIO_FSYNC"
1240 if test "$linux_fallocate" = "yes" ; then
1241 output_sym "CONFIG_LINUX_FALLOCATE"
1243 if test "$posix_fallocate" = "yes" ; then
1244 output_sym "CONFIG_POSIX_FALLOCATE"
1246 if test "$fdatasync" = "yes" ; then
1247 output_sym "CONFIG_FDATASYNC"
1249 if test "$sync_file_range" = "yes" ; then
1250 output_sym "CONFIG_SYNC_FILE_RANGE"
1252 if test "$sfaa" = "yes" ; then
1253 output_sym "CONFIG_SFAA"
1255 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
1256 output_sym "CONFIG_RDMA"
1258 if test "$clock_gettime" = "yes" ; then
1259 output_sym "CONFIG_CLOCK_GETTIME"
1261 if test "$clock_monotonic" = "yes" ; then
1262 output_sym "CONFIG_CLOCK_MONOTONIC"
1264 if test "$clock_monotonic_precise" = "yes" ; then
1265 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
1267 if test "$gettimeofday" = "yes" ; then
1268 output_sym "CONFIG_GETTIMEOFDAY"
1270 if test "$posix_fadvise" = "yes" ; then
1271 output_sym "CONFIG_POSIX_FADVISE"
1273 if test "$linux_3arg_affinity" = "yes" ; then
1274 output_sym "CONFIG_3ARG_AFFINITY"
1275 elif test "$linux_2arg_affinity" = "yes" ; then
1276 output_sym "CONFIG_2ARG_AFFINITY"
1278 if test "$strsep" = "yes" ; then
1279 output_sym "CONFIG_STRSEP"
1281 if test "$strcasestr" = "yes" ; then
1282 output_sym "CONFIG_STRCASESTR"
1284 if test "$getopt_long_only" = "yes" ; then
1285 output_sym "CONFIG_GETOPT_LONG_ONLY"
1287 if test "$inet_aton" = "yes" ; then
1288 output_sym "CONFIG_INET_ATON"
1290 if test "$socklen_t" = "yes" ; then
1291 output_sym "CONFIG_SOCKLEN_T"
1293 if test "$ext4_me" = "yes" ; then
1294 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
1296 if test "$linux_splice" = "yes" ; then
1297 output_sym "CONFIG_LINUX_SPLICE"
1299 if test "$guasi" = "yes" ; then
1300 output_sym "CONFIG_GUASI"
1302 if test "$fusion_aw" = "yes" ; then
1303 output_sym "CONFIG_FUSION_AW"
1305 if test "$libnuma_v2" = "yes" ; then
1306 output_sym "CONFIG_LIBNUMA"
1308 if test "$solaris_aio" = "yes" ; then
1309 output_sym "CONFIG_SOLARISAIO"
1311 if test "$tls_thread" = "yes" ; then
1312 output_sym "CONFIG_TLS_THREAD"
1314 if test "$rusage_thread" = "yes" ; then
1315 output_sym "CONFIG_RUSAGE_THREAD"
1317 if test "$gfio" = "yes" ; then
1318 echo "CONFIG_GFIO=y" >> $config_host_mak
1320 if test "$sched_idle" = "yes" ; then
1321 output_sym "CONFIG_SCHED_IDLE"
1323 if test "$tcp_nodelay" = "yes" ; then
1324 output_sym "CONFIG_TCP_NODELAY"
1326 if test "$rlimit_memlock" = "yes" ; then
1327 output_sym "CONFIG_RLIMIT_MEMLOCK"
1329 if test "$pwritev" = "yes" ; then
1330 output_sym "CONFIG_PWRITEV"
1332 if test "$ipv6" = "yes" ; then
1333 output_sym "CONFIG_IPV6"
1335 if test "$rbd" = "yes" ; then
1336 output_sym "CONFIG_RBD"
1338 if test "$cpu_count" = "yes" ; then
1339 output_sym "CONFIG_CPU_COUNT"
1341 if test "$setvbuf" = "yes" ; then
1342 output_sym "CONFIG_SETVBUF"
1344 if test "$s390_z196_facilities" = "yes" ; then
1345 output_sym "CONFIG_S390_Z196_FACILITIES"
1346 CFLAGS="$CFLAGS -march=z9-109"
1349 echo "LIBS+=$LIBS" >> $config_host_mak
1350 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
1351 echo "CC=$cc" >> $config_host_mak
1352 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak