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