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