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