blob: 0f1acd0b78e125f1d1d2301ff14d3b21eee6201e [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 ;;
Castor Fu44462512013-10-31 11:00:54 -0600156 --disable-numa) disable_numa="yes"
157 ;;
Jens Axboe827da4f2013-01-24 10:27:26 -0700158 --help)
Jens Axboe47f44632013-01-24 10:34:14 -0700159 show_help="yes"
Jens Axboe827da4f2013-01-24 10:27:26 -0700160 ;;
Jens Axboecb1125b2013-01-23 13:47:54 -0700161 *)
162 echo "Bad option $opt"
Jens Axboe47f44632013-01-24 10:34:14 -0700163 show_help="yes"
164 exit_val=1
Jens Axboecb1125b2013-01-23 13:47:54 -0700165 esac
166done
167
Jens Axboe47f44632013-01-24 10:34:14 -0700168if test "$show_help" = "yes" ; then
Jens Axboe8b156d82013-02-10 15:48:34 +0100169 echo "--cpu= Specify target CPU if auto-detect fails"
Jens Axboeb7a99312013-02-04 12:46:54 +0100170 echo "--cc= Specify compiler to use"
Jens Axboe899fab32013-01-29 10:06:30 +0100171 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
Jens Axboeb7c12792013-05-01 13:00:26 +0200172 echo "--build-32bit-win Enable 32-bit build on Windows"
Jens Axboeb7a99312013-02-04 12:46:54 +0100173 echo "--enable-gfio Enable building of gtk gfio"
Castor Fu44462512013-10-31 11:00:54 -0600174 echo "--disable-numa Disable libnuma even if found"
Jens Axboeb7a99312013-02-04 12:46:54 +0100175 exit $exit_val
Jens Axboe47f44632013-01-24 10:34:14 -0700176fi
177
Aaron Carroll6d0e9f82013-02-12 09:58:14 +0100178if check_define __ANDROID__ ; then
179 targetos="Android"
180elif check_define __linux__ ; then
Jens Axboe67bf9822013-01-10 11:23:19 +0100181 targetos="Linux"
Jens Axboe67bf9822013-01-10 11:23:19 +0100182elif check_define __OpenBSD__ ; then
183 targetos='OpenBSD'
184elif check_define __sun__ ; then
185 targetos='SunOS'
Jens Axboe7cb024f2013-11-06 15:37:35 -0700186 CFLAGS="$CFLAGS -D_REENTRANT"
Jens Axboe67bf9822013-01-10 11:23:19 +0100187else
188 targetos=`uname -s`
189fi
190
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100191echo "# Automatically generated by configure - do not modify" > $config_host_mak
192printf "# Configured with:" >> $config_host_mak
193printf " '%s'" "$0" "$@" >> $config_host_mak
194echo >> $config_host_mak
195echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
196
Jens Axboe67bf9822013-01-10 11:23:19 +0100197# Some host OSes need non-standard checks for which CPU to use.
198# Note that these checks are broken for cross-compilation: if you're
199# cross-compiling to one of these OSes then you'll need to specify
200# the correct CPU with the --cpu option.
201case $targetos in
202Darwin)
203 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
204 # we can run 64-bit userspace code.
205 # If the user didn't specify a CPU explicitly and the kernel says this is
206 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
207 # detection code.
208 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
209 cpu="x86_64"
210 fi
211 ;;
212SunOS)
213 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
214 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
215 cpu="x86_64"
216 fi
Jens Axboeadaa46d2013-02-28 22:10:22 +0100217 LIBS="-lnsl -lsocket"
Jens Axboecfd94f72013-01-23 16:23:48 -0700218 ;;
219CYGWIN*)
220 echo "Forcing known good options on Windows"
Jens Axboe4578d012013-01-23 16:26:12 -0700221 if test -z "$CC" ; then
Huadong Liu74097112013-02-05 08:43:14 +0100222 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
223 CC="i686-w64-mingw32-gcc"
224 else
225 CC="x86_64-w64-mingw32-gcc"
226 fi
Jens Axboe4578d012013-01-23 16:26:12 -0700227 fi
Jens Axboe4feafb12013-01-24 23:07:55 -0700228 output_sym "CONFIG_LITTLE_ENDIAN"
Huadong Liu74097112013-02-05 08:43:14 +0100229 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
230 output_sym "CONFIG_32BIT"
231 else
232 output_sym "CONFIG_64BIT_LLP64"
233 fi
Jens Axboe4feafb12013-01-24 23:07:55 -0700234 output_sym "CONFIG_FADVISE"
235 output_sym "CONFIG_SOCKLEN_T"
Jens Axboe4feafb12013-01-24 23:07:55 -0700236 output_sym "CONFIG_FADVISE"
237 output_sym "CONFIG_SFAA"
238 output_sym "CONFIG_RUSAGE_THREAD"
239 output_sym "CONFIG_WINDOWSAIO"
240 output_sym "CONFIG_FDATASYNC"
Bruce Cran59308a62013-02-02 20:59:31 +0000241 output_sym "CONFIG_CLOCK_MONOTONIC"
Bruce Crandc0518c2013-01-28 16:07:15 +0000242 output_sym "CONFIG_GETTIMEOFDAY"
243 output_sym "CONFIG_CLOCK_GETTIME"
Jens Axboe7e09a9f2013-01-30 13:58:58 +0100244 output_sym "CONFIG_SCHED_IDLE"
Jens Axboe1eafa372013-01-31 10:19:51 +0100245 output_sym "CONFIG_TCP_NODELAY"
Bruce Cran7d6be132013-11-07 14:04:00 +0000246 output_sym "CONFIG_TLS_THREAD"
Jens Axboe4feafb12013-01-24 23:07:55 -0700247 echo "CC=$CC" >> $config_host_mak
Jens Axboeaf4862b2013-03-29 08:55:32 -0600248 echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
Jens Axboecfd94f72013-01-23 16:23:48 -0700249 exit 0
Aaron Carroll6d0e9f82013-02-12 09:58:14 +0100250 ;;
Jens Axboe67bf9822013-01-10 11:23:19 +0100251esac
252
253if test ! -z "$cpu" ; then
254 # command line argument
255 :
256elif check_define __i386__ ; then
257 cpu="i386"
258elif check_define __x86_64__ ; then
259 cpu="x86_64"
260elif check_define __sparc__ ; then
261 if check_define __arch64__ ; then
262 cpu="sparc64"
263 else
264 cpu="sparc"
265 fi
266elif check_define _ARCH_PPC ; then
267 if check_define _ARCH_PPC64 ; then
268 cpu="ppc64"
269 else
270 cpu="ppc"
271 fi
272elif check_define __mips__ ; then
273 cpu="mips"
274elif check_define __ia64__ ; then
275 cpu="ia64"
276elif check_define __s390__ ; then
277 if check_define __s390x__ ; then
278 cpu="s390x"
279 else
280 cpu="s390"
281 fi
282elif check_define __arm__ ; then
283 cpu="arm"
284elif check_define __hppa__ ; then
285 cpu="hppa"
286else
287 cpu=`uname -m`
288fi
289
290# Normalise host CPU name and set ARCH.
291case "$cpu" in
292 ia64|ppc|ppc64|s390|s390x|sparc64)
293 cpu="$cpu"
294 ;;
295 i386|i486|i586|i686|i86pc|BePC)
296 cpu="i386"
297 ;;
298 x86_64|amd64)
299 cpu="x86_64"
300 ;;
301 armv*b|armv*l|arm)
302 cpu="arm"
303 ;;
304 hppa|parisc|parisc64)
305 cpu="hppa"
306 ;;
307 mips*)
308 cpu="mips"
309 ;;
310 sparc|sun4[cdmuv])
311 cpu="sparc"
312 ;;
313 *)
Jens Axboe8b156d82013-02-10 15:48:34 +0100314 echo "Unknown CPU"
Jens Axboe67bf9822013-01-10 11:23:19 +0100315 ;;
316esac
317
Jens Axboedcbbf5b2013-01-25 14:35:27 -0700318if test -z "$CC" ; then
Jens Axboe67bf9822013-01-10 11:23:19 +0100319 if test "$targetos" = "FreeBSD"; then
320 if has clang; then
321 CC=clang
322 else
323 CC=gcc
324 fi
Jens Axboe67bf9822013-01-10 11:23:19 +0100325 fi
326fi
327
328cc="${CC-${cross_prefix}gcc}"
329
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700330##########################################
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100331# check cross compile
332
333cross_compile="no"
334cat > $TMPC <<EOF
335int main(void)
336{
337 return 0;
338}
339EOF
340if compile_prog "" "" "cross"; then
341 $TMPE 2>/dev/null || cross_compile="yes"
342else
343 fatal "compile test failed"
344fi
345
346##########################################
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700347# check endianness
348bigendian="no"
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100349if test "$cross_compile" = "no" ; then
350 cat > $TMPC <<EOF
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700351#include <inttypes.h>
352int main(void)
353{
354 volatile uint32_t i=0x01234567;
355 return (*((uint8_t*)(&i))) == 0x67;
356}
357EOF
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100358 if compile_prog "" "" "endian"; then
359 $TMPE && bigendian="yes"
360 fi
361else
362 # If we're cross compiling, try our best to work it out and rely on the
363 # run-time check to fail if we get it wrong.
364 cat > $TMPC <<EOF
365#include <endian.h>
366int main(void)
367{
368#if __BYTE_ORDER != __BIG_ENDIAN
369# error "Unknown endianness"
370#endif
371}
372EOF
373 compile_prog "" "" "endian" && bigendian="yes"
374 check_define "__ARMEB__" && bigendian="yes"
375 check_define "__MIPSEB__" && bigendian="yes"
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700376fi
377
378
Jens Axboe67bf9822013-01-10 11:23:19 +0100379echo "Operating system $targetos"
380echo "CPU $cpu"
Jens Axboe0dcebdf2013-01-23 15:42:16 -0700381echo "Big endian $bigendian"
Jens Axboe67bf9822013-01-10 11:23:19 +0100382echo "Compiler $cc"
Aaron Carroll1a17cfd2013-03-14 16:57:40 +1100383echo "Cross compile $cross_compile"
Jens Axboe67bf9822013-01-10 11:23:19 +0100384echo
385
386##########################################
387# check for wordsize
388wordsize="0"
389cat > $TMPC <<EOF
Aaron Carroll142429e2013-03-14 16:57:39 +1100390#include <limits.h>
391#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
Jens Axboe67bf9822013-01-10 11:23:19 +0100392int main(void)
393{
Aaron Carroll142429e2013-03-14 16:57:39 +1100394 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
Jens Axboe67bf9822013-01-10 11:23:19 +0100395 return 0;
396}
397EOF
Aaron Carroll142429e2013-03-14 16:57:39 +1100398if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
399 wordsize="32"
400elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
401 wordsize="64"
402else
403 fatal "Unknown wordsize"
Jens Axboe67bf9822013-01-10 11:23:19 +0100404fi
405echo "Wordsize $wordsize"
406
407##########################################
Jens Axboea9bca4a2013-04-05 12:55:42 +0200408# zlib probe
409zlib="no"
410cat > $TMPC <<EOF
411#include <zlib.h>
412int main(void)
413{
414 z_stream stream;
415 if (inflateInit(&stream) != Z_OK)
416 return 1;
417 return 0;
418}
419EOF
420if compile_prog "" "-lz" "zlib" ; then
421 zlib=yes
422 LIBS="-lz $LIBS"
Jens Axboea9bca4a2013-04-05 12:55:42 +0200423fi
424echo "zlib $zlib"
425
426##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100427# linux-aio probe
428libaio="no"
429cat > $TMPC <<EOF
430#include <libaio.h>
431#include <stddef.h>
432int main(void)
433{
434 io_setup(0, NULL);
435 return 0;
436}
437EOF
438if compile_prog "" "-laio" "libaio" ; then
439 libaio=yes
440 LIBS="-laio $LIBS"
441else
442 if test "$libaio" = "yes" ; then
Jens Axboec55d7282013-04-12 10:16:43 +0200443 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
Jens Axboe67bf9822013-01-10 11:23:19 +0100444 fi
445 libaio=no
446fi
447echo "Linux AIO support $libaio"
448
449##########################################
450# posix aio probe
451posix_aio="no"
452posix_aio_lrt="no"
453cat > $TMPC <<EOF
454#include <aio.h>
455int main(void)
456{
457 struct aiocb cb;
458 aio_read(&cb);
459 return 0;
460}
461EOF
462if compile_prog "" "" "posixaio" ; then
463 posix_aio="yes"
464elif compile_prog "" "-lrt" "posixaio"; then
465 posix_aio="yes"
466 posix_aio_lrt="yes"
467 LIBS="-lrt $LIBS"
468fi
469echo "POSIX AIO support $posix_aio"
470echo "POSIX AIO support needs -lrt $posix_aio_lrt"
471
472##########################################
473# posix aio fsync probe
474posix_aio_fsync="no"
475if test "$posix_aio" = "yes" ; then
476 cat > $TMPC <<EOF
477#include <fcntl.h>
478#include <aio.h>
479int main(void)
480{
481 struct aiocb cb;
482 return aio_fsync(O_SYNC, &cb);
483 return 0;
484}
485EOF
486 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
487 posix_aio_fsync=yes
488 fi
489fi
490echo "POSIX AIO fsync $posix_aio_fsync"
491
492##########################################
493# solaris aio probe
494solaris_aio="no"
495cat > $TMPC <<EOF
496#include <sys/types.h>
497#include <sys/asynch.h>
498#include <unistd.h>
499int main(void)
500{
501 aio_result_t res;
502 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
503 return 0;
504}
505EOF
506if compile_prog "" "-laio" "solarisaio" ; then
507 solaris_aio=yes
508 LIBS="-laio $LIBS"
509fi
510echo "Solaris AIO support $solaris_aio"
511
512##########################################
513# __sync_fetch_and_and test
514sfaa="no"
515cat > $TMPC << EOF
516static int sfaa(int *ptr)
517{
Jens Axboe9c639a72013-02-28 22:13:29 +0100518 return __sync_fetch_and_add(ptr, 0);
Jens Axboe67bf9822013-01-10 11:23:19 +0100519}
520
521int main(int argc, char **argv)
522{
523 int val = 42;
524 sfaa(&val);
525 return val;
526}
527EOF
528if compile_prog "" "" "__sync_fetch_and_add()" ; then
529 sfaa="yes"
530fi
Jens Axboe9c639a72013-02-28 22:13:29 +0100531echo "__sync_fetch_and_add $sfaa"
Jens Axboe67bf9822013-01-10 11:23:19 +0100532
533##########################################
534# libverbs probe
535libverbs="no"
536cat > $TMPC << EOF
537#include <stdio.h>
538#include <infiniband/arch.h>
539int main(int argc, char **argv)
540{
541 struct ibv_pd *pd = ibv_alloc_pd(NULL);
542 return 0;
543}
544EOF
545if compile_prog "" "-libverbs" "libverbs" ; then
546 libverbs="yes"
547 LIBS="-libverbs $LIBS"
548fi
549echo "libverbs $libverbs"
550
551##########################################
552# rdmacm probe
553rdmacm="no"
554cat > $TMPC << EOF
555#include <stdio.h>
556#include <rdma/rdma_cma.h>
557int main(int argc, char **argv)
558{
559 rdma_destroy_qp(NULL);
560 return 0;
561}
562EOF
563if compile_prog "" "-lrdmacm" "rdma"; then
564 rdmacm="yes"
565 LIBS="-lrdmacm $LIBS"
566fi
567echo "rdmacm $rdmacm"
568
569##########################################
570# Linux fallocate probe
571linux_fallocate="no"
572cat > $TMPC << EOF
573#include <stdio.h>
574#include <linux/falloc.h>
575int main(int argc, char **argv)
576{
577 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
578 return r;
579}
580EOF
581if compile_prog "" "" "linux_fallocate"; then
582 linux_fallocate="yes"
583fi
584echo "Linux fallocate $linux_fallocate"
585
586##########################################
587# POSIX fadvise probe
588posix_fadvise="no"
589cat > $TMPC << EOF
590#include <stdio.h>
591#include <fcntl.h>
592int main(int argc, char **argv)
593{
594 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
595 return r;
596}
597EOF
598if compile_prog "" "" "posix_fadvise"; then
599 posix_fadvise="yes"
600fi
601echo "POSIX fadvise $posix_fadvise"
602
603##########################################
604# POSIX fallocate probe
605posix_fallocate="no"
606cat > $TMPC << EOF
607#include <stdio.h>
608#include <fcntl.h>
609int main(int argc, char **argv)
610{
611 int r = posix_fallocate(0, 0, 1024);
612 return r;
613}
614EOF
615if compile_prog "" "" "posix_fallocate"; then
616 posix_fallocate="yes"
617fi
618echo "POSIX fallocate $posix_fallocate"
619
620##########################################
621# sched_set/getaffinity 2 or 3 argument test
622linux_2arg_affinity="no"
623linux_3arg_affinity="no"
624cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100625#include <sched.h>
626int main(int argc, char **argv)
627{
628 cpu_set_t mask;
629 return sched_setaffinity(0, sizeof(mask), &mask);
630}
631EOF
632if compile_prog "" "" "sched_setaffinity(,,)"; then
633 linux_3arg_affinity="yes"
634else
635 cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100636#include <sched.h>
637int main(int argc, char **argv)
638{
639 cpu_set_t mask;
640 return sched_setaffinity(0, &mask);
641}
642EOF
643 if compile_prog "" "" "sched_setaffinity(,)"; then
644 linux_2arg_affinity="yes"
645 fi
646fi
647echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
648echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
649
650##########################################
651# clock_gettime probe
652clock_gettime="no"
653cat > $TMPC << EOF
654#include <stdio.h>
655#include <time.h>
656int main(int argc, char **argv)
657{
658 return clock_gettime(0, NULL);
659}
660EOF
661if compile_prog "" "" "clock_gettime"; then
662 clock_gettime="yes"
663elif compile_prog "" "-lrt" "clock_gettime"; then
664 clock_gettime="yes"
665 LIBS="-lrt $LIBS"
666fi
667echo "clock_gettime $clock_gettime"
668
669##########################################
670# CLOCK_MONOTONIC probe
671clock_monotonic="no"
672if test "$clock_gettime" = "yes" ; then
673 cat > $TMPC << EOF
674#include <stdio.h>
675#include <time.h>
676int main(int argc, char **argv)
677{
678 return clock_gettime(CLOCK_MONOTONIC, NULL);
679}
680EOF
681 if compile_prog "" "$LIBS" "clock monotonic"; then
682 clock_monotonic="yes"
683 fi
684fi
685echo "CLOCK_MONOTONIC $clock_monotonic"
686
687##########################################
688# CLOCK_MONOTONIC_PRECISE probe
689clock_monotonic_precise="no"
690if test "$clock_gettime" = "yes" ; then
691 cat > $TMPC << EOF
692#include <stdio.h>
693#include <time.h>
694int main(int argc, char **argv)
695{
696 return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
697}
698EOF
699 if compile_prog "" "$LIBS" "clock monotonic precise"; then
700 clock_monotonic_precise="yes"
701 fi
702fi
703echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise"
704
705##########################################
706# gettimeofday() probe
707gettimeofday="no"
708cat > $TMPC << EOF
709#include <sys/time.h>
710#include <stdio.h>
711int main(int argc, char **argv)
712{
713 struct timeval tv;
714 return gettimeofday(&tv, NULL);
715}
716EOF
717if compile_prog "" "" "gettimeofday"; then
718 gettimeofday="yes"
719fi
720echo "gettimeofday $gettimeofday"
721
722##########################################
723# fdatasync() probe
724fdatasync="no"
725cat > $TMPC << EOF
726#include <stdio.h>
727#include <unistd.h>
728int main(int argc, char **argv)
729{
730 return fdatasync(0);
731}
732EOF
733if compile_prog "" "" "fdatasync"; then
734 fdatasync="yes"
735fi
736echo "fdatasync $fdatasync"
737
738##########################################
739# sync_file_range() probe
740sync_file_range="no"
741cat > $TMPC << EOF
742#include <stdio.h>
743#include <unistd.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100744#include <fcntl.h>
745#include <linux/fs.h>
746int main(int argc, char **argv)
747{
748 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
749 SYNC_FILE_RANGE_WAIT_AFTER;
750 return sync_file_range(0, 0, 0, flags);
751}
752EOF
753if compile_prog "" "" "sync_file_range"; then
754 sync_file_range="yes"
755fi
756echo "sync_file_range $sync_file_range"
757
758##########################################
759# ext4 move extent probe
760ext4_me="no"
761cat > $TMPC << EOF
762#include <fcntl.h>
763#include <sys/ioctl.h>
764int main(int argc, char **argv)
765{
766 struct move_extent me;
767 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
768}
769EOF
Jens Axboec7165b82013-01-12 10:27:53 +0100770if compile_prog "" "" "ext4 move extent" ; then
771 ext4_me="yes"
772elif test $targetos = "Linux" ; then
773 # On Linux, just default to it on and let it error at runtime if we really
774 # don't have it. None of my updated systems have it defined, but it does
775 # work. Takes a while to bubble back.
Jens Axboe67bf9822013-01-10 11:23:19 +0100776 ext4_me="yes"
777fi
778echo "EXT4 move extent $ext4_me"
779
780##########################################
781# splice probe
782linux_splice="no"
783cat > $TMPC << EOF
Jens Axboe67bf9822013-01-10 11:23:19 +0100784#include <stdio.h>
785#include <fcntl.h>
786int main(int argc, char **argv)
787{
788 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
789}
790EOF
791if compile_prog "" "" "linux splice"; then
792 linux_splice="yes"
793fi
794echo "Linux splice(2) $linux_splice"
795
796##########################################
797# GUASI probe
798guasi="no"
799cat > $TMPC << EOF
800#include <guasi.h>
801#include <guasi_syscalls.h>
802int main(int argc, char **argv)
803{
804 guasi_t ctx = guasi_create(0, 0, 0);
805 return 0;
806}
807EOF
808if compile_prog "" "" "guasi"; then
809 guasi="yes"
810fi
811echo "GUASI $guasi"
812
813##########################################
814# fusion-aw probe
815fusion_aw="no"
816cat > $TMPC << EOF
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200817#include <nvm/nvm_primitives.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100818int main(int argc, char **argv)
819{
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200820 nvm_version_t ver_info;
821 nvm_handle_t handle;
822
823 handle = nvm_get_handle(0, &ver_info);
824 return nvm_atomic_write(handle, 0, 0, 0);
Jens Axboe67bf9822013-01-10 11:23:19 +0100825}
826EOF
Santhosh Koundinyab2c77c22013-05-18 08:44:01 +0200827if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
828 LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
Jens Axboe67bf9822013-01-10 11:23:19 +0100829 fusion_aw="yes"
830fi
831echo "Fusion-io atomic engine $fusion_aw"
832
833##########################################
834# libnuma probe
835libnuma="no"
836cat > $TMPC << EOF
837#include <numa.h>
838int main(int argc, char **argv)
839{
840 return numa_available();
841}
842EOF
Castor Fu44462512013-10-31 11:00:54 -0600843if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
Jens Axboe67bf9822013-01-10 11:23:19 +0100844 libnuma="yes"
845 LIBS="-lnuma $LIBS"
846fi
847echo "libnuma $libnuma"
848
849##########################################
Jens Axboe50206d92013-03-25 13:20:08 -0600850# libnuma 2.x version API
851if test "$libnuma" = "yes" ; then
852libnuma_v2="no"
853cat > $TMPC << EOF
854#include <numa.h>
855int main(int argc, char **argv)
856{
857 struct bitmask *mask = numa_parse_nodestring(NULL);
858 return 0;
859}
860EOF
861if compile_prog "" "" "libnuma api"; then
862 libnuma_v2="yes"
863fi
864echo "libnuma v2 $libnuma_v2"
865fi
866
867##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100868# strsep() probe
869strsep="no"
870cat > $TMPC << EOF
871#include <string.h>
872int main(int argc, char **argv)
873{
874 strsep(NULL, NULL);
875 return 0;
876}
877EOF
878if compile_prog "" "" "strsep"; then
879 strsep="yes"
880fi
881echo "strsep $strsep"
882
883##########################################
Jens Axboe9ad8da82013-04-05 14:44:03 +0200884# strcasestr() probe
885strcasestr="no"
886cat > $TMPC << EOF
887#include <string.h>
888int main(int argc, char **argv)
889{
890 strcasestr(NULL, NULL);
891 return 0;
892}
893EOF
894if compile_prog "" "" "strcasestr"; then
895 strcasestr="yes"
896fi
897echo "strcasestr $strcasestr"
898
899##########################################
Jens Axboe67bf9822013-01-10 11:23:19 +0100900# getopt_long_only() probe
901getopt_long_only="no"
902cat > $TMPC << EOF
903#include <unistd.h>
904#include <stdio.h>
905int main(int argc, char **argv)
906{
907 int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
908 return c;
909}
910EOF
911if compile_prog "" "" "getopt_long_only"; then
912 getopt_long_only="yes"
913fi
914echo "getopt_long_only() $getopt_long_only"
915
916##########################################
917# inet_aton() probe
918inet_aton="no"
919cat > $TMPC << EOF
920#include <sys/socket.h>
921#include <arpa/inet.h>
922#include <stdio.h>
923int main(int argc, char **argv)
924{
925 struct in_addr in;
926 return inet_aton(NULL, &in);
927}
928EOF
929if compile_prog "" "" "inet_aton"; then
930 inet_aton="yes"
931fi
932echo "inet_aton $inet_aton"
933
934##########################################
935# socklen_t probe
936socklen_t="no"
937cat > $TMPC << EOF
Aaron Carrollf6482612013-03-14 16:57:41 +1100938#include <sys/socket.h>
Jens Axboe67bf9822013-01-10 11:23:19 +0100939int main(int argc, char **argv)
940{
941 socklen_t len = 0;
942 return len;
943}
944EOF
945if compile_prog "" "" "socklen_t"; then
946 socklen_t="yes"
947fi
948echo "socklen_t $socklen_t"
949
950##########################################
951# Whether or not __thread is supported for TLS
952tls_thread="no"
953cat > $TMPC << EOF
954#include <stdio.h>
955static int __thread ret;
956int main(int argc, char **argv)
957{
958 return ret;
959}
960EOF
961if compile_prog "" "" "__thread"; then
962 tls_thread="yes"
963fi
964echo "__thread $tls_thread"
965
Jens Axboe91f94d52013-01-24 10:25:42 -0700966##########################################
Jens Axboe2639f052013-04-10 14:41:08 +0200967# Check if we have required gtk/glib support for gfio
Jens Axboe91f94d52013-01-24 10:25:42 -0700968if test "$gfio" = "yes" ; then
969 cat > $TMPC << EOF
970#include <glib.h>
971#include <cairo.h>
972#include <gtk/gtk.h>
973int main(void)
974{
975 gdk_threads_enter();
Jens Axboe91f94d52013-01-24 10:25:42 -0700976 gdk_threads_leave();
Jens Axboeb7a99312013-02-04 12:46:54 +0100977
978 printf("%d", GTK_CHECK_VERSION(2, 18, 0));
Jens Axboe91f94d52013-01-24 10:25:42 -0700979}
980EOF
981GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
982if test "$?" != "0" ; then
983 echo "configure: gtk and gthread not found"
984 exit 1
985fi
986GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
987if test "$?" != "0" ; then
988 echo "configure: gtk and gthread not found"
989 exit 1
990fi
Jens Axboeb7a99312013-02-04 12:46:54 +0100991if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
992 r=$($TMPE)
993 if test "$r" != "0" ; then
994 gfio="yes"
995 LIBS="$LIBS $GTK_LIBS"
996 CFLAGS="$CFLAGS $GTK_CFLAGS"
997 else
998 echo "GTK found, but need version 2.18 or higher"
999 gfio="no"
1000 fi
Jens Axboe91f94d52013-01-24 10:25:42 -07001001else
1002 echo "Please install gtk and gdk libraries"
1003 gfio="no"
1004fi
1005fi
1006
Jens Axboe2639f052013-04-10 14:41:08 +02001007echo "gtk 2.18 or higher $gfio"
Jens Axboe91f94d52013-01-24 10:25:42 -07001008
Jens Axboe44404c52013-01-24 14:20:09 -07001009# Check whether we have getrusage(RUSAGE_THREAD)
1010rusage_thread="no"
1011cat > $TMPC << EOF
1012#include <sys/time.h>
1013#include <sys/resource.h>
1014int main(int argc, char **argv)
1015{
1016 struct rusage ru;
1017 getrusage(RUSAGE_THREAD, &ru);
1018 return 0;
1019}
1020EOF
1021if compile_prog "" "" "RUSAGE_THREAD"; then
1022 rusage_thread="yes"
1023fi
1024echo "RUSAGE_THREAD $rusage_thread"
1025
Jens Axboe7e09a9f2013-01-30 13:58:58 +01001026##########################################
1027# Check whether we have SCHED_IDLE
1028sched_idle="no"
1029cat > $TMPC << EOF
1030#include <sched.h>
1031int main(int argc, char **argv)
1032{
1033 struct sched_param p;
1034 return sched_setscheduler(0, SCHED_IDLE, &p);
1035}
1036EOF
1037if compile_prog "" "" "SCHED_IDLE"; then
1038 sched_idle="yes"
1039fi
1040echo "SCHED_IDLE $sched_idle"
1041
Jens Axboe1eafa372013-01-31 10:19:51 +01001042##########################################
1043# Check whether we have TCP_NODELAY
1044tcp_nodelay="no"
1045cat > $TMPC << EOF
1046#include <stdio.h>
1047#include <sys/types.h>
1048#include <sys/socket.h>
1049#include <netinet/tcp.h>
1050int main(int argc, char **argv)
1051{
1052 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1053}
1054EOF
1055if compile_prog "" "" "TCP_NODELAY"; then
1056 tcp_nodelay="yes"
1057fi
1058echo "TCP_NODELAY $tcp_nodelay"
1059
Jens Axboe38b93542013-02-28 08:28:05 +01001060##########################################
1061# Check whether we have RLIMIT_MEMLOCK
1062rlimit_memlock="no"
1063cat > $TMPC << EOF
1064#include <sys/time.h>
1065#include <sys/resource.h>
1066int main(int argc, char **argv)
1067{
1068 struct rlimit rl;
1069 return getrlimit(RLIMIT_MEMLOCK, &rl);
1070}
1071EOF
1072if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1073 rlimit_memlock="yes"
1074fi
1075echo "RLIMIT_MEMLOCK $rlimit_memlock"
1076
Jens Axboe07fc0ac2013-05-16 20:36:57 +02001077##########################################
1078# Check whether we have pwritev/preadv
1079pwritev="no"
1080cat > $TMPC << EOF
1081#include <stdio.h>
1082#include <sys/uio.h>
1083int main(int argc, char **argv)
1084{
1085 return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
1086}
1087EOF
1088if compile_prog "" "" "pwritev"; then
1089 pwritev="yes"
1090fi
1091echo "pwritev/preadv $pwritev"
1092
1093
Jens Axboe67bf9822013-01-10 11:23:19 +01001094#############################################################################
1095
Jens Axboe67bf9822013-01-10 11:23:19 +01001096if test "$wordsize" = "64" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001097 output_sym "CONFIG_64BIT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001098elif test "$wordsize" = "32" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001099 output_sym "CONFIG_32BIT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001100else
Jens Axboed7145a72013-02-11 13:21:54 +01001101 fatal "Unknown wordsize!"
Jens Axboe67bf9822013-01-10 11:23:19 +01001102fi
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001103if test "$bigendian" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001104 output_sym "CONFIG_BIG_ENDIAN"
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001105else
Jens Axboe4feafb12013-01-24 23:07:55 -07001106 output_sym "CONFIG_LITTLE_ENDIAN"
Jens Axboe0dcebdf2013-01-23 15:42:16 -07001107fi
Jens Axboe3989b142013-04-12 13:13:24 +02001108if test "$zlib" = "yes" ; then
1109 output_sym "CONFIG_ZLIB"
1110fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001111if test "$libaio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001112 output_sym "CONFIG_LIBAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001113fi
1114if test "$posix_aio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001115 output_sym "CONFIG_POSIXAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001116fi
1117if test "$posix_aio_fsync" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001118 output_sym "CONFIG_POSIXAIO_FSYNC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001119fi
1120if test "$linux_fallocate" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001121 output_sym "CONFIG_LINUX_FALLOCATE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001122fi
1123if test "$posix_fallocate" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001124 output_sym "CONFIG_POSIX_FALLOCATE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001125fi
1126if test "$fdatasync" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001127 output_sym "CONFIG_FDATASYNC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001128fi
1129if test "$sync_file_range" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001130 output_sym "CONFIG_SYNC_FILE_RANGE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001131fi
1132if test "$sfaa" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001133 output_sym "CONFIG_SFAA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001134fi
Yufei Ren954cd732013-07-22 20:58:05 -06001135if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001136 output_sym "CONFIG_RDMA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001137fi
1138if test "$clock_gettime" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001139 output_sym "CONFIG_CLOCK_GETTIME"
Jens Axboe67bf9822013-01-10 11:23:19 +01001140fi
1141if test "$clock_monotonic" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001142 output_sym "CONFIG_CLOCK_MONOTONIC"
Jens Axboe67bf9822013-01-10 11:23:19 +01001143fi
1144if test "$clock_monotonic_precise" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001145 output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001146fi
1147if test "$gettimeofday" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001148 output_sym "CONFIG_GETTIMEOFDAY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001149fi
1150if test "$posix_fadvise" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001151 output_sym "CONFIG_POSIX_FADVISE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001152fi
1153if test "$linux_3arg_affinity" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001154 output_sym "CONFIG_3ARG_AFFINITY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001155elif test "$linux_2arg_affinity" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001156 output_sym "CONFIG_2ARG_AFFINITY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001157fi
1158if test "$strsep" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001159 output_sym "CONFIG_STRSEP"
Jens Axboe67bf9822013-01-10 11:23:19 +01001160fi
Jens Axboe9ad8da82013-04-05 14:44:03 +02001161if test "$strcasestr" = "yes" ; then
1162 output_sym "CONFIG_STRCASESTR"
1163fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001164if test "$getopt_long_only" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001165 output_sym "CONFIG_GETOPT_LONG_ONLY"
Jens Axboe67bf9822013-01-10 11:23:19 +01001166fi
1167if test "$inet_aton" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001168 output_sym "CONFIG_INET_ATON"
Jens Axboe67bf9822013-01-10 11:23:19 +01001169fi
1170if test "$socklen_t" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001171 output_sym "CONFIG_SOCKLEN_T"
Jens Axboe67bf9822013-01-10 11:23:19 +01001172fi
1173if test "$ext4_me" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001174 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
Jens Axboe67bf9822013-01-10 11:23:19 +01001175fi
1176if test "$linux_splice" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001177 output_sym "CONFIG_LINUX_SPLICE"
Jens Axboe67bf9822013-01-10 11:23:19 +01001178fi
1179if test "$guasi" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001180 output_sym "CONFIG_GUASI"
Jens Axboe67bf9822013-01-10 11:23:19 +01001181fi
1182if test "$fusion_aw" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001183 output_sym "CONFIG_FUSION_AW"
Jens Axboe67bf9822013-01-10 11:23:19 +01001184fi
Jens Axboe50206d92013-03-25 13:20:08 -06001185if test "$libnuma_v2" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001186 output_sym "CONFIG_LIBNUMA"
Jens Axboe67bf9822013-01-10 11:23:19 +01001187fi
1188if test "$solaris_aio" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001189 output_sym "CONFIG_SOLARISAIO"
Jens Axboe67bf9822013-01-10 11:23:19 +01001190fi
1191if test "$tls_thread" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001192 output_sym "CONFIG_TLS_THREAD"
Jens Axboe67bf9822013-01-10 11:23:19 +01001193fi
Jens Axboe44404c52013-01-24 14:20:09 -07001194if test "$rusage_thread" = "yes" ; then
Jens Axboe4feafb12013-01-24 23:07:55 -07001195 output_sym "CONFIG_RUSAGE_THREAD"
Jens Axboe67bf9822013-01-10 11:23:19 +01001196fi
Jens Axboe91f94d52013-01-24 10:25:42 -07001197if test "$gfio" = "yes" ; then
1198 echo "CONFIG_GFIO=y" >> $config_host_mak
1199fi
Jens Axboe7e09a9f2013-01-30 13:58:58 +01001200if test "$sched_idle" = "yes" ; then
1201 output_sym "CONFIG_SCHED_IDLE"
1202fi
Jens Axboe1eafa372013-01-31 10:19:51 +01001203if test "$tcp_nodelay" = "yes" ; then
1204 output_sym "CONFIG_TCP_NODELAY"
1205fi
Jens Axboe38b93542013-02-28 08:28:05 +01001206if test "$rlimit_memlock" = "yes" ; then
1207 output_sym "CONFIG_RLIMIT_MEMLOCK"
1208fi
Jens Axboe07fc0ac2013-05-16 20:36:57 +02001209if test "$pwritev" = "yes" ; then
1210 output_sym "CONFIG_PWRITEV"
1211fi
Jens Axboe67bf9822013-01-10 11:23:19 +01001212
1213echo "LIBS+=$LIBS" >> $config_host_mak
Jens Axboe91f94d52013-01-24 10:25:42 -07001214echo "CFLAGS+=$CFLAGS" >> $config_host_mak
Jens Axboe67bf9822013-01-10 11:23:19 +01001215echo "CC=$cc" >> $config_host_mak
Jens Axboeaf4862b2013-03-29 08:55:32 -06001216echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak