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"
163 echo "Bad option $opt"
169 if test "$show_help" = "yes" ; then
170 echo "--cpu= Specify target CPU if auto-detect fails"
171 echo "--cc= Specify compiler to use"
172 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
173 echo "--build-32bit-win Enable 32-bit build on Windows"
174 echo "--esx Configure build options for esx"
175 echo "--enable-gfio Enable building of gtk gfio"
176 echo "--disable-numa Disable libnuma even if found"
180 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
181 cc="${CC-${cross_prefix}gcc}"
183 if check_define __ANDROID__ ; then
185 elif check_define __linux__ ; then
187 elif check_define __OpenBSD__ ; then
189 elif check_define __sun__ ; then
191 CFLAGS="$CFLAGS -D_REENTRANT"
192 elif check_define _WIN32 ; then
198 echo "# Automatically generated by configure - do not modify" > $config_host_mak
199 printf "# Configured with:" >> $config_host_mak
200 printf " '%s'" "$0" "$@" >> $config_host_mak
201 echo >> $config_host_mak
202 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
204 # Some host OSes need non-standard checks for which CPU to use.
205 # Note that these checks are broken for cross-compilation: if you're
206 # cross-compiling to one of these OSes then you'll need to specify
207 # the correct CPU with the --cpu option.
210 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
211 # we can run 64-bit userspace code.
212 # If the user didn't specify a CPU explicitly and the kernel says this is
213 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
215 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
220 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
221 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
224 LIBS="-lnsl -lsocket"
227 echo "Forcing known good options on Windows"
228 if test -z "$CC" ; then
229 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
230 CC="i686-w64-mingw32-gcc"
232 CC="x86_64-w64-mingw32-gcc"
235 output_sym "CONFIG_LITTLE_ENDIAN"
236 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
237 output_sym "CONFIG_32BIT"
239 output_sym "CONFIG_64BIT_LLP64"
241 output_sym "CONFIG_FADVISE"
242 output_sym "CONFIG_SOCKLEN_T"
243 output_sym "CONFIG_FADVISE"
244 output_sym "CONFIG_SFAA"
245 output_sym "CONFIG_RUSAGE_THREAD"
246 output_sym "CONFIG_WINDOWSAIO"
247 output_sym "CONFIG_FDATASYNC"
248 output_sym "CONFIG_CLOCK_MONOTONIC"
249 output_sym "CONFIG_GETTIMEOFDAY"
250 output_sym "CONFIG_CLOCK_GETTIME"
251 output_sym "CONFIG_SCHED_IDLE"
252 output_sym "CONFIG_TCP_NODELAY"
253 output_sym "CONFIG_TLS_THREAD"
254 output_sym "CONFIG_IPV6"
255 echo "CC=$CC" >> $config_host_mak
256 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
261 if test ! -z "$cpu" ; then
262 # command line argument
264 elif check_define __i386__ ; then
266 elif check_define __x86_64__ ; then
268 elif check_define __sparc__ ; then
269 if check_define __arch64__ ; then
274 elif check_define _ARCH_PPC ; then
275 if check_define _ARCH_PPC64 ; then
280 elif check_define __mips__ ; then
282 elif check_define __ia64__ ; then
284 elif check_define __s390__ ; then
285 if check_define __s390x__ ; then
290 elif check_define __arm__ ; then
292 elif check_define __hppa__ ; then
298 # Normalise host CPU name and set ARCH.
300 ia64|ppc|ppc64|s390|s390x|sparc64)
303 i386|i486|i586|i686|i86pc|BePC)
312 hppa|parisc|parisc64)
326 if test -z "$CC" ; then
327 if test "$targetos" = "FreeBSD"; then
336 cc="${CC-${cross_prefix}gcc}"
338 ##########################################
339 # check cross compile
348 if compile_prog "" "" "cross"; then
349 $TMPE 2>/dev/null || cross_compile="yes"
351 fatal "compile test failed"
354 ##########################################
357 if test "$cross_compile" = "no" ; then
359 #include <inttypes.h>
362 volatile uint32_t i=0x01234567;
363 return (*((uint8_t*)(&i))) == 0x67;
366 if compile_prog "" "" "endian"; then
367 $TMPE && bigendian="yes"
370 # If we're cross compiling, try our best to work it out and rely on the
371 # run-time check to fail if we get it wrong.
376 #if __BYTE_ORDER != __BIG_ENDIAN
377 # error "Unknown endianness"
381 compile_prog "" "" "endian" && bigendian="yes"
382 check_define "__ARMEB__" && bigendian="yes"
383 check_define "__MIPSEB__" && bigendian="yes"
387 echo "Operating system $targetos"
389 echo "Big endian $bigendian"
391 echo "Cross compile $cross_compile"
394 ##########################################
399 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
402 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
406 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
408 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
411 fatal "Unknown wordsize"
413 echo "Wordsize $wordsize"
415 ##########################################
423 if (inflateInit(&stream) != Z_OK)
428 if compile_prog "" "-lz" "zlib" ; then
434 ##########################################
446 if compile_prog "" "-laio" "libaio" ; then
450 if test "$libaio" = "yes" ; then
451 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
455 echo "Linux AIO support $libaio"
457 ##########################################
470 if compile_prog "" "" "posixaio" ; then
472 elif compile_prog "" "-lrt" "posixaio"; then
477 echo "POSIX AIO support $posix_aio"
478 echo "POSIX AIO support needs -lrt $posix_aio_lrt"
480 ##########################################
481 # posix aio fsync probe
483 if test "$posix_aio" = "yes" ; then
490 return aio_fsync(O_SYNC, &cb);
494 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
498 echo "POSIX AIO fsync $posix_aio_fsync"
500 ##########################################
504 #include <sys/types.h>
505 #include <sys/asynch.h>
510 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
514 if compile_prog "" "-laio" "solarisaio" ; then
518 echo "Solaris AIO support $solaris_aio"
520 ##########################################
521 # __sync_fetch_and_and test
524 static int sfaa(int *ptr)
526 return __sync_fetch_and_add(ptr, 0);
529 int main(int argc, char **argv)
536 if compile_prog "" "" "__sync_fetch_and_add()" ; then
539 echo "__sync_fetch_and_add $sfaa"
541 ##########################################
546 #include <infiniband/arch.h>
547 int main(int argc, char **argv)
549 struct ibv_pd *pd = ibv_alloc_pd(NULL);
553 if compile_prog "" "-libverbs" "libverbs" ; then
555 LIBS="-libverbs $LIBS"
557 echo "libverbs $libverbs"
559 ##########################################
564 #include <rdma/rdma_cma.h>
565 int main(int argc, char **argv)
567 rdma_destroy_qp(NULL);
571 if compile_prog "" "-lrdmacm" "rdma"; then
573 LIBS="-lrdmacm $LIBS"
575 echo "rdmacm $rdmacm"
577 ##########################################
578 # Linux fallocate probe
583 #include <linux/falloc.h>
584 int main(int argc, char **argv)
586 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
590 if compile_prog "" "" "linux_fallocate"; then
591 linux_fallocate="yes"
593 echo "Linux fallocate $linux_fallocate"
595 ##########################################
596 # POSIX fadvise probe
601 int main(int argc, char **argv)
603 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
607 if compile_prog "" "" "posix_fadvise"; then
610 echo "POSIX fadvise $posix_fadvise"
612 ##########################################
613 # POSIX fallocate probe
618 int main(int argc, char **argv)
620 int r = posix_fallocate(0, 0, 1024);
624 if compile_prog "" "" "posix_fallocate"; then
625 posix_fallocate="yes"
627 echo "POSIX fallocate $posix_fallocate"
629 ##########################################
630 # sched_set/getaffinity 2 or 3 argument test
631 linux_2arg_affinity="no"
632 linux_3arg_affinity="no"
635 int main(int argc, char **argv)
638 return sched_setaffinity(0, sizeof(mask), &mask);
641 if compile_prog "" "" "sched_setaffinity(,,)"; then
642 linux_3arg_affinity="yes"
646 int main(int argc, char **argv)
649 return sched_setaffinity(0, &mask);
652 if compile_prog "" "" "sched_setaffinity(,)"; then
653 linux_2arg_affinity="yes"
656 echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
657 echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
659 ##########################################
660 # clock_gettime probe
665 int main(int argc, char **argv)
667 return clock_gettime(0, NULL);
670 if compile_prog "" "" "clock_gettime"; then
672 elif compile_prog "" "-lrt" "clock_gettime"; then
676 echo "clock_gettime $clock_gettime"
678 ##########################################
679 # CLOCK_MONOTONIC probe
681 if test "$clock_gettime" = "yes" ; then
685 int main(int argc, char **argv)
687 return clock_gettime(CLOCK_MONOTONIC, NULL);
690 if compile_prog "" "$LIBS" "clock monotonic"; then
691 clock_monotonic="yes"
694 echo "CLOCK_MONOTONIC $clock_monotonic"
696 ##########################################
697 # CLOCK_MONOTONIC_PRECISE probe
698 clock_monotonic_precise="no"
699 if test "$clock_gettime" = "yes" ; then
703 int main(int argc, char **argv)
705 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
708 if compile_prog "" "$LIBS" "clock monotonic precise"; then
709 clock_monotonic_precise="yes"
712 echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
714 ##########################################
715 # gettimeofday() probe
718 #include <sys/time.h>
720 int main(int argc, char **argv)
723 return gettimeofday(&tv, NULL);
726 if compile_prog "" "" "gettimeofday"; then
729 echo "gettimeofday $gettimeofday"
731 ##########################################
737 int main(int argc, char **argv)
742 if compile_prog "" "" "fdatasync"; then
745 echo "fdatasync $fdatasync"
747 ##########################################
748 # sync_file_range() probe
754 #include <linux/fs.h>
755 int main(int argc, char **argv)
757 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
758 SYNC_FILE_RANGE_WAIT_AFTER;
759 return sync_file_range(0, 0, 0, flags);
762 if compile_prog "" "" "sync_file_range"; then
763 sync_file_range="yes"
765 echo "sync_file_range $sync_file_range"
767 ##########################################
768 # ext4 move extent probe
772 #include <sys/ioctl.h>
773 int main(int argc, char **argv)
775 struct move_extent me;
776 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
779 if compile_prog "" "" "ext4 move extent" ; then
781 elif test $targetos = "Linux" ; then
782 # On Linux, just default to it on and let it error at runtime if we really
783 # don't have it. None of my updated systems have it defined, but it does
784 # work. Takes a while to bubble back.
787 echo "EXT4 move extent $ext4_me"
789 ##########################################
795 int main(int argc, char **argv)
797 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
800 if compile_prog "" "" "linux splice"; then
803 echo "Linux splice(2) $linux_splice"
805 ##########################################
810 #include <guasi_syscalls.h>
811 int main(int argc, char **argv)
813 guasi_t ctx = guasi_create(0, 0, 0);
817 if compile_prog "" "" "guasi"; then
822 ##########################################
826 #include <nvm/nvm_primitives.h>
827 int main(int argc, char **argv)
829 nvm_version_t ver_info;
832 handle = nvm_get_handle(0, &ver_info);
833 return nvm_atomic_write(handle, 0, 0, 0);
836 if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
837 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
840 echo "Fusion-io atomic engine $fusion_aw"
842 ##########################################
847 int main(int argc, char **argv)
849 return numa_available();
852 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
856 echo "libnuma $libnuma"
858 ##########################################
859 # libnuma 2.x version API
860 if test "$libnuma" = "yes" ; then
864 int main(int argc, char **argv)
866 struct bitmask *mask = numa_parse_nodestring(NULL);
870 if compile_prog "" "" "libnuma api"; then
873 echo "libnuma v2 $libnuma_v2"
876 ##########################################
881 int main(int argc, char **argv)
887 if compile_prog "" "" "strsep"; then
890 echo "strsep $strsep"
892 ##########################################
897 int main(int argc, char **argv)
899 return strcasestr(argv[0], argv[1]) != NULL;
902 if compile_prog "" "" "strcasestr"; then
905 echo "strcasestr $strcasestr"
907 ##########################################
908 # getopt_long_only() probe
909 getopt_long_only="no"
914 int main(int argc, char **argv)
916 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
920 if compile_prog "" "" "getopt_long_only"; then
921 getopt_long_only="yes"
923 echo "getopt_long_only() $getopt_long_only"
925 ##########################################
929 #include <sys/socket.h>
930 #include <arpa/inet.h>
932 int main(int argc, char **argv)
935 return inet_aton(NULL, &in);
938 if compile_prog "" "" "inet_aton"; then
941 echo "inet_aton $inet_aton"
943 ##########################################
947 #include <sys/socket.h>
948 int main(int argc, char **argv)
954 if compile_prog "" "" "socklen_t"; then
957 echo "socklen_t $socklen_t"
959 ##########################################
960 # Whether or not __thread is supported for TLS
964 static __thread int ret;
965 int main(int argc, char **argv)
970 if compile_prog "" "" "__thread"; then
973 echo "__thread $tls_thread"
975 ##########################################
976 # Check if we have required gtk/glib support for gfio
977 if test "$gfio" = "yes" ; then
987 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
990 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
991 if test "$?" != "0" ; then
992 echo "configure: gtk and gthread not found"
995 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
996 if test "$?" != "0" ; then
997 echo "configure: gtk and gthread not found"
1000 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1002 if test "$r" != "0" ; then
1004 LIBS="$LIBS $GTK_LIBS"
1005 CFLAGS="$CFLAGS $GTK_CFLAGS"
1007 echo "GTK found, but need version 2.18 or higher"
1011 echo "Please install gtk and gdk libraries"
1016 echo "gtk 2.18 or higher $gfio"
1018 # Check whether we have getrusage(RUSAGE_THREAD)
1021 #include <sys/time.h>
1022 #include <sys/resource.h>
1023 int main(int argc, char **argv)
1026 getrusage(RUSAGE_THREAD, &ru);
1030 if compile_prog "" "" "RUSAGE_THREAD"; then
1033 echo "RUSAGE_THREAD $rusage_thread"
1035 ##########################################
1036 # Check whether we have SCHED_IDLE
1040 int main(int argc, char **argv)
1042 struct sched_param p;
1043 return sched_setscheduler(0, SCHED_IDLE, &p);
1046 if compile_prog "" "" "SCHED_IDLE"; then
1049 echo "SCHED_IDLE $sched_idle"
1051 ##########################################
1052 # Check whether we have TCP_NODELAY
1056 #include <sys/types.h>
1057 #include <sys/socket.h>
1058 #include <netinet/tcp.h>
1059 int main(int argc, char **argv)
1061 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1064 if compile_prog "" "" "TCP_NODELAY"; then
1067 echo "TCP_NODELAY $tcp_nodelay"
1069 ##########################################
1070 # Check whether we have RLIMIT_MEMLOCK
1073 #include <sys/time.h>
1074 #include <sys/resource.h>
1075 int main(int argc, char **argv)
1078 return getrlimit(RLIMIT_MEMLOCK, &rl);
1081 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1082 rlimit_memlock="yes"
1084 echo "RLIMIT_MEMLOCK $rlimit_memlock"
1086 ##########################################
1087 # Check whether we have pwritev/preadv
1091 #include <sys/uio.h>
1092 int main(int argc, char **argv)
1094 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1097 if compile_prog "" "" "pwritev"; then
1100 echo "pwritev/preadv $pwritev"
1102 ##########################################
1103 # Check whether we have the required functions for ipv6
1106 #include <sys/types.h>
1107 #include <sys/socket.h>
1108 #include <netinet/in.h>
1111 int main(int argc, char **argv)
1113 struct addrinfo hints;
1114 struct in6_addr addr;
1117 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1119 printf("%s\n", gai_strerror(ret));
1124 if compile_prog "" "" "ipv6"; then
1127 echo "IPv6 helpers $ipv6"
1129 ##########################################
1133 #include <rbd/librbd.h>
1135 int main(int argc, char **argv)
1139 rados_ioctx_t io_ctx;
1140 const char pool[] = "rbd";
1142 int major, minor, extra;
1143 rbd_version(&major, &minor, &extra);
1145 rados_ioctx_create(cluster, pool, &io_ctx);
1149 if compile_prog "" "-lrbd -lrados" "rbd"; then
1150 LIBS="-lrbd -lrados $LIBS"
1153 echo "Rados Block Device engine $rbd"
1155 ##########################################
1156 # Check whether we have setvbuf
1160 int main(int argc, char **argv)
1164 setvbuf(f, buf, _IOFBF, sizeof(buf));
1168 if compile_prog "" "" "setvbuf"; then
1171 echo "setvbuf $setvbuf"
1176 #include <glusterfs/api/glfs.h>
1178 int main(int argc, char **argv)
1181 glfs_t *g = glfs_new("foo");
1186 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1187 LIBS="-lgfapi -lglusterfs $LIBS"
1190 echo "Gluster API engine $gfapi"
1192 ##########################################
1193 # check for gfapi fadvise support
1196 #include <glusterfs/api/glfs.h>
1198 int main(int argc, char **argv)
1201 int ret = glfs_fadvise(fd, 0, 0, 1);
1207 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1210 echo "Gluster API use fadvise $gf_fadvise"
1212 ##########################################
1213 # Check if we support stckf on s390
1214 s390_z196_facilities="no"
1216 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1217 int main(int argc, char **argv)
1219 /* We want just 1 double word to be returned. */
1220 register unsigned long reg0 asm("0") = 0;
1221 unsigned long stfle_bits;
1222 asm volatile(".machine push" "\n\t"
1223 ".machine \"z9-109\"" "\n\t"
1226 : "=QS" (stfle_bits), "+d" (reg0)
1229 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1235 if compile_prog "" "" "s390_z196_facilities"; then
1237 if [[ $? -eq 0 ]]; then
1238 s390_z196_facilities="yes"
1241 echo "s390_z196_facilities $s390_z196_facilities"
1242 #############################################################################
1244 if test "$wordsize" = "64" ; then
1245 output_sym "CONFIG_64BIT"
1246 elif test "$wordsize" = "32" ; then
1247 output_sym "CONFIG_32BIT"
1249 fatal "Unknown wordsize!"
1251 if test "$bigendian" = "yes" ; then
1252 output_sym "CONFIG_BIG_ENDIAN"
1254 output_sym "CONFIG_LITTLE_ENDIAN"
1256 if test "$zlib" = "yes" ; then
1257 output_sym "CONFIG_ZLIB"
1259 if test "$libaio" = "yes" ; then
1260 output_sym "CONFIG_LIBAIO"
1262 if test "$posix_aio" = "yes" ; then
1263 output_sym "CONFIG_POSIXAIO"
1265 if test "$posix_aio_fsync" = "yes" ; then
1266 output_sym "CONFIG_POSIXAIO_FSYNC"
1268 if test "$linux_fallocate" = "yes" ; then
1269 output_sym "CONFIG_LINUX_FALLOCATE"
1271 if test "$posix_fallocate" = "yes" ; then
1272 output_sym "CONFIG_POSIX_FALLOCATE"
1274 if test "$fdatasync" = "yes" ; then
1275 output_sym "CONFIG_FDATASYNC"
1277 if test "$sync_file_range" = "yes" ; then
1278 output_sym "CONFIG_SYNC_FILE_RANGE"
1280 if test "$sfaa" = "yes" ; then
1281 output_sym "CONFIG_SFAA"
1283 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
1284 output_sym "CONFIG_RDMA"
1286 if test "$clock_gettime" = "yes" ; then
1287 output_sym "CONFIG_CLOCK_GETTIME"
1289 if test "$clock_monotonic" = "yes" ; then
1290 output_sym "CONFIG_CLOCK_MONOTONIC"
1292 if test "$clock_monotonic_precise" = "yes" ; then
1293 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
1295 if test "$gettimeofday" = "yes" ; then
1296 output_sym "CONFIG_GETTIMEOFDAY"
1298 if test "$posix_fadvise" = "yes" ; then
1299 output_sym "CONFIG_POSIX_FADVISE"
1301 if test "$linux_3arg_affinity" = "yes" ; then
1302 output_sym "CONFIG_3ARG_AFFINITY"
1303 elif test "$linux_2arg_affinity" = "yes" ; then
1304 output_sym "CONFIG_2ARG_AFFINITY"
1306 if test "$strsep" = "yes" ; then
1307 output_sym "CONFIG_STRSEP"
1309 if test "$strcasestr" = "yes" ; then
1310 output_sym "CONFIG_STRCASESTR"
1312 if test "$getopt_long_only" = "yes" ; then
1313 output_sym "CONFIG_GETOPT_LONG_ONLY"
1315 if test "$inet_aton" = "yes" ; then
1316 output_sym "CONFIG_INET_ATON"
1318 if test "$socklen_t" = "yes" ; then
1319 output_sym "CONFIG_SOCKLEN_T"
1321 if test "$ext4_me" = "yes" ; then
1322 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
1324 if test "$linux_splice" = "yes" ; then
1325 output_sym "CONFIG_LINUX_SPLICE"
1327 if test "$guasi" = "yes" ; then
1328 output_sym "CONFIG_GUASI"
1330 if test "$fusion_aw" = "yes" ; then
1331 output_sym "CONFIG_FUSION_AW"
1333 if test "$libnuma_v2" = "yes" ; then
1334 output_sym "CONFIG_LIBNUMA"
1336 if test "$solaris_aio" = "yes" ; then
1337 output_sym "CONFIG_SOLARISAIO"
1339 if test "$tls_thread" = "yes" ; then
1340 output_sym "CONFIG_TLS_THREAD"
1342 if test "$rusage_thread" = "yes" ; then
1343 output_sym "CONFIG_RUSAGE_THREAD"
1345 if test "$gfio" = "yes" ; then
1346 echo "CONFIG_GFIO=y" >> $config_host_mak
1348 if test "$esx" = "yes" ; then
1349 output_sym "CONFIG_ESX"
1350 output_sym "CONFIG_NO_SHM"
1352 if test "$sched_idle" = "yes" ; then
1353 output_sym "CONFIG_SCHED_IDLE"
1355 if test "$tcp_nodelay" = "yes" ; then
1356 output_sym "CONFIG_TCP_NODELAY"
1358 if test "$rlimit_memlock" = "yes" ; then
1359 output_sym "CONFIG_RLIMIT_MEMLOCK"
1361 if test "$pwritev" = "yes" ; then
1362 output_sym "CONFIG_PWRITEV"
1364 if test "$ipv6" = "yes" ; then
1365 output_sym "CONFIG_IPV6"
1367 if test "$rbd" = "yes" ; then
1368 output_sym "CONFIG_RBD"
1370 if test "$setvbuf" = "yes" ; then
1371 output_sym "CONFIG_SETVBUF"
1373 if test "$s390_z196_facilities" = "yes" ; then
1374 output_sym "CONFIG_S390_Z196_FACILITIES"
1375 CFLAGS="$CFLAGS -march=z9-109"
1377 if test "$gfapi" = "yes" ; then
1378 output_sym "CONFIG_GFAPI"
1380 if test "$gf_fadvise" = "yes" ; then
1381 output_sym "CONFIG_GF_FADVISE"
1384 echo "LIBS+=$LIBS" >> $config_host_mak
1385 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
1386 echo "CC=$cc" >> $config_host_mak
1387 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak