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