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