NAN: use __builtin_nanf() if not 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
44404c5a
JA
29# Default CFLAGS
30CFLAGS="-D_GNU_SOURCE"
31
67bf9823
JA
32# Print a helpful header at the top of config.log
33echo "# FIO configure log $(date)" >> config.log
34printf "# Configured with:" >> config.log
35printf " '%s'" "$0" "$@" >> config.log
36echo >> config.log
37echo "#" >> config.log
38
39do_cc() {
40 # Run the compiler, capturing its output to the log.
41 echo $cc "$@" >> config.log
42 $cc "$@" >> config.log 2>&1 || return $?
43 # Test passed. If this is an --enable-werror build, rerun
44 # the test with -Werror and bail out if it fails. This
45 # makes warning-generating-errors in configure test code
46 # obvious to developers.
47 if test "$werror" != "yes"; then
48 return 0
49 fi
50 # Don't bother rerunning the compile if we were already using -Werror
51 case "$*" in
52 *-Werror*)
53 return 0
54 ;;
55 esac
56 echo $cc -Werror "$@" >> config.log
57 $cc -Werror "$@" >> config.log 2>&1 && return $?
58 echo "ERROR: configure test passed without -Werror but failed with -Werror."
59 echo "This is probably a bug in the configure script. The failing command"
60 echo "will be at the bottom of config.log."
61 echo "You can run configure with --disable-werror to bypass this check."
62 exit 1
63}
64
65compile_object() {
66 do_cc $CFLAGS -c -o $TMPO $TMPC
67}
68
69compile_prog() {
70 local_cflags="$1"
71 local_ldflags="$2"
72 echo "Compiling test case $3" >> config.log
73 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
74}
75
76feature_not_found() {
77 feature=$1
78
79 echo "ERROR"
80 echo "ERROR: User requested feature $feature"
81 echo "ERROR: configure was not able to find it"
82 echo "ERROR"
83 exit 1;
84}
85
86has() {
87 type "$1" >/dev/null 2>&1
88}
89
90check_define() {
91 cat > $TMPC <<EOF
92#if !defined($1)
93#error $1 not defined
94#endif
95int main(void)
96{
97 return 0;
98}
99EOF
100 compile_object
101}
102
103targetos=""
104cpu=""
105
106cc="${CC-${cross_prefix}gcc}"
107
cb1125b0
JA
108# parse options
109for opt do
110 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
111 case "$opt" in
112 --cc=*) CC="$optarg"
113 ;;
114 *)
115 echo "Bad option $opt"
116 exit 1
117 esac
118done
119
67bf9823
JA
120if check_define __linux__ ; then
121 targetos="Linux"
67bf9823
JA
122elif check_define __OpenBSD__ ; then
123 targetos='OpenBSD'
124elif check_define __sun__ ; then
125 targetos='SunOS'
126else
127 targetos=`uname -s`
128fi
129
130# Some host OSes need non-standard checks for which CPU to use.
131# Note that these checks are broken for cross-compilation: if you're
132# cross-compiling to one of these OSes then you'll need to specify
133# the correct CPU with the --cpu option.
134case $targetos in
135Darwin)
136 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
137 # we can run 64-bit userspace code.
138 # If the user didn't specify a CPU explicitly and the kernel says this is
139 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
140 # detection code.
141 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
142 cpu="x86_64"
143 fi
144 ;;
145SunOS)
146 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
147 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
148 cpu="x86_64"
149 fi
cfd94f79
JA
150 ;;
151CYGWIN*)
152 echo "Forcing known good options on Windows"
4578d01f
JA
153 if test -z "$CC" ; then
154 CC="x86_64-w64-mingw32-gcc"
155 fi
cfd94f79
JA
156 echo "CC=$CC" > $config_host_mak
157 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
158 echo "CONFIG_64BIT_LLP64=y" >> $config_host_mak
159 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
160 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
161 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
162 echo "CONFIG_FADVISE=y" >> $config_host_mak
cfd94f79
JA
163 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
164 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
165 echo "CONFIG_FADVISE=y" >> $config_host_mak
166 echo "CONFIG_SFAA=y" >> $config_host_mak
a3430ee0 167 echo "CONFIG_RUSAGE_THREAD=y" >> $config_host_mak
cfd94f79 168 exit 0
67bf9823
JA
169esac
170
171if test ! -z "$cpu" ; then
172 # command line argument
173 :
174elif check_define __i386__ ; then
175 cpu="i386"
176elif check_define __x86_64__ ; then
177 cpu="x86_64"
178elif check_define __sparc__ ; then
179 if check_define __arch64__ ; then
180 cpu="sparc64"
181 else
182 cpu="sparc"
183 fi
184elif check_define _ARCH_PPC ; then
185 if check_define _ARCH_PPC64 ; then
186 cpu="ppc64"
187 else
188 cpu="ppc"
189 fi
190elif check_define __mips__ ; then
191 cpu="mips"
192elif check_define __ia64__ ; then
193 cpu="ia64"
194elif check_define __s390__ ; then
195 if check_define __s390x__ ; then
196 cpu="s390x"
197 else
198 cpu="s390"
199 fi
200elif check_define __arm__ ; then
201 cpu="arm"
202elif check_define __hppa__ ; then
203 cpu="hppa"
204else
205 cpu=`uname -m`
206fi
207
208# Normalise host CPU name and set ARCH.
209case "$cpu" in
210 ia64|ppc|ppc64|s390|s390x|sparc64)
211 cpu="$cpu"
212 ;;
213 i386|i486|i586|i686|i86pc|BePC)
214 cpu="i386"
215 ;;
216 x86_64|amd64)
217 cpu="x86_64"
218 ;;
219 armv*b|armv*l|arm)
220 cpu="arm"
221 ;;
222 hppa|parisc|parisc64)
223 cpu="hppa"
224 ;;
225 mips*)
226 cpu="mips"
227 ;;
228 sparc|sun4[cdmuv])
229 cpu="sparc"
230 ;;
231 *)
232 echo "Unknown CPU"
233 exit 1;
234 ;;
235esac
236
237if test -z $CC; then
238 if test "$targetos" = "FreeBSD"; then
239 if has clang; then
240 CC=clang
241 else
242 CC=gcc
243 fi
67bf9823
JA
244 fi
245fi
246
247cc="${CC-${cross_prefix}gcc}"
248
0dcebdf4
JA
249##########################################
250# check endianness
251bigendian="no"
252cat > $TMPC <<EOF
253#include <inttypes.h>
254int main(void)
255{
256 volatile uint32_t i=0x01234567;
257 return (*((uint8_t*)(&i))) == 0x67;
258}
259EOF
260if compile_prog "" "" "endian"; then
261 $TMPE && bigendian="yes"
262fi
263
264
67bf9823
JA
265echo "Operating system $targetos"
266echo "CPU $cpu"
0dcebdf4 267echo "Big endian $bigendian"
67bf9823
JA
268echo "Compiler $cc"
269echo
270
271##########################################
272# check for wordsize
273wordsize="0"
274cat > $TMPC <<EOF
275#include <stdio.h>
276int main(void)
277{
278 unsigned int wsize = sizeof(long) * 8;
279 printf("%d\n", wsize);
280 return 0;
281}
282EOF
283if compile_prog "" "" "wordsize"; then
284 wordsize=$($TMPE)
285fi
286echo "Wordsize $wordsize"
287
288##########################################
289# linux-aio probe
290libaio="no"
291cat > $TMPC <<EOF
292#include <libaio.h>
293#include <stddef.h>
294int main(void)
295{
296 io_setup(0, NULL);
297 return 0;
298}
299EOF
300if compile_prog "" "-laio" "libaio" ; then
301 libaio=yes
302 LIBS="-laio $LIBS"
303else
304 if test "$libaio" = "yes" ; then
305 feature_not_found "linux AIO"
306 fi
307 libaio=no
308fi
309echo "Linux AIO support $libaio"
310
311##########################################
312# posix aio probe
313posix_aio="no"
314posix_aio_lrt="no"
315cat > $TMPC <<EOF
316#include <aio.h>
317int main(void)
318{
319 struct aiocb cb;
320 aio_read(&cb);
321 return 0;
322}
323EOF
324if compile_prog "" "" "posixaio" ; then
325 posix_aio="yes"
326elif compile_prog "" "-lrt" "posixaio"; then
327 posix_aio="yes"
328 posix_aio_lrt="yes"
329 LIBS="-lrt $LIBS"
330fi
331echo "POSIX AIO support $posix_aio"
332echo "POSIX AIO support needs -lrt $posix_aio_lrt"
333
334##########################################
335# posix aio fsync probe
336posix_aio_fsync="no"
337if test "$posix_aio" = "yes" ; then
338 cat > $TMPC <<EOF
339#include <fcntl.h>
340#include <aio.h>
341int main(void)
342{
343 struct aiocb cb;
344 return aio_fsync(O_SYNC, &cb);
345 return 0;
346}
347EOF
348 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
349 posix_aio_fsync=yes
350 fi
351fi
352echo "POSIX AIO fsync $posix_aio_fsync"
353
354##########################################
355# solaris aio probe
356solaris_aio="no"
357cat > $TMPC <<EOF
358#include <sys/types.h>
359#include <sys/asynch.h>
360#include <unistd.h>
361int main(void)
362{
363 aio_result_t res;
364 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
365 return 0;
366}
367EOF
368if compile_prog "" "-laio" "solarisaio" ; then
369 solaris_aio=yes
370 LIBS="-laio $LIBS"
371fi
372echo "Solaris AIO support $solaris_aio"
373
374##########################################
375# __sync_fetch_and_and test
376sfaa="no"
377cat > $TMPC << EOF
378static int sfaa(int *ptr)
379{
380 return __sync_fetch_and_and(ptr, 0);
381}
382
383int main(int argc, char **argv)
384{
385 int val = 42;
386 sfaa(&val);
387 return val;
388}
389EOF
390if compile_prog "" "" "__sync_fetch_and_add()" ; then
391 sfaa="yes"
392fi
393echo "__sync_fetch_and add $sfaa"
394
395##########################################
396# libverbs probe
397libverbs="no"
398cat > $TMPC << EOF
399#include <stdio.h>
400#include <infiniband/arch.h>
401int main(int argc, char **argv)
402{
403 struct ibv_pd *pd = ibv_alloc_pd(NULL);
404 return 0;
405}
406EOF
407if compile_prog "" "-libverbs" "libverbs" ; then
408 libverbs="yes"
409 LIBS="-libverbs $LIBS"
410fi
411echo "libverbs $libverbs"
412
413##########################################
414# rdmacm probe
415rdmacm="no"
416cat > $TMPC << EOF
417#include <stdio.h>
418#include <rdma/rdma_cma.h>
419int main(int argc, char **argv)
420{
421 rdma_destroy_qp(NULL);
422 return 0;
423}
424EOF
425if compile_prog "" "-lrdmacm" "rdma"; then
426 rdmacm="yes"
427 LIBS="-lrdmacm $LIBS"
428fi
429echo "rdmacm $rdmacm"
430
431##########################################
432# Linux fallocate probe
433linux_fallocate="no"
434cat > $TMPC << EOF
435#include <stdio.h>
436#include <linux/falloc.h>
437int main(int argc, char **argv)
438{
439 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
440 return r;
441}
442EOF
443if compile_prog "" "" "linux_fallocate"; then
444 linux_fallocate="yes"
445fi
446echo "Linux fallocate $linux_fallocate"
447
448##########################################
449# POSIX fadvise probe
450posix_fadvise="no"
451cat > $TMPC << EOF
452#include <stdio.h>
453#include <fcntl.h>
454int main(int argc, char **argv)
455{
456 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
457 return r;
458}
459EOF
460if compile_prog "" "" "posix_fadvise"; then
461 posix_fadvise="yes"
462fi
463echo "POSIX fadvise $posix_fadvise"
464
465##########################################
466# POSIX fallocate probe
467posix_fallocate="no"
468cat > $TMPC << EOF
469#include <stdio.h>
470#include <fcntl.h>
471int main(int argc, char **argv)
472{
473 int r = posix_fallocate(0, 0, 1024);
474 return r;
475}
476EOF
477if compile_prog "" "" "posix_fallocate"; then
478 posix_fallocate="yes"
479fi
480echo "POSIX fallocate $posix_fallocate"
481
482##########################################
483# sched_set/getaffinity 2 or 3 argument test
484linux_2arg_affinity="no"
485linux_3arg_affinity="no"
486cat > $TMPC << EOF
67bf9823
JA
487#include <sched.h>
488int main(int argc, char **argv)
489{
490 cpu_set_t mask;
491 return sched_setaffinity(0, sizeof(mask), &mask);
492}
493EOF
494if compile_prog "" "" "sched_setaffinity(,,)"; then
495 linux_3arg_affinity="yes"
496else
497 cat > $TMPC << EOF
67bf9823
JA
498#include <sched.h>
499int main(int argc, char **argv)
500{
501 cpu_set_t mask;
502 return sched_setaffinity(0, &mask);
503}
504EOF
505 if compile_prog "" "" "sched_setaffinity(,)"; then
506 linux_2arg_affinity="yes"
507 fi
508fi
509echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
510echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
511
512##########################################
513# clock_gettime probe
514clock_gettime="no"
515cat > $TMPC << EOF
516#include <stdio.h>
517#include <time.h>
518int main(int argc, char **argv)
519{
520 return clock_gettime(0, NULL);
521}
522EOF
523if compile_prog "" "" "clock_gettime"; then
524 clock_gettime="yes"
525elif compile_prog "" "-lrt" "clock_gettime"; then
526 clock_gettime="yes"
527 LIBS="-lrt $LIBS"
528fi
529echo "clock_gettime $clock_gettime"
530
531##########################################
532# CLOCK_MONOTONIC probe
533clock_monotonic="no"
534if test "$clock_gettime" = "yes" ; then
535 cat > $TMPC << EOF
536#include <stdio.h>
537#include <time.h>
538int main(int argc, char **argv)
539{
540 return clock_gettime(CLOCK_MONOTONIC, NULL);
541}
542EOF
543 if compile_prog "" "$LIBS" "clock monotonic"; then
544 clock_monotonic="yes"
545 fi
546fi
547echo "CLOCK_MONOTONIC $clock_monotonic"
548
549##########################################
550# CLOCK_MONOTONIC_PRECISE probe
551clock_monotonic_precise="no"
552if test "$clock_gettime" = "yes" ; then
553 cat > $TMPC << EOF
554#include <stdio.h>
555#include <time.h>
556int main(int argc, char **argv)
557{
558 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
559}
560EOF
561 if compile_prog "" "$LIBS" "clock monotonic precise"; then
562 clock_monotonic_precise="yes"
563 fi
564fi
565echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
566
567##########################################
568# gettimeofday() probe
569gettimeofday="no"
570cat > $TMPC << EOF
571#include <sys/time.h>
572#include <stdio.h>
573int main(int argc, char **argv)
574{
575 struct timeval tv;
576 return gettimeofday(&tv, NULL);
577}
578EOF
579if compile_prog "" "" "gettimeofday"; then
580 gettimeofday="yes"
581fi
582echo "gettimeofday $gettimeofday"
583
584##########################################
585# fdatasync() probe
586fdatasync="no"
587cat > $TMPC << EOF
588#include <stdio.h>
589#include <unistd.h>
590int main(int argc, char **argv)
591{
592 return fdatasync(0);
593}
594EOF
595if compile_prog "" "" "fdatasync"; then
596 fdatasync="yes"
597fi
598echo "fdatasync $fdatasync"
599
600##########################################
601# sync_file_range() probe
602sync_file_range="no"
603cat > $TMPC << EOF
604#include <stdio.h>
605#include <unistd.h>
67bf9823
JA
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
67bf9823
JA
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
44404c5a
JA
792##########################################
793# Check whether we have getrusage(RUSAGE_THREAD)
794rusage_thread="no"
795cat > $TMPC << EOF
796#include <sys/time.h>
797#include <sys/resource.h>
798int main(int argc, char **argv)
799{
800 struct rusage ru;
801 getrusage(RUSAGE_THREAD, &ru);
802 return 0;
803}
804EOF
805if compile_prog "" "" "RUSAGE_THREAD"; then
806 rusage_thread="yes"
807fi
808echo "RUSAGE_THREAD $rusage_thread"
809
67bf9823
JA
810#############################################################################
811
812echo "# Automatically generated by configure - do not modify" > $config_host_mak
813printf "# Configured with:" >> $config_host_mak
814printf " '%s'" "$0" "$@" >> $config_host_mak
815echo >> $config_host_mak
816
817if test "$wordsize" = "64" ; then
818 echo "CONFIG_64BIT=y" >> $config_host_mak
819elif test "$wordsize" = "32" ; then
820 echo "CONFIG_32BIT=y" >> $config_host_mak
821else
822 echo "Unknown wordsize!"
823 exit 1
824fi
0dcebdf4
JA
825if test "$bigendian" = "yes" ; then
826 echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
827else
828 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
829fi
67bf9823
JA
830if test "$libaio" = "yes" ; then
831 echo "CONFIG_LIBAIO=y" >> $config_host_mak
832fi
833if test "$posix_aio" = "yes" ; then
834 echo "CONFIG_POSIXAIO=y" >> $config_host_mak
835fi
836if test "$posix_aio_fsync" = "yes" ; then
837 echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
838fi
839if test "$linux_fallocate" = "yes" ; then
840 echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
841fi
842if test "$posix_fallocate" = "yes" ; then
843 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
844fi
845if test "$fdatasync" = "yes" ; then
846 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
847fi
848if test "$sync_file_range" = "yes" ; then
849 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
850fi
851if test "$sfaa" = "yes" ; then
852 echo "CONFIG_SFAA=y" >> $config_host_mak
853fi
854if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
855 echo "CONFIG_RDMA=y" >> $config_host_mak
856fi
857if test "$clock_gettime" = "yes" ; then
858 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
859fi
860if test "$clock_monotonic" = "yes" ; then
861 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
862fi
863if test "$clock_monotonic_precise" = "yes" ; then
864 echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
865fi
866if test "$gettimeofday" = "yes" ; then
867 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
868fi
869if test "$posix_fadvise" = "yes" ; then
870 echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
871fi
872if test "$linux_3arg_affinity" = "yes" ; then
873 echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
874elif test "$linux_2arg_affinity" = "yes" ; then
875 echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
876fi
877if test "$strsep" = "yes" ; then
878 echo "CONFIG_STRSEP=y" >> $config_host_mak
879fi
880if test "$getopt_long_only" = "yes" ; then
881 echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
882fi
883if test "$inet_aton" = "yes" ; then
884 echo "CONFIG_INET_ATON=y" >> $config_host_mak
885fi
886if test "$socklen_t" = "yes" ; then
887 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
888fi
889if test "$ext4_me" = "yes" ; then
890 echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
891fi
892if test "$linux_splice" = "yes" ; then
893 echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
894fi
895if test "$guasi" = "yes" ; then
896 echo "CONFIG_GUASI=y" >> $config_host_mak
897fi
898if test "$fusion_aw" = "yes" ; then
899 echo "CONFIG_FUSION_AW=y" >> $config_host_mak
900fi
901if test "$libnuma" = "yes" ; then
902 echo "CONFIG_LIBNUMA=y" >> $config_host_mak
903fi
904if test "$solaris_aio" = "yes" ; then
905 echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
906fi
907if test "$tls_thread" = "yes" ; then
908 echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
909fi
44404c5a
JA
910if test "$rusage_thread" = "yes" ; then
911 echo "CONFIG_RUSAGE_THREAD=y" >> $config_host_mak
912fi
67bf9823
JA
913
914echo "LIBS+=$LIBS" >> $config_host_mak
915echo "CC=$cc" >> $config_host_mak
44404c5a 916echo "CFLAGS=$CFLAGS" >> $config_host_mak