Add lib/getrusage.c
[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
167 exit 0
67bf9823
JA
168esac
169
170if test ! -z "$cpu" ; then
171 # command line argument
172 :
173elif check_define __i386__ ; then
174 cpu="i386"
175elif check_define __x86_64__ ; then
176 cpu="x86_64"
177elif check_define __sparc__ ; then
178 if check_define __arch64__ ; then
179 cpu="sparc64"
180 else
181 cpu="sparc"
182 fi
183elif check_define _ARCH_PPC ; then
184 if check_define _ARCH_PPC64 ; then
185 cpu="ppc64"
186 else
187 cpu="ppc"
188 fi
189elif check_define __mips__ ; then
190 cpu="mips"
191elif check_define __ia64__ ; then
192 cpu="ia64"
193elif check_define __s390__ ; then
194 if check_define __s390x__ ; then
195 cpu="s390x"
196 else
197 cpu="s390"
198 fi
199elif check_define __arm__ ; then
200 cpu="arm"
201elif check_define __hppa__ ; then
202 cpu="hppa"
203else
204 cpu=`uname -m`
205fi
206
207# Normalise host CPU name and set ARCH.
208case "$cpu" in
209 ia64|ppc|ppc64|s390|s390x|sparc64)
210 cpu="$cpu"
211 ;;
212 i386|i486|i586|i686|i86pc|BePC)
213 cpu="i386"
214 ;;
215 x86_64|amd64)
216 cpu="x86_64"
217 ;;
218 armv*b|armv*l|arm)
219 cpu="arm"
220 ;;
221 hppa|parisc|parisc64)
222 cpu="hppa"
223 ;;
224 mips*)
225 cpu="mips"
226 ;;
227 sparc|sun4[cdmuv])
228 cpu="sparc"
229 ;;
230 *)
231 echo "Unknown CPU"
232 exit 1;
233 ;;
234esac
235
236if test -z $CC; then
237 if test "$targetos" = "FreeBSD"; then
238 if has clang; then
239 CC=clang
240 else
241 CC=gcc
242 fi
67bf9823
JA
243 fi
244fi
245
246cc="${CC-${cross_prefix}gcc}"
247
0dcebdf4
JA
248##########################################
249# check endianness
250bigendian="no"
251cat > $TMPC <<EOF
252#include <inttypes.h>
253int main(void)
254{
255 volatile uint32_t i=0x01234567;
256 return (*((uint8_t*)(&i))) == 0x67;
257}
258EOF
259if compile_prog "" "" "endian"; then
260 $TMPE && bigendian="yes"
261fi
262
263
67bf9823
JA
264echo "Operating system $targetos"
265echo "CPU $cpu"
0dcebdf4 266echo "Big endian $bigendian"
67bf9823
JA
267echo "Compiler $cc"
268echo
269
270##########################################
271# check for wordsize
272wordsize="0"
273cat > $TMPC <<EOF
274#include <stdio.h>
275int main(void)
276{
277 unsigned int wsize = sizeof(long) * 8;
278 printf("%d\n", wsize);
279 return 0;
280}
281EOF
282if compile_prog "" "" "wordsize"; then
283 wordsize=$($TMPE)
284fi
285echo "Wordsize $wordsize"
286
287##########################################
288# linux-aio probe
289libaio="no"
290cat > $TMPC <<EOF
291#include <libaio.h>
292#include <stddef.h>
293int main(void)
294{
295 io_setup(0, NULL);
296 return 0;
297}
298EOF
299if compile_prog "" "-laio" "libaio" ; then
300 libaio=yes
301 LIBS="-laio $LIBS"
302else
303 if test "$libaio" = "yes" ; then
304 feature_not_found "linux AIO"
305 fi
306 libaio=no
307fi
308echo "Linux AIO support $libaio"
309
310##########################################
311# posix aio probe
312posix_aio="no"
313posix_aio_lrt="no"
314cat > $TMPC <<EOF
315#include <aio.h>
316int main(void)
317{
318 struct aiocb cb;
319 aio_read(&cb);
320 return 0;
321}
322EOF
323if compile_prog "" "" "posixaio" ; then
324 posix_aio="yes"
325elif compile_prog "" "-lrt" "posixaio"; then
326 posix_aio="yes"
327 posix_aio_lrt="yes"
328 LIBS="-lrt $LIBS"
329fi
330echo "POSIX AIO support $posix_aio"
331echo "POSIX AIO support needs -lrt $posix_aio_lrt"
332
333##########################################
334# posix aio fsync probe
335posix_aio_fsync="no"
336if test "$posix_aio" = "yes" ; then
337 cat > $TMPC <<EOF
338#include <fcntl.h>
339#include <aio.h>
340int main(void)
341{
342 struct aiocb cb;
343 return aio_fsync(O_SYNC, &cb);
344 return 0;
345}
346EOF
347 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
348 posix_aio_fsync=yes
349 fi
350fi
351echo "POSIX AIO fsync $posix_aio_fsync"
352
353##########################################
354# solaris aio probe
355solaris_aio="no"
356cat > $TMPC <<EOF
357#include <sys/types.h>
358#include <sys/asynch.h>
359#include <unistd.h>
360int main(void)
361{
362 aio_result_t res;
363 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
364 return 0;
365}
366EOF
367if compile_prog "" "-laio" "solarisaio" ; then
368 solaris_aio=yes
369 LIBS="-laio $LIBS"
370fi
371echo "Solaris AIO support $solaris_aio"
372
373##########################################
374# __sync_fetch_and_and test
375sfaa="no"
376cat > $TMPC << EOF
377static int sfaa(int *ptr)
378{
379 return __sync_fetch_and_and(ptr, 0);
380}
381
382int main(int argc, char **argv)
383{
384 int val = 42;
385 sfaa(&val);
386 return val;
387}
388EOF
389if compile_prog "" "" "__sync_fetch_and_add()" ; then
390 sfaa="yes"
391fi
392echo "__sync_fetch_and add $sfaa"
393
394##########################################
395# libverbs probe
396libverbs="no"
397cat > $TMPC << EOF
398#include <stdio.h>
399#include <infiniband/arch.h>
400int main(int argc, char **argv)
401{
402 struct ibv_pd *pd = ibv_alloc_pd(NULL);
403 return 0;
404}
405EOF
406if compile_prog "" "-libverbs" "libverbs" ; then
407 libverbs="yes"
408 LIBS="-libverbs $LIBS"
409fi
410echo "libverbs $libverbs"
411
412##########################################
413# rdmacm probe
414rdmacm="no"
415cat > $TMPC << EOF
416#include <stdio.h>
417#include <rdma/rdma_cma.h>
418int main(int argc, char **argv)
419{
420 rdma_destroy_qp(NULL);
421 return 0;
422}
423EOF
424if compile_prog "" "-lrdmacm" "rdma"; then
425 rdmacm="yes"
426 LIBS="-lrdmacm $LIBS"
427fi
428echo "rdmacm $rdmacm"
429
430##########################################
431# Linux fallocate probe
432linux_fallocate="no"
433cat > $TMPC << EOF
434#include <stdio.h>
435#include <linux/falloc.h>
436int main(int argc, char **argv)
437{
438 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
439 return r;
440}
441EOF
442if compile_prog "" "" "linux_fallocate"; then
443 linux_fallocate="yes"
444fi
445echo "Linux fallocate $linux_fallocate"
446
447##########################################
448# POSIX fadvise probe
449posix_fadvise="no"
450cat > $TMPC << EOF
451#include <stdio.h>
452#include <fcntl.h>
453int main(int argc, char **argv)
454{
455 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
456 return r;
457}
458EOF
459if compile_prog "" "" "posix_fadvise"; then
460 posix_fadvise="yes"
461fi
462echo "POSIX fadvise $posix_fadvise"
463
464##########################################
465# POSIX fallocate probe
466posix_fallocate="no"
467cat > $TMPC << EOF
468#include <stdio.h>
469#include <fcntl.h>
470int main(int argc, char **argv)
471{
472 int r = posix_fallocate(0, 0, 1024);
473 return r;
474}
475EOF
476if compile_prog "" "" "posix_fallocate"; then
477 posix_fallocate="yes"
478fi
479echo "POSIX fallocate $posix_fallocate"
480
481##########################################
482# sched_set/getaffinity 2 or 3 argument test
483linux_2arg_affinity="no"
484linux_3arg_affinity="no"
485cat > $TMPC << EOF
67bf9823
JA
486#include <sched.h>
487int main(int argc, char **argv)
488{
489 cpu_set_t mask;
490 return sched_setaffinity(0, sizeof(mask), &mask);
491}
492EOF
493if compile_prog "" "" "sched_setaffinity(,,)"; then
494 linux_3arg_affinity="yes"
495else
496 cat > $TMPC << EOF
67bf9823
JA
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>
67bf9823
JA
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
67bf9823
JA
645#include <stdio.h>
646#include <fcntl.h>
647int main(int argc, char **argv)
648{
649 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
650}
651EOF
652if compile_prog "" "" "linux splice"; then
653 linux_splice="yes"
654fi
655echo "Linux splice(2) $linux_splice"
656
657##########################################
658# GUASI probe
659guasi="no"
660cat > $TMPC << EOF
661#include <guasi.h>
662#include <guasi_syscalls.h>
663int main(int argc, char **argv)
664{
665 guasi_t ctx = guasi_create(0, 0, 0);
666 return 0;
667}
668EOF
669if compile_prog "" "" "guasi"; then
670 guasi="yes"
671fi
672echo "GUASI $guasi"
673
674##########################################
675# fusion-aw probe
676fusion_aw="no"
677cat > $TMPC << EOF
99db6564 678#include <nvm/vectored_write.h>
67bf9823
JA
679int main(int argc, char **argv)
680{
681 struct vsl_iovec iov;
682 return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
683}
684EOF
99db6564
JA
685if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then
686 LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS"
67bf9823
JA
687 fusion_aw="yes"
688fi
689echo "Fusion-io atomic engine $fusion_aw"
690
691##########################################
692# libnuma probe
693libnuma="no"
694cat > $TMPC << EOF
695#include <numa.h>
696int main(int argc, char **argv)
697{
698 return numa_available();
699}
700EOF
701if compile_prog "" "-lnuma" "libnuma"; then
702 libnuma="yes"
703 LIBS="-lnuma $LIBS"
704fi
705echo "libnuma $libnuma"
706
707##########################################
708# strsep() probe
709strsep="no"
710cat > $TMPC << EOF
711#include <string.h>
712int main(int argc, char **argv)
713{
714 strsep(NULL, NULL);
715 return 0;
716}
717EOF
718if compile_prog "" "" "strsep"; then
719 strsep="yes"
720fi
721echo "strsep $strsep"
722
723##########################################
724# getopt_long_only() probe
725getopt_long_only="no"
726cat > $TMPC << EOF
727#include <unistd.h>
728#include <stdio.h>
729int main(int argc, char **argv)
730{
731 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
732 return c;
733}
734EOF
735if compile_prog "" "" "getopt_long_only"; then
736 getopt_long_only="yes"
737fi
738echo "getopt_long_only() $getopt_long_only"
739
740##########################################
741# inet_aton() probe
742inet_aton="no"
743cat > $TMPC << EOF
744#include <sys/socket.h>
745#include <arpa/inet.h>
746#include <stdio.h>
747int main(int argc, char **argv)
748{
749 struct in_addr in;
750 return inet_aton(NULL, &in);
751}
752EOF
753if compile_prog "" "" "inet_aton"; then
754 inet_aton="yes"
755fi
756echo "inet_aton $inet_aton"
757
758##########################################
759# socklen_t probe
760socklen_t="no"
761cat > $TMPC << EOF
762#include <string.h>
763#include <netinet/in.h>
764int main(int argc, char **argv)
765{
766 socklen_t len = 0;
767 return len;
768}
769EOF
770if compile_prog "" "" "socklen_t"; then
771 socklen_t="yes"
772fi
773echo "socklen_t $socklen_t"
774
775##########################################
776# Whether or not __thread is supported for TLS
777tls_thread="no"
778cat > $TMPC << EOF
779#include <stdio.h>
780static int __thread ret;
781int main(int argc, char **argv)
782{
783 return ret;
784}
785EOF
786if compile_prog "" "" "__thread"; then
787 tls_thread="yes"
788fi
789echo "__thread $tls_thread"
790
44404c5a
JA
791##########################################
792# Check whether we have getrusage(RUSAGE_THREAD)
793rusage_thread="no"
794cat > $TMPC << EOF
795#include <sys/time.h>
796#include <sys/resource.h>
797int main(int argc, char **argv)
798{
799 struct rusage ru;
800 getrusage(RUSAGE_THREAD, &ru);
801 return 0;
802}
803EOF
804if compile_prog "" "" "RUSAGE_THREAD"; then
805 rusage_thread="yes"
806fi
807echo "RUSAGE_THREAD $rusage_thread"
808
67bf9823
JA
809#############################################################################
810
811echo "# Automatically generated by configure - do not modify" > $config_host_mak
812printf "# Configured with:" >> $config_host_mak
813printf " '%s'" "$0" "$@" >> $config_host_mak
814echo >> $config_host_mak
815
816if test "$wordsize" = "64" ; then
817 echo "CONFIG_64BIT=y" >> $config_host_mak
818elif test "$wordsize" = "32" ; then
819 echo "CONFIG_32BIT=y" >> $config_host_mak
820else
821 echo "Unknown wordsize!"
822 exit 1
823fi
0dcebdf4
JA
824if test "$bigendian" = "yes" ; then
825 echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
826else
827 echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
828fi
67bf9823
JA
829if test "$libaio" = "yes" ; then
830 echo "CONFIG_LIBAIO=y" >> $config_host_mak
831fi
832if test "$posix_aio" = "yes" ; then
833 echo "CONFIG_POSIXAIO=y" >> $config_host_mak
834fi
835if test "$posix_aio_fsync" = "yes" ; then
836 echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
837fi
838if test "$linux_fallocate" = "yes" ; then
839 echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
840fi
841if test "$posix_fallocate" = "yes" ; then
842 echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
843fi
844if test "$fdatasync" = "yes" ; then
845 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
846fi
847if test "$sync_file_range" = "yes" ; then
848 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
849fi
850if test "$sfaa" = "yes" ; then
851 echo "CONFIG_SFAA=y" >> $config_host_mak
852fi
853if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
854 echo "CONFIG_RDMA=y" >> $config_host_mak
855fi
856if test "$clock_gettime" = "yes" ; then
857 echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
858fi
859if test "$clock_monotonic" = "yes" ; then
860 echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
861fi
862if test "$clock_monotonic_precise" = "yes" ; then
863 echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
864fi
865if test "$gettimeofday" = "yes" ; then
866 echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
867fi
868if test "$posix_fadvise" = "yes" ; then
869 echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
870fi
871if test "$linux_3arg_affinity" = "yes" ; then
872 echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
873elif test "$linux_2arg_affinity" = "yes" ; then
874 echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
875fi
876if test "$strsep" = "yes" ; then
877 echo "CONFIG_STRSEP=y" >> $config_host_mak
878fi
879if test "$getopt_long_only" = "yes" ; then
880 echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
881fi
882if test "$inet_aton" = "yes" ; then
883 echo "CONFIG_INET_ATON=y" >> $config_host_mak
884fi
885if test "$socklen_t" = "yes" ; then
886 echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
887fi
888if test "$ext4_me" = "yes" ; then
889 echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
890fi
891if test "$linux_splice" = "yes" ; then
892 echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
893fi
894if test "$guasi" = "yes" ; then
895 echo "CONFIG_GUASI=y" >> $config_host_mak
896fi
897if test "$fusion_aw" = "yes" ; then
898 echo "CONFIG_FUSION_AW=y" >> $config_host_mak
899fi
900if test "$libnuma" = "yes" ; then
901 echo "CONFIG_LIBNUMA=y" >> $config_host_mak
902fi
903if test "$solaris_aio" = "yes" ; then
904 echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
905fi
906if test "$tls_thread" = "yes" ; then
907 echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
908fi
44404c5a
JA
909if test "$rusage_thread" = "yes" ; then
910 echo "CONFIG_RUSAGE_THREAD=y" >> $config_host_mak
911fi
67bf9823
JA
912
913echo "LIBS+=$LIBS" >> $config_host_mak
914echo "CC=$cc" >> $config_host_mak
44404c5a 915echo "CFLAGS=$CFLAGS" >> $config_host_mak