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