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