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