Use specified buffer_pattern (if given) for all io_u fills
[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
d7145a78
JA
32fatal() {
33 echo $@
34 echo "Configure failed, check config.log and/or the above output"
35 rm -rf $config_host_mak
36 rm -rf $config_host_h
37 exit 1
38}
39
44404c5a 40# Default CFLAGS
af4862b3
JA
41CFLAGS="-D_GNU_SOURCE -include config-host.h"
42BUILD_CFLAGS=""
67bf9823
JA
43
44# Print a helpful header at the top of config.log
45echo "# FIO configure log $(date)" >> config.log
46printf "# Configured with:" >> config.log
47printf " '%s'" "$0" "$@" >> config.log
48echo >> config.log
49echo "#" >> config.log
50
7560fe7c
JA
51# Print configure header at the top of $config_host_h
52echo "/*" > $config_host_h
53echo " * Automatically generated by configure - do not modify" >> $config_host_h
54printf " * Configured with:" >> $config_host_h
55printf " * '%s'" "$0" "$@" >> $config_host_h
56echo "" >> $config_host_h
57echo " */" >> $config_host_h
58
67bf9823
JA
59do_cc() {
60 # Run the compiler, capturing its output to the log.
61 echo $cc "$@" >> config.log
62 $cc "$@" >> config.log 2>&1 || return $?
63 # Test passed. If this is an --enable-werror build, rerun
64 # the test with -Werror and bail out if it fails. This
65 # makes warning-generating-errors in configure test code
66 # obvious to developers.
67 if test "$werror" != "yes"; then
68 return 0
69 fi
70 # Don't bother rerunning the compile if we were already using -Werror
71 case "$*" in
72 *-Werror*)
73 return 0
74 ;;
75 esac
76 echo $cc -Werror "$@" >> config.log
77 $cc -Werror "$@" >> config.log 2>&1 && return $?
78 echo "ERROR: configure test passed without -Werror but failed with -Werror."
79 echo "This is probably a bug in the configure script. The failing command"
80 echo "will be at the bottom of config.log."
d7145a78 81 fatal "You can run configure with --disable-werror to bypass this check."
67bf9823
JA
82}
83
84compile_object() {
85 do_cc $CFLAGS -c -o $TMPO $TMPC
86}
87
88compile_prog() {
89 local_cflags="$1"
adaa46d8 90 local_ldflags="$2 $LIBS"
67bf9823
JA
91 echo "Compiling test case $3" >> config.log
92 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
93}
94
95feature_not_found() {
96 feature=$1
c55d728b 97 packages=$2
67bf9823
JA
98
99 echo "ERROR"
100 echo "ERROR: User requested feature $feature"
c55d728b
JA
101 if test ! -z "$packages" ; then
102 echo "ERROR: That feature needs $packages installed"
103 fi
67bf9823 104 echo "ERROR: configure was not able to find it"
d7145a78 105 fatal "ERROR"
67bf9823
JA
106}
107
108has() {
109 type "$1" >/dev/null 2>&1
110}
111
112check_define() {
113 cat > $TMPC <<EOF
114#if !defined($1)
115#error $1 not defined
116#endif
117int main(void)
118{
119 return 0;
120}
121EOF
122 compile_object
123}
124
4feafb1e
JA
125output_sym() {
126 echo "$1=y" >> $config_host_mak
127 echo "#define $1" >> $config_host_h
128}
129
67bf9823
JA
130targetos=""
131cpu=""
132
91f94d5b 133# default options
47f44635
JA
134show_help="no"
135exit_val=0
ebec2094 136gfio_check="no"
1b10477b 137libhdfs="no"
91f94d5b 138
cb1125b0
JA
139# parse options
140for opt do
141 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
142 case "$opt" in
8b156d8e
JA
143 --cpu=*) cpu="$optarg"
144 ;;
c8931876
JA
145 # esx is cross compiled and cannot be detect through simple uname calls
146 --esx)
147 esx="yes"
148 ;;
cb1125b0
JA
149 --cc=*) CC="$optarg"
150 ;;
208e4c8b
JA
151 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
152 ;;
b7c12794 153 --build-32bit-win) build_32bit_win="yes"
7409711b 154 ;;
d2aeedb9
JA
155 --build-static) build_static="yes"
156 ;;
91f94d5b 157 --enable-gfio)
ebec2094 158 gfio_check="yes"
899fab33 159 ;;
44462517
CF
160 --disable-numa) disable_numa="yes"
161 ;;
ce18290e
TM
162 --disable-rbd) disable_rbd="yes"
163 ;;
164 --disable-gfapi) disable_gfapi="yes"
165 ;;
1b10477b
MM
166 --enable-libhdfs) libhdfs="yes"
167 ;;
827da4f5 168 --help)
47f44635 169 show_help="yes"
827da4f5 170 ;;
cb1125b0
JA
171 *)
172 echo "Bad option $opt"
47f44635
JA
173 show_help="yes"
174 exit_val=1
cb1125b0
JA
175 esac
176done
177
47f44635 178if test "$show_help" = "yes" ; then
8b156d8e 179 echo "--cpu= Specify target CPU if auto-detect fails"
b7a99316 180 echo "--cc= Specify compiler to use"
899fab33 181 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
b7c12794 182 echo "--build-32bit-win Enable 32-bit build on Windows"
d2aeedb9 183 echo "--build-static Build a static fio"
c8931876 184 echo "--esx Configure build options for esx"
b7a99316 185 echo "--enable-gfio Enable building of gtk gfio"
44462517 186 echo "--disable-numa Disable libnuma even if found"
1b10477b 187 echo "--enable-libhdfs Enable hdfs support"
b7a99316 188 exit $exit_val
47f44635
JA
189fi
190
47986339
SH
191cross_prefix=${cross_prefix-${CROSS_COMPILE}}
192cc="${CC-${cross_prefix}gcc}"
193
6d0e9f83
AC
194if check_define __ANDROID__ ; then
195 targetos="Android"
196elif check_define __linux__ ; then
67bf9823 197 targetos="Linux"
67bf9823
JA
198elif check_define __OpenBSD__ ; then
199 targetos='OpenBSD'
200elif check_define __sun__ ; then
201 targetos='SunOS'
7cb024f8 202 CFLAGS="$CFLAGS -D_REENTRANT"
b24f59ab
SH
203elif check_define _WIN32 ; then
204 targetos='CYGWIN'
67bf9823
JA
205else
206 targetos=`uname -s`
207fi
208
53cd4eee
AC
209echo "# Automatically generated by configure - do not modify" > $config_host_mak
210printf "# Configured with:" >> $config_host_mak
211printf " '%s'" "$0" "$@" >> $config_host_mak
212echo >> $config_host_mak
213echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
214
67bf9823
JA
215# Some host OSes need non-standard checks for which CPU to use.
216# Note that these checks are broken for cross-compilation: if you're
217# cross-compiling to one of these OSes then you'll need to specify
218# the correct CPU with the --cpu option.
219case $targetos in
220Darwin)
221 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
222 # we can run 64-bit userspace code.
223 # If the user didn't specify a CPU explicitly and the kernel says this is
224 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
225 # detection code.
226 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
227 cpu="x86_64"
228 fi
229 ;;
230SunOS)
231 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
232 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
233 cpu="x86_64"
234 fi
adaa46d8 235 LIBS="-lnsl -lsocket"
cfd94f79
JA
236 ;;
237CYGWIN*)
238 echo "Forcing known good options on Windows"
4578d01f 239 if test -z "$CC" ; then
7409711b
HL
240 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
241 CC="i686-w64-mingw32-gcc"
242 else
243 CC="x86_64-w64-mingw32-gcc"
244 fi
4578d01f 245 fi
4feafb1e 246 output_sym "CONFIG_LITTLE_ENDIAN"
7409711b
HL
247 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
248 output_sym "CONFIG_32BIT"
249 else
250 output_sym "CONFIG_64BIT_LLP64"
251 fi
4feafb1e
JA
252 output_sym "CONFIG_FADVISE"
253 output_sym "CONFIG_SOCKLEN_T"
4feafb1e
JA
254 output_sym "CONFIG_FADVISE"
255 output_sym "CONFIG_SFAA"
256 output_sym "CONFIG_RUSAGE_THREAD"
257 output_sym "CONFIG_WINDOWSAIO"
258 output_sym "CONFIG_FDATASYNC"
59308a64 259 output_sym "CONFIG_CLOCK_MONOTONIC"
dc0518ca
BC
260 output_sym "CONFIG_GETTIMEOFDAY"
261 output_sym "CONFIG_CLOCK_GETTIME"
7e09a9f1 262 output_sym "CONFIG_SCHED_IDLE"
1eafa37a 263 output_sym "CONFIG_TCP_NODELAY"
7d6be13a 264 output_sym "CONFIG_TLS_THREAD"
ef07baa1 265 output_sym "CONFIG_IPV6"
4feafb1e 266 echo "CC=$CC" >> $config_host_mak
af4862b3 267 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
cfd94f79 268 exit 0
6d0e9f83 269 ;;
67bf9823
JA
270esac
271
272if test ! -z "$cpu" ; then
273 # command line argument
274 :
275elif check_define __i386__ ; then
276 cpu="i386"
277elif check_define __x86_64__ ; then
278 cpu="x86_64"
279elif check_define __sparc__ ; then
280 if check_define __arch64__ ; then
281 cpu="sparc64"
282 else
283 cpu="sparc"
284 fi
285elif check_define _ARCH_PPC ; then
286 if check_define _ARCH_PPC64 ; then
287 cpu="ppc64"
288 else
289 cpu="ppc"
290 fi
291elif check_define __mips__ ; then
292 cpu="mips"
293elif check_define __ia64__ ; then
294 cpu="ia64"
295elif check_define __s390__ ; then
296 if check_define __s390x__ ; then
297 cpu="s390x"
298 else
299 cpu="s390"
300 fi
301elif check_define __arm__ ; then
302 cpu="arm"
303elif check_define __hppa__ ; then
304 cpu="hppa"
305else
306 cpu=`uname -m`
307fi
308
309# Normalise host CPU name and set ARCH.
310case "$cpu" in
311 ia64|ppc|ppc64|s390|s390x|sparc64)
312 cpu="$cpu"
313 ;;
314 i386|i486|i586|i686|i86pc|BePC)
315 cpu="i386"
316 ;;
317 x86_64|amd64)
318 cpu="x86_64"
319 ;;
320 armv*b|armv*l|arm)
321 cpu="arm"
322 ;;
323 hppa|parisc|parisc64)
324 cpu="hppa"
325 ;;
326 mips*)
327 cpu="mips"
328 ;;
329 sparc|sun4[cdmuv])
330 cpu="sparc"
331 ;;
332 *)
8b156d8e 333 echo "Unknown CPU"
67bf9823
JA
334 ;;
335esac
336
dcbbf5b0 337if test -z "$CC" ; then
67bf9823
JA
338 if test "$targetos" = "FreeBSD"; then
339 if has clang; then
340 CC=clang
341 else
342 CC=gcc
343 fi
67bf9823
JA
344 fi
345fi
346
347cc="${CC-${cross_prefix}gcc}"
348
1a17cfdb
AC
349##########################################
350# check cross compile
351
352cross_compile="no"
353cat > $TMPC <<EOF
354int main(void)
355{
356 return 0;
357}
358EOF
359if compile_prog "" "" "cross"; then
360 $TMPE 2>/dev/null || cross_compile="yes"
361else
362 fatal "compile test failed"
363fi
364
0dcebdf4
JA
365##########################################
366# check endianness
367bigendian="no"
1a17cfdb
AC
368if test "$cross_compile" = "no" ; then
369 cat > $TMPC <<EOF
0dcebdf4
JA
370#include <inttypes.h>
371int main(void)
372{
373 volatile uint32_t i=0x01234567;
374 return (*((uint8_t*)(&i))) == 0x67;
375}
376EOF
1a17cfdb
AC
377 if compile_prog "" "" "endian"; then
378 $TMPE && bigendian="yes"
379 fi
380else
381 # If we're cross compiling, try our best to work it out and rely on the
382 # run-time check to fail if we get it wrong.
383 cat > $TMPC <<EOF
384#include <endian.h>
385int main(void)
386{
387#if __BYTE_ORDER != __BIG_ENDIAN
388# error "Unknown endianness"
389#endif
390}
391EOF
392 compile_prog "" "" "endian" && bigendian="yes"
393 check_define "__ARMEB__" && bigendian="yes"
394 check_define "__MIPSEB__" && bigendian="yes"
0dcebdf4
JA
395fi
396
397
67bf9823
JA
398echo "Operating system $targetos"
399echo "CPU $cpu"
0dcebdf4 400echo "Big endian $bigendian"
67bf9823 401echo "Compiler $cc"
1a17cfdb 402echo "Cross compile $cross_compile"
67bf9823
JA
403echo
404
d2aeedb9
JA
405##########################################
406# See if we need to build a static build
407if test "$build_static" = "yes" ; then
408 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
409 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
410else
411 build_static="no"
412fi
413echo "Static build $build_static"
414
67bf9823
JA
415##########################################
416# check for wordsize
417wordsize="0"
418cat > $TMPC <<EOF
142429e5
AC
419#include <limits.h>
420#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
67bf9823
JA
421int main(void)
422{
142429e5 423 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
67bf9823
JA
424 return 0;
425}
426EOF
142429e5
AC
427if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
428 wordsize="32"
429elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
430 wordsize="64"
431else
432 fatal "Unknown wordsize"
67bf9823
JA
433fi
434echo "Wordsize $wordsize"
435
a9bca4aa
JA
436##########################################
437# zlib probe
438zlib="no"
439cat > $TMPC <<EOF
e0186b6f 440#include <zlib.h>
a9bca4aa
JA
441int main(void)
442{
443 z_stream stream;
444 if (inflateInit(&stream) != Z_OK)
445 return 1;
446 return 0;
447}
448EOF
449if compile_prog "" "-lz" "zlib" ; then
450 zlib=yes
451 LIBS="-lz $LIBS"
a9bca4aa
JA
452fi
453echo "zlib $zlib"
454
67bf9823
JA
455##########################################
456# linux-aio probe
457libaio="no"
458cat > $TMPC <<EOF
459#include <libaio.h>
460#include <stddef.h>
461int main(void)
462{
463 io_setup(0, NULL);
464 return 0;
465}
466EOF
467if compile_prog "" "-laio" "libaio" ; then
468 libaio=yes
469 LIBS="-laio $LIBS"
470else
471 if test "$libaio" = "yes" ; then
c55d728b 472 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
67bf9823
JA
473 fi
474 libaio=no
475fi
476echo "Linux AIO support $libaio"
477
478##########################################
479# posix aio probe
480posix_aio="no"
481posix_aio_lrt="no"
482cat > $TMPC <<EOF
483#include <aio.h>
484int main(void)
485{
486 struct aiocb cb;
487 aio_read(&cb);
488 return 0;
489}
490EOF
491if compile_prog "" "" "posixaio" ; then
492 posix_aio="yes"
493elif compile_prog "" "-lrt" "posixaio"; then
494 posix_aio="yes"
495 posix_aio_lrt="yes"
496 LIBS="-lrt $LIBS"
497fi
498echo "POSIX AIO support $posix_aio"
499echo "POSIX AIO support needs -lrt $posix_aio_lrt"
500
501##########################################
502# posix aio fsync probe
503posix_aio_fsync="no"
504if test "$posix_aio" = "yes" ; then
505 cat > $TMPC <<EOF
506#include <fcntl.h>
507#include <aio.h>
508int main(void)
509{
510 struct aiocb cb;
511 return aio_fsync(O_SYNC, &cb);
512 return 0;
513}
514EOF
515 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
516 posix_aio_fsync=yes
517 fi
518fi
519echo "POSIX AIO fsync $posix_aio_fsync"
520
521##########################################
522# solaris aio probe
523solaris_aio="no"
524cat > $TMPC <<EOF
525#include <sys/types.h>
526#include <sys/asynch.h>
527#include <unistd.h>
528int main(void)
529{
530 aio_result_t res;
531 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
532 return 0;
533}
534EOF
535if compile_prog "" "-laio" "solarisaio" ; then
536 solaris_aio=yes
537 LIBS="-laio $LIBS"
538fi
539echo "Solaris AIO support $solaris_aio"
540
541##########################################
542# __sync_fetch_and_and test
543sfaa="no"
544cat > $TMPC << EOF
545static int sfaa(int *ptr)
546{
9c639a76 547 return __sync_fetch_and_add(ptr, 0);
67bf9823
JA
548}
549
550int main(int argc, char **argv)
551{
552 int val = 42;
553 sfaa(&val);
554 return val;
555}
556EOF
557if compile_prog "" "" "__sync_fetch_and_add()" ; then
558 sfaa="yes"
559fi
9c639a76 560echo "__sync_fetch_and_add $sfaa"
67bf9823
JA
561
562##########################################
563# libverbs probe
564libverbs="no"
565cat > $TMPC << EOF
566#include <stdio.h>
567#include <infiniband/arch.h>
568int main(int argc, char **argv)
569{
570 struct ibv_pd *pd = ibv_alloc_pd(NULL);
571 return 0;
572}
573EOF
574if compile_prog "" "-libverbs" "libverbs" ; then
575 libverbs="yes"
576 LIBS="-libverbs $LIBS"
577fi
578echo "libverbs $libverbs"
579
580##########################################
581# rdmacm probe
582rdmacm="no"
583cat > $TMPC << EOF
584#include <stdio.h>
585#include <rdma/rdma_cma.h>
586int main(int argc, char **argv)
587{
588 rdma_destroy_qp(NULL);
589 return 0;
590}
591EOF
592if compile_prog "" "-lrdmacm" "rdma"; then
593 rdmacm="yes"
594 LIBS="-lrdmacm $LIBS"
595fi
596echo "rdmacm $rdmacm"
597
598##########################################
599# Linux fallocate probe
600linux_fallocate="no"
601cat > $TMPC << EOF
602#include <stdio.h>
aa6738a5 603#include <fcntl.h>
67bf9823
JA
604#include <linux/falloc.h>
605int main(int argc, char **argv)
606{
607 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
608 return r;
609}
610EOF
611if compile_prog "" "" "linux_fallocate"; then
612 linux_fallocate="yes"
613fi
614echo "Linux fallocate $linux_fallocate"
615
616##########################################
617# POSIX fadvise probe
618posix_fadvise="no"
619cat > $TMPC << EOF
620#include <stdio.h>
621#include <fcntl.h>
622int main(int argc, char **argv)
623{
624 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
625 return r;
626}
627EOF
628if compile_prog "" "" "posix_fadvise"; then
629 posix_fadvise="yes"
630fi
631echo "POSIX fadvise $posix_fadvise"
632
633##########################################
634# POSIX fallocate probe
635posix_fallocate="no"
636cat > $TMPC << EOF
637#include <stdio.h>
638#include <fcntl.h>
639int main(int argc, char **argv)
640{
641 int r = posix_fallocate(0, 0, 1024);
642 return r;
643}
644EOF
645if compile_prog "" "" "posix_fallocate"; then
646 posix_fallocate="yes"
647fi
648echo "POSIX fallocate $posix_fallocate"
649
650##########################################
651# sched_set/getaffinity 2 or 3 argument test
652linux_2arg_affinity="no"
653linux_3arg_affinity="no"
654cat > $TMPC << EOF
67bf9823
JA
655#include <sched.h>
656int main(int argc, char **argv)
657{
658 cpu_set_t mask;
659 return sched_setaffinity(0, sizeof(mask), &mask);
660}
661EOF
662if compile_prog "" "" "sched_setaffinity(,,)"; then
663 linux_3arg_affinity="yes"
664else
665 cat > $TMPC << EOF
67bf9823
JA
666#include <sched.h>
667int main(int argc, char **argv)
668{
669 cpu_set_t mask;
670 return sched_setaffinity(0, &mask);
671}
672EOF
673 if compile_prog "" "" "sched_setaffinity(,)"; then
674 linux_2arg_affinity="yes"
675 fi
676fi
677echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
678echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
679
680##########################################
681# clock_gettime probe
682clock_gettime="no"
683cat > $TMPC << EOF
684#include <stdio.h>
685#include <time.h>
686int main(int argc, char **argv)
687{
688 return clock_gettime(0, NULL);
689}
690EOF
691if compile_prog "" "" "clock_gettime"; then
692 clock_gettime="yes"
693elif compile_prog "" "-lrt" "clock_gettime"; then
694 clock_gettime="yes"
695 LIBS="-lrt $LIBS"
696fi
697echo "clock_gettime $clock_gettime"
698
699##########################################
700# CLOCK_MONOTONIC probe
701clock_monotonic="no"
702if test "$clock_gettime" = "yes" ; then
703 cat > $TMPC << EOF
704#include <stdio.h>
705#include <time.h>
706int main(int argc, char **argv)
707{
708 return clock_gettime(CLOCK_MONOTONIC, NULL);
709}
710EOF
711 if compile_prog "" "$LIBS" "clock monotonic"; then
712 clock_monotonic="yes"
713 fi
714fi
715echo "CLOCK_MONOTONIC $clock_monotonic"
716
717##########################################
718# CLOCK_MONOTONIC_PRECISE probe
719clock_monotonic_precise="no"
720if test "$clock_gettime" = "yes" ; then
721 cat > $TMPC << EOF
722#include <stdio.h>
723#include <time.h>
724int main(int argc, char **argv)
725{
726 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
727}
728EOF
729 if compile_prog "" "$LIBS" "clock monotonic precise"; then
730 clock_monotonic_precise="yes"
731 fi
732fi
733echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
734
735##########################################
736# gettimeofday() probe
737gettimeofday="no"
738cat > $TMPC << EOF
739#include <sys/time.h>
740#include <stdio.h>
741int main(int argc, char **argv)
742{
743 struct timeval tv;
744 return gettimeofday(&tv, NULL);
745}
746EOF
747if compile_prog "" "" "gettimeofday"; then
748 gettimeofday="yes"
749fi
750echo "gettimeofday $gettimeofday"
751
752##########################################
753# fdatasync() probe
754fdatasync="no"
755cat > $TMPC << EOF
756#include <stdio.h>
757#include <unistd.h>
758int main(int argc, char **argv)
759{
760 return fdatasync(0);
761}
762EOF
763if compile_prog "" "" "fdatasync"; then
764 fdatasync="yes"
765fi
766echo "fdatasync $fdatasync"
767
768##########################################
769# sync_file_range() probe
770sync_file_range="no"
771cat > $TMPC << EOF
772#include <stdio.h>
773#include <unistd.h>
67bf9823
JA
774#include <fcntl.h>
775#include <linux/fs.h>
776int main(int argc, char **argv)
777{
778 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
779 SYNC_FILE_RANGE_WAIT_AFTER;
780 return sync_file_range(0, 0, 0, flags);
781}
782EOF
783if compile_prog "" "" "sync_file_range"; then
784 sync_file_range="yes"
785fi
786echo "sync_file_range $sync_file_range"
787
788##########################################
789# ext4 move extent probe
790ext4_me="no"
791cat > $TMPC << EOF
792#include <fcntl.h>
793#include <sys/ioctl.h>
794int main(int argc, char **argv)
795{
796 struct move_extent me;
797 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
798}
799EOF
c7165b8d
JA
800if compile_prog "" "" "ext4 move extent" ; then
801 ext4_me="yes"
802elif test $targetos = "Linux" ; then
803 # On Linux, just default to it on and let it error at runtime if we really
804 # don't have it. None of my updated systems have it defined, but it does
805 # work. Takes a while to bubble back.
67bf9823
JA
806 ext4_me="yes"
807fi
808echo "EXT4 move extent $ext4_me"
809
810##########################################
811# splice probe
812linux_splice="no"
813cat > $TMPC << EOF
67bf9823
JA
814#include <stdio.h>
815#include <fcntl.h>
816int main(int argc, char **argv)
817{
818 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
819}
820EOF
821if compile_prog "" "" "linux splice"; then
822 linux_splice="yes"
823fi
824echo "Linux splice(2) $linux_splice"
825
826##########################################
827# GUASI probe
828guasi="no"
829cat > $TMPC << EOF
830#include <guasi.h>
831#include <guasi_syscalls.h>
832int main(int argc, char **argv)
833{
834 guasi_t ctx = guasi_create(0, 0, 0);
835 return 0;
836}
837EOF
838if compile_prog "" "" "guasi"; then
839 guasi="yes"
840fi
841echo "GUASI $guasi"
842
843##########################################
844# fusion-aw probe
845fusion_aw="no"
846cat > $TMPC << EOF
b2c77c25 847#include <nvm/nvm_primitives.h>
67bf9823
JA
848int main(int argc, char **argv)
849{
b2c77c25
SK
850 nvm_version_t ver_info;
851 nvm_handle_t handle;
852
853 handle = nvm_get_handle(0, &ver_info);
854 return nvm_atomic_write(handle, 0, 0, 0);
67bf9823
JA
855}
856EOF
b2c77c25
SK
857if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
858 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
67bf9823
JA
859 fusion_aw="yes"
860fi
861echo "Fusion-io atomic engine $fusion_aw"
862
863##########################################
864# libnuma probe
865libnuma="no"
866cat > $TMPC << EOF
867#include <numa.h>
868int main(int argc, char **argv)
869{
870 return numa_available();
871}
872EOF
44462517 873if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
67bf9823
JA
874 libnuma="yes"
875 LIBS="-lnuma $LIBS"
876fi
877echo "libnuma $libnuma"
878
50206d9b
JA
879##########################################
880# libnuma 2.x version API
881if test "$libnuma" = "yes" ; then
882libnuma_v2="no"
883cat > $TMPC << EOF
884#include <numa.h>
885int main(int argc, char **argv)
886{
887 struct bitmask *mask = numa_parse_nodestring(NULL);
888 return 0;
889}
890EOF
891if compile_prog "" "" "libnuma api"; then
892 libnuma_v2="yes"
893fi
894echo "libnuma v2 $libnuma_v2"
895fi
896
67bf9823
JA
897##########################################
898# strsep() probe
899strsep="no"
900cat > $TMPC << EOF
901#include <string.h>
902int main(int argc, char **argv)
903{
904 strsep(NULL, NULL);
905 return 0;
906}
907EOF
908if compile_prog "" "" "strsep"; then
909 strsep="yes"
910fi
911echo "strsep $strsep"
912
9ad8da82
JA
913##########################################
914# strcasestr() probe
915strcasestr="no"
916cat > $TMPC << EOF
917#include <string.h>
918int main(int argc, char **argv)
919{
aa6738a5 920 return strcasestr(argv[0], argv[1]) != NULL;
9ad8da82
JA
921}
922EOF
923if compile_prog "" "" "strcasestr"; then
924 strcasestr="yes"
925fi
926echo "strcasestr $strcasestr"
927
67bf9823
JA
928##########################################
929# getopt_long_only() probe
930getopt_long_only="no"
931cat > $TMPC << EOF
932#include <unistd.h>
933#include <stdio.h>
aa6738a5 934#include <getopt.h>
67bf9823
JA
935int main(int argc, char **argv)
936{
937 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
938 return c;
939}
940EOF
941if compile_prog "" "" "getopt_long_only"; then
942 getopt_long_only="yes"
943fi
944echo "getopt_long_only() $getopt_long_only"
945
946##########################################
947# inet_aton() probe
948inet_aton="no"
949cat > $TMPC << EOF
950#include <sys/socket.h>
951#include <arpa/inet.h>
952#include <stdio.h>
953int main(int argc, char **argv)
954{
955 struct in_addr in;
956 return inet_aton(NULL, &in);
957}
958EOF
959if compile_prog "" "" "inet_aton"; then
960 inet_aton="yes"
961fi
962echo "inet_aton $inet_aton"
963
964##########################################
965# socklen_t probe
966socklen_t="no"
967cat > $TMPC << EOF
f6482613 968#include <sys/socket.h>
67bf9823
JA
969int main(int argc, char **argv)
970{
971 socklen_t len = 0;
972 return len;
973}
974EOF
975if compile_prog "" "" "socklen_t"; then
976 socklen_t="yes"
977fi
978echo "socklen_t $socklen_t"
979
980##########################################
981# Whether or not __thread is supported for TLS
982tls_thread="no"
983cat > $TMPC << EOF
984#include <stdio.h>
aa6738a5 985static __thread int ret;
67bf9823
JA
986int main(int argc, char **argv)
987{
988 return ret;
989}
990EOF
991if compile_prog "" "" "__thread"; then
992 tls_thread="yes"
993fi
994echo "__thread $tls_thread"
995
91f94d5b 996##########################################
2639f056 997# Check if we have required gtk/glib support for gfio
ebec2094
JA
998gfio="no"
999if test "$gfio_check" = "yes" ; then
91f94d5b
JA
1000 cat > $TMPC << EOF
1001#include <glib.h>
1002#include <cairo.h>
1003#include <gtk/gtk.h>
1004int main(void)
1005{
1006 gdk_threads_enter();
91f94d5b 1007 gdk_threads_leave();
b7a99316
JA
1008
1009 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
91f94d5b
JA
1010}
1011EOF
1012GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
86719845
JA
1013ORG_LDFLAGS=$LDFLAGS
1014LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
91f94d5b
JA
1015if test "$?" != "0" ; then
1016 echo "configure: gtk and gthread not found"
1017 exit 1
1018fi
1019GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1020if test "$?" != "0" ; then
1021 echo "configure: gtk and gthread not found"
1022 exit 1
1023fi
b7a99316
JA
1024if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1025 r=$($TMPE)
1026 if test "$r" != "0" ; then
1027 gfio="yes"
86719845 1028 GFIO_LIBS="$LIBS $GTK_LIBS"
b7a99316
JA
1029 CFLAGS="$CFLAGS $GTK_CFLAGS"
1030 else
1031 echo "GTK found, but need version 2.18 or higher"
1032 gfio="no"
1033 fi
91f94d5b
JA
1034else
1035 echo "Please install gtk and gdk libraries"
1036 gfio="no"
1037fi
86719845 1038LDFLAGS=$ORG_LDFLAGS
91f94d5b
JA
1039fi
1040
ebec2094
JA
1041if test "$gfio_check" = "yes" ; then
1042 echo "gtk 2.18 or higher $gfio"
1043fi
91f94d5b 1044
44404c5a
JA
1045# Check whether we have getrusage(RUSAGE_THREAD)
1046rusage_thread="no"
1047cat > $TMPC << EOF
1048#include <sys/time.h>
1049#include <sys/resource.h>
1050int main(int argc, char **argv)
1051{
1052 struct rusage ru;
1053 getrusage(RUSAGE_THREAD, &ru);
1054 return 0;
1055}
1056EOF
1057if compile_prog "" "" "RUSAGE_THREAD"; then
1058 rusage_thread="yes"
1059fi
1060echo "RUSAGE_THREAD $rusage_thread"
1061
7e09a9f1
JA
1062##########################################
1063# Check whether we have SCHED_IDLE
1064sched_idle="no"
1065cat > $TMPC << EOF
1066#include <sched.h>
1067int main(int argc, char **argv)
1068{
1069 struct sched_param p;
1070 return sched_setscheduler(0, SCHED_IDLE, &p);
1071}
1072EOF
1073if compile_prog "" "" "SCHED_IDLE"; then
1074 sched_idle="yes"
1075fi
1076echo "SCHED_IDLE $sched_idle"
1077
1eafa37a
JA
1078##########################################
1079# Check whether we have TCP_NODELAY
1080tcp_nodelay="no"
1081cat > $TMPC << EOF
1082#include <stdio.h>
1083#include <sys/types.h>
1084#include <sys/socket.h>
1085#include <netinet/tcp.h>
1086int main(int argc, char **argv)
1087{
1088 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1089}
1090EOF
1091if compile_prog "" "" "TCP_NODELAY"; then
1092 tcp_nodelay="yes"
1093fi
1094echo "TCP_NODELAY $tcp_nodelay"
1095
1008602c
JA
1096##########################################
1097# Check whether we have SO_SNDBUF
1098window_size="no"
1099cat > $TMPC << EOF
1100#include <stdio.h>
1101#include <sys/types.h>
1102#include <sys/socket.h>
1103#include <netinet/tcp.h>
1104int main(int argc, char **argv)
1105{
1106 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1107 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1108}
1109EOF
1110if compile_prog "" "" "SO_SNDBUF"; then
1111 window_size="yes"
1112fi
1113echo "Net engine window_size $window_size"
1114
e5f34d95
JA
1115##########################################
1116# Check whether we have TCP_MAXSEG
1117mss="no"
1118cat > $TMPC << EOF
1119#include <stdio.h>
1120#include <sys/types.h>
1121#include <sys/socket.h>
1122#include <netinet/tcp.h>
1123#include <arpa/inet.h>
1124#include <netinet/in.h>
1125int main(int argc, char **argv)
1126{
1127 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1128}
1129EOF
1130if compile_prog "" "" "TCP_MAXSEG"; then
1131 mss="yes"
1132fi
1133echo "TCP_MAXSEG $mss"
1134
38b9354a
JA
1135##########################################
1136# Check whether we have RLIMIT_MEMLOCK
1137rlimit_memlock="no"
1138cat > $TMPC << EOF
1139#include <sys/time.h>
1140#include <sys/resource.h>
1141int main(int argc, char **argv)
1142{
1143 struct rlimit rl;
1144 return getrlimit(RLIMIT_MEMLOCK, &rl);
1145}
1146EOF
1147if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1148 rlimit_memlock="yes"
1149fi
1150echo "RLIMIT_MEMLOCK $rlimit_memlock"
1151
07fc0acd
JA
1152##########################################
1153# Check whether we have pwritev/preadv
1154pwritev="no"
1155cat > $TMPC << EOF
1156#include <stdio.h>
1157#include <sys/uio.h>
1158int main(int argc, char **argv)
1159{
1160 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1161}
1162EOF
1163if compile_prog "" "" "pwritev"; then
1164 pwritev="yes"
1165fi
1166echo "pwritev/preadv $pwritev"
1167
ecad55e9
JA
1168##########################################
1169# Check whether we have the required functions for ipv6
1170ipv6="no"
1171cat > $TMPC << EOF
1172#include <sys/types.h>
1173#include <sys/socket.h>
d219028d 1174#include <netinet/in.h>
ecad55e9
JA
1175#include <netdb.h>
1176#include <stdio.h>
1177int main(int argc, char **argv)
1178{
1179 struct addrinfo hints;
1180 struct in6_addr addr;
1181 int ret;
1182
1183 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1184 freeaddrinfo(NULL);
1185 printf("%s\n", gai_strerror(ret));
1186 addr = in6addr_any;
1187 return 0;
1188}
1189EOF
1190if compile_prog "" "" "ipv6"; then
1191 ipv6="yes"
1192fi
1193echo "IPv6 helpers $ipv6"
07fc0acd 1194
fc5c0345
DG
1195##########################################
1196# check for rbd
1197rbd="no"
1198cat > $TMPC << EOF
1199#include <rbd/librbd.h>
1200
1201int main(int argc, char **argv)
1202{
1203
1204 rados_t cluster;
1205 rados_ioctx_t io_ctx;
1206 const char pool[] = "rbd";
1207
1208 int major, minor, extra;
1209 rbd_version(&major, &minor, &extra);
1210
1211 rados_ioctx_create(cluster, pool, &io_ctx);
1212 return 0;
1213}
1214EOF
ce18290e 1215if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
fc5c0345
DG
1216 LIBS="-lrbd -lrados $LIBS"
1217 rbd="yes"
1218fi
1219echo "Rados Block Device engine $rbd"
1220
903b2812
JA
1221##########################################
1222# check for rbd_invaidate_cache()
1223rbd_inval="no"
1224if test "$rbd" = "yes"; then
1225cat > $TMPC << EOF
1226#include <rbd/librbd.h>
1227
1228int main(int argc, char **argv)
1229{
1230 rbd_image_t image;
1231
1232 return rbd_invalidate_cache(image);
1233}
1234EOF
1235if compile_prog "" "-lrbd -lrados" "rbd"; then
1236 rbd_inval="yes"
1237fi
1238echo "rbd_invalidate_cache $rbd_inval"
1239fi
1240
2e802282
JA
1241##########################################
1242# Check whether we have setvbuf
1243setvbuf="no"
1244cat > $TMPC << EOF
1245#include <stdio.h>
1246int main(int argc, char **argv)
1247{
1248 FILE *f = NULL;
1249 char buf[80];
1250 setvbuf(f, buf, _IOFBF, sizeof(buf));
1251 return 0;
1252}
1253EOF
1254if compile_prog "" "" "setvbuf"; then
1255 setvbuf="yes"
1256fi
1257echo "setvbuf $setvbuf"
fc5c0345 1258
6e7d7dfb 1259# check for gfapi
1260gfapi="no"
1261cat > $TMPC << EOF
1262#include <glusterfs/api/glfs.h>
1263
1264int main(int argc, char **argv)
1265{
1266
1267 glfs_t *g = glfs_new("foo");
1268
1269 return 0;
1270}
1271EOF
ce18290e 1272if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
6e7d7dfb 1273 LIBS="-lgfapi -lglusterfs $LIBS"
1274 gfapi="yes"
1275fi
6fa14b99 1276 echo "Gluster API engine $gfapi"
6e7d7dfb 1277
6fa14b99 1278##########################################
1279# check for gfapi fadvise support
6876c98c 1280if test "$gfapi" = "yes" ; then
6fa14b99 1281gf_fadvise="no"
1282cat > $TMPC << EOF
1283#include <glusterfs/api/glfs.h>
1284
1285int main(int argc, char **argv)
1286{
1287 struct glfs_fd *fd;
1288 int ret = glfs_fadvise(fd, 0, 0, 1);
1289
1290 return 0;
1291}
1292EOF
6fa14b99 1293if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
1294 gf_fadvise="yes"
1295fi
1296echo "Gluster API use fadvise $gf_fadvise"
6876c98c
JA
1297fi
1298
1299##########################################
1300# check for gfapi trim support
1301gf_trim="no"
1302if test "$gfapi" = "yes" ; then
1303cat > $TMPC << EOF
1304#include <glusterfs/api/glfs.h>
1305
1306int main(int argc, char **argv)
1307{
1308 return glfs_discard_async(NULL, 0, 0);
1309}
1310EOF
1311if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
1312 gf_trim="yes"
1313fi
1314echo "Gluster API trim support $gf_trim"
1315fi
fc5c0345 1316
81795ce3
CE
1317##########################################
1318# Check if we support stckf on s390
1319s390_z196_facilities="no"
1320cat > $TMPC << EOF
1321#define STFLE_BITS_Z196 45 /* various z196 facilities ... */
1322int main(int argc, char **argv)
1323{
1324 /* We want just 1 double word to be returned. */
1325 register unsigned long reg0 asm("0") = 0;
1326 unsigned long stfle_bits;
1327 asm volatile(".machine push" "\n\t"
1328 ".machine \"z9-109\"" "\n\t"
1329 "stfle %0" "\n\t"
1330 ".machine pop" "\n"
1331 : "=QS" (stfle_bits), "+d" (reg0)
1332 : : "cc");
1333
1334 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
1335 return 0;
1336 else
1337 return -1;
1338}
1339EOF
1340if compile_prog "" "" "s390_z196_facilities"; then
1341 $TMPE
1342 if [[ $? -eq 0 ]]; then
1343 s390_z196_facilities="yes"
1344 fi
1345fi
1346echo "s390_z196_facilities $s390_z196_facilities"
1b10477b
MM
1347
1348##########################################
1349# Check if we have required environment variables configured for libhdfs
1350if test "$libhdfs" = "yes" ; then
1351 hdfs_conf_error=0
1352 if test "$JAVA_HOME" = "" ; then
1353 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
1354 hdfs_conf_error=1
1355 fi
1356 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
1357 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
1358 hdfs_conf_error=1
1359 fi
1360 if test "$FIO_LIBHDFS_LIB" = "" ; then
1361 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
1362 hdfs_conf_error=1
1363 fi
1364 if test "$hdfs_conf_error" = "1" ; then
1365 exit 1
1366 fi
1367fi
1368echo "HDFS engine $libhdfs"
1369
b470a02c
SC
1370# Check if we have lex/yacc available
1371yacc="no"
e7b2c7a3 1372yacc_is_bison="no"
b470a02c
SC
1373lex="no"
1374arith="no"
cf6dd80e 1375if test "$targetos" != "SunOS" ; then
e7b2c7a3 1376LEX=$(which lex 2> /dev/null)
b470a02c
SC
1377if test -x "$LEX" ; then
1378 lex="yes"
1379fi
7e0049e9 1380YACC=$(which bison 2> /dev/null)
b470a02c
SC
1381if test -x "$YACC" ; then
1382 yacc="yes"
7e0049e9 1383 yacc_is_bison="yes"
e7b2c7a3 1384else
7e0049e9 1385 YACC=$(which yacc 2> /dev/null)
e7b2c7a3
JA
1386 if test -x "$YACC" ; then
1387 yacc="yes"
e7b2c7a3 1388 fi
b470a02c
SC
1389fi
1390if test "$yacc" = "yes" && test "$lex" = "yes" ; then
1391 arith="yes"
1392fi
1393
1394if test "$arith" = "yes" ; then
1395cat > $TMPC << EOF
1396extern int yywrap(void);
1397
1398int main(int argc, char **argv)
1399{
1400 yywrap();
1401 return 0;
1402}
1403EOF
719cda03
JA
1404if compile_prog "" "-ll" "lex"; then
1405 LIBS="-ll $LIBS"
b470a02c
SC
1406else
1407 arith="no"
1408fi
1409fi
cf6dd80e 1410fi
b470a02c
SC
1411
1412echo "lex/yacc for arithmetic $arith"
1413
67bf9823
JA
1414#############################################################################
1415
67bf9823 1416if test "$wordsize" = "64" ; then
4feafb1e 1417 output_sym "CONFIG_64BIT"
67bf9823 1418elif test "$wordsize" = "32" ; then
4feafb1e 1419 output_sym "CONFIG_32BIT"
67bf9823 1420else
d7145a78 1421 fatal "Unknown wordsize!"
67bf9823 1422fi
0dcebdf4 1423if test "$bigendian" = "yes" ; then
4feafb1e 1424 output_sym "CONFIG_BIG_ENDIAN"
0dcebdf4 1425else
4feafb1e 1426 output_sym "CONFIG_LITTLE_ENDIAN"
0dcebdf4 1427fi
3989b143
JA
1428if test "$zlib" = "yes" ; then
1429 output_sym "CONFIG_ZLIB"
1430fi
67bf9823 1431if test "$libaio" = "yes" ; then
4feafb1e 1432 output_sym "CONFIG_LIBAIO"
67bf9823
JA
1433fi
1434if test "$posix_aio" = "yes" ; then
4feafb1e 1435 output_sym "CONFIG_POSIXAIO"
67bf9823
JA
1436fi
1437if test "$posix_aio_fsync" = "yes" ; then
4feafb1e 1438 output_sym "CONFIG_POSIXAIO_FSYNC"
67bf9823
JA
1439fi
1440if test "$linux_fallocate" = "yes" ; then
4feafb1e 1441 output_sym "CONFIG_LINUX_FALLOCATE"
67bf9823
JA
1442fi
1443if test "$posix_fallocate" = "yes" ; then
4feafb1e 1444 output_sym "CONFIG_POSIX_FALLOCATE"
67bf9823
JA
1445fi
1446if test "$fdatasync" = "yes" ; then
4feafb1e 1447 output_sym "CONFIG_FDATASYNC"
67bf9823
JA
1448fi
1449if test "$sync_file_range" = "yes" ; then
4feafb1e 1450 output_sym "CONFIG_SYNC_FILE_RANGE"
67bf9823
JA
1451fi
1452if test "$sfaa" = "yes" ; then
4feafb1e 1453 output_sym "CONFIG_SFAA"
67bf9823 1454fi
954cd73a 1455if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
4feafb1e 1456 output_sym "CONFIG_RDMA"
67bf9823
JA
1457fi
1458if test "$clock_gettime" = "yes" ; then
4feafb1e 1459 output_sym "CONFIG_CLOCK_GETTIME"
67bf9823
JA
1460fi
1461if test "$clock_monotonic" = "yes" ; then
4feafb1e 1462 output_sym "CONFIG_CLOCK_MONOTONIC"
67bf9823
JA
1463fi
1464if test "$clock_monotonic_precise" = "yes" ; then
4feafb1e 1465 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
67bf9823
JA
1466fi
1467if test "$gettimeofday" = "yes" ; then
4feafb1e 1468 output_sym "CONFIG_GETTIMEOFDAY"
67bf9823
JA
1469fi
1470if test "$posix_fadvise" = "yes" ; then
4feafb1e 1471 output_sym "CONFIG_POSIX_FADVISE"
67bf9823
JA
1472fi
1473if test "$linux_3arg_affinity" = "yes" ; then
4feafb1e 1474 output_sym "CONFIG_3ARG_AFFINITY"
67bf9823 1475elif test "$linux_2arg_affinity" = "yes" ; then
4feafb1e 1476 output_sym "CONFIG_2ARG_AFFINITY"
67bf9823
JA
1477fi
1478if test "$strsep" = "yes" ; then
4feafb1e 1479 output_sym "CONFIG_STRSEP"
67bf9823 1480fi
9ad8da82
JA
1481if test "$strcasestr" = "yes" ; then
1482 output_sym "CONFIG_STRCASESTR"
1483fi
67bf9823 1484if test "$getopt_long_only" = "yes" ; then
4feafb1e 1485 output_sym "CONFIG_GETOPT_LONG_ONLY"
67bf9823
JA
1486fi
1487if test "$inet_aton" = "yes" ; then
4feafb1e 1488 output_sym "CONFIG_INET_ATON"
67bf9823
JA
1489fi
1490if test "$socklen_t" = "yes" ; then
4feafb1e 1491 output_sym "CONFIG_SOCKLEN_T"
67bf9823
JA
1492fi
1493if test "$ext4_me" = "yes" ; then
4feafb1e 1494 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
67bf9823
JA
1495fi
1496if test "$linux_splice" = "yes" ; then
4feafb1e 1497 output_sym "CONFIG_LINUX_SPLICE"
67bf9823
JA
1498fi
1499if test "$guasi" = "yes" ; then
4feafb1e 1500 output_sym "CONFIG_GUASI"
67bf9823
JA
1501fi
1502if test "$fusion_aw" = "yes" ; then
4feafb1e 1503 output_sym "CONFIG_FUSION_AW"
67bf9823 1504fi
50206d9b 1505if test "$libnuma_v2" = "yes" ; then
4feafb1e 1506 output_sym "CONFIG_LIBNUMA"
67bf9823
JA
1507fi
1508if test "$solaris_aio" = "yes" ; then
4feafb1e 1509 output_sym "CONFIG_SOLARISAIO"
67bf9823
JA
1510fi
1511if test "$tls_thread" = "yes" ; then
4feafb1e 1512 output_sym "CONFIG_TLS_THREAD"
67bf9823 1513fi
44404c5a 1514if test "$rusage_thread" = "yes" ; then
4feafb1e 1515 output_sym "CONFIG_RUSAGE_THREAD"
67bf9823 1516fi
91f94d5b
JA
1517if test "$gfio" = "yes" ; then
1518 echo "CONFIG_GFIO=y" >> $config_host_mak
1519fi
c8931876
JA
1520if test "$esx" = "yes" ; then
1521 output_sym "CONFIG_ESX"
1522 output_sym "CONFIG_NO_SHM"
1523fi
7e09a9f1
JA
1524if test "$sched_idle" = "yes" ; then
1525 output_sym "CONFIG_SCHED_IDLE"
1526fi
1eafa37a
JA
1527if test "$tcp_nodelay" = "yes" ; then
1528 output_sym "CONFIG_TCP_NODELAY"
1529fi
1008602c
JA
1530if test "$window_size" = "yes" ; then
1531 output_sym "CONFIG_NET_WINDOWSIZE"
1532fi
e5f34d95
JA
1533if test "$mss" = "yes" ; then
1534 output_sym "CONFIG_NET_MSS"
1535fi
38b9354a
JA
1536if test "$rlimit_memlock" = "yes" ; then
1537 output_sym "CONFIG_RLIMIT_MEMLOCK"
1538fi
07fc0acd
JA
1539if test "$pwritev" = "yes" ; then
1540 output_sym "CONFIG_PWRITEV"
1541fi
ecad55e9
JA
1542if test "$ipv6" = "yes" ; then
1543 output_sym "CONFIG_IPV6"
1544fi
fc5c0345
DG
1545if test "$rbd" = "yes" ; then
1546 output_sym "CONFIG_RBD"
1547fi
903b2812
JA
1548if test "$rbd_inval" = "yes" ; then
1549 output_sym "CONFIG_RBD_INVAL"
1550fi
2e802282
JA
1551if test "$setvbuf" = "yes" ; then
1552 output_sym "CONFIG_SETVBUF"
1553fi
81795ce3
CE
1554if test "$s390_z196_facilities" = "yes" ; then
1555 output_sym "CONFIG_S390_Z196_FACILITIES"
1556 CFLAGS="$CFLAGS -march=z9-109"
1557fi
6e7d7dfb 1558if test "$gfapi" = "yes" ; then
1559 output_sym "CONFIG_GFAPI"
1560fi
6fa14b99 1561if test "$gf_fadvise" = "yes" ; then
1562 output_sym "CONFIG_GF_FADVISE"
1563fi
6876c98c
JA
1564if test "$gf_trim" = "yes" ; then
1565 output_sym "CONFIG_GF_TRIM"
1566fi
1b10477b
MM
1567if test "$libhdfs" = "yes" ; then
1568 output_sym "CONFIG_LIBHDFS"
1569fi
b470a02c
SC
1570if test "$arith" = "yes" ; then
1571 output_sym "CONFIG_ARITHMETIC"
e7b2c7a3
JA
1572 if test "$yacc_is_bison" = "yes" ; then
1573 echo "YACC=$YACC -y" >> $config_host_mak
1574 else
1575 echo "YACC=$YACC" >> $config_host_mak
1576 fi
b470a02c 1577fi
67bf9823 1578
605cf82e
JA
1579if test "$zlib" = "no" ; then
1580 echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
1581fi
1582
67bf9823 1583echo "LIBS+=$LIBS" >> $config_host_mak
86719845 1584echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
91f94d5b 1585echo "CFLAGS+=$CFLAGS" >> $config_host_mak
d2aeedb9 1586echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
67bf9823 1587echo "CC=$cc" >> $config_host_mak
af4862b3 1588echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak