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