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