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