Commit | Line | Data |
---|---|---|
67bf9823 JA |
1 | #!/bin/sh |
2 | # | |
3 | # Fio configure script. Heavily influenced by the manual qemu configure | |
4 | # script. Sad this this is easier than autoconf and enemies. | |
5 | # | |
6 | ||
7 | # set temporary file name | |
8 | if test ! -z "$TMPDIR" ; then | |
9 | TMPDIR1="${TMPDIR}" | |
10 | elif test ! -z "$TEMPDIR" ; then | |
11 | TMPDIR1="${TEMPDIR}" | |
12 | else | |
13 | TMPDIR1="/tmp" | |
14 | fi | |
15 | ||
16 | TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c" | |
17 | TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o" | |
18 | TMPE="${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> | |
22 | trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM | |
23 | ||
24 | rm -rf config.log | |
25 | ||
26 | config_host_mak="config-host.mak" | |
4feafb1e JA |
27 | config_host_h="config-host.h" |
28 | ||
29 | rm -rf $config_host_mak | |
30 | rm -rf $config_host_h | |
67bf9823 | 31 | |
d7145a78 JA |
32 | fatal() { |
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 | ||
484b0b65 TK |
40 | # Print result for each configuration test |
41 | print_config() { | |
42 | printf "%-30s%s\n" "$1" "$2" | |
43 | } | |
44 | ||
44404c5a | 45 | # Default CFLAGS |
af4862b3 JA |
46 | CFLAGS="-D_GNU_SOURCE -include config-host.h" |
47 | BUILD_CFLAGS="" | |
67bf9823 JA |
48 | |
49 | # Print a helpful header at the top of config.log | |
50 | echo "# FIO configure log $(date)" >> config.log | |
51 | printf "# Configured with:" >> config.log | |
52 | printf " '%s'" "$0" "$@" >> config.log | |
53 | echo >> config.log | |
54 | echo "#" >> config.log | |
55 | ||
7560fe7c JA |
56 | # Print configure header at the top of $config_host_h |
57 | echo "/*" > $config_host_h | |
58 | echo " * Automatically generated by configure - do not modify" >> $config_host_h | |
59 | printf " * Configured with:" >> $config_host_h | |
60 | printf " * '%s'" "$0" "$@" >> $config_host_h | |
61 | echo "" >> $config_host_h | |
62 | echo " */" >> $config_host_h | |
63 | ||
67bf9823 JA |
64 | do_cc() { |
65 | # Run the compiler, capturing its output to the log. | |
66 | echo $cc "$@" >> config.log | |
67 | $cc "$@" >> config.log 2>&1 || return $? | |
68 | # Test passed. If this is an --enable-werror build, rerun | |
69 | # the test with -Werror and bail out if it fails. This | |
70 | # makes warning-generating-errors in configure test code | |
71 | # obvious to developers. | |
72 | if test "$werror" != "yes"; then | |
73 | return 0 | |
74 | fi | |
75 | # Don't bother rerunning the compile if we were already using -Werror | |
76 | case "$*" in | |
77 | *-Werror*) | |
78 | return 0 | |
79 | ;; | |
80 | esac | |
81 | echo $cc -Werror "$@" >> config.log | |
82 | $cc -Werror "$@" >> config.log 2>&1 && return $? | |
83 | echo "ERROR: configure test passed without -Werror but failed with -Werror." | |
84 | echo "This is probably a bug in the configure script. The failing command" | |
85 | echo "will be at the bottom of config.log." | |
d7145a78 | 86 | fatal "You can run configure with --disable-werror to bypass this check." |
67bf9823 JA |
87 | } |
88 | ||
89 | compile_object() { | |
90 | do_cc $CFLAGS -c -o $TMPO $TMPC | |
91 | } | |
92 | ||
93 | compile_prog() { | |
94 | local_cflags="$1" | |
adaa46d8 | 95 | local_ldflags="$2 $LIBS" |
67bf9823 JA |
96 | echo "Compiling test case $3" >> config.log |
97 | do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags | |
98 | } | |
99 | ||
100 | feature_not_found() { | |
101 | feature=$1 | |
c55d728b | 102 | packages=$2 |
67bf9823 JA |
103 | |
104 | echo "ERROR" | |
105 | echo "ERROR: User requested feature $feature" | |
c55d728b JA |
106 | if test ! -z "$packages" ; then |
107 | echo "ERROR: That feature needs $packages installed" | |
108 | fi | |
67bf9823 | 109 | echo "ERROR: configure was not able to find it" |
d7145a78 | 110 | fatal "ERROR" |
67bf9823 JA |
111 | } |
112 | ||
113 | has() { | |
114 | type "$1" >/dev/null 2>&1 | |
115 | } | |
116 | ||
117 | check_define() { | |
118 | cat > $TMPC <<EOF | |
119 | #if !defined($1) | |
120 | #error $1 not defined | |
121 | #endif | |
122 | int main(void) | |
123 | { | |
124 | return 0; | |
125 | } | |
126 | EOF | |
127 | compile_object | |
128 | } | |
129 | ||
4feafb1e JA |
130 | output_sym() { |
131 | echo "$1=y" >> $config_host_mak | |
132 | echo "#define $1" >> $config_host_h | |
133 | } | |
134 | ||
67bf9823 JA |
135 | targetos="" |
136 | cpu="" | |
137 | ||
91f94d5b | 138 | # default options |
47f44635 JA |
139 | show_help="no" |
140 | exit_val=0 | |
ebec2094 | 141 | gfio_check="no" |
1b10477b | 142 | libhdfs="no" |
43f3cec2 | 143 | pmemblk="no" |
cbb15e42 | 144 | devdax="no" |
de26b824 | 145 | disable_lex="" |
3ee2a3c1 | 146 | disable_pmem="no" |
020d54bd | 147 | prefix=/usr/local |
91f94d5b | 148 | |
cb1125b0 JA |
149 | # parse options |
150 | for opt do | |
151 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | |
152 | case "$opt" in | |
020d54bd JA |
153 | --prefix=*) prefix="$optarg" |
154 | ;; | |
8b156d8e JA |
155 | --cpu=*) cpu="$optarg" |
156 | ;; | |
c8931876 JA |
157 | # esx is cross compiled and cannot be detect through simple uname calls |
158 | --esx) | |
159 | esx="yes" | |
160 | ;; | |
cb1125b0 JA |
161 | --cc=*) CC="$optarg" |
162 | ;; | |
208e4c8b JA |
163 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
164 | ;; | |
b7c12794 | 165 | --build-32bit-win) build_32bit_win="yes" |
7409711b | 166 | ;; |
d2aeedb9 JA |
167 | --build-static) build_static="yes" |
168 | ;; | |
bad7e42c | 169 | --enable-gfio) gfio_check="yes" |
899fab33 | 170 | ;; |
44462517 CF |
171 | --disable-numa) disable_numa="yes" |
172 | ;; | |
f678f8d2 MF |
173 | --disable-rdma) disable_rdma="yes" |
174 | ;; | |
ce18290e TM |
175 | --disable-rbd) disable_rbd="yes" |
176 | ;; | |
a4c4c346 | 177 | --disable-rbd-blkin) disable_rbd_blkin="yes" |
178 | ;; | |
ce18290e TM |
179 | --disable-gfapi) disable_gfapi="yes" |
180 | ;; | |
1b10477b MM |
181 | --enable-libhdfs) libhdfs="yes" |
182 | ;; | |
a655bbc4 JA |
183 | --disable-lex) disable_lex="yes" |
184 | ;; | |
de26b824 JA |
185 | --enable-lex) disable_lex="no" |
186 | ;; | |
61054f0d JA |
187 | --disable-shm) no_shm="yes" |
188 | ;; | |
189 | --disable-optimizations) disable_opt="yes" | |
ba40757e | 190 | ;; |
3ee2a3c1 DJ |
191 | --disable-pmem) disable_pmem="yes" |
192 | ;; | |
03553853 YR |
193 | --enable-cuda) enable_cuda="yes" |
194 | ;; | |
827da4f5 | 195 | --help) |
47f44635 | 196 | show_help="yes" |
827da4f5 | 197 | ;; |
cb1125b0 JA |
198 | *) |
199 | echo "Bad option $opt" | |
47f44635 JA |
200 | show_help="yes" |
201 | exit_val=1 | |
cb1125b0 JA |
202 | esac |
203 | done | |
204 | ||
47f44635 | 205 | if test "$show_help" = "yes" ; then |
05cef7a0 TK |
206 | echo "--prefix= Use this directory as installation prefix" |
207 | echo "--cpu= Specify target CPU if auto-detect fails" | |
208 | echo "--cc= Specify compiler to use" | |
209 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" | |
210 | echo "--build-32bit-win Enable 32-bit build on Windows" | |
211 | echo "--build-static Build a static fio" | |
212 | echo "--esx Configure build options for esx" | |
213 | echo "--enable-gfio Enable building of gtk gfio" | |
214 | echo "--disable-numa Disable libnuma even if found" | |
03553853 | 215 | echo "--disable-rdma Disable RDMA support even if found" |
05cef7a0 TK |
216 | echo "--disable-gfapi Disable gfapi" |
217 | echo "--enable-libhdfs Enable hdfs support" | |
218 | echo "--disable-lex Disable use of lex/yacc for math" | |
219 | echo "--disable-pmem Disable pmem based engines even if found" | |
220 | echo "--enable-lex Enable use of lex/yacc for math" | |
221 | echo "--disable-shm Disable SHM support" | |
61054f0d | 222 | echo "--disable-optimizations Don't enable compiler optimizations" |
03553853 | 223 | echo "--enable-cuda Enable GPUDirect RDMA support" |
b7a99316 | 224 | exit $exit_val |
47f44635 JA |
225 | fi |
226 | ||
47986339 | 227 | cross_prefix=${cross_prefix-${CROSS_COMPILE}} |
b73af738 SW |
228 | # Preferred compiler (can be overriden later after we know the platform): |
229 | # ${CC} (if set) | |
230 | # ${cross_prefix}gcc (if cross-prefix specified) | |
231 | # gcc if available | |
232 | # clang if available | |
233 | if test -z "${CC}${cross_prefix}"; then | |
234 | if has gcc; then | |
235 | cc=gcc | |
236 | elif has clang; then | |
237 | cc=clang | |
238 | fi | |
239 | else | |
240 | cc="${CC-${cross_prefix}gcc}" | |
241 | fi | |
47986339 | 242 | |
6d0e9f83 AC |
243 | if check_define __ANDROID__ ; then |
244 | targetos="Android" | |
245 | elif check_define __linux__ ; then | |
67bf9823 | 246 | targetos="Linux" |
67bf9823 JA |
247 | elif check_define __OpenBSD__ ; then |
248 | targetos='OpenBSD' | |
249 | elif check_define __sun__ ; then | |
250 | targetos='SunOS' | |
7cb024f8 | 251 | CFLAGS="$CFLAGS -D_REENTRANT" |
b24f59ab SH |
252 | elif check_define _WIN32 ; then |
253 | targetos='CYGWIN' | |
67bf9823 JA |
254 | else |
255 | targetos=`uname -s` | |
256 | fi | |
257 | ||
53cd4eee AC |
258 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
259 | printf "# Configured with:" >> $config_host_mak | |
260 | printf " '%s'" "$0" "$@" >> $config_host_mak | |
261 | echo >> $config_host_mak | |
262 | echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak | |
263 | ||
61054f0d JA |
264 | if test "$no_shm" = "yes" ; then |
265 | output_sym "CONFIG_NO_SHM" | |
266 | fi | |
267 | ||
268 | if test "$disable_opt" = "yes" ; then | |
269 | output_sym "CONFIG_FIO_NO_OPT" | |
270 | fi | |
271 | ||
67bf9823 JA |
272 | # Some host OSes need non-standard checks for which CPU to use. |
273 | # Note that these checks are broken for cross-compilation: if you're | |
274 | # cross-compiling to one of these OSes then you'll need to specify | |
275 | # the correct CPU with the --cpu option. | |
276 | case $targetos in | |
baa78fdc | 277 | AIX|OpenBSD) |
de26b824 | 278 | # Unless explicitly enabled, turn off lex. |
baa78fdc | 279 | # OpenBSD will hit syntax error when enabled. |
de26b824 JA |
280 | if test -z "$disable_lex" ; then |
281 | disable_lex="yes" | |
daf705b5 JA |
282 | else |
283 | force_no_lex_o="yes" | |
de26b824 JA |
284 | fi |
285 | ;; | |
67bf9823 JA |
286 | Darwin) |
287 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if | |
288 | # we can run 64-bit userspace code. | |
289 | # If the user didn't specify a CPU explicitly and the kernel says this is | |
290 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual | |
291 | # detection code. | |
292 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then | |
293 | cpu="x86_64" | |
294 | fi | |
ccf2d89d SW |
295 | # Error at compile time linking of weak/partial symbols if possible... |
296 | cat > $TMPC <<EOF | |
297 | int main(void) | |
298 | { | |
299 | return 0; | |
300 | } | |
301 | EOF | |
302 | if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then | |
303 | echo "Disabling weak symbols" | |
304 | LDFLAGS="$LDFLAGS -Wl,-no_weak_imports" | |
305 | fi | |
67bf9823 JA |
306 | ;; |
307 | SunOS) | |
308 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo | |
309 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then | |
310 | cpu="x86_64" | |
311 | fi | |
adaa46d8 | 312 | LIBS="-lnsl -lsocket" |
cfd94f79 JA |
313 | ;; |
314 | CYGWIN*) | |
ca205a75 TK |
315 | # We still force some options, so keep this message here. |
316 | echo "Forcing some known good options on Windows" | |
b73af738 | 317 | if test -z "${CC}${cross_prefix}"; then |
7409711b | 318 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
b73af738 | 319 | cc="i686-w64-mingw32-gcc" |
bc0c01e5 RC |
320 | if test -e "../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then |
321 | echo "Building with zlib support" | |
322 | output_sym "CONFIG_ZLIB" | |
323 | echo "LIBS=../zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak | |
324 | fi | |
7409711b | 325 | else |
b73af738 | 326 | cc="x86_64-w64-mingw32-gcc" |
bc0c01e5 RC |
327 | if test -e "../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib"; then |
328 | echo "Building with zlib support" | |
329 | output_sym "CONFIG_ZLIB" | |
330 | echo "LIBS=../zlib/contrib/vstudio/vc14/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib" >> $config_host_mak | |
331 | fi | |
7409711b | 332 | fi |
4578d01f | 333 | fi |
7409711b HL |
334 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
335 | output_sym "CONFIG_32BIT" | |
336 | else | |
337 | output_sym "CONFIG_64BIT_LLP64" | |
338 | fi | |
ca205a75 TK |
339 | # We need this to be output_sym'd here because this is Windows specific. |
340 | # The regular configure path never sets this config. | |
4feafb1e | 341 | output_sym "CONFIG_WINDOWSAIO" |
ca205a75 TK |
342 | # We now take the regular configuration path without having exit 0 here. |
343 | # Flags below are still necessary mostly for MinGW. | |
344 | socklen_t="yes" | |
345 | sfaa="yes" | |
346 | rusage_thread="yes" | |
347 | fdatasync="yes" | |
348 | clock_gettime="yes" # clock_monotonic probe has dependency on this | |
349 | clock_monotonic="yes" | |
350 | gettimeofday="yes" | |
351 | sched_idle="yes" | |
352 | tcp_nodelay="yes" | |
353 | tls_thread="yes" | |
354 | static_assert="yes" | |
355 | ipv6="yes" | |
4252396e | 356 | mkdir_two="no" |
bc0c01e5 | 357 | echo "BUILD_CFLAGS=$CFLAGS -I../zlib -include config-host.h -D_GNU_SOURCE" >> $config_host_mak |
6d0e9f83 | 358 | ;; |
67bf9823 JA |
359 | esac |
360 | ||
b73af738 SW |
361 | # Now we know the target platform we can have another guess at the preferred |
362 | # compiler when it wasn't explictly set | |
363 | if test -z "${CC}${cross_prefix}"; then | |
364 | if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then | |
365 | if has clang; then | |
366 | cc=clang | |
367 | fi | |
368 | fi | |
369 | fi | |
370 | if test -z "$cc"; then | |
371 | echo "configure: failed to find compiler" | |
372 | exit 1 | |
373 | fi | |
374 | ||
67bf9823 JA |
375 | if test ! -z "$cpu" ; then |
376 | # command line argument | |
377 | : | |
378 | elif check_define __i386__ ; then | |
379 | cpu="i386" | |
380 | elif check_define __x86_64__ ; then | |
381 | cpu="x86_64" | |
382 | elif check_define __sparc__ ; then | |
383 | if check_define __arch64__ ; then | |
384 | cpu="sparc64" | |
385 | else | |
386 | cpu="sparc" | |
387 | fi | |
388 | elif check_define _ARCH_PPC ; then | |
389 | if check_define _ARCH_PPC64 ; then | |
390 | cpu="ppc64" | |
391 | else | |
392 | cpu="ppc" | |
393 | fi | |
394 | elif check_define __mips__ ; then | |
395 | cpu="mips" | |
396 | elif check_define __ia64__ ; then | |
397 | cpu="ia64" | |
398 | elif check_define __s390__ ; then | |
399 | if check_define __s390x__ ; then | |
400 | cpu="s390x" | |
401 | else | |
402 | cpu="s390" | |
403 | fi | |
404 | elif check_define __arm__ ; then | |
405 | cpu="arm" | |
214e2d56 | 406 | elif check_define __aarch64__ ; then |
407 | cpu="aarch64" | |
67bf9823 JA |
408 | elif check_define __hppa__ ; then |
409 | cpu="hppa" | |
410 | else | |
411 | cpu=`uname -m` | |
412 | fi | |
413 | ||
414 | # Normalise host CPU name and set ARCH. | |
415 | case "$cpu" in | |
416 | ia64|ppc|ppc64|s390|s390x|sparc64) | |
417 | cpu="$cpu" | |
418 | ;; | |
419 | i386|i486|i586|i686|i86pc|BePC) | |
95ef38ab | 420 | cpu="x86" |
67bf9823 JA |
421 | ;; |
422 | x86_64|amd64) | |
423 | cpu="x86_64" | |
424 | ;; | |
425 | armv*b|armv*l|arm) | |
426 | cpu="arm" | |
427 | ;; | |
214e2d56 | 428 | aarch64) |
429 | cpu="arm64" | |
430 | ;; | |
67bf9823 JA |
431 | hppa|parisc|parisc64) |
432 | cpu="hppa" | |
433 | ;; | |
434 | mips*) | |
435 | cpu="mips" | |
436 | ;; | |
437 | sparc|sun4[cdmuv]) | |
438 | cpu="sparc" | |
439 | ;; | |
440 | *) | |
8b156d8e | 441 | echo "Unknown CPU" |
67bf9823 JA |
442 | ;; |
443 | esac | |
444 | ||
1a17cfdb AC |
445 | ########################################## |
446 | # check cross compile | |
447 | ||
ca205a75 TK |
448 | if test "$cross_compile" != "yes" ; then |
449 | cross_compile="no" | |
450 | fi | |
1a17cfdb AC |
451 | cat > $TMPC <<EOF |
452 | int main(void) | |
453 | { | |
454 | return 0; | |
455 | } | |
456 | EOF | |
457 | if compile_prog "" "" "cross"; then | |
458 | $TMPE 2>/dev/null || cross_compile="yes" | |
459 | else | |
460 | fatal "compile test failed" | |
461 | fi | |
462 | ||
0dcebdf4 JA |
463 | ########################################## |
464 | # check endianness | |
ca205a75 TK |
465 | if test "$bigendian" != "yes" ; then |
466 | bigendian="no" | |
467 | fi | |
1a17cfdb AC |
468 | if test "$cross_compile" = "no" ; then |
469 | cat > $TMPC <<EOF | |
0dcebdf4 JA |
470 | #include <inttypes.h> |
471 | int main(void) | |
472 | { | |
473 | volatile uint32_t i=0x01234567; | |
474 | return (*((uint8_t*)(&i))) == 0x67; | |
475 | } | |
476 | EOF | |
1a17cfdb AC |
477 | if compile_prog "" "" "endian"; then |
478 | $TMPE && bigendian="yes" | |
479 | fi | |
480 | else | |
481 | # If we're cross compiling, try our best to work it out and rely on the | |
482 | # run-time check to fail if we get it wrong. | |
483 | cat > $TMPC <<EOF | |
484 | #include <endian.h> | |
485 | int main(void) | |
486 | { | |
487 | #if __BYTE_ORDER != __BIG_ENDIAN | |
488 | # error "Unknown endianness" | |
489 | #endif | |
490 | } | |
491 | EOF | |
492 | compile_prog "" "" "endian" && bigendian="yes" | |
493 | check_define "__ARMEB__" && bigendian="yes" | |
494 | check_define "__MIPSEB__" && bigendian="yes" | |
0dcebdf4 JA |
495 | fi |
496 | ||
497 | ||
484b0b65 TK |
498 | print_config "Operating system" "$targetos" |
499 | print_config "CPU" "$cpu" | |
500 | print_config "Big endian" "$bigendian" | |
501 | print_config "Compiler" "$cc" | |
502 | print_config "Cross compile" "$cross_compile" | |
67bf9823 JA |
503 | echo |
504 | ||
d2aeedb9 JA |
505 | ########################################## |
506 | # See if we need to build a static build | |
507 | if test "$build_static" = "yes" ; then | |
508 | CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" | |
509 | LDFLAGS="$LDFLAGS -static -Wl,--gc-sections" | |
510 | else | |
511 | build_static="no" | |
512 | fi | |
484b0b65 | 513 | print_config "Static build" "$build_static" |
d2aeedb9 | 514 | |
67bf9823 JA |
515 | ########################################## |
516 | # check for wordsize | |
517 | wordsize="0" | |
518 | cat > $TMPC <<EOF | |
142429e5 AC |
519 | #include <limits.h> |
520 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | |
67bf9823 JA |
521 | int main(void) |
522 | { | |
142429e5 | 523 | BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE); |
67bf9823 JA |
524 | return 0; |
525 | } | |
526 | EOF | |
142429e5 AC |
527 | if compile_prog "-DWORDSIZE=32" "" "wordsize"; then |
528 | wordsize="32" | |
529 | elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then | |
530 | wordsize="64" | |
531 | else | |
532 | fatal "Unknown wordsize" | |
67bf9823 | 533 | fi |
484b0b65 | 534 | print_config "Wordsize" "$wordsize" |
67bf9823 | 535 | |
a9bca4aa JA |
536 | ########################################## |
537 | # zlib probe | |
ca205a75 TK |
538 | if test "$zlib" != "yes" ; then |
539 | zlib="no" | |
540 | fi | |
a9bca4aa | 541 | cat > $TMPC <<EOF |
804a1e05 | 542 | #include <zlib.h> |
a9bca4aa JA |
543 | int main(void) |
544 | { | |
545 | z_stream stream; | |
546 | if (inflateInit(&stream) != Z_OK) | |
547 | return 1; | |
548 | return 0; | |
549 | } | |
550 | EOF | |
551 | if compile_prog "" "-lz" "zlib" ; then | |
552 | zlib=yes | |
553 | LIBS="-lz $LIBS" | |
a9bca4aa | 554 | fi |
484b0b65 | 555 | print_config "zlib" "$zlib" |
a9bca4aa | 556 | |
67bf9823 JA |
557 | ########################################## |
558 | # linux-aio probe | |
ca205a75 TK |
559 | if test "$libaio" != "yes" ; then |
560 | libaio="no" | |
561 | fi | |
7c77ebef | 562 | if test "$esx" != "yes" ; then |
563 | cat > $TMPC <<EOF | |
67bf9823 JA |
564 | #include <libaio.h> |
565 | #include <stddef.h> | |
566 | int main(void) | |
567 | { | |
568 | io_setup(0, NULL); | |
569 | return 0; | |
570 | } | |
571 | EOF | |
7c77ebef | 572 | if compile_prog "" "-laio" "libaio" ; then |
573 | libaio=yes | |
574 | LIBS="-laio $LIBS" | |
575 | else | |
576 | if test "$libaio" = "yes" ; then | |
577 | feature_not_found "linux AIO" "libaio-dev or libaio-devel" | |
578 | fi | |
579 | libaio=no | |
67bf9823 | 580 | fi |
67bf9823 | 581 | fi |
484b0b65 | 582 | print_config "Linux AIO support" "$libaio" |
67bf9823 JA |
583 | |
584 | ########################################## | |
585 | # posix aio probe | |
ca205a75 TK |
586 | if test "$posix_aio" != "yes" ; then |
587 | posix_aio="no" | |
588 | fi | |
589 | if test "$posix_aio_lrt" != "yes" ; then | |
590 | posix_aio_lrt="no" | |
591 | fi | |
67bf9823 JA |
592 | cat > $TMPC <<EOF |
593 | #include <aio.h> | |
594 | int main(void) | |
595 | { | |
596 | struct aiocb cb; | |
597 | aio_read(&cb); | |
598 | return 0; | |
599 | } | |
600 | EOF | |
601 | if compile_prog "" "" "posixaio" ; then | |
602 | posix_aio="yes" | |
603 | elif compile_prog "" "-lrt" "posixaio"; then | |
604 | posix_aio="yes" | |
605 | posix_aio_lrt="yes" | |
606 | LIBS="-lrt $LIBS" | |
607 | fi | |
484b0b65 TK |
608 | print_config "POSIX AIO support" "$posix_aio" |
609 | print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt" | |
67bf9823 JA |
610 | |
611 | ########################################## | |
612 | # posix aio fsync probe | |
ca205a75 TK |
613 | if test "$posix_aio_fsync" != "yes" ; then |
614 | posix_aio_fsync="no" | |
615 | fi | |
67bf9823 JA |
616 | if test "$posix_aio" = "yes" ; then |
617 | cat > $TMPC <<EOF | |
618 | #include <fcntl.h> | |
619 | #include <aio.h> | |
620 | int main(void) | |
621 | { | |
622 | struct aiocb cb; | |
623 | return aio_fsync(O_SYNC, &cb); | |
624 | return 0; | |
625 | } | |
626 | EOF | |
627 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then | |
628 | posix_aio_fsync=yes | |
629 | fi | |
630 | fi | |
484b0b65 | 631 | print_config "POSIX AIO fsync" "$posix_aio_fsync" |
67bf9823 | 632 | |
06eac6b2 SW |
633 | ########################################## |
634 | # POSIX pshared attribute probe | |
d418fa90 TK |
635 | if test "$posix_pshared" != "yes" ; then |
636 | posix_pshared="no" | |
637 | fi | |
06eac6b2 SW |
638 | cat > $TMPC <<EOF |
639 | #include <unistd.h> | |
640 | int main(void) | |
641 | { | |
642 | #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0) | |
643 | # if defined(__CYGWIN__) | |
644 | # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin" | |
645 | # elif defined(__APPLE__) | |
646 | # include <AvailabilityMacros.h> | |
647 | # include <TargetConditionals.h> | |
648 | # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070 | |
649 | # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7" | |
650 | # endif | |
651 | # endif | |
652 | #else | |
653 | # error "_POSIX_THREAD_PROCESS_SHARED is unsupported" | |
654 | #endif | |
655 | return 0; | |
656 | } | |
657 | EOF | |
658 | if compile_prog "" "$LIBS" "posix_pshared" ; then | |
659 | posix_pshared=yes | |
660 | fi | |
484b0b65 | 661 | print_config "POSIX pshared support" "$posix_pshared" |
06eac6b2 | 662 | |
67bf9823 JA |
663 | ########################################## |
664 | # solaris aio probe | |
ca205a75 TK |
665 | if test "$solaris_aio" != "yes" ; then |
666 | solaris_aio="no" | |
667 | fi | |
67bf9823 JA |
668 | cat > $TMPC <<EOF |
669 | #include <sys/types.h> | |
670 | #include <sys/asynch.h> | |
671 | #include <unistd.h> | |
672 | int main(void) | |
673 | { | |
674 | aio_result_t res; | |
675 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); | |
676 | return 0; | |
677 | } | |
678 | EOF | |
679 | if compile_prog "" "-laio" "solarisaio" ; then | |
680 | solaris_aio=yes | |
681 | LIBS="-laio $LIBS" | |
682 | fi | |
484b0b65 | 683 | print_config "Solaris AIO support" "$solaris_aio" |
67bf9823 JA |
684 | |
685 | ########################################## | |
f5cd2907 | 686 | # __sync_fetch_and_add test |
ca205a75 TK |
687 | if test "$sfaa" != "yes" ; then |
688 | sfaa="no" | |
689 | fi | |
67bf9823 | 690 | cat > $TMPC << EOF |
958886d8 JA |
691 | #include <inttypes.h> |
692 | static int sfaa(uint64_t *ptr) | |
67bf9823 | 693 | { |
9c639a76 | 694 | return __sync_fetch_and_add(ptr, 0); |
67bf9823 JA |
695 | } |
696 | ||
697 | int main(int argc, char **argv) | |
698 | { | |
958886d8 | 699 | uint64_t val = 42; |
67bf9823 JA |
700 | sfaa(&val); |
701 | return val; | |
702 | } | |
703 | EOF | |
704 | if compile_prog "" "" "__sync_fetch_and_add()" ; then | |
705 | sfaa="yes" | |
706 | fi | |
484b0b65 | 707 | print_config "__sync_fetch_and_add" "$sfaa" |
67bf9823 JA |
708 | |
709 | ########################################## | |
710 | # libverbs probe | |
ca205a75 TK |
711 | if test "$libverbs" != "yes" ; then |
712 | libverbs="no" | |
713 | fi | |
67bf9823 | 714 | cat > $TMPC << EOF |
eb3bfdd8 | 715 | #include <infiniband/verbs.h> |
67bf9823 JA |
716 | int main(int argc, char **argv) |
717 | { | |
718 | struct ibv_pd *pd = ibv_alloc_pd(NULL); | |
719 | return 0; | |
720 | } | |
721 | EOF | |
f678f8d2 | 722 | if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then |
67bf9823 JA |
723 | libverbs="yes" |
724 | LIBS="-libverbs $LIBS" | |
725 | fi | |
484b0b65 | 726 | print_config "libverbs" "$libverbs" |
67bf9823 JA |
727 | |
728 | ########################################## | |
729 | # rdmacm probe | |
ca205a75 TK |
730 | if test "$rdmacm" != "yes" ; then |
731 | rdmacm="no" | |
732 | fi | |
67bf9823 JA |
733 | cat > $TMPC << EOF |
734 | #include <stdio.h> | |
735 | #include <rdma/rdma_cma.h> | |
736 | int main(int argc, char **argv) | |
737 | { | |
738 | rdma_destroy_qp(NULL); | |
739 | return 0; | |
740 | } | |
741 | EOF | |
f678f8d2 | 742 | if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then |
67bf9823 JA |
743 | rdmacm="yes" |
744 | LIBS="-lrdmacm $LIBS" | |
745 | fi | |
484b0b65 | 746 | print_config "rdmacm" "$rdmacm" |
67bf9823 JA |
747 | |
748 | ########################################## | |
749 | # Linux fallocate probe | |
ca205a75 TK |
750 | if test "$linux_fallocate" != "yes" ; then |
751 | linux_fallocate="no" | |
752 | fi | |
67bf9823 JA |
753 | cat > $TMPC << EOF |
754 | #include <stdio.h> | |
aa6738a5 | 755 | #include <fcntl.h> |
67bf9823 JA |
756 | #include <linux/falloc.h> |
757 | int main(int argc, char **argv) | |
758 | { | |
759 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); | |
760 | return r; | |
761 | } | |
762 | EOF | |
763 | if compile_prog "" "" "linux_fallocate"; then | |
764 | linux_fallocate="yes" | |
765 | fi | |
484b0b65 | 766 | print_config "Linux fallocate" "$linux_fallocate" |
67bf9823 JA |
767 | |
768 | ########################################## | |
769 | # POSIX fadvise probe | |
ca205a75 TK |
770 | if test "$posix_fadvise" != "yes" ; then |
771 | posix_fadvise="no" | |
772 | fi | |
67bf9823 JA |
773 | cat > $TMPC << EOF |
774 | #include <stdio.h> | |
775 | #include <fcntl.h> | |
776 | int main(int argc, char **argv) | |
777 | { | |
778 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); | |
779 | return r; | |
780 | } | |
781 | EOF | |
782 | if compile_prog "" "" "posix_fadvise"; then | |
783 | posix_fadvise="yes" | |
784 | fi | |
484b0b65 | 785 | print_config "POSIX fadvise" "$posix_fadvise" |
67bf9823 JA |
786 | |
787 | ########################################## | |
788 | # POSIX fallocate probe | |
ca205a75 TK |
789 | if test "$posix_fallocate" != "yes" ; then |
790 | posix_fallocate="no" | |
791 | fi | |
67bf9823 JA |
792 | cat > $TMPC << EOF |
793 | #include <stdio.h> | |
794 | #include <fcntl.h> | |
795 | int main(int argc, char **argv) | |
796 | { | |
797 | int r = posix_fallocate(0, 0, 1024); | |
798 | return r; | |
799 | } | |
800 | EOF | |
801 | if compile_prog "" "" "posix_fallocate"; then | |
802 | posix_fallocate="yes" | |
803 | fi | |
484b0b65 | 804 | print_config "POSIX fallocate" "$posix_fallocate" |
67bf9823 JA |
805 | |
806 | ########################################## | |
807 | # sched_set/getaffinity 2 or 3 argument test | |
ca205a75 TK |
808 | if test "$linux_2arg_affinity" != "yes" ; then |
809 | linux_2arg_affinity="no" | |
810 | fi | |
811 | if test "$linux_3arg_affinity" != "yes" ; then | |
812 | linux_3arg_affinity="no" | |
813 | fi | |
67bf9823 | 814 | cat > $TMPC << EOF |
67bf9823 JA |
815 | #include <sched.h> |
816 | int main(int argc, char **argv) | |
817 | { | |
818 | cpu_set_t mask; | |
819 | return sched_setaffinity(0, sizeof(mask), &mask); | |
820 | } | |
821 | EOF | |
822 | if compile_prog "" "" "sched_setaffinity(,,)"; then | |
823 | linux_3arg_affinity="yes" | |
824 | else | |
825 | cat > $TMPC << EOF | |
67bf9823 JA |
826 | #include <sched.h> |
827 | int main(int argc, char **argv) | |
828 | { | |
829 | cpu_set_t mask; | |
830 | return sched_setaffinity(0, &mask); | |
831 | } | |
832 | EOF | |
833 | if compile_prog "" "" "sched_setaffinity(,)"; then | |
834 | linux_2arg_affinity="yes" | |
835 | fi | |
836 | fi | |
484b0b65 TK |
837 | print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity" |
838 | print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity" | |
67bf9823 JA |
839 | |
840 | ########################################## | |
841 | # clock_gettime probe | |
ca205a75 TK |
842 | if test "$clock_gettime" != "yes" ; then |
843 | clock_gettime="no" | |
844 | fi | |
67bf9823 JA |
845 | cat > $TMPC << EOF |
846 | #include <stdio.h> | |
847 | #include <time.h> | |
848 | int main(int argc, char **argv) | |
849 | { | |
850 | return clock_gettime(0, NULL); | |
851 | } | |
852 | EOF | |
853 | if compile_prog "" "" "clock_gettime"; then | |
854 | clock_gettime="yes" | |
855 | elif compile_prog "" "-lrt" "clock_gettime"; then | |
856 | clock_gettime="yes" | |
857 | LIBS="-lrt $LIBS" | |
858 | fi | |
484b0b65 | 859 | print_config "clock_gettime" "$clock_gettime" |
67bf9823 JA |
860 | |
861 | ########################################## | |
862 | # CLOCK_MONOTONIC probe | |
ca205a75 TK |
863 | if test "$clock_monotonic" != "yes" ; then |
864 | clock_monotonic="no" | |
865 | fi | |
67bf9823 JA |
866 | if test "$clock_gettime" = "yes" ; then |
867 | cat > $TMPC << EOF | |
868 | #include <stdio.h> | |
869 | #include <time.h> | |
870 | int main(int argc, char **argv) | |
871 | { | |
872 | return clock_gettime(CLOCK_MONOTONIC, NULL); | |
873 | } | |
874 | EOF | |
875 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
876 | clock_monotonic="yes" | |
877 | fi | |
878 | fi | |
484b0b65 | 879 | print_config "CLOCK_MONOTONIC" "$clock_monotonic" |
67bf9823 | 880 | |
c544f604 SN |
881 | ########################################## |
882 | # CLOCK_MONOTONIC_RAW probe | |
ca205a75 TK |
883 | if test "$clock_monotonic_raw" != "yes" ; then |
884 | clock_monotonic_raw="no" | |
885 | fi | |
c544f604 SN |
886 | if test "$clock_gettime" = "yes" ; then |
887 | cat > $TMPC << EOF | |
888 | #include <stdio.h> | |
889 | #include <time.h> | |
890 | int main(int argc, char **argv) | |
891 | { | |
892 | return clock_gettime(CLOCK_MONOTONIC_RAW, NULL); | |
893 | } | |
894 | EOF | |
895 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
896 | clock_monotonic_raw="yes" | |
897 | fi | |
898 | fi | |
484b0b65 | 899 | print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw" |
c544f604 | 900 | |
67bf9823 JA |
901 | ########################################## |
902 | # CLOCK_MONOTONIC_PRECISE probe | |
ca205a75 TK |
903 | if test "$clock_monotonic_precise" != "yes" ; then |
904 | clock_monotonic_precise="no" | |
905 | fi | |
67bf9823 JA |
906 | if test "$clock_gettime" = "yes" ; then |
907 | cat > $TMPC << EOF | |
908 | #include <stdio.h> | |
909 | #include <time.h> | |
910 | int main(int argc, char **argv) | |
911 | { | |
912 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); | |
913 | } | |
914 | EOF | |
915 | if compile_prog "" "$LIBS" "clock monotonic precise"; then | |
916 | clock_monotonic_precise="yes" | |
917 | fi | |
918 | fi | |
484b0b65 | 919 | print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise" |
67bf9823 | 920 | |
25f8227d JA |
921 | ########################################## |
922 | # clockid_t probe | |
ca205a75 TK |
923 | if test "$clockid_t" != "yes" ; then |
924 | clockid_t="no" | |
925 | fi | |
25f8227d | 926 | cat > $TMPC << EOF |
25f8227d | 927 | #include <time.h> |
209c37b4 | 928 | #include <string.h> |
25f8227d JA |
929 | int main(int argc, char **argv) |
930 | { | |
ccf2d89d | 931 | volatile clockid_t cid; |
7fcad9e1 | 932 | memset((void*)&cid, 0, sizeof(cid)); |
ccf2d89d | 933 | return 0; |
25f8227d JA |
934 | } |
935 | EOF | |
936 | if compile_prog "" "$LIBS" "clockid_t"; then | |
937 | clockid_t="yes" | |
938 | fi | |
484b0b65 | 939 | print_config "clockid_t" "$clockid_t" |
25f8227d | 940 | |
67bf9823 JA |
941 | ########################################## |
942 | # gettimeofday() probe | |
ca205a75 TK |
943 | if test "$gettimeofday" != "yes" ; then |
944 | gettimeofday="no" | |
945 | fi | |
67bf9823 JA |
946 | cat > $TMPC << EOF |
947 | #include <sys/time.h> | |
948 | #include <stdio.h> | |
949 | int main(int argc, char **argv) | |
950 | { | |
951 | struct timeval tv; | |
952 | return gettimeofday(&tv, NULL); | |
953 | } | |
954 | EOF | |
955 | if compile_prog "" "" "gettimeofday"; then | |
956 | gettimeofday="yes" | |
957 | fi | |
484b0b65 | 958 | print_config "gettimeofday" "$gettimeofday" |
67bf9823 JA |
959 | |
960 | ########################################## | |
961 | # fdatasync() probe | |
ca205a75 TK |
962 | if test "$fdatasync" != "yes" ; then |
963 | fdatasync="no" | |
964 | fi | |
67bf9823 JA |
965 | cat > $TMPC << EOF |
966 | #include <stdio.h> | |
967 | #include <unistd.h> | |
968 | int main(int argc, char **argv) | |
969 | { | |
970 | return fdatasync(0); | |
971 | } | |
972 | EOF | |
973 | if compile_prog "" "" "fdatasync"; then | |
974 | fdatasync="yes" | |
975 | fi | |
484b0b65 | 976 | print_config "fdatasync" "$fdatasync" |
67bf9823 JA |
977 | |
978 | ########################################## | |
979 | # sync_file_range() probe | |
ca205a75 TK |
980 | if test "$sync_file_range" != "yes" ; then |
981 | sync_file_range="no" | |
982 | fi | |
67bf9823 JA |
983 | cat > $TMPC << EOF |
984 | #include <stdio.h> | |
985 | #include <unistd.h> | |
67bf9823 JA |
986 | #include <fcntl.h> |
987 | #include <linux/fs.h> | |
988 | int main(int argc, char **argv) | |
989 | { | |
990 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | | |
991 | SYNC_FILE_RANGE_WAIT_AFTER; | |
992 | return sync_file_range(0, 0, 0, flags); | |
993 | } | |
994 | EOF | |
995 | if compile_prog "" "" "sync_file_range"; then | |
996 | sync_file_range="yes" | |
997 | fi | |
484b0b65 | 998 | print_config "sync_file_range" "$sync_file_range" |
67bf9823 JA |
999 | |
1000 | ########################################## | |
1001 | # ext4 move extent probe | |
ca205a75 TK |
1002 | if test "$ext4_me" != "yes" ; then |
1003 | ext4_me="no" | |
1004 | fi | |
67bf9823 JA |
1005 | cat > $TMPC << EOF |
1006 | #include <fcntl.h> | |
1007 | #include <sys/ioctl.h> | |
1008 | int main(int argc, char **argv) | |
1009 | { | |
1010 | struct move_extent me; | |
1011 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); | |
1012 | } | |
1013 | EOF | |
c7165b8d JA |
1014 | if compile_prog "" "" "ext4 move extent" ; then |
1015 | ext4_me="yes" | |
1016 | elif test $targetos = "Linux" ; then | |
1017 | # On Linux, just default to it on and let it error at runtime if we really | |
1018 | # don't have it. None of my updated systems have it defined, but it does | |
1019 | # work. Takes a while to bubble back. | |
67bf9823 JA |
1020 | ext4_me="yes" |
1021 | fi | |
484b0b65 | 1022 | print_config "EXT4 move extent" "$ext4_me" |
67bf9823 JA |
1023 | |
1024 | ########################################## | |
1025 | # splice probe | |
ca205a75 TK |
1026 | if test "$linux_splice" != "yes" ; then |
1027 | linux_splice="no" | |
1028 | fi | |
67bf9823 | 1029 | cat > $TMPC << EOF |
67bf9823 JA |
1030 | #include <stdio.h> |
1031 | #include <fcntl.h> | |
1032 | int main(int argc, char **argv) | |
1033 | { | |
1034 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); | |
1035 | } | |
1036 | EOF | |
1037 | if compile_prog "" "" "linux splice"; then | |
1038 | linux_splice="yes" | |
1039 | fi | |
484b0b65 | 1040 | print_config "Linux splice(2)" "$linux_splice" |
67bf9823 JA |
1041 | |
1042 | ########################################## | |
1043 | # GUASI probe | |
ca205a75 TK |
1044 | if test "$guasi" != "yes" ; then |
1045 | guasi="no" | |
1046 | fi | |
67bf9823 JA |
1047 | cat > $TMPC << EOF |
1048 | #include <guasi.h> | |
1049 | #include <guasi_syscalls.h> | |
1050 | int main(int argc, char **argv) | |
1051 | { | |
1052 | guasi_t ctx = guasi_create(0, 0, 0); | |
1053 | return 0; | |
1054 | } | |
1055 | EOF | |
1056 | if compile_prog "" "" "guasi"; then | |
1057 | guasi="yes" | |
1058 | fi | |
484b0b65 | 1059 | print_config "GUASI" "$guasi" |
67bf9823 JA |
1060 | |
1061 | ########################################## | |
1062 | # fusion-aw probe | |
ca205a75 TK |
1063 | if test "$fusion_aw" != "yes" ; then |
1064 | fusion_aw="no" | |
1065 | fi | |
67bf9823 | 1066 | cat > $TMPC << EOF |
b2c77c25 | 1067 | #include <nvm/nvm_primitives.h> |
67bf9823 JA |
1068 | int main(int argc, char **argv) |
1069 | { | |
b2c77c25 SK |
1070 | nvm_version_t ver_info; |
1071 | nvm_handle_t handle; | |
1072 | ||
1073 | handle = nvm_get_handle(0, &ver_info); | |
1074 | return nvm_atomic_write(handle, 0, 0, 0); | |
67bf9823 JA |
1075 | } |
1076 | EOF | |
92aef550 ARJ |
1077 | if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then |
1078 | LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS" | |
67bf9823 JA |
1079 | fusion_aw="yes" |
1080 | fi | |
484b0b65 | 1081 | print_config "Fusion-io atomic engine" "$fusion_aw" |
67bf9823 JA |
1082 | |
1083 | ########################################## | |
1084 | # libnuma probe | |
ca205a75 TK |
1085 | if test "$libnuma" != "yes" ; then |
1086 | libnuma="no" | |
1087 | fi | |
67bf9823 JA |
1088 | cat > $TMPC << EOF |
1089 | #include <numa.h> | |
1090 | int main(int argc, char **argv) | |
1091 | { | |
1092 | return numa_available(); | |
1093 | } | |
1094 | EOF | |
44462517 | 1095 | if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then |
67bf9823 JA |
1096 | libnuma="yes" |
1097 | LIBS="-lnuma $LIBS" | |
1098 | fi | |
484b0b65 | 1099 | print_config "libnuma" "$libnuma" |
67bf9823 | 1100 | |
50206d9b | 1101 | ########################################## |
ca205a75 | 1102 | # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes" |
50206d9b JA |
1103 | if test "$libnuma" = "yes" ; then |
1104 | libnuma_v2="no" | |
1105 | cat > $TMPC << EOF | |
1106 | #include <numa.h> | |
1107 | int main(int argc, char **argv) | |
1108 | { | |
1109 | struct bitmask *mask = numa_parse_nodestring(NULL); | |
61bde962 | 1110 | return mask->size == 0; |
50206d9b JA |
1111 | } |
1112 | EOF | |
1113 | if compile_prog "" "" "libnuma api"; then | |
1114 | libnuma_v2="yes" | |
1115 | fi | |
484b0b65 | 1116 | print_config "libnuma v2" "$libnuma_v2" |
50206d9b JA |
1117 | fi |
1118 | ||
67bf9823 JA |
1119 | ########################################## |
1120 | # strsep() probe | |
ca205a75 TK |
1121 | if test "$strsep" != "yes" ; then |
1122 | strsep="no" | |
1123 | fi | |
67bf9823 JA |
1124 | cat > $TMPC << EOF |
1125 | #include <string.h> | |
1126 | int main(int argc, char **argv) | |
1127 | { | |
ae156be6 JA |
1128 | static char *string = "This is a string"; |
1129 | strsep(&string, "needle"); | |
67bf9823 JA |
1130 | return 0; |
1131 | } | |
1132 | EOF | |
1133 | if compile_prog "" "" "strsep"; then | |
1134 | strsep="yes" | |
1135 | fi | |
484b0b65 | 1136 | print_config "strsep" "$strsep" |
67bf9823 | 1137 | |
9ad8da82 JA |
1138 | ########################################## |
1139 | # strcasestr() probe | |
ca205a75 TK |
1140 | if test "$strcasestr" != "yes" ; then |
1141 | strcasestr="no" | |
1142 | fi | |
9ad8da82 JA |
1143 | cat > $TMPC << EOF |
1144 | #include <string.h> | |
1145 | int main(int argc, char **argv) | |
1146 | { | |
aa6738a5 | 1147 | return strcasestr(argv[0], argv[1]) != NULL; |
9ad8da82 JA |
1148 | } |
1149 | EOF | |
1150 | if compile_prog "" "" "strcasestr"; then | |
1151 | strcasestr="yes" | |
1152 | fi | |
484b0b65 | 1153 | print_config "strcasestr" "$strcasestr" |
9ad8da82 | 1154 | |
5ad7be56 KD |
1155 | ########################################## |
1156 | # strlcat() probe | |
ca205a75 TK |
1157 | if test "$strlcat" != "yes" ; then |
1158 | strlcat="no" | |
1159 | fi | |
5ad7be56 KD |
1160 | cat > $TMPC << EOF |
1161 | #include <string.h> | |
1162 | int main(int argc, char **argv) | |
1163 | { | |
1164 | static char dst[64]; | |
1165 | static char *string = "This is a string"; | |
1166 | memset(dst, 0, sizeof(dst)); | |
1167 | strlcat(dst, string, sizeof(dst)); | |
1168 | return 0; | |
1169 | } | |
1170 | EOF | |
1171 | if compile_prog "" "" "strlcat"; then | |
1172 | strlcat="yes" | |
1173 | fi | |
484b0b65 | 1174 | print_config "strlcat" "$strlcat" |
5ad7be56 | 1175 | |
67bf9823 JA |
1176 | ########################################## |
1177 | # getopt_long_only() probe | |
ca205a75 TK |
1178 | if test "$getopt_long_only" != "yes" ; then |
1179 | getopt_long_only="no" | |
1180 | fi | |
67bf9823 JA |
1181 | cat > $TMPC << EOF |
1182 | #include <unistd.h> | |
1183 | #include <stdio.h> | |
aa6738a5 | 1184 | #include <getopt.h> |
67bf9823 JA |
1185 | int main(int argc, char **argv) |
1186 | { | |
1187 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); | |
1188 | return c; | |
1189 | } | |
1190 | EOF | |
1191 | if compile_prog "" "" "getopt_long_only"; then | |
1192 | getopt_long_only="yes" | |
1193 | fi | |
484b0b65 | 1194 | print_config "getopt_long_only()" "$getopt_long_only" |
67bf9823 JA |
1195 | |
1196 | ########################################## | |
1197 | # inet_aton() probe | |
ca205a75 TK |
1198 | if test "$inet_aton" != "yes" ; then |
1199 | inet_aton="no" | |
1200 | fi | |
67bf9823 JA |
1201 | cat > $TMPC << EOF |
1202 | #include <sys/socket.h> | |
1203 | #include <arpa/inet.h> | |
1204 | #include <stdio.h> | |
1205 | int main(int argc, char **argv) | |
1206 | { | |
1207 | struct in_addr in; | |
1208 | return inet_aton(NULL, &in); | |
1209 | } | |
1210 | EOF | |
1211 | if compile_prog "" "" "inet_aton"; then | |
1212 | inet_aton="yes" | |
1213 | fi | |
484b0b65 | 1214 | print_config "inet_aton" "$inet_aton" |
67bf9823 JA |
1215 | |
1216 | ########################################## | |
1217 | # socklen_t probe | |
ca205a75 TK |
1218 | if test "$socklen_t" != "yes" ; then |
1219 | socklen_t="no" | |
1220 | fi | |
67bf9823 | 1221 | cat > $TMPC << EOF |
f6482613 | 1222 | #include <sys/socket.h> |
67bf9823 JA |
1223 | int main(int argc, char **argv) |
1224 | { | |
1225 | socklen_t len = 0; | |
1226 | return len; | |
1227 | } | |
1228 | EOF | |
1229 | if compile_prog "" "" "socklen_t"; then | |
1230 | socklen_t="yes" | |
1231 | fi | |
484b0b65 | 1232 | print_config "socklen_t" "$socklen_t" |
67bf9823 JA |
1233 | |
1234 | ########################################## | |
1235 | # Whether or not __thread is supported for TLS | |
ca205a75 TK |
1236 | if test "$tls_thread" != "yes" ; then |
1237 | tls_thread="no" | |
1238 | fi | |
67bf9823 JA |
1239 | cat > $TMPC << EOF |
1240 | #include <stdio.h> | |
aa6738a5 | 1241 | static __thread int ret; |
67bf9823 JA |
1242 | int main(int argc, char **argv) |
1243 | { | |
1244 | return ret; | |
1245 | } | |
1246 | EOF | |
1247 | if compile_prog "" "" "__thread"; then | |
1248 | tls_thread="yes" | |
1249 | fi | |
484b0b65 | 1250 | print_config "__thread" "$tls_thread" |
67bf9823 | 1251 | |
91f94d5b | 1252 | ########################################## |
2639f056 | 1253 | # Check if we have required gtk/glib support for gfio |
ca205a75 TK |
1254 | if test "$gfio" != "yes" ; then |
1255 | gfio="no" | |
1256 | fi | |
ebec2094 | 1257 | if test "$gfio_check" = "yes" ; then |
91f94d5b JA |
1258 | cat > $TMPC << EOF |
1259 | #include <glib.h> | |
1260 | #include <cairo.h> | |
1261 | #include <gtk/gtk.h> | |
1262 | int main(void) | |
1263 | { | |
1264 | gdk_threads_enter(); | |
91f94d5b | 1265 | gdk_threads_leave(); |
b7a99316 | 1266 | |
ef2b61aa | 1267 | return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */ |
91f94d5b JA |
1268 | } |
1269 | EOF | |
1270 | GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) | |
86719845 JA |
1271 | ORG_LDFLAGS=$LDFLAGS |
1272 | LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g) | |
91f94d5b JA |
1273 | if test "$?" != "0" ; then |
1274 | echo "configure: gtk and gthread not found" | |
1275 | exit 1 | |
1276 | fi | |
1277 | GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0) | |
1278 | if test "$?" != "0" ; then | |
1279 | echo "configure: gtk and gthread not found" | |
1280 | exit 1 | |
1281 | fi | |
b7a99316 | 1282 | if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then |
ef2b61aa TK |
1283 | $TMPE |
1284 | if test "$?" = "0" ; then | |
b7a99316 | 1285 | gfio="yes" |
86719845 | 1286 | GFIO_LIBS="$LIBS $GTK_LIBS" |
b7a99316 JA |
1287 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
1288 | else | |
1289 | echo "GTK found, but need version 2.18 or higher" | |
1290 | gfio="no" | |
1291 | fi | |
91f94d5b JA |
1292 | else |
1293 | echo "Please install gtk and gdk libraries" | |
1294 | gfio="no" | |
1295 | fi | |
86719845 | 1296 | LDFLAGS=$ORG_LDFLAGS |
91f94d5b JA |
1297 | fi |
1298 | ||
ebec2094 | 1299 | if test "$gfio_check" = "yes" ; then |
484b0b65 | 1300 | print_config "gtk 2.18 or higher" "$gfio" |
ebec2094 | 1301 | fi |
91f94d5b | 1302 | |
bda92394 | 1303 | ########################################## |
44404c5a | 1304 | # Check whether we have getrusage(RUSAGE_THREAD) |
ca205a75 TK |
1305 | if test "$rusage_thread" != "yes" ; then |
1306 | rusage_thread="no" | |
1307 | fi | |
44404c5a JA |
1308 | cat > $TMPC << EOF |
1309 | #include <sys/time.h> | |
1310 | #include <sys/resource.h> | |
1311 | int main(int argc, char **argv) | |
1312 | { | |
1313 | struct rusage ru; | |
1314 | getrusage(RUSAGE_THREAD, &ru); | |
1315 | return 0; | |
1316 | } | |
1317 | EOF | |
1318 | if compile_prog "" "" "RUSAGE_THREAD"; then | |
1319 | rusage_thread="yes" | |
1320 | fi | |
484b0b65 | 1321 | print_config "RUSAGE_THREAD" "$rusage_thread" |
44404c5a | 1322 | |
7e09a9f1 JA |
1323 | ########################################## |
1324 | # Check whether we have SCHED_IDLE | |
ca205a75 TK |
1325 | if test "$sched_idle" != "yes" ; then |
1326 | sched_idle="no" | |
1327 | fi | |
7e09a9f1 JA |
1328 | cat > $TMPC << EOF |
1329 | #include <sched.h> | |
1330 | int main(int argc, char **argv) | |
1331 | { | |
1332 | struct sched_param p; | |
1333 | return sched_setscheduler(0, SCHED_IDLE, &p); | |
1334 | } | |
1335 | EOF | |
1336 | if compile_prog "" "" "SCHED_IDLE"; then | |
1337 | sched_idle="yes" | |
1338 | fi | |
484b0b65 | 1339 | print_config "SCHED_IDLE" "$sched_idle" |
7e09a9f1 | 1340 | |
1eafa37a JA |
1341 | ########################################## |
1342 | # Check whether we have TCP_NODELAY | |
ca205a75 TK |
1343 | if test "$tcp_nodelay" != "yes" ; then |
1344 | tcp_nodelay="no" | |
1345 | fi | |
1eafa37a JA |
1346 | cat > $TMPC << EOF |
1347 | #include <stdio.h> | |
1348 | #include <sys/types.h> | |
1349 | #include <sys/socket.h> | |
1350 | #include <netinet/tcp.h> | |
1351 | int main(int argc, char **argv) | |
1352 | { | |
1353 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); | |
1354 | } | |
1355 | EOF | |
1356 | if compile_prog "" "" "TCP_NODELAY"; then | |
1357 | tcp_nodelay="yes" | |
1358 | fi | |
484b0b65 | 1359 | print_config "TCP_NODELAY" "$tcp_nodelay" |
1eafa37a | 1360 | |
1008602c JA |
1361 | ########################################## |
1362 | # Check whether we have SO_SNDBUF | |
ca205a75 TK |
1363 | if test "$window_size" != "yes" ; then |
1364 | window_size="no" | |
1365 | fi | |
1008602c JA |
1366 | cat > $TMPC << EOF |
1367 | #include <stdio.h> | |
1368 | #include <sys/types.h> | |
1369 | #include <sys/socket.h> | |
1370 | #include <netinet/tcp.h> | |
1371 | int main(int argc, char **argv) | |
1372 | { | |
1373 | setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0); | |
1374 | setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0); | |
1375 | } | |
1376 | EOF | |
1377 | if compile_prog "" "" "SO_SNDBUF"; then | |
1378 | window_size="yes" | |
1379 | fi | |
484b0b65 | 1380 | print_config "Net engine window_size" "$window_size" |
1008602c | 1381 | |
e5f34d95 JA |
1382 | ########################################## |
1383 | # Check whether we have TCP_MAXSEG | |
ca205a75 TK |
1384 | if test "$mss" != "yes" ; then |
1385 | mss="no" | |
1386 | fi | |
e5f34d95 JA |
1387 | cat > $TMPC << EOF |
1388 | #include <stdio.h> | |
1389 | #include <sys/types.h> | |
1390 | #include <sys/socket.h> | |
1391 | #include <netinet/tcp.h> | |
1392 | #include <arpa/inet.h> | |
1393 | #include <netinet/in.h> | |
1394 | int main(int argc, char **argv) | |
1395 | { | |
1396 | return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0); | |
1397 | } | |
1398 | EOF | |
1399 | if compile_prog "" "" "TCP_MAXSEG"; then | |
1400 | mss="yes" | |
1401 | fi | |
484b0b65 | 1402 | print_config "TCP_MAXSEG" "$mss" |
e5f34d95 | 1403 | |
38b9354a JA |
1404 | ########################################## |
1405 | # Check whether we have RLIMIT_MEMLOCK | |
ca205a75 TK |
1406 | if test "$rlimit_memlock" != "yes" ; then |
1407 | rlimit_memlock="no" | |
1408 | fi | |
38b9354a JA |
1409 | cat > $TMPC << EOF |
1410 | #include <sys/time.h> | |
1411 | #include <sys/resource.h> | |
1412 | int main(int argc, char **argv) | |
1413 | { | |
1414 | struct rlimit rl; | |
1415 | return getrlimit(RLIMIT_MEMLOCK, &rl); | |
1416 | } | |
1417 | EOF | |
1418 | if compile_prog "" "" "RLIMIT_MEMLOCK"; then | |
1419 | rlimit_memlock="yes" | |
1420 | fi | |
484b0b65 | 1421 | print_config "RLIMIT_MEMLOCK" "$rlimit_memlock" |
38b9354a | 1422 | |
07fc0acd JA |
1423 | ########################################## |
1424 | # Check whether we have pwritev/preadv | |
ca205a75 TK |
1425 | if test "$pwritev" != "yes" ; then |
1426 | pwritev="no" | |
1427 | fi | |
07fc0acd JA |
1428 | cat > $TMPC << EOF |
1429 | #include <stdio.h> | |
1430 | #include <sys/uio.h> | |
1431 | int main(int argc, char **argv) | |
1432 | { | |
1433 | return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0); | |
1434 | } | |
1435 | EOF | |
1436 | if compile_prog "" "" "pwritev"; then | |
1437 | pwritev="yes" | |
1438 | fi | |
484b0b65 | 1439 | print_config "pwritev/preadv" "$pwritev" |
07fc0acd | 1440 | |
2cafffbe JA |
1441 | ########################################## |
1442 | # Check whether we have pwritev2/preadv2 | |
ca205a75 TK |
1443 | if test "$pwritev2" != "yes" ; then |
1444 | pwritev2="no" | |
1445 | fi | |
2cafffbe JA |
1446 | cat > $TMPC << EOF |
1447 | #include <stdio.h> | |
1448 | #include <sys/uio.h> | |
1449 | int main(int argc, char **argv) | |
1450 | { | |
1451 | return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0); | |
1452 | } | |
1453 | EOF | |
1454 | if compile_prog "" "" "pwritev2"; then | |
1455 | pwritev2="yes" | |
1456 | fi | |
484b0b65 | 1457 | print_config "pwritev2/preadv2" "$pwritev2" |
2cafffbe | 1458 | |
ecad55e9 JA |
1459 | ########################################## |
1460 | # Check whether we have the required functions for ipv6 | |
ca205a75 TK |
1461 | if test "$ipv6" != "yes" ; then |
1462 | ipv6="no" | |
1463 | fi | |
ecad55e9 JA |
1464 | cat > $TMPC << EOF |
1465 | #include <sys/types.h> | |
1466 | #include <sys/socket.h> | |
d219028d | 1467 | #include <netinet/in.h> |
ecad55e9 JA |
1468 | #include <netdb.h> |
1469 | #include <stdio.h> | |
1470 | int main(int argc, char **argv) | |
1471 | { | |
1472 | struct addrinfo hints; | |
1473 | struct in6_addr addr; | |
1474 | int ret; | |
1475 | ||
1476 | ret = getaddrinfo(NULL, NULL, &hints, NULL); | |
1477 | freeaddrinfo(NULL); | |
1478 | printf("%s\n", gai_strerror(ret)); | |
1479 | addr = in6addr_any; | |
1480 | return 0; | |
1481 | } | |
1482 | EOF | |
1483 | if compile_prog "" "" "ipv6"; then | |
1484 | ipv6="yes" | |
1485 | fi | |
484b0b65 | 1486 | print_config "IPv6 helpers" "$ipv6" |
07fc0acd | 1487 | |
fc5c0345 DG |
1488 | ########################################## |
1489 | # check for rbd | |
ca205a75 TK |
1490 | if test "$rbd" != "yes" ; then |
1491 | rbd="no" | |
1492 | fi | |
fc5c0345 DG |
1493 | cat > $TMPC << EOF |
1494 | #include <rbd/librbd.h> | |
1495 | ||
1496 | int main(int argc, char **argv) | |
1497 | { | |
fc5c0345 DG |
1498 | rados_t cluster; |
1499 | rados_ioctx_t io_ctx; | |
fb9bc6e3 SW |
1500 | const char cluster_name[] = "ceph"; |
1501 | const char user_name[] = "client.admin"; | |
fc5c0345 | 1502 | const char pool[] = "rbd"; |
fc5c0345 | 1503 | int major, minor, extra; |
fc5c0345 | 1504 | |
fb9bc6e3 SW |
1505 | rbd_version(&major, &minor, &extra); |
1506 | /* The rados_create2 signature required was only introduced in ceph 0.65 */ | |
1507 | rados_create2(&cluster, cluster_name, user_name, 0); | |
fc5c0345 | 1508 | rados_ioctx_create(cluster, pool, &io_ctx); |
fb9bc6e3 | 1509 | |
fc5c0345 DG |
1510 | return 0; |
1511 | } | |
1512 | EOF | |
ce18290e | 1513 | if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then |
fc5c0345 DG |
1514 | LIBS="-lrbd -lrados $LIBS" |
1515 | rbd="yes" | |
1516 | fi | |
484b0b65 | 1517 | print_config "Rados Block Device engine" "$rbd" |
fc5c0345 | 1518 | |
53b6c979 PL |
1519 | ########################################## |
1520 | # check for rbd_poll | |
ca205a75 TK |
1521 | if test "$rbd_poll" != "yes" ; then |
1522 | rbd_poll="no" | |
1523 | fi | |
53b6c979 PL |
1524 | if test "$rbd" = "yes"; then |
1525 | cat > $TMPC << EOF | |
1526 | #include <rbd/librbd.h> | |
1527 | #include <sys/eventfd.h> | |
1528 | ||
1529 | int main(int argc, char **argv) | |
1530 | { | |
1531 | rbd_image_t image; | |
1532 | rbd_completion_t comp; | |
1533 | ||
1534 | int fd = eventfd(0, EFD_NONBLOCK); | |
1535 | rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD); | |
1536 | rbd_poll_io_events(image, comp, 1); | |
1537 | ||
1538 | return 0; | |
1539 | } | |
1540 | EOF | |
1541 | if compile_prog "" "-lrbd -lrados" "rbd"; then | |
1542 | rbd_poll="yes" | |
1543 | fi | |
484b0b65 | 1544 | print_config "rbd_poll" "$rbd_poll" |
53b6c979 PL |
1545 | fi |
1546 | ||
903b2812 JA |
1547 | ########################################## |
1548 | # check for rbd_invaidate_cache() | |
ca205a75 TK |
1549 | if test "$rbd_inval" != "yes" ; then |
1550 | rbd_inval="no" | |
1551 | fi | |
903b2812 JA |
1552 | if test "$rbd" = "yes"; then |
1553 | cat > $TMPC << EOF | |
1554 | #include <rbd/librbd.h> | |
1555 | ||
1556 | int main(int argc, char **argv) | |
1557 | { | |
1558 | rbd_image_t image; | |
1559 | ||
1560 | return rbd_invalidate_cache(image); | |
1561 | } | |
1562 | EOF | |
1563 | if compile_prog "" "-lrbd -lrados" "rbd"; then | |
1564 | rbd_inval="yes" | |
1565 | fi | |
484b0b65 | 1566 | print_config "rbd_invalidate_cache" "$rbd_inval" |
903b2812 JA |
1567 | fi |
1568 | ||
a4c4c346 | 1569 | ########################################## |
1570 | # check for blkin | |
ca205a75 TK |
1571 | if test "$rbd_blkin" != "yes" ; then |
1572 | rbd_blkin="no" | |
1573 | fi | |
a4c4c346 | 1574 | cat > $TMPC << EOF |
1575 | #include <rbd/librbd.h> | |
1576 | #include <zipkin_c.h> | |
1577 | ||
1578 | int main(int argc, char **argv) | |
1579 | { | |
1580 | int r; | |
1581 | struct blkin_trace_info t_info; | |
1582 | blkin_init_trace_info(&t_info); | |
1583 | rbd_completion_t completion; | |
1584 | rbd_image_t image; | |
1585 | uint64_t off; | |
1586 | size_t len; | |
1587 | const char *buf; | |
1588 | r = rbd_aio_write_traced(image, off, len, buf, completion, &t_info); | |
1589 | return 0; | |
1590 | } | |
1591 | EOF | |
1592 | if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \ | |
1593 | && compile_prog "" "-lrbd -lrados -lblkin" "rbd_blkin"; then | |
1594 | LIBS="-lblkin $LIBS" | |
1595 | rbd_blkin="yes" | |
1596 | fi | |
484b0b65 | 1597 | print_config "rbd blkin tracing" "$rbd_blkin" |
a4c4c346 | 1598 | |
2e802282 JA |
1599 | ########################################## |
1600 | # Check whether we have setvbuf | |
ca205a75 TK |
1601 | if test "$setvbuf" != "yes" ; then |
1602 | setvbuf="no" | |
1603 | fi | |
2e802282 JA |
1604 | cat > $TMPC << EOF |
1605 | #include <stdio.h> | |
1606 | int main(int argc, char **argv) | |
1607 | { | |
1608 | FILE *f = NULL; | |
1609 | char buf[80]; | |
1610 | setvbuf(f, buf, _IOFBF, sizeof(buf)); | |
1611 | return 0; | |
1612 | } | |
1613 | EOF | |
1614 | if compile_prog "" "" "setvbuf"; then | |
1615 | setvbuf="yes" | |
1616 | fi | |
484b0b65 | 1617 | print_config "setvbuf" "$setvbuf" |
fc5c0345 | 1618 | |
bda92394 | 1619 | ########################################## |
6e7d7dfb | 1620 | # check for gfapi |
ca205a75 TK |
1621 | if test "$gfapi" != "yes" ; then |
1622 | gfapi="no" | |
1623 | fi | |
6e7d7dfb | 1624 | cat > $TMPC << EOF |
1625 | #include <glusterfs/api/glfs.h> | |
1626 | ||
1627 | int main(int argc, char **argv) | |
1628 | { | |
6e7d7dfb | 1629 | glfs_t *g = glfs_new("foo"); |
1630 | ||
1631 | return 0; | |
1632 | } | |
1633 | EOF | |
ce18290e | 1634 | if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
6e7d7dfb | 1635 | LIBS="-lgfapi -lglusterfs $LIBS" |
1636 | gfapi="yes" | |
1637 | fi | |
484b0b65 | 1638 | print_config "Gluster API engine" "$gfapi" |
6e7d7dfb | 1639 | |
6fa14b99 | 1640 | ########################################## |
ca205a75 | 1641 | # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes" |
6876c98c | 1642 | if test "$gfapi" = "yes" ; then |
6fa14b99 | 1643 | gf_fadvise="no" |
1644 | cat > $TMPC << EOF | |
1645 | #include <glusterfs/api/glfs.h> | |
1646 | ||
1647 | int main(int argc, char **argv) | |
1648 | { | |
1649 | struct glfs_fd *fd; | |
1650 | int ret = glfs_fadvise(fd, 0, 0, 1); | |
1651 | ||
1652 | return 0; | |
1653 | } | |
1654 | EOF | |
6fa14b99 | 1655 | if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
1656 | gf_fadvise="yes" | |
1657 | fi | |
484b0b65 | 1658 | print_config "Gluster API use fadvise" "$gf_fadvise" |
6876c98c JA |
1659 | fi |
1660 | ||
1661 | ########################################## | |
1662 | # check for gfapi trim support | |
ca205a75 TK |
1663 | if test "$gf_trim" != "yes" ; then |
1664 | gf_trim="no" | |
1665 | fi | |
6876c98c JA |
1666 | if test "$gfapi" = "yes" ; then |
1667 | cat > $TMPC << EOF | |
1668 | #include <glusterfs/api/glfs.h> | |
1669 | ||
1670 | int main(int argc, char **argv) | |
1671 | { | |
1672 | return glfs_discard_async(NULL, 0, 0); | |
1673 | } | |
1674 | EOF | |
1675 | if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then | |
1676 | gf_trim="yes" | |
1677 | fi | |
484b0b65 | 1678 | print_config "Gluster API trim support" "$gf_trim" |
6876c98c | 1679 | fi |
fc5c0345 | 1680 | |
81795ce3 CE |
1681 | ########################################## |
1682 | # Check if we support stckf on s390 | |
ca205a75 TK |
1683 | if test "$s390_z196_facilities" != "yes" ; then |
1684 | s390_z196_facilities="no" | |
1685 | fi | |
81795ce3 CE |
1686 | cat > $TMPC << EOF |
1687 | #define STFLE_BITS_Z196 45 /* various z196 facilities ... */ | |
1688 | int main(int argc, char **argv) | |
1689 | { | |
1690 | /* We want just 1 double word to be returned. */ | |
1691 | register unsigned long reg0 asm("0") = 0; | |
1692 | unsigned long stfle_bits; | |
1693 | asm volatile(".machine push" "\n\t" | |
1694 | ".machine \"z9-109\"" "\n\t" | |
1695 | "stfle %0" "\n\t" | |
1696 | ".machine pop" "\n" | |
1697 | : "=QS" (stfle_bits), "+d" (reg0) | |
1698 | : : "cc"); | |
1699 | ||
1700 | if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) | |
1701 | return 0; | |
1702 | else | |
1703 | return -1; | |
1704 | } | |
1705 | EOF | |
1706 | if compile_prog "" "" "s390_z196_facilities"; then | |
1707 | $TMPE | |
6a2c9363 | 1708 | if [ $? -eq 0 ]; then |
81795ce3 CE |
1709 | s390_z196_facilities="yes" |
1710 | fi | |
1711 | fi | |
484b0b65 | 1712 | print_config "s390_z196_facilities" "$s390_z196_facilities" |
1b10477b MM |
1713 | |
1714 | ########################################## | |
1715 | # Check if we have required environment variables configured for libhdfs | |
1716 | if test "$libhdfs" = "yes" ; then | |
1717 | hdfs_conf_error=0 | |
1718 | if test "$JAVA_HOME" = "" ; then | |
1719 | echo "configure: JAVA_HOME should be defined to jdk/jvm path" | |
1720 | hdfs_conf_error=1 | |
1721 | fi | |
1722 | if test "$FIO_LIBHDFS_INCLUDE" = "" ; then | |
1723 | echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path" | |
1724 | hdfs_conf_error=1 | |
1725 | fi | |
1726 | if test "$FIO_LIBHDFS_LIB" = "" ; then | |
1727 | echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path" | |
1728 | hdfs_conf_error=1 | |
1729 | fi | |
1730 | if test "$hdfs_conf_error" = "1" ; then | |
1731 | exit 1 | |
1732 | fi | |
247e5436 JA |
1733 | FIO_HDFS_CPU=$cpu |
1734 | if test "$FIO_HDFS_CPU" = "x86_64" ; then | |
1735 | FIO_HDFS_CPU="amd64" | |
1736 | fi | |
1b10477b | 1737 | fi |
484b0b65 | 1738 | print_config "HDFS engine" "$libhdfs" |
1b10477b | 1739 | |
b8116a87 DE |
1740 | ########################################## |
1741 | # Check whether we have MTD | |
ca205a75 TK |
1742 | if test "$mtd" != "yes" ; then |
1743 | mtd="no" | |
1744 | fi | |
b8116a87 | 1745 | cat > $TMPC << EOF |
0e1c454a | 1746 | #include <string.h> |
b8116a87 DE |
1747 | #include <mtd/mtd-user.h> |
1748 | #include <sys/ioctl.h> | |
1749 | int main(int argc, char **argv) | |
1750 | { | |
0e1c454a | 1751 | struct mtd_write_req ops; |
b8116a87 | 1752 | struct mtd_info_user info; |
0e1c454a | 1753 | memset(&ops, 0, sizeof(ops)); |
400cd0ff | 1754 | info.type = MTD_MLCNANDFLASH; |
b8116a87 DE |
1755 | return ioctl(0, MEMGETINFO, &info); |
1756 | } | |
1757 | EOF | |
1758 | if compile_prog "" "" "mtd"; then | |
1759 | mtd="yes" | |
1760 | fi | |
484b0b65 | 1761 | print_config "MTD" "$mtd" |
b8116a87 | 1762 | |
3ee2a3c1 DJ |
1763 | ########################################## |
1764 | # Check whether we have libpmem | |
ca205a75 TK |
1765 | if test "$libpmem" != "yes" ; then |
1766 | libpmem="no" | |
1767 | fi | |
3ee2a3c1 DJ |
1768 | cat > $TMPC << EOF |
1769 | #include <libpmem.h> | |
1770 | int main(int argc, char **argv) | |
1771 | { | |
1772 | int rc; | |
1773 | rc = pmem_is_pmem(0, 0); | |
1774 | return 0; | |
1775 | } | |
1776 | EOF | |
1777 | if compile_prog "" "-lpmem" "libpmem"; then | |
1778 | libpmem="yes" | |
cf8775b8 | 1779 | LIBS="-lpmem $LIBS" |
3ee2a3c1 | 1780 | fi |
484b0b65 | 1781 | print_config "libpmem" "$libpmem" |
3ee2a3c1 DJ |
1782 | |
1783 | ########################################## | |
1784 | # Check whether we have libpmemblk | |
cf8775b8 | 1785 | # libpmem is a prerequisite |
ca205a75 TK |
1786 | if test "$libpmemblk" != "yes" ; then |
1787 | libpmemblk="no" | |
1788 | fi | |
cf8775b8 RE |
1789 | if test "$libpmem" = "yes"; then |
1790 | cat > $TMPC << EOF | |
3ee2a3c1 DJ |
1791 | #include <libpmemblk.h> |
1792 | int main(int argc, char **argv) | |
1793 | { | |
cf8775b8 RE |
1794 | PMEMblkpool *pbp; |
1795 | pbp = pmemblk_open("", 0); | |
3ee2a3c1 DJ |
1796 | return 0; |
1797 | } | |
1798 | EOF | |
cf8775b8 RE |
1799 | if compile_prog "" "-lpmemblk" "libpmemblk"; then |
1800 | libpmemblk="yes" | |
1801 | LIBS="-lpmemblk $LIBS" | |
1802 | fi | |
3ee2a3c1 | 1803 | fi |
484b0b65 | 1804 | print_config "libpmemblk" "$libpmemblk" |
3ee2a3c1 | 1805 | |
cf8775b8 | 1806 | # Choose the ioengines |
3ee2a3c1 DJ |
1807 | if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then |
1808 | devdax="yes" | |
1809 | if test "$libpmemblk" = "yes"; then | |
1810 | pmemblk="yes" | |
1811 | fi | |
1812 | fi | |
1813 | ||
43f3cec2 BB |
1814 | ########################################## |
1815 | # Report whether pmemblk engine is enabled | |
484b0b65 | 1816 | print_config "NVML pmemblk engine" "$pmemblk" |
43f3cec2 | 1817 | |
cbb15e42 DJ |
1818 | ########################################## |
1819 | # Report whether dev-dax engine is enabled | |
484b0b65 | 1820 | print_config "NVML dev-dax engine" "$devdax" |
cbb15e42 | 1821 | |
bda92394 | 1822 | ########################################## |
b470a02c SC |
1823 | # Check if we have lex/yacc available |
1824 | yacc="no" | |
e7b2c7a3 | 1825 | yacc_is_bison="no" |
b470a02c SC |
1826 | lex="no" |
1827 | arith="no" | |
de26b824 | 1828 | if test "$disable_lex" = "no" || test -z "$disable_lex" ; then |
cf6dd80e | 1829 | if test "$targetos" != "SunOS" ; then |
e7b2c7a3 | 1830 | LEX=$(which lex 2> /dev/null) |
b470a02c SC |
1831 | if test -x "$LEX" ; then |
1832 | lex="yes" | |
1833 | fi | |
7e0049e9 | 1834 | YACC=$(which bison 2> /dev/null) |
b470a02c SC |
1835 | if test -x "$YACC" ; then |
1836 | yacc="yes" | |
7e0049e9 | 1837 | yacc_is_bison="yes" |
e7b2c7a3 | 1838 | else |
7e0049e9 | 1839 | YACC=$(which yacc 2> /dev/null) |
e7b2c7a3 JA |
1840 | if test -x "$YACC" ; then |
1841 | yacc="yes" | |
e7b2c7a3 | 1842 | fi |
b470a02c SC |
1843 | fi |
1844 | if test "$yacc" = "yes" && test "$lex" = "yes" ; then | |
1845 | arith="yes" | |
1846 | fi | |
1847 | ||
1848 | if test "$arith" = "yes" ; then | |
1849 | cat > $TMPC << EOF | |
1850 | extern int yywrap(void); | |
1851 | ||
1852 | int main(int argc, char **argv) | |
1853 | { | |
1854 | yywrap(); | |
1855 | return 0; | |
1856 | } | |
1857 | EOF | |
719cda03 JA |
1858 | if compile_prog "" "-ll" "lex"; then |
1859 | LIBS="-ll $LIBS" | |
b470a02c SC |
1860 | else |
1861 | arith="no" | |
1862 | fi | |
1863 | fi | |
cf6dd80e | 1864 | fi |
a655bbc4 | 1865 | fi |
b470a02c | 1866 | |
63bda378 JA |
1867 | # Check if lex fails using -o |
1868 | if test "$arith" = "yes" ; then | |
daf705b5 JA |
1869 | if test "$force_no_lex_o" = "yes" ; then |
1870 | lex_use_o="no" | |
1871 | else | |
63bda378 JA |
1872 | $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null |
1873 | if test "$?" = "0" ; then | |
1874 | lex_use_o="yes" | |
1875 | else | |
1876 | lex_use_o="no" | |
1877 | fi | |
1878 | fi | |
daf705b5 | 1879 | fi |
63bda378 | 1880 | |
484b0b65 | 1881 | print_config "lex/yacc for arithmetic" "$arith" |
b470a02c | 1882 | |
aae599ba JA |
1883 | ########################################## |
1884 | # Check whether we have setmntent/getmntent | |
ca205a75 TK |
1885 | if test "$getmntent" != "yes" ; then |
1886 | getmntent="no" | |
1887 | fi | |
aae599ba JA |
1888 | cat > $TMPC << EOF |
1889 | #include <stdio.h> | |
1890 | #include <mntent.h> | |
1891 | int main(int argc, char **argv) | |
1892 | { | |
1893 | FILE *mtab = setmntent(NULL, "r"); | |
1894 | struct mntent *mnt = getmntent(mtab); | |
1581b82a | 1895 | endmntent(mtab); |
aae599ba JA |
1896 | return 0; |
1897 | } | |
1898 | EOF | |
1899 | if compile_prog "" "" "getmntent"; then | |
1900 | getmntent="yes" | |
1901 | fi | |
484b0b65 | 1902 | print_config "getmntent" "$getmntent" |
aae599ba | 1903 | |
e7e136da TK |
1904 | ########################################## |
1905 | # Check whether we have getmntinfo | |
b765bec0 TK |
1906 | # These are originally added for BSDs, but may also work |
1907 | # on other operating systems with getmntinfo(3). | |
1908 | ||
1909 | # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD. | |
1910 | # Note that NetBSD needs -Werror to catch warning as error. | |
ca205a75 TK |
1911 | if test "$getmntinfo" != "yes" ; then |
1912 | getmntinfo="no" | |
1913 | fi | |
e7e136da TK |
1914 | cat > $TMPC << EOF |
1915 | #include <stdio.h> | |
1916 | #include <sys/param.h> | |
1917 | #include <sys/mount.h> | |
1918 | int main(int argc, char **argv) | |
1919 | { | |
9ada751d | 1920 | struct statfs *st; |
e7e136da TK |
1921 | return getmntinfo(&st, MNT_NOWAIT); |
1922 | } | |
1923 | EOF | |
b765bec0 | 1924 | if compile_prog "-Werror" "" "getmntinfo"; then |
e7e136da TK |
1925 | getmntinfo="yes" |
1926 | fi | |
484b0b65 | 1927 | print_config "getmntinfo" "$getmntinfo" |
e7e136da | 1928 | |
b765bec0 | 1929 | # getmntinfo(3) for NetBSD. |
ca205a75 TK |
1930 | if test "$getmntinfo_statvfs" != "yes" ; then |
1931 | getmntinfo_statvfs="no" | |
1932 | fi | |
b765bec0 TK |
1933 | cat > $TMPC << EOF |
1934 | #include <stdio.h> | |
1935 | #include <sys/statvfs.h> | |
1936 | int main(int argc, char **argv) | |
1937 | { | |
1938 | struct statvfs *st; | |
1939 | return getmntinfo(&st, MNT_NOWAIT); | |
1940 | } | |
1941 | EOF | |
1942 | # Skip the test if the one with statfs arg is detected. | |
1943 | if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then | |
1944 | getmntinfo_statvfs="yes" | |
484b0b65 | 1945 | print_config "getmntinfo_statvfs" "$getmntinfo_statvfs" |
b765bec0 TK |
1946 | fi |
1947 | ||
5018f79f AH |
1948 | ########################################## |
1949 | # Check whether we have _Static_assert | |
ca205a75 TK |
1950 | if test "$static_assert" != "yes" ; then |
1951 | static_assert="no" | |
1952 | fi | |
5018f79f AH |
1953 | cat > $TMPC << EOF |
1954 | #include <assert.h> | |
94815a5c | 1955 | #include <stdlib.h> |
51b4c81e | 1956 | #include <stddef.h> |
94815a5c JA |
1957 | |
1958 | struct foo { | |
1959 | int a, b; | |
1960 | }; | |
1961 | ||
5018f79f AH |
1962 | int main(int argc, char **argv) |
1963 | { | |
94815a5c | 1964 | _Static_assert(offsetof(struct foo, a) == 0 , "Check"); |
5018f79f AH |
1965 | return 0 ; |
1966 | } | |
1967 | EOF | |
1968 | if compile_prog "" "" "static_assert"; then | |
1969 | static_assert="yes" | |
1970 | fi | |
484b0b65 | 1971 | print_config "Static Assert" "$static_assert" |
e39c0676 JA |
1972 | |
1973 | ########################################## | |
1974 | # Check whether we have bool / stdbool.h | |
ca205a75 TK |
1975 | if test "$have_bool" != "yes" ; then |
1976 | have_bool="no" | |
1977 | fi | |
e39c0676 JA |
1978 | cat > $TMPC << EOF |
1979 | #include <stdbool.h> | |
1980 | int main(int argc, char **argv) | |
1981 | { | |
1982 | bool var = true; | |
1983 | return var != false; | |
1984 | } | |
1985 | EOF | |
1986 | if compile_prog "" "" "bool"; then | |
1987 | have_bool="yes" | |
1988 | fi | |
484b0b65 | 1989 | print_config "bool" "$have_bool" |
e39c0676 | 1990 | |
b29c71c4 JA |
1991 | ########################################## |
1992 | # Check whether we have strndup() | |
107ad008 | 1993 | strndup="no" |
b29c71c4 JA |
1994 | cat > $TMPC << EOF |
1995 | #include <string.h> | |
1996 | #include <stdlib.h> | |
1997 | int main(int argc, char **argv) | |
1998 | { | |
1999 | char *res = strndup("test string", 8); | |
2000 | ||
2001 | free(res); | |
2002 | return 0; | |
2003 | } | |
2004 | EOF | |
2005 | if compile_prog "" "" "strndup"; then | |
2006 | strndup="yes" | |
2007 | fi | |
2008 | print_config "strndup" "$strndup" | |
2009 | ||
214e2d56 | 2010 | ########################################## |
2011 | # check march=armv8-a+crc+crypto | |
ca205a75 TK |
2012 | if test "$march_armv8_a_crc_crypto" != "yes" ; then |
2013 | march_armv8_a_crc_crypto="no" | |
2014 | fi | |
214e2d56 | 2015 | if test "$cpu" = "arm64" ; then |
2016 | cat > $TMPC <<EOF | |
9b153dc2 TT |
2017 | #include <sys/auxv.h> |
2018 | #include <arm_acle.h> | |
2019 | #include <arm_neon.h> | |
2020 | ||
214e2d56 | 2021 | int main(void) |
2022 | { | |
2023 | return 0; | |
2024 | } | |
2025 | EOF | |
2026 | if compile_prog "-march=armv8-a+crc+crypto" "" ""; then | |
2027 | march_armv8_a_crc_crypto="yes" | |
2028 | CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO" | |
2029 | fi | |
2030 | fi | |
484b0b65 | 2031 | print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto" |
214e2d56 | 2032 | |
03553853 YR |
2033 | ########################################## |
2034 | # cuda probe | |
d418fa90 TK |
2035 | if test "$cuda" != "yes" ; then |
2036 | cuda="no" | |
2037 | fi | |
03553853 YR |
2038 | cat > $TMPC << EOF |
2039 | #include <cuda.h> | |
2040 | int main(int argc, char **argv) | |
2041 | { | |
2042 | return cuInit(0); | |
2043 | } | |
2044 | EOF | |
4bd2c8b9 | 2045 | if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then |
03553853 YR |
2046 | cuda="yes" |
2047 | LIBS="-lcuda $LIBS" | |
2048 | fi | |
484b0b65 | 2049 | print_config "cuda" "$cuda" |
214e2d56 | 2050 | |
4252396e JA |
2051 | ########################################## |
2052 | # mkdir() probe. mingw apparently has a one-argument mkdir :/ | |
2053 | mkdir_two="no" | |
2054 | cat > $TMPC << EOF | |
2055 | #include <sys/stat.h> | |
2056 | #include <sys/types.h> | |
2057 | int main(int argc, char **argv) | |
2058 | { | |
2059 | return mkdir("/tmp/bla", 0600); | |
2060 | } | |
2061 | EOF | |
2062 | if compile_prog "" "" "mkdir(a, b)"; then | |
2063 | mkdir_two="yes" | |
2064 | fi | |
2065 | print_config "mkdir(a, b)" "$mkdir_two" | |
2066 | ||
67bf9823 JA |
2067 | ############################################################################# |
2068 | ||
67bf9823 | 2069 | if test "$wordsize" = "64" ; then |
4feafb1e | 2070 | output_sym "CONFIG_64BIT" |
67bf9823 | 2071 | elif test "$wordsize" = "32" ; then |
4feafb1e | 2072 | output_sym "CONFIG_32BIT" |
67bf9823 | 2073 | else |
d7145a78 | 2074 | fatal "Unknown wordsize!" |
67bf9823 | 2075 | fi |
0dcebdf4 | 2076 | if test "$bigendian" = "yes" ; then |
4feafb1e | 2077 | output_sym "CONFIG_BIG_ENDIAN" |
0dcebdf4 | 2078 | else |
4feafb1e | 2079 | output_sym "CONFIG_LITTLE_ENDIAN" |
0dcebdf4 | 2080 | fi |
3989b143 JA |
2081 | if test "$zlib" = "yes" ; then |
2082 | output_sym "CONFIG_ZLIB" | |
2083 | fi | |
67bf9823 | 2084 | if test "$libaio" = "yes" ; then |
4feafb1e | 2085 | output_sym "CONFIG_LIBAIO" |
67bf9823 JA |
2086 | fi |
2087 | if test "$posix_aio" = "yes" ; then | |
4feafb1e | 2088 | output_sym "CONFIG_POSIXAIO" |
67bf9823 JA |
2089 | fi |
2090 | if test "$posix_aio_fsync" = "yes" ; then | |
4feafb1e | 2091 | output_sym "CONFIG_POSIXAIO_FSYNC" |
67bf9823 | 2092 | fi |
06eac6b2 SW |
2093 | if test "$posix_pshared" = "yes" ; then |
2094 | output_sym "CONFIG_PSHARED" | |
2095 | fi | |
67bf9823 | 2096 | if test "$linux_fallocate" = "yes" ; then |
4feafb1e | 2097 | output_sym "CONFIG_LINUX_FALLOCATE" |
67bf9823 JA |
2098 | fi |
2099 | if test "$posix_fallocate" = "yes" ; then | |
4feafb1e | 2100 | output_sym "CONFIG_POSIX_FALLOCATE" |
67bf9823 JA |
2101 | fi |
2102 | if test "$fdatasync" = "yes" ; then | |
4feafb1e | 2103 | output_sym "CONFIG_FDATASYNC" |
67bf9823 JA |
2104 | fi |
2105 | if test "$sync_file_range" = "yes" ; then | |
4feafb1e | 2106 | output_sym "CONFIG_SYNC_FILE_RANGE" |
67bf9823 JA |
2107 | fi |
2108 | if test "$sfaa" = "yes" ; then | |
4feafb1e | 2109 | output_sym "CONFIG_SFAA" |
67bf9823 | 2110 | fi |
954cd73a | 2111 | if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then |
4feafb1e | 2112 | output_sym "CONFIG_RDMA" |
67bf9823 JA |
2113 | fi |
2114 | if test "$clock_gettime" = "yes" ; then | |
4feafb1e | 2115 | output_sym "CONFIG_CLOCK_GETTIME" |
67bf9823 JA |
2116 | fi |
2117 | if test "$clock_monotonic" = "yes" ; then | |
4feafb1e | 2118 | output_sym "CONFIG_CLOCK_MONOTONIC" |
67bf9823 | 2119 | fi |
c544f604 SN |
2120 | if test "$clock_monotonic_raw" = "yes" ; then |
2121 | output_sym "CONFIG_CLOCK_MONOTONIC_RAW" | |
2122 | fi | |
67bf9823 | 2123 | if test "$clock_monotonic_precise" = "yes" ; then |
4feafb1e | 2124 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
67bf9823 | 2125 | fi |
25f8227d JA |
2126 | if test "$clockid_t" = "yes"; then |
2127 | output_sym "CONFIG_CLOCKID_T" | |
2128 | fi | |
67bf9823 | 2129 | if test "$gettimeofday" = "yes" ; then |
4feafb1e | 2130 | output_sym "CONFIG_GETTIMEOFDAY" |
67bf9823 JA |
2131 | fi |
2132 | if test "$posix_fadvise" = "yes" ; then | |
4feafb1e | 2133 | output_sym "CONFIG_POSIX_FADVISE" |
67bf9823 JA |
2134 | fi |
2135 | if test "$linux_3arg_affinity" = "yes" ; then | |
4feafb1e | 2136 | output_sym "CONFIG_3ARG_AFFINITY" |
67bf9823 | 2137 | elif test "$linux_2arg_affinity" = "yes" ; then |
4feafb1e | 2138 | output_sym "CONFIG_2ARG_AFFINITY" |
67bf9823 JA |
2139 | fi |
2140 | if test "$strsep" = "yes" ; then | |
4feafb1e | 2141 | output_sym "CONFIG_STRSEP" |
67bf9823 | 2142 | fi |
9ad8da82 JA |
2143 | if test "$strcasestr" = "yes" ; then |
2144 | output_sym "CONFIG_STRCASESTR" | |
2145 | fi | |
5ad7be56 KD |
2146 | if test "$strlcat" = "yes" ; then |
2147 | output_sym "CONFIG_STRLCAT" | |
2148 | fi | |
67bf9823 | 2149 | if test "$getopt_long_only" = "yes" ; then |
4feafb1e | 2150 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
67bf9823 JA |
2151 | fi |
2152 | if test "$inet_aton" = "yes" ; then | |
4feafb1e | 2153 | output_sym "CONFIG_INET_ATON" |
67bf9823 JA |
2154 | fi |
2155 | if test "$socklen_t" = "yes" ; then | |
4feafb1e | 2156 | output_sym "CONFIG_SOCKLEN_T" |
67bf9823 JA |
2157 | fi |
2158 | if test "$ext4_me" = "yes" ; then | |
4feafb1e | 2159 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
67bf9823 JA |
2160 | fi |
2161 | if test "$linux_splice" = "yes" ; then | |
4feafb1e | 2162 | output_sym "CONFIG_LINUX_SPLICE" |
67bf9823 JA |
2163 | fi |
2164 | if test "$guasi" = "yes" ; then | |
4feafb1e | 2165 | output_sym "CONFIG_GUASI" |
67bf9823 JA |
2166 | fi |
2167 | if test "$fusion_aw" = "yes" ; then | |
4feafb1e | 2168 | output_sym "CONFIG_FUSION_AW" |
67bf9823 | 2169 | fi |
50206d9b | 2170 | if test "$libnuma_v2" = "yes" ; then |
4feafb1e | 2171 | output_sym "CONFIG_LIBNUMA" |
67bf9823 JA |
2172 | fi |
2173 | if test "$solaris_aio" = "yes" ; then | |
4feafb1e | 2174 | output_sym "CONFIG_SOLARISAIO" |
67bf9823 JA |
2175 | fi |
2176 | if test "$tls_thread" = "yes" ; then | |
4feafb1e | 2177 | output_sym "CONFIG_TLS_THREAD" |
67bf9823 | 2178 | fi |
44404c5a | 2179 | if test "$rusage_thread" = "yes" ; then |
4feafb1e | 2180 | output_sym "CONFIG_RUSAGE_THREAD" |
67bf9823 | 2181 | fi |
91f94d5b | 2182 | if test "$gfio" = "yes" ; then |
bad7e42c | 2183 | output_sym "CONFIG_GFIO" |
91f94d5b | 2184 | fi |
c8931876 JA |
2185 | if test "$esx" = "yes" ; then |
2186 | output_sym "CONFIG_ESX" | |
2187 | output_sym "CONFIG_NO_SHM" | |
2188 | fi | |
7e09a9f1 JA |
2189 | if test "$sched_idle" = "yes" ; then |
2190 | output_sym "CONFIG_SCHED_IDLE" | |
2191 | fi | |
1eafa37a JA |
2192 | if test "$tcp_nodelay" = "yes" ; then |
2193 | output_sym "CONFIG_TCP_NODELAY" | |
2194 | fi | |
1008602c JA |
2195 | if test "$window_size" = "yes" ; then |
2196 | output_sym "CONFIG_NET_WINDOWSIZE" | |
2197 | fi | |
e5f34d95 JA |
2198 | if test "$mss" = "yes" ; then |
2199 | output_sym "CONFIG_NET_MSS" | |
2200 | fi | |
38b9354a JA |
2201 | if test "$rlimit_memlock" = "yes" ; then |
2202 | output_sym "CONFIG_RLIMIT_MEMLOCK" | |
2203 | fi | |
07fc0acd JA |
2204 | if test "$pwritev" = "yes" ; then |
2205 | output_sym "CONFIG_PWRITEV" | |
2206 | fi | |
2cafffbe JA |
2207 | if test "$pwritev2" = "yes" ; then |
2208 | output_sym "CONFIG_PWRITEV2" | |
2209 | fi | |
ecad55e9 JA |
2210 | if test "$ipv6" = "yes" ; then |
2211 | output_sym "CONFIG_IPV6" | |
2212 | fi | |
fc5c0345 DG |
2213 | if test "$rbd" = "yes" ; then |
2214 | output_sym "CONFIG_RBD" | |
2215 | fi | |
53b6c979 PL |
2216 | if test "$rbd_poll" = "yes" ; then |
2217 | output_sym "CONFIG_RBD_POLL" | |
2218 | fi | |
903b2812 JA |
2219 | if test "$rbd_inval" = "yes" ; then |
2220 | output_sym "CONFIG_RBD_INVAL" | |
2221 | fi | |
a4c4c346 | 2222 | if test "$rbd_blkin" = "yes" ; then |
2223 | output_sym "CONFIG_RBD_BLKIN" | |
2224 | fi | |
2e802282 JA |
2225 | if test "$setvbuf" = "yes" ; then |
2226 | output_sym "CONFIG_SETVBUF" | |
2227 | fi | |
81795ce3 CE |
2228 | if test "$s390_z196_facilities" = "yes" ; then |
2229 | output_sym "CONFIG_S390_Z196_FACILITIES" | |
2230 | CFLAGS="$CFLAGS -march=z9-109" | |
2231 | fi | |
6e7d7dfb | 2232 | if test "$gfapi" = "yes" ; then |
2233 | output_sym "CONFIG_GFAPI" | |
2234 | fi | |
6fa14b99 | 2235 | if test "$gf_fadvise" = "yes" ; then |
2236 | output_sym "CONFIG_GF_FADVISE" | |
2237 | fi | |
6876c98c JA |
2238 | if test "$gf_trim" = "yes" ; then |
2239 | output_sym "CONFIG_GF_TRIM" | |
2240 | fi | |
1b10477b MM |
2241 | if test "$libhdfs" = "yes" ; then |
2242 | output_sym "CONFIG_LIBHDFS" | |
247e5436 | 2243 | echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak |
1527dc50 FB |
2244 | echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak |
2245 | echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak | |
2246 | echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak | |
2247 | fi | |
b8116a87 DE |
2248 | if test "$mtd" = "yes" ; then |
2249 | output_sym "CONFIG_MTD" | |
2250 | fi | |
43f3cec2 BB |
2251 | if test "$pmemblk" = "yes" ; then |
2252 | output_sym "CONFIG_PMEMBLK" | |
2253 | fi | |
cbb15e42 DJ |
2254 | if test "$devdax" = "yes" ; then |
2255 | output_sym "CONFIG_LINUX_DEVDAX" | |
2256 | fi | |
b470a02c SC |
2257 | if test "$arith" = "yes" ; then |
2258 | output_sym "CONFIG_ARITHMETIC" | |
e7b2c7a3 JA |
2259 | if test "$yacc_is_bison" = "yes" ; then |
2260 | echo "YACC=$YACC -y" >> $config_host_mak | |
2261 | else | |
2262 | echo "YACC=$YACC" >> $config_host_mak | |
2263 | fi | |
63bda378 JA |
2264 | if test "$lex_use_o" = "yes" ; then |
2265 | echo "CONFIG_LEX_USE_O=y" >> $config_host_mak | |
2266 | fi | |
b470a02c | 2267 | fi |
aae599ba JA |
2268 | if test "$getmntent" = "yes" ; then |
2269 | output_sym "CONFIG_GETMNTENT" | |
2270 | fi | |
e7e136da TK |
2271 | if test "$getmntinfo" = "yes" ; then |
2272 | output_sym "CONFIG_GETMNTINFO" | |
2273 | fi | |
b765bec0 TK |
2274 | if test "$getmntinfo_statvfs" = "yes" ; then |
2275 | output_sym "CONFIG_GETMNTINFO_STATVFS" | |
2276 | fi | |
5018f79f AH |
2277 | if test "$static_assert" = "yes" ; then |
2278 | output_sym "CONFIG_STATIC_ASSERT" | |
2279 | fi | |
e39c0676 JA |
2280 | if test "$have_bool" = "yes" ; then |
2281 | output_sym "CONFIG_HAVE_BOOL" | |
2282 | fi | |
b29c71c4 JA |
2283 | if test "$strndup" = "yes" ; then |
2284 | output_sym "CONFIG_HAVE_STRNDUP" | |
2285 | fi | |
484817a9 JA |
2286 | if test "$disable_opt" = "yes" ; then |
2287 | output_sym "CONFIG_DISABLE_OPTIMIZATIONS" | |
2288 | fi | |
605cf82e JA |
2289 | if test "$zlib" = "no" ; then |
2290 | echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it." | |
2291 | fi | |
03553853 YR |
2292 | if test "$cuda" = "yes" ; then |
2293 | output_sym "CONFIG_CUDA" | |
2294 | fi | |
4252396e JA |
2295 | if test "$mkdir_two" = "yes" ; then |
2296 | output_sym "CONFIG_HAVE_MKDIR_TWO" | |
2297 | fi | |
605cf82e | 2298 | |
67bf9823 | 2299 | echo "LIBS+=$LIBS" >> $config_host_mak |
86719845 | 2300 | echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak |
91f94d5b | 2301 | echo "CFLAGS+=$CFLAGS" >> $config_host_mak |
d2aeedb9 | 2302 | echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak |
67bf9823 | 2303 | echo "CC=$cc" >> $config_host_mak |
af4862b3 | 2304 | echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak |
020d54bd | 2305 | echo "INSTALL_PREFIX=$prefix" >> $config_host_mak |
c61a3a44 | 2306 | |
59d8f412 | 2307 | if [ `dirname $0` != "." -a ! -e Makefile ]; then |
c61a3a44 JF |
2308 | cat > Makefile <<EOF |
2309 | SRCDIR:=`dirname $0` | |
2310 | include \$(SRCDIR)/Makefile | |
2311 | EOF | |
2312 | fi |