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