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