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"
144 # esx is cross compiled and cannot be detect through simple uname calls
150 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
152 --build-32bit-win) build_32bit_win="yes"
157 --disable-numa) disable_numa="yes"
159 --disable-rbd) disable_rbd="yes"
161 --disable-gfapi) disable_gfapi="yes"
167 echo "Bad option $opt"
173 if test "$show_help" = "yes" ; then
174 echo "--cpu= Specify target CPU if auto-detect fails"
175 echo "--cc= Specify compiler to use"
176 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
177 echo "--build-32bit-win Enable 32-bit build on Windows"
178 echo "--esx Configure build options for esx"
179 echo "--enable-gfio Enable building of gtk gfio"
180 echo "--disable-numa Disable libnuma even if found"
184 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
185 cc="${CC-${cross_prefix}gcc}"
187 if check_define __ANDROID__ ; then
189 elif check_define __linux__ ; then
191 elif check_define __OpenBSD__ ; then
193 elif check_define __sun__ ; then
195 CFLAGS="$CFLAGS -D_REENTRANT"
196 elif check_define _WIN32 ; then
202 echo "# Automatically generated by configure - do not modify" > $config_host_mak
203 printf "# Configured with:" >> $config_host_mak
204 printf " '%s'" "$0" "$@" >> $config_host_mak
205 echo >> $config_host_mak
206 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
208 # Some host OSes need non-standard checks for which CPU to use.
209 # Note that these checks are broken for cross-compilation: if you're
210 # cross-compiling to one of these OSes then you'll need to specify
211 # the correct CPU with the --cpu option.
214 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
215 # we can run 64-bit userspace code.
216 # If the user didn't specify a CPU explicitly and the kernel says this is
217 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
219 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
224 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
225 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
228 LIBS="-lnsl -lsocket"
231 echo "Forcing known good options on Windows"
232 if test -z "$CC" ; then
233 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
234 CC="i686-w64-mingw32-gcc"
236 CC="x86_64-w64-mingw32-gcc"
239 output_sym "CONFIG_LITTLE_ENDIAN"
240 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
241 output_sym "CONFIG_32BIT"
243 output_sym "CONFIG_64BIT_LLP64"
245 output_sym "CONFIG_FADVISE"
246 output_sym "CONFIG_SOCKLEN_T"
247 output_sym "CONFIG_FADVISE"
248 output_sym "CONFIG_SFAA"
249 output_sym "CONFIG_RUSAGE_THREAD"
250 output_sym "CONFIG_WINDOWSAIO"
251 output_sym "CONFIG_FDATASYNC"
252 output_sym "CONFIG_CLOCK_MONOTONIC"
253 output_sym "CONFIG_GETTIMEOFDAY"
254 output_sym "CONFIG_CLOCK_GETTIME"
255 output_sym "CONFIG_SCHED_IDLE"
256 output_sym "CONFIG_TCP_NODELAY"
257 output_sym "CONFIG_TLS_THREAD"
258 output_sym "CONFIG_IPV6"
259 echo "CC=$CC" >> $config_host_mak
260 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
265 if test ! -z "$cpu" ; then
266 # command line argument
268 elif check_define __i386__ ; then
270 elif check_define __x86_64__ ; then
272 elif check_define __sparc__ ; then
273 if check_define __arch64__ ; then
278 elif check_define _ARCH_PPC ; then
279 if check_define _ARCH_PPC64 ; then
284 elif check_define __mips__ ; then
286 elif check_define __ia64__ ; then
288 elif check_define __s390__ ; then
289 if check_define __s390x__ ; then
294 elif check_define __arm__ ; then
296 elif check_define __hppa__ ; then
302 # Normalise host CPU name and set ARCH.
304 ia64|ppc|ppc64|s390|s390x|sparc64)
307 i386|i486|i586|i686|i86pc|BePC)
316 hppa|parisc|parisc64)
330 if test -z "$CC" ; then
331 if test "$targetos" = "FreeBSD"; then
340 cc="${CC-${cross_prefix}gcc}"
342 ##########################################
343 # check cross compile
352 if compile_prog "" "" "cross"; then
353 $TMPE 2>/dev/null || cross_compile="yes"
355 fatal "compile test failed"
358 ##########################################
361 if test "$cross_compile" = "no" ; then
363 #include <inttypes.h>
366 volatile uint32_t i=0x01234567;
367 return (*((uint8_t*)(&i))) == 0x67;
370 if compile_prog "" "" "endian"; then
371 $TMPE && bigendian="yes"
374 # If we're cross compiling, try our best to work it out and rely on the
375 # run-time check to fail if we get it wrong.
380 #if __BYTE_ORDER != __BIG_ENDIAN
381 # error "Unknown endianness"
385 compile_prog "" "" "endian" && bigendian="yes"
386 check_define "__ARMEB__" && bigendian="yes"
387 check_define "__MIPSEB__" && bigendian="yes"
391 echo "Operating system $targetos"
393 echo "Big endian $bigendian"
395 echo "Cross compile $cross_compile"
398 ##########################################
403 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
406 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
410 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
412 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
415 fatal "Unknown wordsize"
417 echo "Wordsize $wordsize"
419 ##########################################
427 if (inflateInit(&stream) != Z_OK)
432 if compile_prog "" "-lz" "zlib" ; then
438 ##########################################
450 if compile_prog "" "-laio" "libaio" ; then
454 if test "$libaio" = "yes" ; then
455 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
459 echo "Linux AIO support $libaio"
461 ##########################################
474 if compile_prog "" "" "posixaio" ; then
476 elif compile_prog "" "-lrt" "posixaio"; then
481 echo "POSIX AIO support $posix_aio"
482 echo "POSIX AIO support needs -lrt $posix_aio_lrt"
484 ##########################################
485 # posix aio fsync probe
487 if test "$posix_aio" = "yes" ; then
494 return aio_fsync(O_SYNC, &cb);
498 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
502 echo "POSIX AIO fsync $posix_aio_fsync"
504 ##########################################
508 #include <sys/types.h>
509 #include <sys/asynch.h>
514 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
518 if compile_prog "" "-laio" "solarisaio" ; then
522 echo "Solaris AIO support $solaris_aio"
524 ##########################################
525 # __sync_fetch_and_and test
528 static int sfaa(int *ptr)
530 return __sync_fetch_and_add(ptr, 0);
533 int main(int argc, char **argv)
540 if compile_prog "" "" "__sync_fetch_and_add()" ; then
543 echo "__sync_fetch_and_add $sfaa"
545 ##########################################
550 #include <infiniband/arch.h>
551 int main(int argc, char **argv)
553 struct ibv_pd *pd = ibv_alloc_pd(NULL);
557 if compile_prog "" "-libverbs" "libverbs" ; then
559 LIBS="-libverbs $LIBS"
561 echo "libverbs $libverbs"
563 ##########################################
568 #include <rdma/rdma_cma.h>
569 int main(int argc, char **argv)
571 rdma_destroy_qp(NULL);
575 if compile_prog "" "-lrdmacm" "rdma"; then
577 LIBS="-lrdmacm $LIBS"
579 echo "rdmacm $rdmacm"
581 ##########################################
582 # Linux fallocate probe
587 #include <linux/falloc.h>
588 int main(int argc, char **argv)
590 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
594 if compile_prog "" "" "linux_fallocate"; then
595 linux_fallocate="yes"
597 echo "Linux fallocate $linux_fallocate"
599 ##########################################
600 # POSIX fadvise probe
605 int main(int argc, char **argv)
607 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
611 if compile_prog "" "" "posix_fadvise"; then
614 echo "POSIX fadvise $posix_fadvise"
616 ##########################################
617 # POSIX fallocate probe
622 int main(int argc, char **argv)
624 int r = posix_fallocate(0, 0, 1024);
628 if compile_prog "" "" "posix_fallocate"; then
629 posix_fallocate="yes"
631 echo "POSIX fallocate $posix_fallocate"
633 ##########################################
634 # sched_set/getaffinity 2 or 3 argument test
635 linux_2arg_affinity="no"
636 linux_3arg_affinity="no"
639 int main(int argc, char **argv)
642 return sched_setaffinity(0, sizeof(mask), &mask);
645 if compile_prog "" "" "sched_setaffinity(,,)"; then
646 linux_3arg_affinity="yes"
650 int main(int argc, char **argv)
653 return sched_setaffinity(0, &mask);
656 if compile_prog "" "" "sched_setaffinity(,)"; then
657 linux_2arg_affinity="yes"
660 echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
661 echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
663 ##########################################
664 # clock_gettime probe
669 int main(int argc, char **argv)
671 return clock_gettime(0, NULL);
674 if compile_prog "" "" "clock_gettime"; then
676 elif compile_prog "" "-lrt" "clock_gettime"; then
680 echo "clock_gettime $clock_gettime"
682 ##########################################
683 # CLOCK_MONOTONIC probe
685 if test "$clock_gettime" = "yes" ; then
689 int main(int argc, char **argv)
691 return clock_gettime(CLOCK_MONOTONIC, NULL);
694 if compile_prog "" "$LIBS" "clock monotonic"; then
695 clock_monotonic="yes"
698 echo "CLOCK_MONOTONIC $clock_monotonic"
700 ##########################################
701 # CLOCK_MONOTONIC_PRECISE probe
702 clock_monotonic_precise="no"
703 if test "$clock_gettime" = "yes" ; then
707 int main(int argc, char **argv)
709 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
712 if compile_prog "" "$LIBS" "clock monotonic precise"; then
713 clock_monotonic_precise="yes"
716 echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
718 ##########################################
719 # gettimeofday() probe
722 #include <sys/time.h>
724 int main(int argc, char **argv)
727 return gettimeofday(&tv, NULL);
730 if compile_prog "" "" "gettimeofday"; then
733 echo "gettimeofday $gettimeofday"
735 ##########################################
741 int main(int argc, char **argv)
746 if compile_prog "" "" "fdatasync"; then
749 echo "fdatasync $fdatasync"
751 ##########################################
752 # sync_file_range() probe
758 #include <linux/fs.h>
759 int main(int argc, char **argv)
761 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
762 SYNC_FILE_RANGE_WAIT_AFTER;
763 return sync_file_range(0, 0, 0, flags);
766 if compile_prog "" "" "sync_file_range"; then
767 sync_file_range="yes"
769 echo "sync_file_range $sync_file_range"
771 ##########################################
772 # ext4 move extent probe
776 #include <sys/ioctl.h>
777 int main(int argc, char **argv)
779 struct move_extent me;
780 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
783 if compile_prog "" "" "ext4 move extent" ; then
785 elif test $targetos = "Linux" ; then
786 # On Linux, just default to it on and let it error at runtime if we really
787 # don't have it. None of my updated systems have it defined, but it does
788 # work. Takes a while to bubble back.
791 echo "EXT4 move extent $ext4_me"
793 ##########################################
799 int main(int argc, char **argv)
801 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
804 if compile_prog "" "" "linux splice"; then
807 echo "Linux splice(2) $linux_splice"
809 ##########################################
814 #include <guasi_syscalls.h>
815 int main(int argc, char **argv)
817 guasi_t ctx = guasi_create(0, 0, 0);
821 if compile_prog "" "" "guasi"; then
826 ##########################################
830 #include <nvm/nvm_primitives.h>
831 int main(int argc, char **argv)
833 nvm_version_t ver_info;
836 handle = nvm_get_handle(0, &ver_info);
837 return nvm_atomic_write(handle, 0, 0, 0);
840 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
841 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
844 echo "Fusion-io atomic engine $fusion_aw"
846 ##########################################
851 int main(int argc, char **argv)
853 return numa_available();
856 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
860 echo "libnuma $libnuma"
862 ##########################################
863 # libnuma 2.x version API
864 if test "$libnuma" = "yes" ; then
868 int main(int argc, char **argv)
870 struct bitmask *mask = numa_parse_nodestring(NULL);
874 if compile_prog "" "" "libnuma api"; then
877 echo "libnuma v2 $libnuma_v2"
880 ##########################################
885 int main(int argc, char **argv)
891 if compile_prog "" "" "strsep"; then
894 echo "strsep $strsep"
896 ##########################################
901 int main(int argc, char **argv)
903 return strcasestr(argv[0], argv[1]) != NULL;
906 if compile_prog "" "" "strcasestr"; then
909 echo "strcasestr $strcasestr"
911 ##########################################
912 # getopt_long_only() probe
913 getopt_long_only="no"
918 int main(int argc, char **argv)
920 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
924 if compile_prog "" "" "getopt_long_only"; then
925 getopt_long_only="yes"
927 echo "getopt_long_only() $getopt_long_only"
929 ##########################################
933 #include <sys/socket.h>
934 #include <arpa/inet.h>
936 int main(int argc, char **argv)
939 return inet_aton(NULL, &in);
942 if compile_prog "" "" "inet_aton"; then
945 echo "inet_aton $inet_aton"
947 ##########################################
951 #include <sys/socket.h>
952 int main(int argc, char **argv)
958 if compile_prog "" "" "socklen_t"; then
961 echo "socklen_t $socklen_t"
963 ##########################################
964 # Whether or not __thread is supported for TLS
968 static __thread int ret;
969 int main(int argc, char **argv)
974 if compile_prog "" "" "__thread"; then
977 echo "__thread $tls_thread"
979 ##########################################
980 # Check if we have required gtk/glib support for gfio
981 if test "$gfio" = "yes" ; then
991 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
994 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
995 if test "$?" != "0" ; then
996 echo "configure: gtk and gthread not found"
999 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1000 if test "$?" != "0" ; then
1001 echo "configure: gtk and gthread not found"
1004 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1006 if test "$r" != "0" ; then
1008 LIBS="$LIBS $GTK_LIBS"
1009 CFLAGS="$CFLAGS $GTK_CFLAGS"
1011 echo "GTK found, but need version 2.18 or higher"
1015 echo "Please install gtk and gdk libraries"
1020 echo "gtk 2.18 or higher $gfio"
1022 # Check whether we have getrusage(RUSAGE_THREAD)
1025 #include <sys/time.h>
1026 #include <sys/resource.h>
1027 int main(int argc, char **argv)
1030 getrusage(RUSAGE_THREAD, &ru);
1034 if compile_prog "" "" "RUSAGE_THREAD"; then
1037 echo "RUSAGE_THREAD $rusage_thread"
1039 ##########################################
1040 # Check whether we have SCHED_IDLE
1044 int main(int argc, char **argv)
1046 struct sched_param p;
1047 return sched_setscheduler(0, SCHED_IDLE, &p);
1050 if compile_prog "" "" "SCHED_IDLE"; then
1053 echo "SCHED_IDLE $sched_idle"
1055 ##########################################
1056 # Check whether we have TCP_NODELAY
1060 #include <sys/types.h>
1061 #include <sys/socket.h>
1062 #include <netinet/tcp.h>
1063 int main(int argc, char **argv)
1065 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1068 if compile_prog "" "" "TCP_NODELAY"; then
1071 echo "TCP_NODELAY $tcp_nodelay"
1073 ##########################################
1074 # Check whether we have RLIMIT_MEMLOCK
1077 #include <sys/time.h>
1078 #include <sys/resource.h>
1079 int main(int argc, char **argv)
1082 return getrlimit(RLIMIT_MEMLOCK, &rl);
1085 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1086 rlimit_memlock="yes"
1088 echo "RLIMIT_MEMLOCK $rlimit_memlock"
1090 ##########################################
1091 # Check whether we have pwritev/preadv
1095 #include <sys/uio.h>
1096 int main(int argc, char **argv)
1098 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1101 if compile_prog "" "" "pwritev"; then
1104 echo "pwritev/preadv $pwritev"
1106 ##########################################
1107 # Check whether we have the required functions for ipv6
1110 #include <sys/types.h>
1111 #include <sys/socket.h>
1112 #include <netinet/in.h>
1115 int main(int argc, char **argv)
1117 struct addrinfo hints;
1118 struct in6_addr addr;
1121 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1123 printf("%s\n", gai_strerror(ret));
1128 if compile_prog "" "" "ipv6"; then
1131 echo "IPv6 helpers $ipv6"
1133 ##########################################
1137 #include <rbd/librbd.h>
1139 int main(int argc, char **argv)
1143 rados_ioctx_t io_ctx;
1144 const char pool[] = "rbd";
1146 int major, minor, extra;
1147 rbd_version(&major, &minor, &extra);
1149 rados_ioctx_create(cluster, pool, &io_ctx);
1153 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1154 LIBS="-lrbd -lrados $LIBS"
1157 echo "Rados Block Device engine $rbd"
1159 ##########################################
1160 # Check whether we have setvbuf
1164 int main(int argc, char **argv)
1168 setvbuf(f, buf, _IOFBF, sizeof(buf));
1172 if compile_prog "" "" "setvbuf"; then
1175 echo "setvbuf $setvbuf"
1180 #include <glusterfs/api/glfs.h>
1182 int main(int argc, char **argv)
1185 glfs_t *g = glfs_new("foo");
1190 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1191 LIBS="-lgfapi -lglusterfs $LIBS"
1194 echo "Gluster API engine $gfapi"
1196 ##########################################
1197 # check for gfapi fadvise support
1200 #include <glusterfs/api/glfs.h>
1202 int main(int argc, char **argv)
1205 int ret = glfs_fadvise(fd, 0, 0, 1);
1211 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1214 echo "Gluster API use fadvise $gf_fadvise"
1216 ##########################################
1217 # Check if we support stckf on s390
1218 s390_z196_facilities="no"
1220 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1221 int main(int argc, char **argv)
1223 /* We want just 1 double word to be returned. */
1224 register unsigned long reg0 asm("0") = 0;
1225 unsigned long stfle_bits;
1226 asm volatile(".machine push" "\n\t"
1227 ".machine \"z9-109\"" "\n\t"
1230 : "=QS" (stfle_bits), "+d" (reg0)
1233 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1239 if compile_prog "" "" "s390_z196_facilities"; then
1241 if [[ $? -eq 0 ]]; then
1242 s390_z196_facilities="yes"
1245 echo "s390_z196_facilities $s390_z196_facilities"
1246 #############################################################################
1248 if test "$wordsize" = "64" ; then
1249 output_sym "CONFIG_64BIT"
1250 elif test "$wordsize" = "32" ; then
1251 output_sym "CONFIG_32BIT"
1253 fatal "Unknown wordsize!"
1255 if test "$bigendian" = "yes" ; then
1256 output_sym "CONFIG_BIG_ENDIAN"
1258 output_sym "CONFIG_LITTLE_ENDIAN"
1260 if test "$zlib" = "yes" ; then
1261 output_sym "CONFIG_ZLIB"
1263 if test "$libaio" = "yes" ; then
1264 output_sym "CONFIG_LIBAIO"
1266 if test "$posix_aio" = "yes" ; then
1267 output_sym "CONFIG_POSIXAIO"
1269 if test "$posix_aio_fsync" = "yes" ; then
1270 output_sym "CONFIG_POSIXAIO_FSYNC"
1272 if test "$linux_fallocate" = "yes" ; then
1273 output_sym "CONFIG_LINUX_FALLOCATE"
1275 if test "$posix_fallocate" = "yes" ; then
1276 output_sym "CONFIG_POSIX_FALLOCATE"
1278 if test "$fdatasync" = "yes" ; then
1279 output_sym "CONFIG_FDATASYNC"
1281 if test "$sync_file_range" = "yes" ; then
1282 output_sym "CONFIG_SYNC_FILE_RANGE"
1284 if test "$sfaa" = "yes" ; then
1285 output_sym "CONFIG_SFAA"
1287 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
1288 output_sym "CONFIG_RDMA"
1290 if test "$clock_gettime" = "yes" ; then
1291 output_sym "CONFIG_CLOCK_GETTIME"
1293 if test "$clock_monotonic" = "yes" ; then
1294 output_sym "CONFIG_CLOCK_MONOTONIC"
1296 if test "$clock_monotonic_precise" = "yes" ; then
1297 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
1299 if test "$gettimeofday" = "yes" ; then
1300 output_sym "CONFIG_GETTIMEOFDAY"
1302 if test "$posix_fadvise" = "yes" ; then
1303 output_sym "CONFIG_POSIX_FADVISE"
1305 if test "$linux_3arg_affinity" = "yes" ; then
1306 output_sym "CONFIG_3ARG_AFFINITY"
1307 elif test "$linux_2arg_affinity" = "yes" ; then
1308 output_sym "CONFIG_2ARG_AFFINITY"
1310 if test "$strsep" = "yes" ; then
1311 output_sym "CONFIG_STRSEP"
1313 if test "$strcasestr" = "yes" ; then
1314 output_sym "CONFIG_STRCASESTR"
1316 if test "$getopt_long_only" = "yes" ; then
1317 output_sym "CONFIG_GETOPT_LONG_ONLY"
1319 if test "$inet_aton" = "yes" ; then
1320 output_sym "CONFIG_INET_ATON"
1322 if test "$socklen_t" = "yes" ; then
1323 output_sym "CONFIG_SOCKLEN_T"
1325 if test "$ext4_me" = "yes" ; then
1326 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
1328 if test "$linux_splice" = "yes" ; then
1329 output_sym "CONFIG_LINUX_SPLICE"
1331 if test "$guasi" = "yes" ; then
1332 output_sym "CONFIG_GUASI"
1334 if test "$fusion_aw" = "yes" ; then
1335 output_sym "CONFIG_FUSION_AW"
1337 if test "$libnuma_v2" = "yes" ; then
1338 output_sym "CONFIG_LIBNUMA"
1340 if test "$solaris_aio" = "yes" ; then
1341 output_sym "CONFIG_SOLARISAIO"
1343 if test "$tls_thread" = "yes" ; then
1344 output_sym "CONFIG_TLS_THREAD"
1346 if test "$rusage_thread" = "yes" ; then
1347 output_sym "CONFIG_RUSAGE_THREAD"
1349 if test "$gfio" = "yes" ; then
1350 echo "CONFIG_GFIO=y" >> $config_host_mak
1352 if test "$esx" = "yes" ; then
1353 output_sym "CONFIG_ESX"
1354 output_sym "CONFIG_NO_SHM"
1356 if test "$sched_idle" = "yes" ; then
1357 output_sym "CONFIG_SCHED_IDLE"
1359 if test "$tcp_nodelay" = "yes" ; then
1360 output_sym "CONFIG_TCP_NODELAY"
1362 if test "$rlimit_memlock" = "yes" ; then
1363 output_sym "CONFIG_RLIMIT_MEMLOCK"
1365 if test "$pwritev" = "yes" ; then
1366 output_sym "CONFIG_PWRITEV"
1368 if test "$ipv6" = "yes" ; then
1369 output_sym "CONFIG_IPV6"
1371 if test "$rbd" = "yes" ; then
1372 output_sym "CONFIG_RBD"
1374 if test "$setvbuf" = "yes" ; then
1375 output_sym "CONFIG_SETVBUF"
1377 if test "$s390_z196_facilities" = "yes" ; then
1378 output_sym "CONFIG_S390_Z196_FACILITIES"
1379 CFLAGS="$CFLAGS -march=z9-109"
1381 if test "$gfapi" = "yes" ; then
1382 output_sym "CONFIG_GFAPI"
1384 if test "$gf_fadvise" = "yes" ; then
1385 output_sym "CONFIG_GF_FADVISE"
1388 echo "LIBS+=$LIBS" >> $config_host_mak
1389 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
1390 echo "CC=$cc" >> $config_host_mak
1391 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak