Use RUSAGE_THREAD, if available
[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
cfd94f79
JA
160 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
161 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
162 echo "CONFIG_FADVISE=y" >> $config_host_mak
163 echo "CONFIG_SFAA=y" >> $config_host_mak
164 exit 0
67bf9823
JA
165esac
166
167if test ! -z "$cpu" ; then
168 # command line argument
169 :
170elif check_define __i386__ ; then
171 cpu="i386"
172elif check_define __x86_64__ ; then
173 cpu="x86_64"
174elif check_define __sparc__ ; then
175 if check_define __arch64__ ; then
176 cpu="sparc64"
177 else
178 cpu="sparc"
179 fi
180elif check_define _ARCH_PPC ; then
181 if check_define _ARCH_PPC64 ; then
182 cpu="ppc64"
183 else
184 cpu="ppc"
185 fi
186elif check_define __mips__ ; then
187 cpu="mips"
188elif check_define __ia64__ ; then
189 cpu="ia64"
190elif check_define __s390__ ; then
191 if check_define __s390x__ ; then
192 cpu="s390x"
193 else
194 cpu="s390"
195 fi
196elif check_define __arm__ ; then
197 cpu="arm"
198elif check_define __hppa__ ; then
199 cpu="hppa"
200else
201 cpu=`uname -m`
202fi
203
204# Normalise host CPU name and set ARCH.
205case "$cpu" in
206 ia64|ppc|ppc64|s390|s390x|sparc64)
207 cpu="$cpu"
208 ;;
209 i386|i486|i586|i686|i86pc|BePC)
210 cpu="i386"
211 ;;
212 x86_64|amd64)
213 cpu="x86_64"
214 ;;
215 armv*b|armv*l|arm)
216 cpu="arm"
217 ;;
218 hppa|parisc|parisc64)
219 cpu="hppa"
220 ;;
221 mips*)
222 cpu="mips"
223 ;;
224 sparc|sun4[cdmuv])
225 cpu="sparc"
226 ;;
227 *)
228 echo "Unknown CPU"
229 exit 1;
230 ;;
231esac
232
233if test -z $CC; then
234 if test "$targetos" = "FreeBSD"; then
235 if has clang; then
236 CC=clang
237 else
238 CC=gcc
239 fi
67bf9823
JA
240 fi
241fi
242
243cc="${CC-${cross_prefix}gcc}"
244
0dcebdf4
JA
245##########################################
246# check endianness
247bigendian="no"
248cat > $TMPC <<EOF
249#include <inttypes.h>
250int main(void)
251{
252 volatile uint32_t i=0x01234567;
253 return (*((uint8_t*)(&i))) == 0x67;
254}
255EOF
256if compile_prog "" "" "endian"; then
257 $TMPE && bigendian="yes"
258fi
259
260
67bf9823
JA
261echo "Operating system $targetos"
262echo "CPU $cpu"
0dcebdf4 263echo "Big endian $bigendian"
67bf9823
JA
264echo "Compiler $cc"
265echo
266
267##########################################
268# check for wordsize
269wordsize="0"
270cat > $TMPC <<EOF
271#include <stdio.h>
272int main(void)
273{
274 unsigned int wsize = sizeof(long) * 8;
275 printf("%d\n", wsize);
276 return 0;
277}
278EOF
279if compile_prog "" "" "wordsize"; then
280 wordsize=$($TMPE)
281fi
282echo "Wordsize $wordsize"
283
284##########################################
285# linux-aio probe
286libaio="no"
287cat > $TMPC <<EOF
288#include <libaio.h>
289#include <stddef.h>
290int main(void)
291{
292 io_setup(0, NULL);
293 return 0;
294}
295EOF
296if compile_prog "" "-laio" "libaio" ; then
297 libaio=yes
298 LIBS="-laio $LIBS"
299else
300 if test "$libaio" = "yes" ; then
301 feature_not_found "linux AIO"
302 fi
303 libaio=no
304fi
305echo "Linux AIO support $libaio"
306
307##########################################
308# posix aio probe
309posix_aio="no"
310posix_aio_lrt="no"
311cat > $TMPC <<EOF
312#include <aio.h>
313int main(void)
314{
315 struct aiocb cb;
316 aio_read(&cb);
317 return 0;
318}
319EOF
320if compile_prog "" "" "posixaio" ; then
321 posix_aio="yes"
322elif compile_prog "" "-lrt" "posixaio"; then
323 posix_aio="yes"
324 posix_aio_lrt="yes"
325 LIBS="-lrt $LIBS"
326fi
327echo "POSIX AIO support $posix_aio"
328echo "POSIX AIO support needs -lrt $posix_aio_lrt"
329
330##########################################
331# posix aio fsync probe
332posix_aio_fsync="no"
333if test "$posix_aio" = "yes" ; then
334 cat > $TMPC <<EOF
335#include <fcntl.h>
336#include <aio.h>
337int main(void)
338{
339 struct aiocb cb;
340 return aio_fsync(O_SYNC, &cb);
341 return 0;
342}
343EOF
344 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
345 posix_aio_fsync=yes
346 fi
347fi
348echo "POSIX AIO fsync $posix_aio_fsync"
349
350##########################################
351# solaris aio probe
352solaris_aio="no"
353cat > $TMPC <<EOF
354#include <sys/types.h>
355#include <sys/asynch.h>
356#include <unistd.h>
357int main(void)
358{
359 aio_result_t res;
360 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
361 return 0;
362}
363EOF
364if compile_prog "" "-laio" "solarisaio" ; then
365 solaris_aio=yes
366 LIBS="-laio $LIBS"
367fi
368echo "Solaris AIO support $solaris_aio"
369
370##########################################
371# __sync_fetch_and_and test
372sfaa="no"
373cat > $TMPC << EOF
374static int sfaa(int *ptr)
375{
376 return __sync_fetch_and_and(ptr, 0);
377}
378
379int main(int argc, char **argv)
380{
381 int val = 42;
382 sfaa(&val);
383 return val;
384}
385EOF
386if compile_prog "" "" "__sync_fetch_and_add()" ; then
387 sfaa="yes"
388fi
389echo "__sync_fetch_and add $sfaa"
390
391##########################################
392# libverbs probe
393libverbs="no"
394cat > $TMPC << EOF
395#include <stdio.h>
396#include <infiniband/arch.h>
397int main(int argc, char **argv)
398{
399 struct ibv_pd *pd = ibv_alloc_pd(NULL);
400 return 0;
401}
402EOF
403if compile_prog "" "-libverbs" "libverbs" ; then
404 libverbs="yes"
405 LIBS="-libverbs $LIBS"
406fi
407echo "libverbs $libverbs"
408
409##########################################
410# rdmacm probe
411rdmacm="no"
412cat > $TMPC << EOF
413#include <stdio.h>
414#include <rdma/rdma_cma.h>
415int main(int argc, char **argv)
416{
417 rdma_destroy_qp(NULL);
418 return 0;
419}
420EOF
421if compile_prog "" "-lrdmacm" "rdma"; then
422 rdmacm="yes"
423 LIBS="-lrdmacm $LIBS"
424fi
425echo "rdmacm $rdmacm"
426
427##########################################
428# Linux fallocate probe
429linux_fallocate="no"
430cat > $TMPC << EOF
431#include <stdio.h>
432#include <linux/falloc.h>
433int main(int argc, char **argv)
434{
435 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
436 return r;
437}
438EOF
439if compile_prog "" "" "linux_fallocate"; then
440 linux_fallocate="yes"
441fi
442echo "Linux fallocate $linux_fallocate"
443
444##########################################
445# POSIX fadvise probe
446posix_fadvise="no"
447cat > $TMPC << EOF
448#include <stdio.h>
449#include <fcntl.h>
450int main(int argc, char **argv)
451{
452 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
453 return r;
454}
455EOF
456if compile_prog "" "" "posix_fadvise"; then
457 posix_fadvise="yes"
458fi
459echo "POSIX fadvise $posix_fadvise"
460
461##########################################
462# POSIX fallocate probe
463posix_fallocate="no"
464cat > $TMPC << EOF
465#include <stdio.h>
466#include <fcntl.h>
467int main(int argc, char **argv)
468{
469 int r = posix_fallocate(0, 0, 1024);
470 return r;
471}
472EOF
473if compile_prog "" "" "posix_fallocate"; then
474 posix_fallocate="yes"
475fi
476echo "POSIX fallocate $posix_fallocate"
477
478##########################################
479# sched_set/getaffinity 2 or 3 argument test
480linux_2arg_affinity="no"
481linux_3arg_affinity="no"
482cat > $TMPC << EOF
483#define _GNU_SOURCE
484#include <sched.h>
485int main(int argc, char **argv)
486{
487 cpu_set_t mask;
488 return sched_setaffinity(0, sizeof(mask), &mask);
489}
490EOF
491if compile_prog "" "" "sched_setaffinity(,,)"; then
492 linux_3arg_affinity="yes"
493else
494 cat > $TMPC << EOF
495#define _GNU_SOURCE
496#include <sched.h>
497int main(int argc, char **argv)
498{
499 cpu_set_t mask;
500 return sched_setaffinity(0, &mask);
501}
502EOF
503 if compile_prog "" "" "sched_setaffinity(,)"; then
504 linux_2arg_affinity="yes"
505 fi
506fi
507echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
508echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
509
510##########################################
511# clock_gettime probe
512clock_gettime="no"
513cat > $TMPC << EOF
514#include <stdio.h>
515#include <time.h>
516int main(int argc, char **argv)
517{
518 return clock_gettime(0, NULL);
519}
520EOF
521if compile_prog "" "" "clock_gettime"; then
522 clock_gettime="yes"
523elif compile_prog "" "-lrt" "clock_gettime"; then
524 clock_gettime="yes"
525 LIBS="-lrt $LIBS"
526fi
527echo "clock_gettime $clock_gettime"
528
529##########################################
530# CLOCK_MONOTONIC probe
531clock_monotonic="no"
532if test "$clock_gettime" = "yes" ; then
533 cat > $TMPC << EOF
534#include <stdio.h>
535#include <time.h>
536int main(int argc, char **argv)
537{
538 return clock_gettime(CLOCK_MONOTONIC, NULL);
539}
540EOF
541 if compile_prog "" "$LIBS" "clock monotonic"; then
542 clock_monotonic="yes"
543 fi
544fi
545echo "CLOCK_MONOTONIC $clock_monotonic"
546
547##########################################
548# CLOCK_MONOTONIC_PRECISE probe
549clock_monotonic_precise="no"
550if test "$clock_gettime" = "yes" ; then
551 cat > $TMPC << EOF
552#include <stdio.h>
553#include <time.h>
554int main(int argc, char **argv)
555{
556 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
557}
558EOF
559 if compile_prog "" "$LIBS" "clock monotonic precise"; then
560 clock_monotonic_precise="yes"
561 fi
562fi
563echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
564
565##########################################
566# gettimeofday() probe
567gettimeofday="no"
568cat > $TMPC << EOF
569#include <sys/time.h>
570#include <stdio.h>
571int main(int argc, char **argv)
572{
573 struct timeval tv;
574 return gettimeofday(&tv, NULL);
575}
576EOF
577if compile_prog "" "" "gettimeofday"; then
578 gettimeofday="yes"
579fi
580echo "gettimeofday $gettimeofday"
581
582##########################################
583# fdatasync() probe
584fdatasync="no"
585cat > $TMPC << EOF
586#include <stdio.h>
587#include <unistd.h>
588int main(int argc, char **argv)
589{
590 return fdatasync(0);
591}
592EOF
593if compile_prog "" "" "fdatasync"; then
594 fdatasync="yes"
595fi
596echo "fdatasync $fdatasync"
597
598##########################################
599# sync_file_range() probe
600sync_file_range="no"
601cat > $TMPC << EOF
602#include <stdio.h>
603#include <unistd.h>
604#define _GNU_SOURCE
605#include <fcntl.h>
606#include <linux/fs.h>
607int main(int argc, char **argv)
608{
609 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
610 SYNC_FILE_RANGE_WAIT_AFTER;
611 return sync_file_range(0, 0, 0, flags);
612}
613EOF
614if compile_prog "" "" "sync_file_range"; then
615 sync_file_range="yes"
616fi
617echo "sync_file_range $sync_file_range"
618
619##########################################
620# ext4 move extent probe
621ext4_me="no"
622cat > $TMPC << EOF
623#include <fcntl.h>
624#include <sys/ioctl.h>
625int main(int argc, char **argv)
626{
627 struct move_extent me;
628 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
629}
630EOF
c7165b8d
JA
631if compile_prog "" "" "ext4 move extent" ; then
632 ext4_me="yes"
633elif test $targetos = "Linux" ; then
634 # On Linux, just default to it on and let it error at runtime if we really
635 # don't have it. None of my updated systems have it defined, but it does
636 # work. Takes a while to bubble back.
67bf9823
JA
637 ext4_me="yes"
638fi
639echo "EXT4 move extent $ext4_me"
640
641##########################################
642# splice probe
643linux_splice="no"
644cat > $TMPC << EOF
645#define _GNU_SOURCE
646#include <stdio.h>
647#include <fcntl.h>
648int main(int argc, char **argv)
649{
650 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
651}
652EOF
653if compile_prog "" "" "linux splice"; then
654 linux_splice="yes"
655fi
656echo "Linux splice(2) $linux_splice"
657
658##########################################
659# GUASI probe
660guasi="no"
661cat > $TMPC << EOF
662#include <guasi.h>
663#include <guasi_syscalls.h>
664int main(int argc, char **argv)
665{
666 guasi_t ctx = guasi_create(0, 0, 0);
667 return 0;
668}
669EOF
670if compile_prog "" "" "guasi"; then
671 guasi="yes"
672fi
673echo "GUASI $guasi"
674
675##########################################
676# fusion-aw probe
677fusion_aw="no"
678cat > $TMPC << EOF
99db6564 679#include <nvm/vectored_write.h>
67bf9823
JA
680int main(int argc, char **argv)
681{
682 struct vsl_iovec iov;
683 return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
684}
685EOF
99db6564
JA
686if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then
687 LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS"
67bf9823
JA
688 fusion_aw="yes"
689fi
690echo "Fusion-io atomic engine $fusion_aw"
691
692##########################################
693# libnuma probe
694libnuma="no"
695cat > $TMPC << EOF
696#include <numa.h>
697int main(int argc, char **argv)
698{
699 return numa_available();
700}
701EOF
702if compile_prog "" "-lnuma" "libnuma"; then
703 libnuma="yes"
704 LIBS="-lnuma $LIBS"
705fi
706echo "libnuma $libnuma"
707
708##########################################
709# strsep() probe
710strsep="no"
711cat > $TMPC << EOF
712#include <string.h>
713int main(int argc, char **argv)
714{
715 strsep(NULL, NULL);
716 return 0;
717}
718EOF
719if compile_prog "" "" "strsep"; then
720 strsep="yes"
721fi
722echo "strsep $strsep"
723
724##########################################
725# getopt_long_only() probe
726getopt_long_only="no"
727cat > $TMPC << EOF
728#include <unistd.h>
729#include <stdio.h>
730int main(int argc, char **argv)
731{
732 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
733 return c;
734}
735EOF
736if compile_prog "" "" "getopt_long_only"; then
737 getopt_long_only="yes"
738fi
739echo "getopt_long_only() $getopt_long_only"
740
741##########################################
742# inet_aton() probe
743inet_aton="no"
744cat > $TMPC << EOF
745#include <sys/socket.h>
746#include <arpa/inet.h>
747#include <stdio.h>
748int main(int argc, char **argv)
749{
750 struct in_addr in;
751 return inet_aton(NULL, &in);
752}
753EOF
754if compile_prog "" "" "inet_aton"; then
755 inet_aton="yes"
756fi
757echo "inet_aton $inet_aton"
758
759##########################################
760# socklen_t probe
761socklen_t="no"
762cat > $TMPC << EOF
763#include <string.h>
764#include <netinet/in.h>
765int main(int argc, char **argv)
766{
767 socklen_t len = 0;
768 return len;
769}
770EOF
771if compile_prog "" "" "socklen_t"; then
772 socklen_t="yes"
773fi
774echo "socklen_t $socklen_t"
775
776##########################################
777# Whether or not __thread is supported for TLS
778tls_thread="no"
779cat > $TMPC << EOF
780#include <stdio.h>
781static int __thread ret;
782int main(int argc, char **argv)
783{
784 return ret;
785}
786EOF
787if compile_prog "" "" "__thread"; then
788 tls_thread="yes"
789fi
790echo "__thread $tls_thread"
791
792#############################################################################
793
794echo "# Automatically generated by configure - do not modify" > $config_host_mak
795printf "# Configured with:" >> $config_host_mak
796printf " '%s'" "$0" "$@" >> $config_host_mak
797echo >> $config_host_mak
798
799if test "$wordsize" = "64" ; then
800 echo "CONFIG_64BIT=y" >> $config_host_mak
801elif test "$wordsize" = "32" ; then
802 echo "CONFIG_32BIT=y" >> $config_host_mak
803else
804 echo "Unknown wordsize!"
805 exit 1
806fi
0dcebdf4
JA
807if test "$bigendian" = "yes" ; then
808 echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
809else
810 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
811fi
67bf9823
JA
812if test "$libaio" = "yes" ; then
813 echo "CONFIG_LIBAIO=y" >> $config_host_mak
814fi
815if test "$posix_aio" = "yes" ; then
816 echo "CONFIG_POSIXAIO=y" >> $config_host_mak
817fi
818if test "$posix_aio_fsync" = "yes" ; then
819 echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
820fi
821if test "$linux_fallocate" = "yes" ; then
822 echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
823fi
824if test "$posix_fallocate" = "yes" ; then
825 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
826fi
827if test "$fdatasync" = "yes" ; then
828 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
829fi
830if test "$sync_file_range" = "yes" ; then
831 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
832fi
833if test "$sfaa" = "yes" ; then
834 echo "CONFIG_SFAA=y" >> $config_host_mak
835fi
836if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
837 echo "CONFIG_RDMA=y" >> $config_host_mak
838fi
839if test "$clock_gettime" = "yes" ; then
840 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
841fi
842if test "$clock_monotonic" = "yes" ; then
843 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
844fi
845if test "$clock_monotonic_precise" = "yes" ; then
846 echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
847fi
848if test "$gettimeofday" = "yes" ; then
849 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
850fi
851if test "$posix_fadvise" = "yes" ; then
852 echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
853fi
854if test "$linux_3arg_affinity" = "yes" ; then
855 echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
856elif test "$linux_2arg_affinity" = "yes" ; then
857 echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
858fi
859if test "$strsep" = "yes" ; then
860 echo "CONFIG_STRSEP=y" >> $config_host_mak
861fi
862if test "$getopt_long_only" = "yes" ; then
863 echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
864fi
865if test "$inet_aton" = "yes" ; then
866 echo "CONFIG_INET_ATON=y" >> $config_host_mak
867fi
868if test "$socklen_t" = "yes" ; then
869 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
870fi
871if test "$ext4_me" = "yes" ; then
872 echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
873fi
874if test "$linux_splice" = "yes" ; then
875 echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
876fi
877if test "$guasi" = "yes" ; then
878 echo "CONFIG_GUASI=y" >> $config_host_mak
879fi
880if test "$fusion_aw" = "yes" ; then
881 echo "CONFIG_FUSION_AW=y" >> $config_host_mak
882fi
883if test "$libnuma" = "yes" ; then
884 echo "CONFIG_LIBNUMA=y" >> $config_host_mak
885fi
886if test "$solaris_aio" = "yes" ; then
887 echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
888fi
889if test "$tls_thread" = "yes" ; then
890 echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
891fi
892
893echo "LIBS+=$LIBS" >> $config_host_mak
894echo "CC=$cc" >> $config_host_mak