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