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