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