configure: add default compiler on Windows
[fio.git] / configure
CommitLineData
67bf9823
JA
1#!/bin/sh
2#
3# Fio configure script. Heavily influenced by the manual qemu configure
4# script. Sad this this is easier than autoconf and enemies.
5#
6
7# set temporary file name
8if test ! -z "$TMPDIR" ; then
9 TMPDIR1="${TMPDIR}"
10elif test ! -z "$TEMPDIR" ; then
11 TMPDIR1="${TEMPDIR}"
12else
13 TMPDIR1="/tmp"
14fi
15
16TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
19
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>
22trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
23
24rm -rf config.log
25
26config_host_mak="config-host.mak"
27config_host_ld="config-host.ld"
28
29# Print a helpful header at the top of config.log
30echo "# FIO configure log $(date)" >> config.log
31printf "# Configured with:" >> config.log
32printf " '%s'" "$0" "$@" >> config.log
33echo >> config.log
34echo "#" >> config.log
35
36do_cc() {
37 # Run the compiler, capturing its output to the log.
38 echo $cc "$@" >> config.log
39 $cc "$@" >> config.log 2>&1 || return $?
40 # Test passed. If this is an --enable-werror build, rerun
41 # the test with -Werror and bail out if it fails. This
42 # makes warning-generating-errors in configure test code
43 # obvious to developers.
44 if test "$werror" != "yes"; then
45 return 0
46 fi
47 # Don't bother rerunning the compile if we were already using -Werror
48 case "$*" in
49 *-Werror*)
50 return 0
51 ;;
52 esac
53 echo $cc -Werror "$@" >> config.log
54 $cc -Werror "$@" >> config.log 2>&1 && return $?
55 echo "ERROR: configure test passed without -Werror but failed with -Werror."
56 echo "This is probably a bug in the configure script. The failing command"
57 echo "will be at the bottom of config.log."
58 echo "You can run configure with --disable-werror to bypass this check."
59 exit 1
60}
61
62compile_object() {
63 do_cc $CFLAGS -c -o $TMPO $TMPC
64}
65
66compile_prog() {
67 local_cflags="$1"
68 local_ldflags="$2"
69 echo "Compiling test case $3" >> config.log
70 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
71}
72
73feature_not_found() {
74 feature=$1
75
76 echo "ERROR"
77 echo "ERROR: User requested feature $feature"
78 echo "ERROR: configure was not able to find it"
79 echo "ERROR"
80 exit 1;
81}
82
83has() {
84 type "$1" >/dev/null 2>&1
85}
86
87check_define() {
88 cat > $TMPC <<EOF
89#if !defined($1)
90#error $1 not defined
91#endif
92int main(void)
93{
94 return 0;
95}
96EOF
97 compile_object
98}
99
100targetos=""
101cpu=""
102
103cc="${CC-${cross_prefix}gcc}"
104
cb1125b0
JA
105# parse options
106for opt do
107 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
108 case "$opt" in
109 --cc=*) CC="$optarg"
110 ;;
111 *)
112 echo "Bad option $opt"
113 exit 1
114 esac
115done
116
67bf9823
JA
117if check_define __linux__ ; then
118 targetos="Linux"
67bf9823
JA
119elif check_define __OpenBSD__ ; then
120 targetos='OpenBSD'
121elif check_define __sun__ ; then
122 targetos='SunOS'
123else
124 targetos=`uname -s`
125fi
126
127# Some host OSes need non-standard checks for which CPU to use.
128# Note that these checks are broken for cross-compilation: if you're
129# cross-compiling to one of these OSes then you'll need to specify
130# the correct CPU with the --cpu option.
131case $targetos in
132Darwin)
133 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
134 # we can run 64-bit userspace code.
135 # If the user didn't specify a CPU explicitly and the kernel says this is
136 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
137 # detection code.
138 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
139 cpu="x86_64"
140 fi
141 ;;
142SunOS)
143 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
144 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
145 cpu="x86_64"
146 fi
cfd94f79
JA
147 ;;
148CYGWIN*)
149 echo "Forcing known good options on Windows"
4578d01f
JA
150 if test -z "$CC" ; then
151 CC="x86_64-w64-mingw32-gcc"
152 fi
cfd94f79
JA
153 echo "CC=$CC" > $config_host_mak
154 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
155 echo "CONFIG_64BIT_LLP64=y" >> $config_host_mak
156 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
157 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
158 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
159 echo "CONFIG_FADVISE=y" >> $config_host_mak
160 echo "CONFIG_STRSEP=y" >> $config_host_mak
161 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
162 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
163 echo "CONFIG_FADVISE=y" >> $config_host_mak
164 echo "CONFIG_SFAA=y" >> $config_host_mak
165 exit 0
67bf9823
JA
166esac
167
168if test ! -z "$cpu" ; then
169 # command line argument
170 :
171elif check_define __i386__ ; then
172 cpu="i386"
173elif check_define __x86_64__ ; then
174 cpu="x86_64"
175elif check_define __sparc__ ; then
176 if check_define __arch64__ ; then
177 cpu="sparc64"
178 else
179 cpu="sparc"
180 fi
181elif check_define _ARCH_PPC ; then
182 if check_define _ARCH_PPC64 ; then
183 cpu="ppc64"
184 else
185 cpu="ppc"
186 fi
187elif check_define __mips__ ; then
188 cpu="mips"
189elif check_define __ia64__ ; then
190 cpu="ia64"
191elif check_define __s390__ ; then
192 if check_define __s390x__ ; then
193 cpu="s390x"
194 else
195 cpu="s390"
196 fi
197elif check_define __arm__ ; then
198 cpu="arm"
199elif check_define __hppa__ ; then
200 cpu="hppa"
201else
202 cpu=`uname -m`
203fi
204
205# Normalise host CPU name and set ARCH.
206case "$cpu" in
207 ia64|ppc|ppc64|s390|s390x|sparc64)
208 cpu="$cpu"
209 ;;
210 i386|i486|i586|i686|i86pc|BePC)
211 cpu="i386"
212 ;;
213 x86_64|amd64)
214 cpu="x86_64"
215 ;;
216 armv*b|armv*l|arm)
217 cpu="arm"
218 ;;
219 hppa|parisc|parisc64)
220 cpu="hppa"
221 ;;
222 mips*)
223 cpu="mips"
224 ;;
225 sparc|sun4[cdmuv])
226 cpu="sparc"
227 ;;
228 *)
229 echo "Unknown CPU"
230 exit 1;
231 ;;
232esac
233
234if test -z $CC; then
235 if test "$targetos" = "FreeBSD"; then
236 if has clang; then
237 CC=clang
238 else
239 CC=gcc
240 fi
67bf9823
JA
241 fi
242fi
243
244cc="${CC-${cross_prefix}gcc}"
245
0dcebdf4
JA
246##########################################
247# check endianness
248bigendian="no"
249cat > $TMPC <<EOF
250#include <inttypes.h>
251int main(void)
252{
253 volatile uint32_t i=0x01234567;
254 return (*((uint8_t*)(&i))) == 0x67;
255}
256EOF
257if compile_prog "" "" "endian"; then
258 $TMPE && bigendian="yes"
259fi
260
261
67bf9823
JA
262echo "Operating system $targetos"
263echo "CPU $cpu"
0dcebdf4 264echo "Big endian $bigendian"
67bf9823
JA
265echo "Compiler $cc"
266echo
267
268##########################################
269# check for wordsize
270wordsize="0"
271cat > $TMPC <<EOF
272#include <stdio.h>
273int main(void)
274{
275 unsigned int wsize = sizeof(long) * 8;
276 printf("%d\n", wsize);
277 return 0;
278}
279EOF
280if compile_prog "" "" "wordsize"; then
281 wordsize=$($TMPE)
282fi
283echo "Wordsize $wordsize"
284
285##########################################
286# linux-aio probe
287libaio="no"
288cat > $TMPC <<EOF
289#include <libaio.h>
290#include <stddef.h>
291int main(void)
292{
293 io_setup(0, NULL);
294 return 0;
295}
296EOF
297if compile_prog "" "-laio" "libaio" ; then
298 libaio=yes
299 LIBS="-laio $LIBS"
300else
301 if test "$libaio" = "yes" ; then
302 feature_not_found "linux AIO"
303 fi
304 libaio=no
305fi
306echo "Linux AIO support $libaio"
307
308##########################################
309# posix aio probe
310posix_aio="no"
311posix_aio_lrt="no"
312cat > $TMPC <<EOF
313#include <aio.h>
314int main(void)
315{
316 struct aiocb cb;
317 aio_read(&cb);
318 return 0;
319}
320EOF
321if compile_prog "" "" "posixaio" ; then
322 posix_aio="yes"
323elif compile_prog "" "-lrt" "posixaio"; then
324 posix_aio="yes"
325 posix_aio_lrt="yes"
326 LIBS="-lrt $LIBS"
327fi
328echo "POSIX AIO support $posix_aio"
329echo "POSIX AIO support needs -lrt $posix_aio_lrt"
330
331##########################################
332# posix aio fsync probe
333posix_aio_fsync="no"
334if test "$posix_aio" = "yes" ; then
335 cat > $TMPC <<EOF
336#include <fcntl.h>
337#include <aio.h>
338int main(void)
339{
340 struct aiocb cb;
341 return aio_fsync(O_SYNC, &cb);
342 return 0;
343}
344EOF
345 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
346 posix_aio_fsync=yes
347 fi
348fi
349echo "POSIX AIO fsync $posix_aio_fsync"
350
351##########################################
352# solaris aio probe
353solaris_aio="no"
354cat > $TMPC <<EOF
355#include <sys/types.h>
356#include <sys/asynch.h>
357#include <unistd.h>
358int main(void)
359{
360 aio_result_t res;
361 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
362 return 0;
363}
364EOF
365if compile_prog "" "-laio" "solarisaio" ; then
366 solaris_aio=yes
367 LIBS="-laio $LIBS"
368fi
369echo "Solaris AIO support $solaris_aio"
370
371##########################################
372# __sync_fetch_and_and test
373sfaa="no"
374cat > $TMPC << EOF
375static int sfaa(int *ptr)
376{
377 return __sync_fetch_and_and(ptr, 0);
378}
379
380int main(int argc, char **argv)
381{
382 int val = 42;
383 sfaa(&val);
384 return val;
385}
386EOF
387if compile_prog "" "" "__sync_fetch_and_add()" ; then
388 sfaa="yes"
389fi
390echo "__sync_fetch_and add $sfaa"
391
392##########################################
393# libverbs probe
394libverbs="no"
395cat > $TMPC << EOF
396#include <stdio.h>
397#include <infiniband/arch.h>
398int main(int argc, char **argv)
399{
400 struct ibv_pd *pd = ibv_alloc_pd(NULL);
401 return 0;
402}
403EOF
404if compile_prog "" "-libverbs" "libverbs" ; then
405 libverbs="yes"
406 LIBS="-libverbs $LIBS"
407fi
408echo "libverbs $libverbs"
409
410##########################################
411# rdmacm probe
412rdmacm="no"
413cat > $TMPC << EOF
414#include <stdio.h>
415#include <rdma/rdma_cma.h>
416int main(int argc, char **argv)
417{
418 rdma_destroy_qp(NULL);
419 return 0;
420}
421EOF
422if compile_prog "" "-lrdmacm" "rdma"; then
423 rdmacm="yes"
424 LIBS="-lrdmacm $LIBS"
425fi
426echo "rdmacm $rdmacm"
427
428##########################################
429# Linux fallocate probe
430linux_fallocate="no"
431cat > $TMPC << EOF
432#include <stdio.h>
433#include <linux/falloc.h>
434int main(int argc, char **argv)
435{
436 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
437 return r;
438}
439EOF
440if compile_prog "" "" "linux_fallocate"; then
441 linux_fallocate="yes"
442fi
443echo "Linux fallocate $linux_fallocate"
444
445##########################################
446# POSIX fadvise probe
447posix_fadvise="no"
448cat > $TMPC << EOF
449#include <stdio.h>
450#include <fcntl.h>
451int main(int argc, char **argv)
452{
453 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
454 return r;
455}
456EOF
457if compile_prog "" "" "posix_fadvise"; then
458 posix_fadvise="yes"
459fi
460echo "POSIX fadvise $posix_fadvise"
461
462##########################################
463# POSIX fallocate probe
464posix_fallocate="no"
465cat > $TMPC << EOF
466#include <stdio.h>
467#include <fcntl.h>
468int main(int argc, char **argv)
469{
470 int r = posix_fallocate(0, 0, 1024);
471 return r;
472}
473EOF
474if compile_prog "" "" "posix_fallocate"; then
475 posix_fallocate="yes"
476fi
477echo "POSIX fallocate $posix_fallocate"
478
479##########################################
480# sched_set/getaffinity 2 or 3 argument test
481linux_2arg_affinity="no"
482linux_3arg_affinity="no"
483cat > $TMPC << EOF
484#define _GNU_SOURCE
485#include <sched.h>
486int main(int argc, char **argv)
487{
488 cpu_set_t mask;
489 return sched_setaffinity(0, sizeof(mask), &mask);
490}
491EOF
492if compile_prog "" "" "sched_setaffinity(,,)"; then
493 linux_3arg_affinity="yes"
494else
495 cat > $TMPC << EOF
496#define _GNU_SOURCE
497#include <sched.h>
498int main(int argc, char **argv)
499{
500 cpu_set_t mask;
501 return sched_setaffinity(0, &mask);
502}
503EOF
504 if compile_prog "" "" "sched_setaffinity(,)"; then
505 linux_2arg_affinity="yes"
506 fi
507fi
508echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
509echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
510
511##########################################
512# clock_gettime probe
513clock_gettime="no"
514cat > $TMPC << EOF
515#include <stdio.h>
516#include <time.h>
517int main(int argc, char **argv)
518{
519 return clock_gettime(0, NULL);
520}
521EOF
522if compile_prog "" "" "clock_gettime"; then
523 clock_gettime="yes"
524elif compile_prog "" "-lrt" "clock_gettime"; then
525 clock_gettime="yes"
526 LIBS="-lrt $LIBS"
527fi
528echo "clock_gettime $clock_gettime"
529
530##########################################
531# CLOCK_MONOTONIC probe
532clock_monotonic="no"
533if test "$clock_gettime" = "yes" ; then
534 cat > $TMPC << EOF
535#include <stdio.h>
536#include <time.h>
537int main(int argc, char **argv)
538{
539 return clock_gettime(CLOCK_MONOTONIC, NULL);
540}
541EOF
542 if compile_prog "" "$LIBS" "clock monotonic"; then
543 clock_monotonic="yes"
544 fi
545fi
546echo "CLOCK_MONOTONIC $clock_monotonic"
547
548##########################################
549# CLOCK_MONOTONIC_PRECISE probe
550clock_monotonic_precise="no"
551if test "$clock_gettime" = "yes" ; then
552 cat > $TMPC << EOF
553#include <stdio.h>
554#include <time.h>
555int main(int argc, char **argv)
556{
557 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
558}
559EOF
560 if compile_prog "" "$LIBS" "clock monotonic precise"; then
561 clock_monotonic_precise="yes"
562 fi
563fi
564echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
565
566##########################################
567# gettimeofday() probe
568gettimeofday="no"
569cat > $TMPC << EOF
570#include <sys/time.h>
571#include <stdio.h>
572int main(int argc, char **argv)
573{
574 struct timeval tv;
575 return gettimeofday(&tv, NULL);
576}
577EOF
578if compile_prog "" "" "gettimeofday"; then
579 gettimeofday="yes"
580fi
581echo "gettimeofday $gettimeofday"
582
583##########################################
584# fdatasync() probe
585fdatasync="no"
586cat > $TMPC << EOF
587#include <stdio.h>
588#include <unistd.h>
589int main(int argc, char **argv)
590{
591 return fdatasync(0);
592}
593EOF
594if compile_prog "" "" "fdatasync"; then
595 fdatasync="yes"
596fi
597echo "fdatasync $fdatasync"
598
599##########################################
600# sync_file_range() probe
601sync_file_range="no"
602cat > $TMPC << EOF
603#include <stdio.h>
604#include <unistd.h>
605#define _GNU_SOURCE
606#include <fcntl.h>
607#include <linux/fs.h>
608int main(int argc, char **argv)
609{
610 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
611 SYNC_FILE_RANGE_WAIT_AFTER;
612 return sync_file_range(0, 0, 0, flags);
613}
614EOF
615if compile_prog "" "" "sync_file_range"; then
616 sync_file_range="yes"
617fi
618echo "sync_file_range $sync_file_range"
619
620##########################################
621# ext4 move extent probe
622ext4_me="no"
623cat > $TMPC << EOF
624#include <fcntl.h>
625#include <sys/ioctl.h>
626int main(int argc, char **argv)
627{
628 struct move_extent me;
629 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
630}
631EOF
c7165b8d
JA
632if compile_prog "" "" "ext4 move extent" ; then
633 ext4_me="yes"
634elif test $targetos = "Linux" ; then
635 # On Linux, just default to it on and let it error at runtime if we really
636 # don't have it. None of my updated systems have it defined, but it does
637 # work. Takes a while to bubble back.
67bf9823
JA
638 ext4_me="yes"
639fi
640echo "EXT4 move extent $ext4_me"
641
642##########################################
643# splice probe
644linux_splice="no"
645cat > $TMPC << EOF
646#define _GNU_SOURCE
647#include <stdio.h>
648#include <fcntl.h>
649int main(int argc, char **argv)
650{
651 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
652}
653EOF
654if compile_prog "" "" "linux splice"; then
655 linux_splice="yes"
656fi
657echo "Linux splice(2) $linux_splice"
658
659##########################################
660# GUASI probe
661guasi="no"
662cat > $TMPC << EOF
663#include <guasi.h>
664#include <guasi_syscalls.h>
665int main(int argc, char **argv)
666{
667 guasi_t ctx = guasi_create(0, 0, 0);
668 return 0;
669}
670EOF
671if compile_prog "" "" "guasi"; then
672 guasi="yes"
673fi
674echo "GUASI $guasi"
675
676##########################################
677# fusion-aw probe
678fusion_aw="no"
679cat > $TMPC << EOF
99db6564 680#include <nvm/vectored_write.h>
67bf9823
JA
681int main(int argc, char **argv)
682{
683 struct vsl_iovec iov;
684 return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
685}
686EOF
99db6564
JA
687if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then
688 LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS"
67bf9823
JA
689 fusion_aw="yes"
690fi
691echo "Fusion-io atomic engine $fusion_aw"
692
693##########################################
694# libnuma probe
695libnuma="no"
696cat > $TMPC << EOF
697#include <numa.h>
698int main(int argc, char **argv)
699{
700 return numa_available();
701}
702EOF
703if compile_prog "" "-lnuma" "libnuma"; then
704 libnuma="yes"
705 LIBS="-lnuma $LIBS"
706fi
707echo "libnuma $libnuma"
708
709##########################################
710# strsep() probe
711strsep="no"
712cat > $TMPC << EOF
713#include <string.h>
714int main(int argc, char **argv)
715{
716 strsep(NULL, NULL);
717 return 0;
718}
719EOF
720if compile_prog "" "" "strsep"; then
721 strsep="yes"
722fi
723echo "strsep $strsep"
724
725##########################################
726# getopt_long_only() probe
727getopt_long_only="no"
728cat > $TMPC << EOF
729#include <unistd.h>
730#include <stdio.h>
731int main(int argc, char **argv)
732{
733 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
734 return c;
735}
736EOF
737if compile_prog "" "" "getopt_long_only"; then
738 getopt_long_only="yes"
739fi
740echo "getopt_long_only() $getopt_long_only"
741
742##########################################
743# inet_aton() probe
744inet_aton="no"
745cat > $TMPC << EOF
746#include <sys/socket.h>
747#include <arpa/inet.h>
748#include <stdio.h>
749int main(int argc, char **argv)
750{
751 struct in_addr in;
752 return inet_aton(NULL, &in);
753}
754EOF
755if compile_prog "" "" "inet_aton"; then
756 inet_aton="yes"
757fi
758echo "inet_aton $inet_aton"
759
760##########################################
761# socklen_t probe
762socklen_t="no"
763cat > $TMPC << EOF
764#include <string.h>
765#include <netinet/in.h>
766int main(int argc, char **argv)
767{
768 socklen_t len = 0;
769 return len;
770}
771EOF
772if compile_prog "" "" "socklen_t"; then
773 socklen_t="yes"
774fi
775echo "socklen_t $socklen_t"
776
777##########################################
778# Whether or not __thread is supported for TLS
779tls_thread="no"
780cat > $TMPC << EOF
781#include <stdio.h>
782static int __thread ret;
783int main(int argc, char **argv)
784{
785 return ret;
786}
787EOF
788if compile_prog "" "" "__thread"; then
789 tls_thread="yes"
790fi
791echo "__thread $tls_thread"
792
793#############################################################################
794
795echo "# Automatically generated by configure - do not modify" > $config_host_mak
796printf "# Configured with:" >> $config_host_mak
797printf " '%s'" "$0" "$@" >> $config_host_mak
798echo >> $config_host_mak
799
800if test "$wordsize" = "64" ; then
801 echo "CONFIG_64BIT=y" >> $config_host_mak
802elif test "$wordsize" = "32" ; then
803 echo "CONFIG_32BIT=y" >> $config_host_mak
804else
805 echo "Unknown wordsize!"
806 exit 1
807fi
0dcebdf4
JA
808if test "$bigendian" = "yes" ; then
809 echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
810else
811 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
812fi
67bf9823
JA
813if test "$libaio" = "yes" ; then
814 echo "CONFIG_LIBAIO=y" >> $config_host_mak
815fi
816if test "$posix_aio" = "yes" ; then
817 echo "CONFIG_POSIXAIO=y" >> $config_host_mak
818fi
819if test "$posix_aio_fsync" = "yes" ; then
820 echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
821fi
822if test "$linux_fallocate" = "yes" ; then
823 echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
824fi
825if test "$posix_fallocate" = "yes" ; then
826 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
827fi
828if test "$fdatasync" = "yes" ; then
829 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
830fi
831if test "$sync_file_range" = "yes" ; then
832 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
833fi
834if test "$sfaa" = "yes" ; then
835 echo "CONFIG_SFAA=y" >> $config_host_mak
836fi
837if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
838 echo "CONFIG_RDMA=y" >> $config_host_mak
839fi
840if test "$clock_gettime" = "yes" ; then
841 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
842fi
843if test "$clock_monotonic" = "yes" ; then
844 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
845fi
846if test "$clock_monotonic_precise" = "yes" ; then
847 echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
848fi
849if test "$gettimeofday" = "yes" ; then
850 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
851fi
852if test "$posix_fadvise" = "yes" ; then
853 echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
854fi
855if test "$linux_3arg_affinity" = "yes" ; then
856 echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
857elif test "$linux_2arg_affinity" = "yes" ; then
858 echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
859fi
860if test "$strsep" = "yes" ; then
861 echo "CONFIG_STRSEP=y" >> $config_host_mak
862fi
863if test "$getopt_long_only" = "yes" ; then
864 echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
865fi
866if test "$inet_aton" = "yes" ; then
867 echo "CONFIG_INET_ATON=y" >> $config_host_mak
868fi
869if test "$socklen_t" = "yes" ; then
870 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
871fi
872if test "$ext4_me" = "yes" ; then
873 echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
874fi
875if test "$linux_splice" = "yes" ; then
876 echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
877fi
878if test "$guasi" = "yes" ; then
879 echo "CONFIG_GUASI=y" >> $config_host_mak
880fi
881if test "$fusion_aw" = "yes" ; then
882 echo "CONFIG_FUSION_AW=y" >> $config_host_mak
883fi
884if test "$libnuma" = "yes" ; then
885 echo "CONFIG_LIBNUMA=y" >> $config_host_mak
886fi
887if test "$solaris_aio" = "yes" ; then
888 echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
889fi
890if test "$tls_thread" = "yes" ; then
891 echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
892fi
893
894echo "LIBS+=$LIBS" >> $config_host_mak
895echo "CC=$cc" >> $config_host_mak