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