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