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