blob: 98af5ff38bd3500aec82086c1cd6c37ebb018013 [file] [log] [blame]
Jens Axboe67bf9822013-01-10 11:23:19 +01001#!/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"
Jens Axboe4feafb12013-01-24 23:07:55 -070027config_host_h="config-host.h"
28
29rm -rf $config_host_mak
30rm -rf $config_host_h
Jens Axboe67bf9822013-01-10 11:23:19 +010031
Jens Axboed7145a72013-02-11 13:21:54 +010032fatal() {
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
Jens Axboe44404c52013-01-24 14:20:09 -070040# Default CFLAGS
Jens Axboeaf4862b2013-03-29 08:55:32 -060041CFLAGS="-D_GNU_SOURCE -include config-host.h"
42BUILD_CFLAGS=""
Jens Axboe67bf9822013-01-10 11:23:19 +010043
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
Jens Axboe7560fe72013-01-25 08:52:28 -070051# 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
Jens Axboe67bf9822013-01-10 11:23:19 +010059do_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."
Jens Axboed7145a72013-02-11 13:21:54 +010081 fatal "You can run configure with --disable-werror to bypass this check."
Jens Axboe67bf9822013-01-10 11:23:19 +010082}
83
84compile_object() {
85 do_cc $CFLAGS -c -o $TMPO $TMPC
86}
87
88compile_prog() {
89 local_cflags="$1"
Jens Axboeadaa46d2013-02-28 22:10:22 +010090 local_ldflags="$2 $LIBS"
Jens Axboe67bf9822013-01-10 11:23:19 +010091 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
Jens Axboec55d7282013-04-12 10:16:43 +020097 packages=$2
Jens Axboe67bf9822013-01-10 11:23:19 +010098
99 echo "ERROR"
100 echo "ERROR: User requested feature $feature"
Jens Axboec55d7282013-04-12 10:16:43 +0200101 if test ! -z "$packages" ; then
102 echo "ERROR: That feature needs $packages installed"
103 fi
Jens Axboe67bf9822013-01-10 11:23:19 +0100104 echo "ERROR: configure was not able to find it"
Jens Axboed7145a72013-02-11 13:21:54 +0100105 fatal "ERROR"
Jens Axboe67bf9822013-01-10 11:23:19 +0100106}
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
Jens Axboe4feafb12013-01-24 23:07:55 -0700125output_sym() {
126 echo "$1=y" >> $config_host_mak
127 echo "#define $1" >> $config_host_h
128}
129
Jens Axboe67bf9822013-01-10 11:23:19 +0100130targetos=""
131cpu=""
132
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100133cross_prefix=${cross_prefix-${CROSS_COMPILE}}
Jens Axboe67bf9822013-01-10 11:23:19 +0100134cc="${CC-${cross_prefix}gcc}"
135
Jens Axboe91f94d52013-01-24 10:25:42 -0700136# default options
Jens Axboe47f44632013-01-24 10:34:14 -0700137show_help="no"
138exit_val=0
Jens Axboe135be492013-01-29 10:09:55 +0100139gfio="no"
Jens Axboe91f94d52013-01-24 10:25:42 -0700140
Jens Axboecb1125b2013-01-23 13:47:54 -0700141# parse options
142for opt do
143 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
144 case "$opt" in
Jens Axboe8b156d82013-02-10 15:48:34 +0100145 --cpu=*) cpu="$optarg"
146 ;;
Jens Axboecb1125b2013-01-23 13:47:54 -0700147 --cc=*) CC="$optarg"
148 ;;
Jens Axboe208e4c82013-01-29 09:26:07 +0100149 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
Jens Axboecb1125b2013-01-23 13:47:54 -0700150 ;;
Jens Axboeb7c12792013-05-01 13:00:26 +0200151 --build-32bit-win) build_32bit_win="yes"
Huadong Liu74097112013-02-05 08:43:14 +0100152 ;;
Jens Axboe91f94d52013-01-24 10:25:42 -0700153 --enable-gfio)
Jens Axboe9db01ef2013-02-07 15:45:39 +0100154 gfio="yes"
Jens Axboe899fab32013-01-29 10:06:30 +0100155 ;;
Jens Axboe827da4f2013-01-24 10:27:26 -0700156 --help)
Jens Axboe47f44632013-01-24 10:34:14 -0700157 show_help="yes"
Jens Axboe827da4f2013-01-24 10:27:26 -0700158 ;;
Jens Axboecb1125b2013-01-23 13:47:54 -0700159 *)
160 echo "Bad option $opt"
Jens Axboe47f44632013-01-24 10:34:14 -0700161 show_help="yes"
162 exit_val=1
Jens Axboecb1125b2013-01-23 13:47:54 -0700163 esac
164done
165
Jens Axboe47f44632013-01-24 10:34:14 -0700166if test "$show_help" = "yes" ; then
Jens Axboe8b156d82013-02-10 15:48:34 +0100167 echo "--cpu= Specify target CPU if auto-detect fails"
Jens Axboeb7a99312013-02-04 12:46:54 +0100168 echo "--cc= Specify compiler to use"
Jens Axboe899fab32013-01-29 10:06:30 +0100169 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
Jens Axboeb7c12792013-05-01 13:00:26 +0200170 echo "--build-32bit-win Enable 32-bit build on Windows"
Jens Axboeb7a99312013-02-04 12:46:54 +0100171 echo "--enable-gfio Enable building of gtk gfio"
172 exit $exit_val
Jens Axboe47f44632013-01-24 10:34:14 -0700173fi
174
Aaron Carroll6d0e9f82013-02-12 09:58:14 +0100175if check_define __ANDROID__ ; then
176 targetos="Android"
177elif check_define __linux__ ; then
Jens Axboe67bf9822013-01-10 11:23:19 +0100178 targetos="Linux"
Jens Axboe67bf9822013-01-10 11:23:19 +0100179elif check_define __OpenBSD__ ; then
180 targetos='OpenBSD'
181elif check_define __sun__ ; then
182 targetos='SunOS'
183else
184 targetos=`uname -s`
185fi
186
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100187echo "# Automatically generated by configure - do not modify" > $config_host_mak
188printf "# Configured with:" >> $config_host_mak
189printf " '%s'" "$0" "$@" >> $config_host_mak
190echo >> $config_host_mak
191echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
192
Jens Axboe67bf9822013-01-10 11:23:19 +0100193# Some host OSes need non-standard checks for which CPU to use.
194# Note that these checks are broken for cross-compilation: if you're
195# cross-compiling to one of these OSes then you'll need to specify
196# the correct CPU with the --cpu option.
197case $targetos in
198Darwin)
199 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
200 # we can run 64-bit userspace code.
201 # If the user didn't specify a CPU explicitly and the kernel says this is
202 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
203 # detection code.
204 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
205 cpu="x86_64"
206 fi
207 ;;
208SunOS)
209 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
210 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
211 cpu="x86_64"
212 fi
Jens Axboeadaa46d2013-02-28 22:10:22 +0100213 LIBS="-lnsl -lsocket"
Jens Axboecfd94f72013-01-23 16:23:48 -0700214 ;;
215CYGWIN*)
216 echo "Forcing known good options on Windows"
Jens Axboe4578d012013-01-23 16:26:12 -0700217 if test -z "$CC" ; then
Huadong Liu74097112013-02-05 08:43:14 +0100218 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
219 CC="i686-w64-mingw32-gcc"
220 else
221 CC="x86_64-w64-mingw32-gcc"
222 fi
Jens Axboe4578d012013-01-23 16:26:12 -0700223 fi
Jens Axboe4feafb12013-01-24 23:07:55 -0700224 output_sym "CONFIG_LITTLE_ENDIAN"
Huadong Liu74097112013-02-05 08:43:14 +0100225 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
226 output_sym "CONFIG_32BIT"
227 else
228 output_sym "CONFIG_64BIT_LLP64"
229 fi
Jens Axboe4feafb12013-01-24 23:07:55 -0700230 output_sym "CONFIG_FADVISE"
231 output_sym "CONFIG_SOCKLEN_T"
Jens Axboe4feafb12013-01-24 23:07:55 -0700232 output_sym "CONFIG_FADVISE"
233 output_sym "CONFIG_SFAA"
234 output_sym "CONFIG_RUSAGE_THREAD"
235 output_sym "CONFIG_WINDOWSAIO"
236 output_sym "CONFIG_FDATASYNC"
Bruce Cran59308a62013-02-02 20:59:31 +0000237 output_sym "CONFIG_CLOCK_MONOTONIC"
Bruce Crandc0518c2013-01-28 16:07:15 +0000238 output_sym "CONFIG_GETTIMEOFDAY"
239 output_sym "CONFIG_CLOCK_GETTIME"
Jens Axboe7e09a9f2013-01-30 13:58:58 +0100240 output_sym "CONFIG_SCHED_IDLE"
Jens Axboe1eafa372013-01-31 10:19:51 +0100241 output_sym "CONFIG_TCP_NODELAY"
Jens Axboe4feafb12013-01-24 23:07:55 -0700242 echo "CC=$CC" >> $config_host_mak
Jens Axboeaf4862b2013-03-29 08:55:32 -0600243 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
Jens Axboecfd94f72013-01-23 16:23:48 -0700244 exit 0
Aaron Carroll6d0e9f82013-02-12 09:58:14 +0100245 ;;
Jens Axboe67bf9822013-01-10 11:23:19 +0100246esac
247
248if test ! -z "$cpu" ; then
249 # command line argument
250 :
251elif check_define __i386__ ; then
252 cpu="i386"
253elif check_define __x86_64__ ; then
254 cpu="x86_64"
255elif check_define __sparc__ ; then
256 if check_define __arch64__ ; then
257 cpu="sparc64"
258 else
259 cpu="sparc"
260 fi
261elif check_define _ARCH_PPC ; then
262 if check_define _ARCH_PPC64 ; then
263 cpu="ppc64"
264 else
265 cpu="ppc"
266 fi
267elif check_define __mips__ ; then
268 cpu="mips"
269elif check_define __ia64__ ; then
270 cpu="ia64"
271elif check_define __s390__ ; then
272 if check_define __s390x__ ; then
273 cpu="s390x"
274 else
275 cpu="s390"
276 fi
277elif check_define __arm__ ; then
278 cpu="arm"
279elif check_define __hppa__ ; then
280 cpu="hppa"
281else
282 cpu=`uname -m`
283fi
284
285# Normalise host CPU name and set ARCH.
286case "$cpu" in
287 ia64|ppc|ppc64|s390|s390x|sparc64)
288 cpu="$cpu"
289 ;;
290 i386|i486|i586|i686|i86pc|BePC)
291 cpu="i386"
292 ;;
293 x86_64|amd64)
294 cpu="x86_64"
295 ;;
296 armv*b|armv*l|arm)
297 cpu="arm"
298 ;;
299 hppa|parisc|parisc64)
300 cpu="hppa"
301 ;;
302 mips*)
303 cpu="mips"
304 ;;
305 sparc|sun4[cdmuv])
306 cpu="sparc"
307 ;;
308 *)
Jens Axboe8b156d82013-02-10 15:48:34 +0100309 echo "Unknown CPU"
Jens Axboe67bf9822013-01-10 11:23:19 +0100310 ;;
311esac
312
Jens Axboedcbbf5b2013-01-25 14:35:27 -0700313if test -z "$CC" ; then
Jens Axboe67bf9822013-01-10 11:23:19 +0100314 if test "$targetos" = "FreeBSD"; then
315 if has clang; then
316 CC=clang
317 else
318 CC=gcc
319 fi
Jens Axboe67bf9822013-01-10 11:23:19 +0100320 fi
321fi
322
323cc="${CC-${cross_prefix}gcc}"
324
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700325##########################################
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100326# check cross compile
327
328cross_compile="no"
329cat > $TMPC <<EOF
330int main(void)
331{
332 return 0;
333}
334EOF
335if compile_prog "" "" "cross"; then
336 $TMPE 2>/dev/null || cross_compile="yes"
337else
338 fatal "compile test failed"
339fi
340
341##########################################
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700342# check endianness
343bigendian="no"
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100344if test "$cross_compile" = "no" ; then
345 cat > $TMPC <<EOF
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700346#include <inttypes.h>
347int main(void)
348{
349 volatile uint32_t i=0x01234567;
350 return (*((uint8_t*)(&i))) == 0x67;
351}
352EOF
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100353 if compile_prog "" "" "endian"; then
354 $TMPE && bigendian="yes"
355 fi
356else
357 # If we're cross compiling, try our best to work it out and rely on the
358 # run-time check to fail if we get it wrong.
359 cat > $TMPC <<EOF
360#include <endian.h>
361int main(void)
362{
363#if __BYTE_ORDER != __BIG_ENDIAN
364# error "Unknown endianness"
365#endif
366}
367EOF
368 compile_prog "" "" "endian" && bigendian="yes"
369 check_define "__ARMEB__" && bigendian="yes"
370 check_define "__MIPSEB__" && bigendian="yes"
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700371fi
372
373
Jens Axboe67bf9822013-01-10 11:23:19 +0100374echo "Operating system $targetos"
375echo "CPU $cpu"
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700376echo "Big endian $bigendian"
Jens Axboe67bf9822013-01-10 11:23:19 +0100377echo "Compiler $cc"
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100378echo "Cross compile $cross_compile"
Jens Axboe67bf9822013-01-10 11:23:19 +0100379echo
380
381##########################################
382# check for wordsize
383wordsize="0"
384cat > $TMPC <<EOF
Aaron Carroll142429e2013-03-14 16:57:39 +1100385#include <limits.h>
386#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
Jens Axboe67bf9822013-01-10 11:23:19 +0100387int main(void)
388{
Aaron Carroll142429e2013-03-14 16:57:39 +1100389 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
Jens Axboe67bf9822013-01-10 11:23:19 +0100390 return 0;
391}
392EOF
Aaron Carroll142429e2013-03-14 16:57:39 +1100393if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
394 wordsize="32"
395elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
396 wordsize="64"
397else
398 fatal "Unknown wordsize"
Jens Axboe67bf9822013-01-10 11:23:19 +0100399fi
400echo "Wordsize $wordsize"
401
402##########################################
Jens Axboea9bca4a2013-04-05 12:55:42 +0200403# zlib probe
404zlib="no"
405cat > $TMPC <<EOF
406#include <zlib.h>
407int main(void)
408{
409 z_stream stream;
410 if (inflateInit(&stream) != Z_OK)
411 return 1;
412 return 0;
413}
414EOF
415if compile_prog "" "-lz" "zlib" ; then
416 zlib=yes
417 LIBS="-lz $LIBS"
Jens Axboea9bca4a2013-04-05 12:55:42 +0200418fi
419echo "zlib $zlib"
420
421##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100422# linux-aio probe
423libaio="no"
424cat > $TMPC <<EOF
425#include <libaio.h>
426#include <stddef.h>
427int main(void)
428{
429 io_setup(0, NULL);
430 return 0;
431}
432EOF
433if compile_prog "" "-laio" "libaio" ; then
434 libaio=yes
435 LIBS="-laio $LIBS"
436else
437 if test "$libaio" = "yes" ; then
Jens Axboec55d7282013-04-12 10:16:43 +0200438 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
Jens Axboe67bf9822013-01-10 11:23:19 +0100439 fi
440 libaio=no
441fi
442echo "Linux AIO support $libaio"
443
444##########################################
445# posix aio probe
446posix_aio="no"
447posix_aio_lrt="no"
448cat > $TMPC <<EOF
449#include <aio.h>
450int main(void)
451{
452 struct aiocb cb;
453 aio_read(&cb);
454 return 0;
455}
456EOF
457if compile_prog "" "" "posixaio" ; then
458 posix_aio="yes"
459elif compile_prog "" "-lrt" "posixaio"; then
460 posix_aio="yes"
461 posix_aio_lrt="yes"
462 LIBS="-lrt $LIBS"
463fi
464echo "POSIX AIO support $posix_aio"
465echo "POSIX AIO support needs -lrt $posix_aio_lrt"
466
467##########################################
468# posix aio fsync probe
469posix_aio_fsync="no"
470if test "$posix_aio" = "yes" ; then
471 cat > $TMPC <<EOF
472#include <fcntl.h>
473#include <aio.h>
474int main(void)
475{
476 struct aiocb cb;
477 return aio_fsync(O_SYNC, &cb);
478 return 0;
479}
480EOF
481 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
482 posix_aio_fsync=yes
483 fi
484fi
485echo "POSIX AIO fsync $posix_aio_fsync"
486
487##########################################
488# solaris aio probe
489solaris_aio="no"
490cat > $TMPC <<EOF
491#include <sys/types.h>
492#include <sys/asynch.h>
493#include <unistd.h>
494int main(void)
495{
496 aio_result_t res;
497 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
498 return 0;
499}
500EOF
501if compile_prog "" "-laio" "solarisaio" ; then
502 solaris_aio=yes
503 LIBS="-laio $LIBS"
504fi
505echo "Solaris AIO support $solaris_aio"
506
507##########################################
508# __sync_fetch_and_and test
509sfaa="no"
510cat > $TMPC << EOF
511static int sfaa(int *ptr)
512{
Jens Axboe9c639a72013-02-28 22:13:29 +0100513 return __sync_fetch_and_add(ptr, 0);
Jens Axboe67bf9822013-01-10 11:23:19 +0100514}
515
516int main(int argc, char **argv)
517{
518 int val = 42;
519 sfaa(&val);
520 return val;
521}
522EOF
523if compile_prog "" "" "__sync_fetch_and_add()" ; then
524 sfaa="yes"
525fi
Jens Axboe9c639a72013-02-28 22:13:29 +0100526echo "__sync_fetch_and_add $sfaa"
Jens Axboe67bf9822013-01-10 11:23:19 +0100527
528##########################################
529# libverbs probe
530libverbs="no"
531cat > $TMPC << EOF
532#include <stdio.h>
533#include <infiniband/arch.h>
534int main(int argc, char **argv)
535{
536 struct ibv_pd *pd = ibv_alloc_pd(NULL);
537 return 0;
538}
539EOF
540if compile_prog "" "-libverbs" "libverbs" ; then
541 libverbs="yes"
542 LIBS="-libverbs $LIBS"
543fi
544echo "libverbs $libverbs"
545
546##########################################
547# rdmacm probe
548rdmacm="no"
549cat > $TMPC << EOF
550#include <stdio.h>
551#include <rdma/rdma_cma.h>
552int main(int argc, char **argv)
553{
554 rdma_destroy_qp(NULL);
555 return 0;
556}
557EOF
558if compile_prog "" "-lrdmacm" "rdma"; then
559 rdmacm="yes"
560 LIBS="-lrdmacm $LIBS"
561fi
562echo "rdmacm $rdmacm"
563
564##########################################
565# Linux fallocate probe
566linux_fallocate="no"
567cat > $TMPC << EOF
568#include <stdio.h>
569#include <linux/falloc.h>
570int main(int argc, char **argv)
571{
572 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
573 return r;
574}
575EOF
576if compile_prog "" "" "linux_fallocate"; then
577 linux_fallocate="yes"
578fi
579echo "Linux fallocate $linux_fallocate"
580
581##########################################
582# POSIX fadvise probe
583posix_fadvise="no"
584cat > $TMPC << EOF
585#include <stdio.h>
586#include <fcntl.h>
587int main(int argc, char **argv)
588{
589 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
590 return r;
591}
592EOF
593if compile_prog "" "" "posix_fadvise"; then
594 posix_fadvise="yes"
595fi
596echo "POSIX fadvise $posix_fadvise"
597
598##########################################
599# POSIX fallocate probe
600posix_fallocate="no"
601cat > $TMPC << EOF
602#include <stdio.h>
603#include <fcntl.h>
604int main(int argc, char **argv)
605{
606 int r = posix_fallocate(0, 0, 1024);
607 return r;
608}
609EOF
610if compile_prog "" "" "posix_fallocate"; then
611 posix_fallocate="yes"
612fi
613echo "POSIX fallocate $posix_fallocate"
614
615##########################################
616# sched_set/getaffinity 2 or 3 argument test
617linux_2arg_affinity="no"
618linux_3arg_affinity="no"
619cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100620#include <sched.h>
621int main(int argc, char **argv)
622{
623 cpu_set_t mask;
624 return sched_setaffinity(0, sizeof(mask), &mask);
625}
626EOF
627if compile_prog "" "" "sched_setaffinity(,,)"; then
628 linux_3arg_affinity="yes"
629else
630 cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100631#include <sched.h>
632int main(int argc, char **argv)
633{
634 cpu_set_t mask;
635 return sched_setaffinity(0, &mask);
636}
637EOF
638 if compile_prog "" "" "sched_setaffinity(,)"; then
639 linux_2arg_affinity="yes"
640 fi
641fi
642echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
643echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
644
645##########################################
646# clock_gettime probe
647clock_gettime="no"
648cat > $TMPC << EOF
649#include <stdio.h>
650#include <time.h>
651int main(int argc, char **argv)
652{
653 return clock_gettime(0, NULL);
654}
655EOF
656if compile_prog "" "" "clock_gettime"; then
657 clock_gettime="yes"
658elif compile_prog "" "-lrt" "clock_gettime"; then
659 clock_gettime="yes"
660 LIBS="-lrt $LIBS"
661fi
662echo "clock_gettime $clock_gettime"
663
664##########################################
665# CLOCK_MONOTONIC probe
666clock_monotonic="no"
667if test "$clock_gettime" = "yes" ; then
668 cat > $TMPC << EOF
669#include <stdio.h>
670#include <time.h>
671int main(int argc, char **argv)
672{
673 return clock_gettime(CLOCK_MONOTONIC, NULL);
674}
675EOF
676 if compile_prog "" "$LIBS" "clock monotonic"; then
677 clock_monotonic="yes"
678 fi
679fi
680echo "CLOCK_MONOTONIC $clock_monotonic"
681
682##########################################
683# CLOCK_MONOTONIC_PRECISE probe
684clock_monotonic_precise="no"
685if test "$clock_gettime" = "yes" ; then
686 cat > $TMPC << EOF
687#include <stdio.h>
688#include <time.h>
689int main(int argc, char **argv)
690{
691 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
692}
693EOF
694 if compile_prog "" "$LIBS" "clock monotonic precise"; then
695 clock_monotonic_precise="yes"
696 fi
697fi
698echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
699
700##########################################
701# gettimeofday() probe
702gettimeofday="no"
703cat > $TMPC << EOF
704#include <sys/time.h>
705#include <stdio.h>
706int main(int argc, char **argv)
707{
708 struct timeval tv;
709 return gettimeofday(&tv, NULL);
710}
711EOF
712if compile_prog "" "" "gettimeofday"; then
713 gettimeofday="yes"
714fi
715echo "gettimeofday $gettimeofday"
716
717##########################################
718# fdatasync() probe
719fdatasync="no"
720cat > $TMPC << EOF
721#include <stdio.h>
722#include <unistd.h>
723int main(int argc, char **argv)
724{
725 return fdatasync(0);
726}
727EOF
728if compile_prog "" "" "fdatasync"; then
729 fdatasync="yes"
730fi
731echo "fdatasync $fdatasync"
732
733##########################################
734# sync_file_range() probe
735sync_file_range="no"
736cat > $TMPC << EOF
737#include <stdio.h>
738#include <unistd.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100739#include <fcntl.h>
740#include <linux/fs.h>
741int main(int argc, char **argv)
742{
743 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
744 SYNC_FILE_RANGE_WAIT_AFTER;
745 return sync_file_range(0, 0, 0, flags);
746}
747EOF
748if compile_prog "" "" "sync_file_range"; then
749 sync_file_range="yes"
750fi
751echo "sync_file_range $sync_file_range"
752
753##########################################
754# ext4 move extent probe
755ext4_me="no"
756cat > $TMPC << EOF
757#include <fcntl.h>
758#include <sys/ioctl.h>
759int main(int argc, char **argv)
760{
761 struct move_extent me;
762 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
763}
764EOF
Jens Axboec7165b82013-01-12 10:27:53 +0100765if compile_prog "" "" "ext4 move extent" ; then
766 ext4_me="yes"
767elif test $targetos = "Linux" ; then
768 # On Linux, just default to it on and let it error at runtime if we really
769 # don't have it. None of my updated systems have it defined, but it does
770 # work. Takes a while to bubble back.
Jens Axboe67bf9822013-01-10 11:23:19 +0100771 ext4_me="yes"
772fi
773echo "EXT4 move extent $ext4_me"
774
775##########################################
776# splice probe
777linux_splice="no"
778cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100779#include <stdio.h>
780#include <fcntl.h>
781int main(int argc, char **argv)
782{
783 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
784}
785EOF
786if compile_prog "" "" "linux splice"; then
787 linux_splice="yes"
788fi
789echo "Linux splice(2) $linux_splice"
790
791##########################################
792# GUASI probe
793guasi="no"
794cat > $TMPC << EOF
795#include <guasi.h>
796#include <guasi_syscalls.h>
797int main(int argc, char **argv)
798{
799 guasi_t ctx = guasi_create(0, 0, 0);
800 return 0;
801}
802EOF
803if compile_prog "" "" "guasi"; then
804 guasi="yes"
805fi
806echo "GUASI $guasi"
807
808##########################################
809# fusion-aw probe
810fusion_aw="no"
811cat > $TMPC << EOF
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200812#include <nvm/nvm_primitives.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100813int main(int argc, char **argv)
814{
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200815 nvm_version_t ver_info;
816 nvm_handle_t handle;
817
818 handle = nvm_get_handle(0, &ver_info);
819 return nvm_atomic_write(handle, 0, 0, 0);
Jens Axboe67bf9822013-01-10 11:23:19 +0100820}
821EOF
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200822if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
823 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
Jens Axboe67bf9822013-01-10 11:23:19 +0100824 fusion_aw="yes"
825fi
826echo "Fusion-io atomic engine $fusion_aw"
827
828##########################################
829# libnuma probe
830libnuma="no"
831cat > $TMPC << EOF
832#include <numa.h>
833int main(int argc, char **argv)
834{
835 return numa_available();
836}
837EOF
838if compile_prog "" "-lnuma" "libnuma"; then
839 libnuma="yes"
840 LIBS="-lnuma $LIBS"
841fi
842echo "libnuma $libnuma"
843
844##########################################
Jens Axboe50206d92013-03-25 13:20:08 -0600845# libnuma 2.x version API
846if test "$libnuma" = "yes" ; then
847libnuma_v2="no"
848cat > $TMPC << EOF
849#include <numa.h>
850int main(int argc, char **argv)
851{
852 struct bitmask *mask = numa_parse_nodestring(NULL);
853 return 0;
854}
855EOF
856if compile_prog "" "" "libnuma api"; then
857 libnuma_v2="yes"
858fi
859echo "libnuma v2 $libnuma_v2"
860fi
861
862##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100863# strsep() probe
864strsep="no"
865cat > $TMPC << EOF
866#include <string.h>
867int main(int argc, char **argv)
868{
869 strsep(NULL, NULL);
870 return 0;
871}
872EOF
873if compile_prog "" "" "strsep"; then
874 strsep="yes"
875fi
876echo "strsep $strsep"
877
878##########################################
Jens Axboe9ad8da82013-04-05 14:44:03 +0200879# strcasestr() probe
880strcasestr="no"
881cat > $TMPC << EOF
882#include <string.h>
883int main(int argc, char **argv)
884{
885 strcasestr(NULL, NULL);
886 return 0;
887}
888EOF
889if compile_prog "" "" "strcasestr"; then
890 strcasestr="yes"
891fi
892echo "strcasestr $strcasestr"
893
894##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100895# getopt_long_only() probe
896getopt_long_only="no"
897cat > $TMPC << EOF
898#include <unistd.h>
899#include <stdio.h>
900int main(int argc, char **argv)
901{
902 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
903 return c;
904}
905EOF
906if compile_prog "" "" "getopt_long_only"; then
907 getopt_long_only="yes"
908fi
909echo "getopt_long_only() $getopt_long_only"
910
911##########################################
912# inet_aton() probe
913inet_aton="no"
914cat > $TMPC << EOF
915#include <sys/socket.h>
916#include <arpa/inet.h>
917#include <stdio.h>
918int main(int argc, char **argv)
919{
920 struct in_addr in;
921 return inet_aton(NULL, &in);
922}
923EOF
924if compile_prog "" "" "inet_aton"; then
925 inet_aton="yes"
926fi
927echo "inet_aton $inet_aton"
928
929##########################################
930# socklen_t probe
931socklen_t="no"
932cat > $TMPC << EOF
Aaron Carrollf6482612013-03-14 16:57:41 +1100933#include <sys/socket.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100934int main(int argc, char **argv)
935{
936 socklen_t len = 0;
937 return len;
938}
939EOF
940if compile_prog "" "" "socklen_t"; then
941 socklen_t="yes"
942fi
943echo "socklen_t $socklen_t"
944
945##########################################
946# Whether or not __thread is supported for TLS
947tls_thread="no"
948cat > $TMPC << EOF
949#include <stdio.h>
950static int __thread ret;
951int main(int argc, char **argv)
952{
953 return ret;
954}
955EOF
956if compile_prog "" "" "__thread"; then
957 tls_thread="yes"
958fi
959echo "__thread $tls_thread"
960
Jens Axboe91f94d52013-01-24 10:25:42 -0700961##########################################
Jens Axboe2639f052013-04-10 14:41:08 +0200962# Check if we have required gtk/glib support for gfio
Jens Axboe91f94d52013-01-24 10:25:42 -0700963if test "$gfio" = "yes" ; then
964 cat > $TMPC << EOF
965#include <glib.h>
966#include <cairo.h>
967#include <gtk/gtk.h>
968int main(void)
969{
970 gdk_threads_enter();
Jens Axboe91f94d52013-01-24 10:25:42 -0700971 gdk_threads_leave();
Jens Axboeb7a99312013-02-04 12:46:54 +0100972
973 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
Jens Axboe91f94d52013-01-24 10:25:42 -0700974}
975EOF
976GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
977if test "$?" != "0" ; then
978 echo "configure: gtk and gthread not found"
979 exit 1
980fi
981GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
982if test "$?" != "0" ; then
983 echo "configure: gtk and gthread not found"
984 exit 1
985fi
Jens Axboeb7a99312013-02-04 12:46:54 +0100986if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
987 r=$($TMPE)
988 if test "$r" != "0" ; then
989 gfio="yes"
990 LIBS="$LIBS $GTK_LIBS"
991 CFLAGS="$CFLAGS $GTK_CFLAGS"
992 else
993 echo "GTK found, but need version 2.18 or higher"
994 gfio="no"
995 fi
Jens Axboe91f94d52013-01-24 10:25:42 -0700996else
997 echo "Please install gtk and gdk libraries"
998 gfio="no"
999fi
1000fi
1001
Jens Axboe2639f052013-04-10 14:41:08 +02001002echo "gtk 2.18 or higher $gfio"
Jens Axboe91f94d52013-01-24 10:25:42 -07001003
Jens Axboe44404c52013-01-24 14:20:09 -07001004# Check whether we have getrusage(RUSAGE_THREAD)
1005rusage_thread="no"
1006cat > $TMPC << EOF
1007#include <sys/time.h>
1008#include <sys/resource.h>
1009int main(int argc, char **argv)
1010{
1011 struct rusage ru;
1012 getrusage(RUSAGE_THREAD, &ru);
1013 return 0;
1014}
1015EOF
1016if compile_prog "" "" "RUSAGE_THREAD"; then
1017 rusage_thread="yes"
1018fi
1019echo "RUSAGE_THREAD $rusage_thread"
1020
Jens Axboe7e09a9f2013-01-30 13:58:58 +01001021##########################################
1022# Check whether we have SCHED_IDLE
1023sched_idle="no"
1024cat > $TMPC << EOF
1025#include <sched.h>
1026int main(int argc, char **argv)
1027{
1028 struct sched_param p;
1029 return sched_setscheduler(0, SCHED_IDLE, &p);
1030}
1031EOF
1032if compile_prog "" "" "SCHED_IDLE"; then
1033 sched_idle="yes"
1034fi
1035echo "SCHED_IDLE $sched_idle"
1036
Jens Axboe1eafa372013-01-31 10:19:51 +01001037##########################################
1038# Check whether we have TCP_NODELAY
1039tcp_nodelay="no"
1040cat > $TMPC << EOF
1041#include <stdio.h>
1042#include <sys/types.h>
1043#include <sys/socket.h>
1044#include <netinet/tcp.h>
1045int main(int argc, char **argv)
1046{
1047 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1048}
1049EOF
1050if compile_prog "" "" "TCP_NODELAY"; then
1051 tcp_nodelay="yes"
1052fi
1053echo "TCP_NODELAY $tcp_nodelay"
1054
Jens Axboe38b93542013-02-28 08:28:05 +01001055##########################################
1056# Check whether we have RLIMIT_MEMLOCK
1057rlimit_memlock="no"
1058cat > $TMPC << EOF
1059#include <sys/time.h>
1060#include <sys/resource.h>
1061int main(int argc, char **argv)
1062{
1063 struct rlimit rl;
1064 return getrlimit(RLIMIT_MEMLOCK, &rl);
1065}
1066EOF
1067if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1068 rlimit_memlock="yes"
1069fi
1070echo "RLIMIT_MEMLOCK $rlimit_memlock"
1071
Jens Axboe07fc0ac2013-05-16 20:36:57 +02001072##########################################
1073# Check whether we have pwritev/preadv
1074pwritev="no"
1075cat > $TMPC << EOF
1076#include <stdio.h>
1077#include <sys/uio.h>
1078int main(int argc, char **argv)
1079{
1080 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1081}
1082EOF
1083if compile_prog "" "" "pwritev"; then
1084 pwritev="yes"
1085fi
1086echo "pwritev/preadv $pwritev"
1087
1088
Jens Axboe67bf9822013-01-10 11:23:19 +01001089#############################################################################
1090
Jens Axboe67bf9822013-01-10 11:23:19 +01001091if test "$wordsize" = "64" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001092 output_sym "CONFIG_64BIT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001093elif test "$wordsize" = "32" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001094 output_sym "CONFIG_32BIT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001095else
Jens Axboed7145a72013-02-11 13:21:54 +01001096 fatal "Unknown wordsize!"
Jens Axboe67bf9822013-01-10 11:23:19 +01001097fi
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001098if test "$bigendian" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001099 output_sym "CONFIG_BIG_ENDIAN"
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001100else
Jens Axboe4feafb12013-01-24 23:07:55 -07001101 output_sym "CONFIG_LITTLE_ENDIAN"
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001102fi
Jens Axboe3989b142013-04-12 13:13:24 +02001103if test "$zlib" = "yes" ; then
1104 output_sym "CONFIG_ZLIB"
1105fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001106if test "$libaio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001107 output_sym "CONFIG_LIBAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001108fi
1109if test "$posix_aio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001110 output_sym "CONFIG_POSIXAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001111fi
1112if test "$posix_aio_fsync" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001113 output_sym "CONFIG_POSIXAIO_FSYNC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001114fi
1115if test "$linux_fallocate" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001116 output_sym "CONFIG_LINUX_FALLOCATE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001117fi
1118if test "$posix_fallocate" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001119 output_sym "CONFIG_POSIX_FALLOCATE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001120fi
1121if test "$fdatasync" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001122 output_sym "CONFIG_FDATASYNC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001123fi
1124if test "$sync_file_range" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001125 output_sym "CONFIG_SYNC_FILE_RANGE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001126fi
1127if test "$sfaa" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001128 output_sym "CONFIG_SFAA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001129fi
Jens Axboed9d9db02013-03-28 12:52:17 -06001130if test "$libverbs" = "yes" -a "rdmacm" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001131 output_sym "CONFIG_RDMA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001132fi
1133if test "$clock_gettime" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001134 output_sym "CONFIG_CLOCK_GETTIME"
Jens Axboe67bf9822013-01-10 11:23:19 +01001135fi
1136if test "$clock_monotonic" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001137 output_sym "CONFIG_CLOCK_MONOTONIC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001138fi
1139if test "$clock_monotonic_precise" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001140 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001141fi
1142if test "$gettimeofday" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001143 output_sym "CONFIG_GETTIMEOFDAY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001144fi
1145if test "$posix_fadvise" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001146 output_sym "CONFIG_POSIX_FADVISE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001147fi
1148if test "$linux_3arg_affinity" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001149 output_sym "CONFIG_3ARG_AFFINITY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001150elif test "$linux_2arg_affinity" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001151 output_sym "CONFIG_2ARG_AFFINITY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001152fi
1153if test "$strsep" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001154 output_sym "CONFIG_STRSEP"
Jens Axboe67bf9822013-01-10 11:23:19 +01001155fi
Jens Axboe9ad8da82013-04-05 14:44:03 +02001156if test "$strcasestr" = "yes" ; then
1157 output_sym "CONFIG_STRCASESTR"
1158fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001159if test "$getopt_long_only" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001160 output_sym "CONFIG_GETOPT_LONG_ONLY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001161fi
1162if test "$inet_aton" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001163 output_sym "CONFIG_INET_ATON"
Jens Axboe67bf9822013-01-10 11:23:19 +01001164fi
1165if test "$socklen_t" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001166 output_sym "CONFIG_SOCKLEN_T"
Jens Axboe67bf9822013-01-10 11:23:19 +01001167fi
1168if test "$ext4_me" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001169 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001170fi
1171if test "$linux_splice" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001172 output_sym "CONFIG_LINUX_SPLICE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001173fi
1174if test "$guasi" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001175 output_sym "CONFIG_GUASI"
Jens Axboe67bf9822013-01-10 11:23:19 +01001176fi
1177if test "$fusion_aw" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001178 output_sym "CONFIG_FUSION_AW"
Jens Axboe67bf9822013-01-10 11:23:19 +01001179fi
Jens Axboe50206d92013-03-25 13:20:08 -06001180if test "$libnuma_v2" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001181 output_sym "CONFIG_LIBNUMA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001182fi
1183if test "$solaris_aio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001184 output_sym "CONFIG_SOLARISAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001185fi
1186if test "$tls_thread" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001187 output_sym "CONFIG_TLS_THREAD"
Jens Axboe67bf9822013-01-10 11:23:19 +01001188fi
Jens Axboe44404c52013-01-24 14:20:09 -07001189if test "$rusage_thread" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001190 output_sym "CONFIG_RUSAGE_THREAD"
Jens Axboe67bf9822013-01-10 11:23:19 +01001191fi
Jens Axboe91f94d52013-01-24 10:25:42 -07001192if test "$gfio" = "yes" ; then
1193 echo "CONFIG_GFIO=y" >> $config_host_mak
1194fi
Jens Axboe7e09a9f2013-01-30 13:58:58 +01001195if test "$sched_idle" = "yes" ; then
1196 output_sym "CONFIG_SCHED_IDLE"
1197fi
Jens Axboe1eafa372013-01-31 10:19:51 +01001198if test "$tcp_nodelay" = "yes" ; then
1199 output_sym "CONFIG_TCP_NODELAY"
1200fi
Jens Axboe38b93542013-02-28 08:28:05 +01001201if test "$rlimit_memlock" = "yes" ; then
1202 output_sym "CONFIG_RLIMIT_MEMLOCK"
1203fi
Jens Axboe07fc0ac2013-05-16 20:36:57 +02001204if test "$pwritev" = "yes" ; then
1205 output_sym "CONFIG_PWRITEV"
1206fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001207
1208echo "LIBS+=$LIBS" >> $config_host_mak
Jens Axboe91f94d52013-01-24 10:25:42 -07001209echo "CFLAGS+=$CFLAGS" >> $config_host_mak
Jens Axboe67bf9822013-01-10 11:23:19 +01001210echo "CC=$cc" >> $config_host_mak
Jens Axboeaf4862b2013-03-29 08:55:32 -06001211echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak