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