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