configure: solaris and windowsaio fixups
[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
4700b234 168 echo "CONFIG_WINDOWSAIO=y" >> $config_host_mak
cfd94f79 169 exit 0
67bf9823
JA
170esac
171
172if test ! -z "$cpu" ; then
173 # command line argument
174 :
175elif check_define __i386__ ; then
176 cpu="i386"
177elif check_define __x86_64__ ; then
178 cpu="x86_64"
179elif check_define __sparc__ ; then
180 if check_define __arch64__ ; then
181 cpu="sparc64"
182 else
183 cpu="sparc"
184 fi
185elif check_define _ARCH_PPC ; then
186 if check_define _ARCH_PPC64 ; then
187 cpu="ppc64"
188 else
189 cpu="ppc"
190 fi
191elif check_define __mips__ ; then
192 cpu="mips"
193elif check_define __ia64__ ; then
194 cpu="ia64"
195elif check_define __s390__ ; then
196 if check_define __s390x__ ; then
197 cpu="s390x"
198 else
199 cpu="s390"
200 fi
201elif check_define __arm__ ; then
202 cpu="arm"
203elif check_define __hppa__ ; then
204 cpu="hppa"
205else
206 cpu=`uname -m`
207fi
208
209# Normalise host CPU name and set ARCH.
210case "$cpu" in
211 ia64|ppc|ppc64|s390|s390x|sparc64)
212 cpu="$cpu"
213 ;;
214 i386|i486|i586|i686|i86pc|BePC)
215 cpu="i386"
216 ;;
217 x86_64|amd64)
218 cpu="x86_64"
219 ;;
220 armv*b|armv*l|arm)
221 cpu="arm"
222 ;;
223 hppa|parisc|parisc64)
224 cpu="hppa"
225 ;;
226 mips*)
227 cpu="mips"
228 ;;
229 sparc|sun4[cdmuv])
230 cpu="sparc"
231 ;;
232 *)
233 echo "Unknown CPU"
234 exit 1;
235 ;;
236esac
237
238if test -z $CC; then
239 if test "$targetos" = "FreeBSD"; then
240 if has clang; then
241 CC=clang
242 else
243 CC=gcc
244 fi
67bf9823
JA
245 fi
246fi
247
248cc="${CC-${cross_prefix}gcc}"
249
0dcebdf4
JA
250##########################################
251# check endianness
252bigendian="no"
253cat > $TMPC <<EOF
254#include <inttypes.h>
255int main(void)
256{
257 volatile uint32_t i=0x01234567;
258 return (*((uint8_t*)(&i))) == 0x67;
259}
260EOF
261if compile_prog "" "" "endian"; then
262 $TMPE && bigendian="yes"
263fi
264
265
67bf9823
JA
266echo "Operating system $targetos"
267echo "CPU $cpu"
0dcebdf4 268echo "Big endian $bigendian"
67bf9823
JA
269echo "Compiler $cc"
270echo
271
272##########################################
273# check for wordsize
274wordsize="0"
275cat > $TMPC <<EOF
276#include <stdio.h>
277int main(void)
278{
279 unsigned int wsize = sizeof(long) * 8;
280 printf("%d\n", wsize);
281 return 0;
282}
283EOF
284if compile_prog "" "" "wordsize"; then
285 wordsize=$($TMPE)
286fi
287echo "Wordsize $wordsize"
288
289##########################################
290# linux-aio probe
291libaio="no"
292cat > $TMPC <<EOF
293#include <libaio.h>
294#include <stddef.h>
295int main(void)
296{
297 io_setup(0, NULL);
298 return 0;
299}
300EOF
301if compile_prog "" "-laio" "libaio" ; then
302 libaio=yes
303 LIBS="-laio $LIBS"
304else
305 if test "$libaio" = "yes" ; then
306 feature_not_found "linux AIO"
307 fi
308 libaio=no
309fi
310echo "Linux AIO support $libaio"
311
312##########################################
313# posix aio probe
314posix_aio="no"
315posix_aio_lrt="no"
316cat > $TMPC <<EOF
317#include <aio.h>
318int main(void)
319{
320 struct aiocb cb;
321 aio_read(&cb);
322 return 0;
323}
324EOF
325if compile_prog "" "" "posixaio" ; then
326 posix_aio="yes"
327elif compile_prog "" "-lrt" "posixaio"; then
328 posix_aio="yes"
329 posix_aio_lrt="yes"
330 LIBS="-lrt $LIBS"
331fi
332echo "POSIX AIO support $posix_aio"
333echo "POSIX AIO support needs -lrt $posix_aio_lrt"
334
335##########################################
336# posix aio fsync probe
337posix_aio_fsync="no"
338if test "$posix_aio" = "yes" ; then
339 cat > $TMPC <<EOF
340#include <fcntl.h>
341#include <aio.h>
342int main(void)
343{
344 struct aiocb cb;
345 return aio_fsync(O_SYNC, &cb);
346 return 0;
347}
348EOF
349 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
350 posix_aio_fsync=yes
351 fi
352fi
353echo "POSIX AIO fsync $posix_aio_fsync"
354
355##########################################
356# solaris aio probe
357solaris_aio="no"
358cat > $TMPC <<EOF
359#include <sys/types.h>
360#include <sys/asynch.h>
361#include <unistd.h>
362int main(void)
363{
364 aio_result_t res;
365 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
366 return 0;
367}
368EOF
369if compile_prog "" "-laio" "solarisaio" ; then
370 solaris_aio=yes
371 LIBS="-laio $LIBS"
372fi
373echo "Solaris AIO support $solaris_aio"
374
375##########################################
376# __sync_fetch_and_and test
377sfaa="no"
378cat > $TMPC << EOF
379static int sfaa(int *ptr)
380{
381 return __sync_fetch_and_and(ptr, 0);
382}
383
384int main(int argc, char **argv)
385{
386 int val = 42;
387 sfaa(&val);
388 return val;
389}
390EOF
391if compile_prog "" "" "__sync_fetch_and_add()" ; then
392 sfaa="yes"
393fi
394echo "__sync_fetch_and add $sfaa"
395
396##########################################
397# libverbs probe
398libverbs="no"
399cat > $TMPC << EOF
400#include <stdio.h>
401#include <infiniband/arch.h>
402int main(int argc, char **argv)
403{
404 struct ibv_pd *pd = ibv_alloc_pd(NULL);
405 return 0;
406}
407EOF
408if compile_prog "" "-libverbs" "libverbs" ; then
409 libverbs="yes"
410 LIBS="-libverbs $LIBS"
411fi
412echo "libverbs $libverbs"
413
414##########################################
415# rdmacm probe
416rdmacm="no"
417cat > $TMPC << EOF
418#include <stdio.h>
419#include <rdma/rdma_cma.h>
420int main(int argc, char **argv)
421{
422 rdma_destroy_qp(NULL);
423 return 0;
424}
425EOF
426if compile_prog "" "-lrdmacm" "rdma"; then
427 rdmacm="yes"
428 LIBS="-lrdmacm $LIBS"
429fi
430echo "rdmacm $rdmacm"
431
432##########################################
433# Linux fallocate probe
434linux_fallocate="no"
435cat > $TMPC << EOF
436#include <stdio.h>
437#include <linux/falloc.h>
438int main(int argc, char **argv)
439{
440 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
441 return r;
442}
443EOF
444if compile_prog "" "" "linux_fallocate"; then
445 linux_fallocate="yes"
446fi
447echo "Linux fallocate $linux_fallocate"
448
449##########################################
450# POSIX fadvise probe
451posix_fadvise="no"
452cat > $TMPC << EOF
453#include <stdio.h>
454#include <fcntl.h>
455int main(int argc, char **argv)
456{
457 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
458 return r;
459}
460EOF
461if compile_prog "" "" "posix_fadvise"; then
462 posix_fadvise="yes"
463fi
464echo "POSIX fadvise $posix_fadvise"
465
466##########################################
467# POSIX fallocate probe
468posix_fallocate="no"
469cat > $TMPC << EOF
470#include <stdio.h>
471#include <fcntl.h>
472int main(int argc, char **argv)
473{
474 int r = posix_fallocate(0, 0, 1024);
475 return r;
476}
477EOF
478if compile_prog "" "" "posix_fallocate"; then
479 posix_fallocate="yes"
480fi
481echo "POSIX fallocate $posix_fallocate"
482
483##########################################
484# sched_set/getaffinity 2 or 3 argument test
485linux_2arg_affinity="no"
486linux_3arg_affinity="no"
487cat > $TMPC << EOF
67bf9823
JA
488#include <sched.h>
489int main(int argc, char **argv)
490{
491 cpu_set_t mask;
492 return sched_setaffinity(0, sizeof(mask), &mask);
493}
494EOF
495if compile_prog "" "" "sched_setaffinity(,,)"; then
496 linux_3arg_affinity="yes"
497else
498 cat > $TMPC << EOF
67bf9823
JA
499#include <sched.h>
500int main(int argc, char **argv)
501{
502 cpu_set_t mask;
503 return sched_setaffinity(0, &mask);
504}
505EOF
506 if compile_prog "" "" "sched_setaffinity(,)"; then
507 linux_2arg_affinity="yes"
508 fi
509fi
510echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
511echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
512
513##########################################
514# clock_gettime probe
515clock_gettime="no"
516cat > $TMPC << EOF
517#include <stdio.h>
518#include <time.h>
519int main(int argc, char **argv)
520{
521 return clock_gettime(0, NULL);
522}
523EOF
524if compile_prog "" "" "clock_gettime"; then
525 clock_gettime="yes"
526elif compile_prog "" "-lrt" "clock_gettime"; then
527 clock_gettime="yes"
528 LIBS="-lrt $LIBS"
529fi
530echo "clock_gettime $clock_gettime"
531
532##########################################
533# CLOCK_MONOTONIC probe
534clock_monotonic="no"
535if test "$clock_gettime" = "yes" ; then
536 cat > $TMPC << EOF
537#include <stdio.h>
538#include <time.h>
539int main(int argc, char **argv)
540{
541 return clock_gettime(CLOCK_MONOTONIC, NULL);
542}
543EOF
544 if compile_prog "" "$LIBS" "clock monotonic"; then
545 clock_monotonic="yes"
546 fi
547fi
548echo "CLOCK_MONOTONIC $clock_monotonic"
549
550##########################################
551# CLOCK_MONOTONIC_PRECISE probe
552clock_monotonic_precise="no"
553if test "$clock_gettime" = "yes" ; then
554 cat > $TMPC << EOF
555#include <stdio.h>
556#include <time.h>
557int main(int argc, char **argv)
558{
559 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
560}
561EOF
562 if compile_prog "" "$LIBS" "clock monotonic precise"; then
563 clock_monotonic_precise="yes"
564 fi
565fi
566echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
567
568##########################################
569# gettimeofday() probe
570gettimeofday="no"
571cat > $TMPC << EOF
572#include <sys/time.h>
573#include <stdio.h>
574int main(int argc, char **argv)
575{
576 struct timeval tv;
577 return gettimeofday(&tv, NULL);
578}
579EOF
580if compile_prog "" "" "gettimeofday"; then
581 gettimeofday="yes"
582fi
583echo "gettimeofday $gettimeofday"
584
585##########################################
586# fdatasync() probe
587fdatasync="no"
588cat > $TMPC << EOF
589#include <stdio.h>
590#include <unistd.h>
591int main(int argc, char **argv)
592{
593 return fdatasync(0);
594}
595EOF
596if compile_prog "" "" "fdatasync"; then
597 fdatasync="yes"
598fi
599echo "fdatasync $fdatasync"
600
601##########################################
602# sync_file_range() probe
603sync_file_range="no"
604cat > $TMPC << EOF
605#include <stdio.h>
606#include <unistd.h>
67bf9823
JA
607#include <fcntl.h>
608#include <linux/fs.h>
609int main(int argc, char **argv)
610{
611 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
612 SYNC_FILE_RANGE_WAIT_AFTER;
613 return sync_file_range(0, 0, 0, flags);
614}
615EOF
616if compile_prog "" "" "sync_file_range"; then
617 sync_file_range="yes"
618fi
619echo "sync_file_range $sync_file_range"
620
621##########################################
622# ext4 move extent probe
623ext4_me="no"
624cat > $TMPC << EOF
625#include <fcntl.h>
626#include <sys/ioctl.h>
627int main(int argc, char **argv)
628{
629 struct move_extent me;
630 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
631}
632EOF
c7165b8d
JA
633if compile_prog "" "" "ext4 move extent" ; then
634 ext4_me="yes"
635elif test $targetos = "Linux" ; then
636 # On Linux, just default to it on and let it error at runtime if we really
637 # don't have it. None of my updated systems have it defined, but it does
638 # work. Takes a while to bubble back.
67bf9823
JA
639 ext4_me="yes"
640fi
641echo "EXT4 move extent $ext4_me"
642
643##########################################
644# splice probe
645linux_splice="no"
646cat > $TMPC << EOF
67bf9823
JA
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
44404c5a
JA
793##########################################
794# Check whether we have getrusage(RUSAGE_THREAD)
795rusage_thread="no"
796cat > $TMPC << EOF
797#include <sys/time.h>
798#include <sys/resource.h>
799int main(int argc, char **argv)
800{
801 struct rusage ru;
802 getrusage(RUSAGE_THREAD, &ru);
803 return 0;
804}
805EOF
806if compile_prog "" "" "RUSAGE_THREAD"; then
807 rusage_thread="yes"
808fi
809echo "RUSAGE_THREAD $rusage_thread"
810
67bf9823
JA
811#############################################################################
812
813echo "# Automatically generated by configure - do not modify" > $config_host_mak
814printf "# Configured with:" >> $config_host_mak
815printf " '%s'" "$0" "$@" >> $config_host_mak
816echo >> $config_host_mak
817
818if test "$wordsize" = "64" ; then
819 echo "CONFIG_64BIT=y" >> $config_host_mak
820elif test "$wordsize" = "32" ; then
821 echo "CONFIG_32BIT=y" >> $config_host_mak
822else
823 echo "Unknown wordsize!"
824 exit 1
825fi
0dcebdf4
JA
826if test "$bigendian" = "yes" ; then
827 echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
828else
829 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
830fi
67bf9823
JA
831if test "$libaio" = "yes" ; then
832 echo "CONFIG_LIBAIO=y" >> $config_host_mak
833fi
834if test "$posix_aio" = "yes" ; then
835 echo "CONFIG_POSIXAIO=y" >> $config_host_mak
836fi
837if test "$posix_aio_fsync" = "yes" ; then
838 echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
839fi
840if test "$linux_fallocate" = "yes" ; then
841 echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
842fi
843if test "$posix_fallocate" = "yes" ; then
844 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
845fi
846if test "$fdatasync" = "yes" ; then
847 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
848fi
849if test "$sync_file_range" = "yes" ; then
850 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
851fi
852if test "$sfaa" = "yes" ; then
853 echo "CONFIG_SFAA=y" >> $config_host_mak
854fi
855if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
856 echo "CONFIG_RDMA=y" >> $config_host_mak
857fi
858if test "$clock_gettime" = "yes" ; then
859 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
860fi
861if test "$clock_monotonic" = "yes" ; then
862 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
863fi
864if test "$clock_monotonic_precise" = "yes" ; then
865 echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
866fi
867if test "$gettimeofday" = "yes" ; then
868 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
869fi
870if test "$posix_fadvise" = "yes" ; then
871 echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
872fi
873if test "$linux_3arg_affinity" = "yes" ; then
874 echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
875elif test "$linux_2arg_affinity" = "yes" ; then
876 echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
877fi
878if test "$strsep" = "yes" ; then
879 echo "CONFIG_STRSEP=y" >> $config_host_mak
880fi
881if test "$getopt_long_only" = "yes" ; then
882 echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
883fi
884if test "$inet_aton" = "yes" ; then
885 echo "CONFIG_INET_ATON=y" >> $config_host_mak
886fi
887if test "$socklen_t" = "yes" ; then
888 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
889fi
890if test "$ext4_me" = "yes" ; then
891 echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
892fi
893if test "$linux_splice" = "yes" ; then
894 echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
895fi
896if test "$guasi" = "yes" ; then
897 echo "CONFIG_GUASI=y" >> $config_host_mak
898fi
899if test "$fusion_aw" = "yes" ; then
900 echo "CONFIG_FUSION_AW=y" >> $config_host_mak
901fi
902if test "$libnuma" = "yes" ; then
903 echo "CONFIG_LIBNUMA=y" >> $config_host_mak
904fi
905if test "$solaris_aio" = "yes" ; then
906 echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
907fi
908if test "$tls_thread" = "yes" ; then
909 echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
910fi
44404c5a
JA
911if test "$rusage_thread" = "yes" ; then
912 echo "CONFIG_RUSAGE_THREAD=y" >> $config_host_mak
913fi
67bf9823
JA
914
915echo "LIBS+=$LIBS" >> $config_host_mak
916echo "CC=$cc" >> $config_host_mak
44404c5a 917echo "CFLAGS=$CFLAGS" >> $config_host_mak