| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Fio configure script. Heavily influenced by the manual qemu configure |
| 4 | # script. Sad this this is easier than autoconf and enemies. |
| 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" |
| 17 | TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o" |
| 18 | TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe" |
| 19 | |
| 20 | # NB: do not call "exit" in the trap handler; this is buggy with some shells; |
| 21 | # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> |
| 22 | trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM |
| 23 | |
| 24 | rm -rf config.log |
| 25 | |
| 26 | config_host_mak="config-host.mak" |
| 27 | config_host_h="config-host.h" |
| 28 | |
| 29 | rm -rf $config_host_mak |
| 30 | rm -rf $config_host_h |
| 31 | |
| 32 | fatal() { |
| 33 | echo $@ |
| 34 | echo "Configure failed, check config.log and/or the above output" |
| 35 | rm -rf $config_host_mak |
| 36 | rm -rf $config_host_h |
| 37 | exit 1 |
| 38 | } |
| 39 | |
| 40 | # Default CFLAGS |
| 41 | CFLAGS="-D_GNU_SOURCE -include config-host.h" |
| 42 | BUILD_CFLAGS="" |
| 43 | |
| 44 | # Print a helpful header at the top of config.log |
| 45 | echo "# FIO configure log $(date)" >> config.log |
| 46 | printf "# Configured with:" >> config.log |
| 47 | printf " '%s'" "$0" "$@" >> config.log |
| 48 | echo >> config.log |
| 49 | echo "#" >> config.log |
| 50 | |
| 51 | # Print configure header at the top of $config_host_h |
| 52 | echo "/*" > $config_host_h |
| 53 | echo " * Automatically generated by configure - do not modify" >> $config_host_h |
| 54 | printf " * Configured with:" >> $config_host_h |
| 55 | printf " * '%s'" "$0" "$@" >> $config_host_h |
| 56 | echo "" >> $config_host_h |
| 57 | echo " */" >> $config_host_h |
| 58 | |
| 59 | do_cc() { |
| 60 | # Run the compiler, capturing its output to the log. |
| 61 | echo $cc "$@" >> config.log |
| 62 | $cc "$@" >> config.log 2>&1 || return $? |
| 63 | # Test passed. If this is an --enable-werror build, rerun |
| 64 | # the test with -Werror and bail out if it fails. This |
| 65 | # makes warning-generating-errors in configure test code |
| 66 | # obvious to developers. |
| 67 | if test "$werror" != "yes"; then |
| 68 | return 0 |
| 69 | fi |
| 70 | # Don't bother rerunning the compile if we were already using -Werror |
| 71 | case "$*" in |
| 72 | *-Werror*) |
| 73 | return 0 |
| 74 | ;; |
| 75 | esac |
| 76 | echo $cc -Werror "$@" >> config.log |
| 77 | $cc -Werror "$@" >> config.log 2>&1 && return $? |
| 78 | echo "ERROR: configure test passed without -Werror but failed with -Werror." |
| 79 | echo "This is probably a bug in the configure script. The failing command" |
| 80 | echo "will be at the bottom of config.log." |
| 81 | fatal "You can run configure with --disable-werror to bypass this check." |
| 82 | } |
| 83 | |
| 84 | compile_object() { |
| 85 | do_cc $CFLAGS -c -o $TMPO $TMPC |
| 86 | } |
| 87 | |
| 88 | compile_prog() { |
| 89 | local_cflags="$1" |
| 90 | local_ldflags="$2 $LIBS" |
| 91 | echo "Compiling test case $3" >> config.log |
| 92 | do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags |
| 93 | } |
| 94 | |
| 95 | feature_not_found() { |
| 96 | feature=$1 |
| 97 | packages=$2 |
| 98 | |
| 99 | echo "ERROR" |
| 100 | echo "ERROR: User requested feature $feature" |
| 101 | if test ! -z "$packages" ; then |
| 102 | echo "ERROR: That feature needs $packages installed" |
| 103 | fi |
| 104 | echo "ERROR: configure was not able to find it" |
| 105 | fatal "ERROR" |
| 106 | } |
| 107 | |
| 108 | has() { |
| 109 | type "$1" >/dev/null 2>&1 |
| 110 | } |
| 111 | |
| 112 | check_define() { |
| 113 | cat > $TMPC <<EOF |
| 114 | #if !defined($1) |
| 115 | #error $1 not defined |
| 116 | #endif |
| 117 | int main(void) |
| 118 | { |
| 119 | return 0; |
| 120 | } |
| 121 | EOF |
| 122 | compile_object |
| 123 | } |
| 124 | |
| 125 | output_sym() { |
| 126 | echo "$1=y" >> $config_host_mak |
| 127 | echo "#define $1" >> $config_host_h |
| 128 | } |
| 129 | |
| 130 | targetos="" |
| 131 | cpu="" |
| 132 | |
| 133 | # default options |
| 134 | show_help="no" |
| 135 | exit_val=0 |
| 136 | gfio_check="no" |
| 137 | libhdfs="no" |
| 138 | pmemblk="no" |
| 139 | disable_lex="" |
| 140 | prefix=/usr/local |
| 141 | |
| 142 | # parse options |
| 143 | for opt do |
| 144 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
| 145 | case "$opt" in |
| 146 | --prefix=*) prefix="$optarg" |
| 147 | ;; |
| 148 | --cpu=*) cpu="$optarg" |
| 149 | ;; |
| 150 | # esx is cross compiled and cannot be detect through simple uname calls |
| 151 | --esx) |
| 152 | esx="yes" |
| 153 | ;; |
| 154 | --cc=*) CC="$optarg" |
| 155 | ;; |
| 156 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
| 157 | ;; |
| 158 | --build-32bit-win) build_32bit_win="yes" |
| 159 | ;; |
| 160 | --build-static) build_static="yes" |
| 161 | ;; |
| 162 | --enable-gfio) |
| 163 | gfio_check="yes" |
| 164 | ;; |
| 165 | --disable-numa) disable_numa="yes" |
| 166 | ;; |
| 167 | --disable-rbd) disable_rbd="yes" |
| 168 | ;; |
| 169 | --disable-gfapi) disable_gfapi="yes" |
| 170 | ;; |
| 171 | --enable-libhdfs) libhdfs="yes" |
| 172 | ;; |
| 173 | --enable-pmemblk) pmemblk="yes" |
| 174 | ;; |
| 175 | --disable-lex) disable_lex="yes" |
| 176 | ;; |
| 177 | --enable-lex) disable_lex="no" |
| 178 | ;; |
| 179 | --disable-shm) no_shm="yes" |
| 180 | ;; |
| 181 | --disable-optimizations) disable_opt="yes" |
| 182 | ;; |
| 183 | --help) |
| 184 | show_help="yes" |
| 185 | ;; |
| 186 | *) |
| 187 | echo "Bad option $opt" |
| 188 | show_help="yes" |
| 189 | exit_val=1 |
| 190 | esac |
| 191 | done |
| 192 | |
| 193 | if test "$show_help" = "yes" ; then |
| 194 | echo "--prefix= Use this directory as installation prefix" |
| 195 | echo "--cpu= Specify target CPU if auto-detect fails" |
| 196 | echo "--cc= Specify compiler to use" |
| 197 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" |
| 198 | echo "--build-32bit-win Enable 32-bit build on Windows" |
| 199 | echo "--build-static Build a static fio" |
| 200 | echo "--esx Configure build options for esx" |
| 201 | echo "--enable-gfio Enable building of gtk gfio" |
| 202 | echo "--disable-numa Disable libnuma even if found" |
| 203 | echo "--disable-gfapi Disable gfapi" |
| 204 | echo "--enable-libhdfs Enable hdfs support" |
| 205 | echo "--enable-pmemblk Enable NVML libpmemblk support" |
| 206 | echo "--disable-lex Disable use of lex/yacc for math" |
| 207 | echo "--enable-lex Enable use of lex/yacc for math" |
| 208 | echo "--disable-shm Disable SHM support" |
| 209 | echo "--disable-optimizations Don't enable compiler optimizations" |
| 210 | exit $exit_val |
| 211 | fi |
| 212 | |
| 213 | cross_prefix=${cross_prefix-${CROSS_COMPILE}} |
| 214 | cc="${CC-${cross_prefix}gcc}" |
| 215 | |
| 216 | if check_define __ANDROID__ ; then |
| 217 | targetos="Android" |
| 218 | elif check_define __linux__ ; then |
| 219 | targetos="Linux" |
| 220 | elif check_define __OpenBSD__ ; then |
| 221 | targetos='OpenBSD' |
| 222 | elif check_define __sun__ ; then |
| 223 | targetos='SunOS' |
| 224 | CFLAGS="$CFLAGS -D_REENTRANT" |
| 225 | elif check_define _WIN32 ; then |
| 226 | targetos='CYGWIN' |
| 227 | else |
| 228 | targetos=`uname -s` |
| 229 | fi |
| 230 | |
| 231 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
| 232 | printf "# Configured with:" >> $config_host_mak |
| 233 | printf " '%s'" "$0" "$@" >> $config_host_mak |
| 234 | echo >> $config_host_mak |
| 235 | echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak |
| 236 | |
| 237 | if test "$no_shm" = "yes" ; then |
| 238 | output_sym "CONFIG_NO_SHM" |
| 239 | fi |
| 240 | |
| 241 | if test "$disable_opt" = "yes" ; then |
| 242 | output_sym "CONFIG_FIO_NO_OPT" |
| 243 | fi |
| 244 | |
| 245 | # Some host OSes need non-standard checks for which CPU to use. |
| 246 | # Note that these checks are broken for cross-compilation: if you're |
| 247 | # cross-compiling to one of these OSes then you'll need to specify |
| 248 | # the correct CPU with the --cpu option. |
| 249 | case $targetos in |
| 250 | AIX) |
| 251 | # Unless explicitly enabled, turn off lex. |
| 252 | if test -z "$disable_lex" ; then |
| 253 | disable_lex="yes" |
| 254 | else |
| 255 | force_no_lex_o="yes" |
| 256 | fi |
| 257 | ;; |
| 258 | Darwin) |
| 259 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if |
| 260 | # we can run 64-bit userspace code. |
| 261 | # If the user didn't specify a CPU explicitly and the kernel says this is |
| 262 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual |
| 263 | # detection code. |
| 264 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then |
| 265 | cpu="x86_64" |
| 266 | fi |
| 267 | ;; |
| 268 | SunOS) |
| 269 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo |
| 270 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
| 271 | cpu="x86_64" |
| 272 | fi |
| 273 | LIBS="-lnsl -lsocket" |
| 274 | ;; |
| 275 | CYGWIN*) |
| 276 | echo "Forcing known good options on Windows" |
| 277 | if test -z "$CC" ; then |
| 278 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
| 279 | CC="i686-w64-mingw32-gcc" |
| 280 | else |
| 281 | CC="x86_64-w64-mingw32-gcc" |
| 282 | fi |
| 283 | fi |
| 284 | output_sym "CONFIG_LITTLE_ENDIAN" |
| 285 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
| 286 | output_sym "CONFIG_32BIT" |
| 287 | else |
| 288 | output_sym "CONFIG_64BIT_LLP64" |
| 289 | fi |
| 290 | output_sym "CONFIG_FADVISE" |
| 291 | output_sym "CONFIG_SOCKLEN_T" |
| 292 | output_sym "CONFIG_FADVISE" |
| 293 | output_sym "CONFIG_SFAA" |
| 294 | output_sym "CONFIG_RUSAGE_THREAD" |
| 295 | output_sym "CONFIG_WINDOWSAIO" |
| 296 | output_sym "CONFIG_FDATASYNC" |
| 297 | output_sym "CONFIG_CLOCK_MONOTONIC" |
| 298 | output_sym "CONFIG_GETTIMEOFDAY" |
| 299 | output_sym "CONFIG_CLOCK_GETTIME" |
| 300 | output_sym "CONFIG_SCHED_IDLE" |
| 301 | output_sym "CONFIG_TCP_NODELAY" |
| 302 | output_sym "CONFIG_TLS_THREAD" |
| 303 | output_sym "CONFIG_IPV6" |
| 304 | echo "CC=$CC" >> $config_host_mak |
| 305 | echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak |
| 306 | exit 0 |
| 307 | ;; |
| 308 | esac |
| 309 | |
| 310 | if test ! -z "$cpu" ; then |
| 311 | # command line argument |
| 312 | : |
| 313 | elif check_define __i386__ ; then |
| 314 | cpu="i386" |
| 315 | elif check_define __x86_64__ ; then |
| 316 | cpu="x86_64" |
| 317 | elif check_define __sparc__ ; then |
| 318 | if check_define __arch64__ ; then |
| 319 | cpu="sparc64" |
| 320 | else |
| 321 | cpu="sparc" |
| 322 | fi |
| 323 | elif check_define _ARCH_PPC ; then |
| 324 | if check_define _ARCH_PPC64 ; then |
| 325 | cpu="ppc64" |
| 326 | else |
| 327 | cpu="ppc" |
| 328 | fi |
| 329 | elif check_define __mips__ ; then |
| 330 | cpu="mips" |
| 331 | elif check_define __ia64__ ; then |
| 332 | cpu="ia64" |
| 333 | elif check_define __s390__ ; then |
| 334 | if check_define __s390x__ ; then |
| 335 | cpu="s390x" |
| 336 | else |
| 337 | cpu="s390" |
| 338 | fi |
| 339 | elif check_define __arm__ ; then |
| 340 | cpu="arm" |
| 341 | elif check_define __hppa__ ; then |
| 342 | cpu="hppa" |
| 343 | else |
| 344 | cpu=`uname -m` |
| 345 | fi |
| 346 | |
| 347 | # Normalise host CPU name and set ARCH. |
| 348 | case "$cpu" in |
| 349 | ia64|ppc|ppc64|s390|s390x|sparc64) |
| 350 | cpu="$cpu" |
| 351 | ;; |
| 352 | i386|i486|i586|i686|i86pc|BePC) |
| 353 | cpu="i386" |
| 354 | ;; |
| 355 | x86_64|amd64) |
| 356 | cpu="x86_64" |
| 357 | ;; |
| 358 | armv*b|armv*l|arm) |
| 359 | cpu="arm" |
| 360 | ;; |
| 361 | hppa|parisc|parisc64) |
| 362 | cpu="hppa" |
| 363 | ;; |
| 364 | mips*) |
| 365 | cpu="mips" |
| 366 | ;; |
| 367 | sparc|sun4[cdmuv]) |
| 368 | cpu="sparc" |
| 369 | ;; |
| 370 | *) |
| 371 | echo "Unknown CPU" |
| 372 | ;; |
| 373 | esac |
| 374 | |
| 375 | if test -z "$CC" ; then |
| 376 | if test "$targetos" = "FreeBSD"; then |
| 377 | if has clang; then |
| 378 | CC=clang |
| 379 | else |
| 380 | CC=gcc |
| 381 | fi |
| 382 | fi |
| 383 | fi |
| 384 | |
| 385 | cc="${CC-${cross_prefix}gcc}" |
| 386 | |
| 387 | ########################################## |
| 388 | # check cross compile |
| 389 | |
| 390 | cross_compile="no" |
| 391 | cat > $TMPC <<EOF |
| 392 | int main(void) |
| 393 | { |
| 394 | return 0; |
| 395 | } |
| 396 | EOF |
| 397 | if compile_prog "" "" "cross"; then |
| 398 | $TMPE 2>/dev/null || cross_compile="yes" |
| 399 | else |
| 400 | fatal "compile test failed" |
| 401 | fi |
| 402 | |
| 403 | ########################################## |
| 404 | # check endianness |
| 405 | bigendian="no" |
| 406 | if test "$cross_compile" = "no" ; then |
| 407 | cat > $TMPC <<EOF |
| 408 | #include <inttypes.h> |
| 409 | int main(void) |
| 410 | { |
| 411 | volatile uint32_t i=0x01234567; |
| 412 | return (*((uint8_t*)(&i))) == 0x67; |
| 413 | } |
| 414 | EOF |
| 415 | if compile_prog "" "" "endian"; then |
| 416 | $TMPE && bigendian="yes" |
| 417 | fi |
| 418 | else |
| 419 | # If we're cross compiling, try our best to work it out and rely on the |
| 420 | # run-time check to fail if we get it wrong. |
| 421 | cat > $TMPC <<EOF |
| 422 | #include <endian.h> |
| 423 | int main(void) |
| 424 | { |
| 425 | #if __BYTE_ORDER != __BIG_ENDIAN |
| 426 | # error "Unknown endianness" |
| 427 | #endif |
| 428 | } |
| 429 | EOF |
| 430 | compile_prog "" "" "endian" && bigendian="yes" |
| 431 | check_define "__ARMEB__" && bigendian="yes" |
| 432 | check_define "__MIPSEB__" && bigendian="yes" |
| 433 | fi |
| 434 | |
| 435 | |
| 436 | echo "Operating system $targetos" |
| 437 | echo "CPU $cpu" |
| 438 | echo "Big endian $bigendian" |
| 439 | echo "Compiler $cc" |
| 440 | echo "Cross compile $cross_compile" |
| 441 | echo |
| 442 | |
| 443 | ########################################## |
| 444 | # See if we need to build a static build |
| 445 | if test "$build_static" = "yes" ; then |
| 446 | CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" |
| 447 | LDFLAGS="$LDFLAGS -static -Wl,--gc-sections" |
| 448 | else |
| 449 | build_static="no" |
| 450 | fi |
| 451 | echo "Static build $build_static" |
| 452 | |
| 453 | ########################################## |
| 454 | # check for wordsize |
| 455 | wordsize="0" |
| 456 | cat > $TMPC <<EOF |
| 457 | #include <limits.h> |
| 458 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
| 459 | int main(void) |
| 460 | { |
| 461 | BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE); |
| 462 | return 0; |
| 463 | } |
| 464 | EOF |
| 465 | if compile_prog "-DWORDSIZE=32" "" "wordsize"; then |
| 466 | wordsize="32" |
| 467 | elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then |
| 468 | wordsize="64" |
| 469 | else |
| 470 | fatal "Unknown wordsize" |
| 471 | fi |
| 472 | echo "Wordsize $wordsize" |
| 473 | |
| 474 | ########################################## |
| 475 | # zlib probe |
| 476 | zlib="no" |
| 477 | cat > $TMPC <<EOF |
| 478 | #include <zlib.h> |
| 479 | int main(void) |
| 480 | { |
| 481 | z_stream stream; |
| 482 | if (inflateInit(&stream) != Z_OK) |
| 483 | return 1; |
| 484 | return 0; |
| 485 | } |
| 486 | EOF |
| 487 | if compile_prog "" "-lz" "zlib" ; then |
| 488 | zlib=yes |
| 489 | LIBS="-lz $LIBS" |
| 490 | fi |
| 491 | echo "zlib $zlib" |
| 492 | |
| 493 | ########################################## |
| 494 | # linux-aio probe |
| 495 | libaio="no" |
| 496 | if test "$esx" != "yes" ; then |
| 497 | cat > $TMPC <<EOF |
| 498 | #include <libaio.h> |
| 499 | #include <stddef.h> |
| 500 | int main(void) |
| 501 | { |
| 502 | io_setup(0, NULL); |
| 503 | return 0; |
| 504 | } |
| 505 | EOF |
| 506 | if compile_prog "" "-laio" "libaio" ; then |
| 507 | libaio=yes |
| 508 | LIBS="-laio $LIBS" |
| 509 | else |
| 510 | if test "$libaio" = "yes" ; then |
| 511 | feature_not_found "linux AIO" "libaio-dev or libaio-devel" |
| 512 | fi |
| 513 | libaio=no |
| 514 | fi |
| 515 | fi |
| 516 | echo "Linux AIO support $libaio" |
| 517 | |
| 518 | ########################################## |
| 519 | # posix aio probe |
| 520 | posix_aio="no" |
| 521 | posix_aio_lrt="no" |
| 522 | cat > $TMPC <<EOF |
| 523 | #include <aio.h> |
| 524 | int main(void) |
| 525 | { |
| 526 | struct aiocb cb; |
| 527 | aio_read(&cb); |
| 528 | return 0; |
| 529 | } |
| 530 | EOF |
| 531 | if compile_prog "" "" "posixaio" ; then |
| 532 | posix_aio="yes" |
| 533 | elif compile_prog "" "-lrt" "posixaio"; then |
| 534 | posix_aio="yes" |
| 535 | posix_aio_lrt="yes" |
| 536 | LIBS="-lrt $LIBS" |
| 537 | fi |
| 538 | echo "POSIX AIO support $posix_aio" |
| 539 | echo "POSIX AIO support needs -lrt $posix_aio_lrt" |
| 540 | |
| 541 | ########################################## |
| 542 | # posix aio fsync probe |
| 543 | posix_aio_fsync="no" |
| 544 | if test "$posix_aio" = "yes" ; then |
| 545 | cat > $TMPC <<EOF |
| 546 | #include <fcntl.h> |
| 547 | #include <aio.h> |
| 548 | int main(void) |
| 549 | { |
| 550 | struct aiocb cb; |
| 551 | return aio_fsync(O_SYNC, &cb); |
| 552 | return 0; |
| 553 | } |
| 554 | EOF |
| 555 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then |
| 556 | posix_aio_fsync=yes |
| 557 | fi |
| 558 | fi |
| 559 | echo "POSIX AIO fsync $posix_aio_fsync" |
| 560 | |
| 561 | ########################################## |
| 562 | # solaris aio probe |
| 563 | solaris_aio="no" |
| 564 | cat > $TMPC <<EOF |
| 565 | #include <sys/types.h> |
| 566 | #include <sys/asynch.h> |
| 567 | #include <unistd.h> |
| 568 | int main(void) |
| 569 | { |
| 570 | aio_result_t res; |
| 571 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); |
| 572 | return 0; |
| 573 | } |
| 574 | EOF |
| 575 | if compile_prog "" "-laio" "solarisaio" ; then |
| 576 | solaris_aio=yes |
| 577 | LIBS="-laio $LIBS" |
| 578 | fi |
| 579 | echo "Solaris AIO support $solaris_aio" |
| 580 | |
| 581 | ########################################## |
| 582 | # __sync_fetch_and_add test |
| 583 | sfaa="no" |
| 584 | cat > $TMPC << EOF |
| 585 | #include <inttypes.h> |
| 586 | static int sfaa(uint64_t *ptr) |
| 587 | { |
| 588 | return __sync_fetch_and_add(ptr, 0); |
| 589 | } |
| 590 | |
| 591 | int main(int argc, char **argv) |
| 592 | { |
| 593 | uint64_t val = 42; |
| 594 | sfaa(&val); |
| 595 | return val; |
| 596 | } |
| 597 | EOF |
| 598 | if compile_prog "" "" "__sync_fetch_and_add()" ; then |
| 599 | sfaa="yes" |
| 600 | fi |
| 601 | echo "__sync_fetch_and_add $sfaa" |
| 602 | |
| 603 | ########################################## |
| 604 | # libverbs probe |
| 605 | libverbs="no" |
| 606 | cat > $TMPC << EOF |
| 607 | #include <stdio.h> |
| 608 | #include <infiniband/arch.h> |
| 609 | int main(int argc, char **argv) |
| 610 | { |
| 611 | struct ibv_pd *pd = ibv_alloc_pd(NULL); |
| 612 | return 0; |
| 613 | } |
| 614 | EOF |
| 615 | if compile_prog "" "-libverbs" "libverbs" ; then |
| 616 | libverbs="yes" |
| 617 | LIBS="-libverbs $LIBS" |
| 618 | fi |
| 619 | echo "libverbs $libverbs" |
| 620 | |
| 621 | ########################################## |
| 622 | # rdmacm probe |
| 623 | rdmacm="no" |
| 624 | cat > $TMPC << EOF |
| 625 | #include <stdio.h> |
| 626 | #include <rdma/rdma_cma.h> |
| 627 | int main(int argc, char **argv) |
| 628 | { |
| 629 | rdma_destroy_qp(NULL); |
| 630 | return 0; |
| 631 | } |
| 632 | EOF |
| 633 | if compile_prog "" "-lrdmacm" "rdma"; then |
| 634 | rdmacm="yes" |
| 635 | LIBS="-lrdmacm $LIBS" |
| 636 | fi |
| 637 | echo "rdmacm $rdmacm" |
| 638 | |
| 639 | ########################################## |
| 640 | # Linux fallocate probe |
| 641 | linux_fallocate="no" |
| 642 | cat > $TMPC << EOF |
| 643 | #include <stdio.h> |
| 644 | #include <fcntl.h> |
| 645 | #include <linux/falloc.h> |
| 646 | int main(int argc, char **argv) |
| 647 | { |
| 648 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); |
| 649 | return r; |
| 650 | } |
| 651 | EOF |
| 652 | if compile_prog "" "" "linux_fallocate"; then |
| 653 | linux_fallocate="yes" |
| 654 | fi |
| 655 | echo "Linux fallocate $linux_fallocate" |
| 656 | |
| 657 | ########################################## |
| 658 | # POSIX fadvise probe |
| 659 | posix_fadvise="no" |
| 660 | cat > $TMPC << EOF |
| 661 | #include <stdio.h> |
| 662 | #include <fcntl.h> |
| 663 | int main(int argc, char **argv) |
| 664 | { |
| 665 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); |
| 666 | return r; |
| 667 | } |
| 668 | EOF |
| 669 | if compile_prog "" "" "posix_fadvise"; then |
| 670 | posix_fadvise="yes" |
| 671 | fi |
| 672 | echo "POSIX fadvise $posix_fadvise" |
| 673 | |
| 674 | ########################################## |
| 675 | # POSIX fallocate probe |
| 676 | posix_fallocate="no" |
| 677 | cat > $TMPC << EOF |
| 678 | #include <stdio.h> |
| 679 | #include <fcntl.h> |
| 680 | int main(int argc, char **argv) |
| 681 | { |
| 682 | int r = posix_fallocate(0, 0, 1024); |
| 683 | return r; |
| 684 | } |
| 685 | EOF |
| 686 | if compile_prog "" "" "posix_fallocate"; then |
| 687 | posix_fallocate="yes" |
| 688 | fi |
| 689 | echo "POSIX fallocate $posix_fallocate" |
| 690 | |
| 691 | ########################################## |
| 692 | # sched_set/getaffinity 2 or 3 argument test |
| 693 | linux_2arg_affinity="no" |
| 694 | linux_3arg_affinity="no" |
| 695 | cat > $TMPC << EOF |
| 696 | #include <sched.h> |
| 697 | int main(int argc, char **argv) |
| 698 | { |
| 699 | cpu_set_t mask; |
| 700 | return sched_setaffinity(0, sizeof(mask), &mask); |
| 701 | } |
| 702 | EOF |
| 703 | if compile_prog "" "" "sched_setaffinity(,,)"; then |
| 704 | linux_3arg_affinity="yes" |
| 705 | else |
| 706 | cat > $TMPC << EOF |
| 707 | #include <sched.h> |
| 708 | int main(int argc, char **argv) |
| 709 | { |
| 710 | cpu_set_t mask; |
| 711 | return sched_setaffinity(0, &mask); |
| 712 | } |
| 713 | EOF |
| 714 | if compile_prog "" "" "sched_setaffinity(,)"; then |
| 715 | linux_2arg_affinity="yes" |
| 716 | fi |
| 717 | fi |
| 718 | echo "sched_setaffinity(3 arg) $linux_3arg_affinity" |
| 719 | echo "sched_setaffinity(2 arg) $linux_2arg_affinity" |
| 720 | |
| 721 | ########################################## |
| 722 | # clock_gettime probe |
| 723 | clock_gettime="no" |
| 724 | cat > $TMPC << EOF |
| 725 | #include <stdio.h> |
| 726 | #include <time.h> |
| 727 | int main(int argc, char **argv) |
| 728 | { |
| 729 | return clock_gettime(0, NULL); |
| 730 | } |
| 731 | EOF |
| 732 | if compile_prog "" "" "clock_gettime"; then |
| 733 | clock_gettime="yes" |
| 734 | elif compile_prog "" "-lrt" "clock_gettime"; then |
| 735 | clock_gettime="yes" |
| 736 | LIBS="-lrt $LIBS" |
| 737 | fi |
| 738 | echo "clock_gettime $clock_gettime" |
| 739 | |
| 740 | ########################################## |
| 741 | # CLOCK_MONOTONIC probe |
| 742 | clock_monotonic="no" |
| 743 | if test "$clock_gettime" = "yes" ; then |
| 744 | cat > $TMPC << EOF |
| 745 | #include <stdio.h> |
| 746 | #include <time.h> |
| 747 | int main(int argc, char **argv) |
| 748 | { |
| 749 | return clock_gettime(CLOCK_MONOTONIC, NULL); |
| 750 | } |
| 751 | EOF |
| 752 | if compile_prog "" "$LIBS" "clock monotonic"; then |
| 753 | clock_monotonic="yes" |
| 754 | fi |
| 755 | fi |
| 756 | echo "CLOCK_MONOTONIC $clock_monotonic" |
| 757 | |
| 758 | ########################################## |
| 759 | # CLOCK_MONOTONIC_RAW probe |
| 760 | clock_monotonic_raw="no" |
| 761 | if test "$clock_gettime" = "yes" ; then |
| 762 | cat > $TMPC << EOF |
| 763 | #include <stdio.h> |
| 764 | #include <time.h> |
| 765 | int main(int argc, char **argv) |
| 766 | { |
| 767 | return clock_gettime(CLOCK_MONOTONIC_RAW, NULL); |
| 768 | } |
| 769 | EOF |
| 770 | if compile_prog "" "$LIBS" "clock monotonic"; then |
| 771 | clock_monotonic_raw="yes" |
| 772 | fi |
| 773 | fi |
| 774 | echo "CLOCK_MONOTONIC_RAW $clock_monotonic_raw" |
| 775 | |
| 776 | ########################################## |
| 777 | # CLOCK_MONOTONIC_PRECISE probe |
| 778 | clock_monotonic_precise="no" |
| 779 | if test "$clock_gettime" = "yes" ; then |
| 780 | cat > $TMPC << EOF |
| 781 | #include <stdio.h> |
| 782 | #include <time.h> |
| 783 | int main(int argc, char **argv) |
| 784 | { |
| 785 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); |
| 786 | } |
| 787 | EOF |
| 788 | if compile_prog "" "$LIBS" "clock monotonic precise"; then |
| 789 | clock_monotonic_precise="yes" |
| 790 | fi |
| 791 | fi |
| 792 | echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise" |
| 793 | |
| 794 | ########################################## |
| 795 | # gettimeofday() probe |
| 796 | gettimeofday="no" |
| 797 | cat > $TMPC << EOF |
| 798 | #include <sys/time.h> |
| 799 | #include <stdio.h> |
| 800 | int main(int argc, char **argv) |
| 801 | { |
| 802 | struct timeval tv; |
| 803 | return gettimeofday(&tv, NULL); |
| 804 | } |
| 805 | EOF |
| 806 | if compile_prog "" "" "gettimeofday"; then |
| 807 | gettimeofday="yes" |
| 808 | fi |
| 809 | echo "gettimeofday $gettimeofday" |
| 810 | |
| 811 | ########################################## |
| 812 | # fdatasync() probe |
| 813 | fdatasync="no" |
| 814 | cat > $TMPC << EOF |
| 815 | #include <stdio.h> |
| 816 | #include <unistd.h> |
| 817 | int main(int argc, char **argv) |
| 818 | { |
| 819 | return fdatasync(0); |
| 820 | } |
| 821 | EOF |
| 822 | if compile_prog "" "" "fdatasync"; then |
| 823 | fdatasync="yes" |
| 824 | fi |
| 825 | echo "fdatasync $fdatasync" |
| 826 | |
| 827 | ########################################## |
| 828 | # sync_file_range() probe |
| 829 | sync_file_range="no" |
| 830 | cat > $TMPC << EOF |
| 831 | #include <stdio.h> |
| 832 | #include <unistd.h> |
| 833 | #include <fcntl.h> |
| 834 | #include <linux/fs.h> |
| 835 | int main(int argc, char **argv) |
| 836 | { |
| 837 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | |
| 838 | SYNC_FILE_RANGE_WAIT_AFTER; |
| 839 | return sync_file_range(0, 0, 0, flags); |
| 840 | } |
| 841 | EOF |
| 842 | if compile_prog "" "" "sync_file_range"; then |
| 843 | sync_file_range="yes" |
| 844 | fi |
| 845 | echo "sync_file_range $sync_file_range" |
| 846 | |
| 847 | ########################################## |
| 848 | # ext4 move extent probe |
| 849 | ext4_me="no" |
| 850 | cat > $TMPC << EOF |
| 851 | #include <fcntl.h> |
| 852 | #include <sys/ioctl.h> |
| 853 | int main(int argc, char **argv) |
| 854 | { |
| 855 | struct move_extent me; |
| 856 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); |
| 857 | } |
| 858 | EOF |
| 859 | if compile_prog "" "" "ext4 move extent" ; then |
| 860 | ext4_me="yes" |
| 861 | elif test $targetos = "Linux" ; then |
| 862 | # On Linux, just default to it on and let it error at runtime if we really |
| 863 | # don't have it. None of my updated systems have it defined, but it does |
| 864 | # work. Takes a while to bubble back. |
| 865 | ext4_me="yes" |
| 866 | fi |
| 867 | echo "EXT4 move extent $ext4_me" |
| 868 | |
| 869 | ########################################## |
| 870 | # splice probe |
| 871 | linux_splice="no" |
| 872 | cat > $TMPC << EOF |
| 873 | #include <stdio.h> |
| 874 | #include <fcntl.h> |
| 875 | int main(int argc, char **argv) |
| 876 | { |
| 877 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); |
| 878 | } |
| 879 | EOF |
| 880 | if compile_prog "" "" "linux splice"; then |
| 881 | linux_splice="yes" |
| 882 | fi |
| 883 | echo "Linux splice(2) $linux_splice" |
| 884 | |
| 885 | ########################################## |
| 886 | # GUASI probe |
| 887 | guasi="no" |
| 888 | cat > $TMPC << EOF |
| 889 | #include <guasi.h> |
| 890 | #include <guasi_syscalls.h> |
| 891 | int main(int argc, char **argv) |
| 892 | { |
| 893 | guasi_t ctx = guasi_create(0, 0, 0); |
| 894 | return 0; |
| 895 | } |
| 896 | EOF |
| 897 | if compile_prog "" "" "guasi"; then |
| 898 | guasi="yes" |
| 899 | fi |
| 900 | echo "GUASI $guasi" |
| 901 | |
| 902 | ########################################## |
| 903 | # fusion-aw probe |
| 904 | fusion_aw="no" |
| 905 | cat > $TMPC << EOF |
| 906 | #include <nvm/nvm_primitives.h> |
| 907 | int main(int argc, char **argv) |
| 908 | { |
| 909 | nvm_version_t ver_info; |
| 910 | nvm_handle_t handle; |
| 911 | |
| 912 | handle = nvm_get_handle(0, &ver_info); |
| 913 | return nvm_atomic_write(handle, 0, 0, 0); |
| 914 | } |
| 915 | EOF |
| 916 | if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then |
| 917 | LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS" |
| 918 | fusion_aw="yes" |
| 919 | fi |
| 920 | echo "Fusion-io atomic engine $fusion_aw" |
| 921 | |
| 922 | ########################################## |
| 923 | # libnuma probe |
| 924 | libnuma="no" |
| 925 | cat > $TMPC << EOF |
| 926 | #include <numa.h> |
| 927 | int main(int argc, char **argv) |
| 928 | { |
| 929 | return numa_available(); |
| 930 | } |
| 931 | EOF |
| 932 | if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then |
| 933 | libnuma="yes" |
| 934 | LIBS="-lnuma $LIBS" |
| 935 | fi |
| 936 | echo "libnuma $libnuma" |
| 937 | |
| 938 | ########################################## |
| 939 | # libnuma 2.x version API |
| 940 | if test "$libnuma" = "yes" ; then |
| 941 | libnuma_v2="no" |
| 942 | cat > $TMPC << EOF |
| 943 | #include <numa.h> |
| 944 | int main(int argc, char **argv) |
| 945 | { |
| 946 | struct bitmask *mask = numa_parse_nodestring(NULL); |
| 947 | return mask->size == 0; |
| 948 | } |
| 949 | EOF |
| 950 | if compile_prog "" "" "libnuma api"; then |
| 951 | libnuma_v2="yes" |
| 952 | fi |
| 953 | echo "libnuma v2 $libnuma_v2" |
| 954 | fi |
| 955 | |
| 956 | ########################################## |
| 957 | # strsep() probe |
| 958 | strsep="no" |
| 959 | cat > $TMPC << EOF |
| 960 | #include <string.h> |
| 961 | int main(int argc, char **argv) |
| 962 | { |
| 963 | static char *string = "This is a string"; |
| 964 | strsep(&string, "needle"); |
| 965 | return 0; |
| 966 | } |
| 967 | EOF |
| 968 | if compile_prog "" "" "strsep"; then |
| 969 | strsep="yes" |
| 970 | fi |
| 971 | echo "strsep $strsep" |
| 972 | |
| 973 | ########################################## |
| 974 | # strcasestr() probe |
| 975 | strcasestr="no" |
| 976 | cat > $TMPC << EOF |
| 977 | #include <string.h> |
| 978 | int main(int argc, char **argv) |
| 979 | { |
| 980 | return strcasestr(argv[0], argv[1]) != NULL; |
| 981 | } |
| 982 | EOF |
| 983 | if compile_prog "" "" "strcasestr"; then |
| 984 | strcasestr="yes" |
| 985 | fi |
| 986 | echo "strcasestr $strcasestr" |
| 987 | |
| 988 | ########################################## |
| 989 | # strlcat() probe |
| 990 | strlcat="no" |
| 991 | cat > $TMPC << EOF |
| 992 | #include <string.h> |
| 993 | int main(int argc, char **argv) |
| 994 | { |
| 995 | static char dst[64]; |
| 996 | static char *string = "This is a string"; |
| 997 | memset(dst, 0, sizeof(dst)); |
| 998 | strlcat(dst, string, sizeof(dst)); |
| 999 | return 0; |
| 1000 | } |
| 1001 | EOF |
| 1002 | if compile_prog "" "" "strlcat"; then |
| 1003 | strlcat="yes" |
| 1004 | fi |
| 1005 | echo "strlcat $strlcat" |
| 1006 | |
| 1007 | ########################################## |
| 1008 | # getopt_long_only() probe |
| 1009 | getopt_long_only="no" |
| 1010 | cat > $TMPC << EOF |
| 1011 | #include <unistd.h> |
| 1012 | #include <stdio.h> |
| 1013 | #include <getopt.h> |
| 1014 | int main(int argc, char **argv) |
| 1015 | { |
| 1016 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); |
| 1017 | return c; |
| 1018 | } |
| 1019 | EOF |
| 1020 | if compile_prog "" "" "getopt_long_only"; then |
| 1021 | getopt_long_only="yes" |
| 1022 | fi |
| 1023 | echo "getopt_long_only() $getopt_long_only" |
| 1024 | |
| 1025 | ########################################## |
| 1026 | # inet_aton() probe |
| 1027 | inet_aton="no" |
| 1028 | cat > $TMPC << EOF |
| 1029 | #include <sys/socket.h> |
| 1030 | #include <arpa/inet.h> |
| 1031 | #include <stdio.h> |
| 1032 | int main(int argc, char **argv) |
| 1033 | { |
| 1034 | struct in_addr in; |
| 1035 | return inet_aton(NULL, &in); |
| 1036 | } |
| 1037 | EOF |
| 1038 | if compile_prog "" "" "inet_aton"; then |
| 1039 | inet_aton="yes" |
| 1040 | fi |
| 1041 | echo "inet_aton $inet_aton" |
| 1042 | |
| 1043 | ########################################## |
| 1044 | # socklen_t probe |
| 1045 | socklen_t="no" |
| 1046 | cat > $TMPC << EOF |
| 1047 | #include <sys/socket.h> |
| 1048 | int main(int argc, char **argv) |
| 1049 | { |
| 1050 | socklen_t len = 0; |
| 1051 | return len; |
| 1052 | } |
| 1053 | EOF |
| 1054 | if compile_prog "" "" "socklen_t"; then |
| 1055 | socklen_t="yes" |
| 1056 | fi |
| 1057 | echo "socklen_t $socklen_t" |
| 1058 | |
| 1059 | ########################################## |
| 1060 | # Whether or not __thread is supported for TLS |
| 1061 | tls_thread="no" |
| 1062 | cat > $TMPC << EOF |
| 1063 | #include <stdio.h> |
| 1064 | static __thread int ret; |
| 1065 | int main(int argc, char **argv) |
| 1066 | { |
| 1067 | return ret; |
| 1068 | } |
| 1069 | EOF |
| 1070 | if compile_prog "" "" "__thread"; then |
| 1071 | tls_thread="yes" |
| 1072 | fi |
| 1073 | echo "__thread $tls_thread" |
| 1074 | |
| 1075 | ########################################## |
| 1076 | # Check if we have required gtk/glib support for gfio |
| 1077 | gfio="no" |
| 1078 | if test "$gfio_check" = "yes" ; then |
| 1079 | cat > $TMPC << EOF |
| 1080 | #include <glib.h> |
| 1081 | #include <cairo.h> |
| 1082 | #include <gtk/gtk.h> |
| 1083 | int main(void) |
| 1084 | { |
| 1085 | gdk_threads_enter(); |
| 1086 | gdk_threads_leave(); |
| 1087 | |
| 1088 | printf("%d", GTK_CHECK_VERSION(2, 18, 0)); |
| 1089 | } |
| 1090 | EOF |
| 1091 | GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) |
| 1092 | ORG_LDFLAGS=$LDFLAGS |
| 1093 | LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g) |
| 1094 | if test "$?" != "0" ; then |
| 1095 | echo "configure: gtk and gthread not found" |
| 1096 | exit 1 |
| 1097 | fi |
| 1098 | GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0) |
| 1099 | if test "$?" != "0" ; then |
| 1100 | echo "configure: gtk and gthread not found" |
| 1101 | exit 1 |
| 1102 | fi |
| 1103 | if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then |
| 1104 | r=$($TMPE) |
| 1105 | if test "$r" != "0" ; then |
| 1106 | gfio="yes" |
| 1107 | GFIO_LIBS="$LIBS $GTK_LIBS" |
| 1108 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 1109 | else |
| 1110 | echo "GTK found, but need version 2.18 or higher" |
| 1111 | gfio="no" |
| 1112 | fi |
| 1113 | else |
| 1114 | echo "Please install gtk and gdk libraries" |
| 1115 | gfio="no" |
| 1116 | fi |
| 1117 | LDFLAGS=$ORG_LDFLAGS |
| 1118 | fi |
| 1119 | |
| 1120 | if test "$gfio_check" = "yes" ; then |
| 1121 | echo "gtk 2.18 or higher $gfio" |
| 1122 | fi |
| 1123 | |
| 1124 | # Check whether we have getrusage(RUSAGE_THREAD) |
| 1125 | rusage_thread="no" |
| 1126 | cat > $TMPC << EOF |
| 1127 | #include <sys/time.h> |
| 1128 | #include <sys/resource.h> |
| 1129 | int main(int argc, char **argv) |
| 1130 | { |
| 1131 | struct rusage ru; |
| 1132 | getrusage(RUSAGE_THREAD, &ru); |
| 1133 | return 0; |
| 1134 | } |
| 1135 | EOF |
| 1136 | if compile_prog "" "" "RUSAGE_THREAD"; then |
| 1137 | rusage_thread="yes" |
| 1138 | fi |
| 1139 | echo "RUSAGE_THREAD $rusage_thread" |
| 1140 | |
| 1141 | ########################################## |
| 1142 | # Check whether we have SCHED_IDLE |
| 1143 | sched_idle="no" |
| 1144 | cat > $TMPC << EOF |
| 1145 | #include <sched.h> |
| 1146 | int main(int argc, char **argv) |
| 1147 | { |
| 1148 | struct sched_param p; |
| 1149 | return sched_setscheduler(0, SCHED_IDLE, &p); |
| 1150 | } |
| 1151 | EOF |
| 1152 | if compile_prog "" "" "SCHED_IDLE"; then |
| 1153 | sched_idle="yes" |
| 1154 | fi |
| 1155 | echo "SCHED_IDLE $sched_idle" |
| 1156 | |
| 1157 | ########################################## |
| 1158 | # Check whether we have TCP_NODELAY |
| 1159 | tcp_nodelay="no" |
| 1160 | cat > $TMPC << EOF |
| 1161 | #include <stdio.h> |
| 1162 | #include <sys/types.h> |
| 1163 | #include <sys/socket.h> |
| 1164 | #include <netinet/tcp.h> |
| 1165 | int main(int argc, char **argv) |
| 1166 | { |
| 1167 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); |
| 1168 | } |
| 1169 | EOF |
| 1170 | if compile_prog "" "" "TCP_NODELAY"; then |
| 1171 | tcp_nodelay="yes" |
| 1172 | fi |
| 1173 | echo "TCP_NODELAY $tcp_nodelay" |
| 1174 | |
| 1175 | ########################################## |
| 1176 | # Check whether we have SO_SNDBUF |
| 1177 | window_size="no" |
| 1178 | cat > $TMPC << EOF |
| 1179 | #include <stdio.h> |
| 1180 | #include <sys/types.h> |
| 1181 | #include <sys/socket.h> |
| 1182 | #include <netinet/tcp.h> |
| 1183 | int main(int argc, char **argv) |
| 1184 | { |
| 1185 | setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0); |
| 1186 | setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0); |
| 1187 | } |
| 1188 | EOF |
| 1189 | if compile_prog "" "" "SO_SNDBUF"; then |
| 1190 | window_size="yes" |
| 1191 | fi |
| 1192 | echo "Net engine window_size $window_size" |
| 1193 | |
| 1194 | ########################################## |
| 1195 | # Check whether we have TCP_MAXSEG |
| 1196 | mss="no" |
| 1197 | cat > $TMPC << EOF |
| 1198 | #include <stdio.h> |
| 1199 | #include <sys/types.h> |
| 1200 | #include <sys/socket.h> |
| 1201 | #include <netinet/tcp.h> |
| 1202 | #include <arpa/inet.h> |
| 1203 | #include <netinet/in.h> |
| 1204 | int main(int argc, char **argv) |
| 1205 | { |
| 1206 | return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0); |
| 1207 | } |
| 1208 | EOF |
| 1209 | if compile_prog "" "" "TCP_MAXSEG"; then |
| 1210 | mss="yes" |
| 1211 | fi |
| 1212 | echo "TCP_MAXSEG $mss" |
| 1213 | |
| 1214 | ########################################## |
| 1215 | # Check whether we have RLIMIT_MEMLOCK |
| 1216 | rlimit_memlock="no" |
| 1217 | cat > $TMPC << EOF |
| 1218 | #include <sys/time.h> |
| 1219 | #include <sys/resource.h> |
| 1220 | int main(int argc, char **argv) |
| 1221 | { |
| 1222 | struct rlimit rl; |
| 1223 | return getrlimit(RLIMIT_MEMLOCK, &rl); |
| 1224 | } |
| 1225 | EOF |
| 1226 | if compile_prog "" "" "RLIMIT_MEMLOCK"; then |
| 1227 | rlimit_memlock="yes" |
| 1228 | fi |
| 1229 | echo "RLIMIT_MEMLOCK $rlimit_memlock" |
| 1230 | |
| 1231 | ########################################## |
| 1232 | # Check whether we have pwritev/preadv |
| 1233 | pwritev="no" |
| 1234 | cat > $TMPC << EOF |
| 1235 | #include <stdio.h> |
| 1236 | #include <sys/uio.h> |
| 1237 | int main(int argc, char **argv) |
| 1238 | { |
| 1239 | return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0); |
| 1240 | } |
| 1241 | EOF |
| 1242 | if compile_prog "" "" "pwritev"; then |
| 1243 | pwritev="yes" |
| 1244 | fi |
| 1245 | echo "pwritev/preadv $pwritev" |
| 1246 | |
| 1247 | ########################################## |
| 1248 | # Check whether we have pwritev2/preadv2 |
| 1249 | pwritev2="no" |
| 1250 | cat > $TMPC << EOF |
| 1251 | #include <stdio.h> |
| 1252 | #include <sys/uio.h> |
| 1253 | int main(int argc, char **argv) |
| 1254 | { |
| 1255 | return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0); |
| 1256 | } |
| 1257 | EOF |
| 1258 | if compile_prog "" "" "pwritev2"; then |
| 1259 | pwritev2="yes" |
| 1260 | fi |
| 1261 | echo "pwritev2/preadv2 $pwritev2" |
| 1262 | |
| 1263 | ########################################## |
| 1264 | # Check whether we have the required functions for ipv6 |
| 1265 | ipv6="no" |
| 1266 | cat > $TMPC << EOF |
| 1267 | #include <sys/types.h> |
| 1268 | #include <sys/socket.h> |
| 1269 | #include <netinet/in.h> |
| 1270 | #include <netdb.h> |
| 1271 | #include <stdio.h> |
| 1272 | int main(int argc, char **argv) |
| 1273 | { |
| 1274 | struct addrinfo hints; |
| 1275 | struct in6_addr addr; |
| 1276 | int ret; |
| 1277 | |
| 1278 | ret = getaddrinfo(NULL, NULL, &hints, NULL); |
| 1279 | freeaddrinfo(NULL); |
| 1280 | printf("%s\n", gai_strerror(ret)); |
| 1281 | addr = in6addr_any; |
| 1282 | return 0; |
| 1283 | } |
| 1284 | EOF |
| 1285 | if compile_prog "" "" "ipv6"; then |
| 1286 | ipv6="yes" |
| 1287 | fi |
| 1288 | echo "IPv6 helpers $ipv6" |
| 1289 | |
| 1290 | ########################################## |
| 1291 | # check for rbd |
| 1292 | rbd="no" |
| 1293 | cat > $TMPC << EOF |
| 1294 | #include <rbd/librbd.h> |
| 1295 | |
| 1296 | int main(int argc, char **argv) |
| 1297 | { |
| 1298 | |
| 1299 | rados_t cluster; |
| 1300 | rados_ioctx_t io_ctx; |
| 1301 | const char pool[] = "rbd"; |
| 1302 | |
| 1303 | int major, minor, extra; |
| 1304 | rbd_version(&major, &minor, &extra); |
| 1305 | |
| 1306 | rados_ioctx_create(cluster, pool, &io_ctx); |
| 1307 | return 0; |
| 1308 | } |
| 1309 | EOF |
| 1310 | if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then |
| 1311 | LIBS="-lrbd -lrados $LIBS" |
| 1312 | rbd="yes" |
| 1313 | fi |
| 1314 | echo "Rados Block Device engine $rbd" |
| 1315 | |
| 1316 | ########################################## |
| 1317 | # check for rbd_invaidate_cache() |
| 1318 | rbd_inval="no" |
| 1319 | if test "$rbd" = "yes"; then |
| 1320 | cat > $TMPC << EOF |
| 1321 | #include <rbd/librbd.h> |
| 1322 | |
| 1323 | int main(int argc, char **argv) |
| 1324 | { |
| 1325 | rbd_image_t image; |
| 1326 | |
| 1327 | return rbd_invalidate_cache(image); |
| 1328 | } |
| 1329 | EOF |
| 1330 | if compile_prog "" "-lrbd -lrados" "rbd"; then |
| 1331 | rbd_inval="yes" |
| 1332 | fi |
| 1333 | echo "rbd_invalidate_cache $rbd_inval" |
| 1334 | fi |
| 1335 | |
| 1336 | ########################################## |
| 1337 | # Check whether we have setvbuf |
| 1338 | setvbuf="no" |
| 1339 | cat > $TMPC << EOF |
| 1340 | #include <stdio.h> |
| 1341 | int main(int argc, char **argv) |
| 1342 | { |
| 1343 | FILE *f = NULL; |
| 1344 | char buf[80]; |
| 1345 | setvbuf(f, buf, _IOFBF, sizeof(buf)); |
| 1346 | return 0; |
| 1347 | } |
| 1348 | EOF |
| 1349 | if compile_prog "" "" "setvbuf"; then |
| 1350 | setvbuf="yes" |
| 1351 | fi |
| 1352 | echo "setvbuf $setvbuf" |
| 1353 | |
| 1354 | # check for gfapi |
| 1355 | gfapi="no" |
| 1356 | cat > $TMPC << EOF |
| 1357 | #include <glusterfs/api/glfs.h> |
| 1358 | |
| 1359 | int main(int argc, char **argv) |
| 1360 | { |
| 1361 | |
| 1362 | glfs_t *g = glfs_new("foo"); |
| 1363 | |
| 1364 | return 0; |
| 1365 | } |
| 1366 | EOF |
| 1367 | if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
| 1368 | LIBS="-lgfapi -lglusterfs $LIBS" |
| 1369 | gfapi="yes" |
| 1370 | fi |
| 1371 | echo "Gluster API engine $gfapi" |
| 1372 | |
| 1373 | ########################################## |
| 1374 | # check for gfapi fadvise support |
| 1375 | if test "$gfapi" = "yes" ; then |
| 1376 | gf_fadvise="no" |
| 1377 | cat > $TMPC << EOF |
| 1378 | #include <glusterfs/api/glfs.h> |
| 1379 | |
| 1380 | int main(int argc, char **argv) |
| 1381 | { |
| 1382 | struct glfs_fd *fd; |
| 1383 | int ret = glfs_fadvise(fd, 0, 0, 1); |
| 1384 | |
| 1385 | return 0; |
| 1386 | } |
| 1387 | EOF |
| 1388 | if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
| 1389 | gf_fadvise="yes" |
| 1390 | fi |
| 1391 | echo "Gluster API use fadvise $gf_fadvise" |
| 1392 | fi |
| 1393 | |
| 1394 | ########################################## |
| 1395 | # check for gfapi trim support |
| 1396 | gf_trim="no" |
| 1397 | if test "$gfapi" = "yes" ; then |
| 1398 | cat > $TMPC << EOF |
| 1399 | #include <glusterfs/api/glfs.h> |
| 1400 | |
| 1401 | int main(int argc, char **argv) |
| 1402 | { |
| 1403 | return glfs_discard_async(NULL, 0, 0); |
| 1404 | } |
| 1405 | EOF |
| 1406 | if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then |
| 1407 | gf_trim="yes" |
| 1408 | fi |
| 1409 | echo "Gluster API trim support $gf_trim" |
| 1410 | fi |
| 1411 | |
| 1412 | ########################################## |
| 1413 | # Check if we support stckf on s390 |
| 1414 | s390_z196_facilities="no" |
| 1415 | cat > $TMPC << EOF |
| 1416 | #define STFLE_BITS_Z196 45 /* various z196 facilities ... */ |
| 1417 | int main(int argc, char **argv) |
| 1418 | { |
| 1419 | /* We want just 1 double word to be returned. */ |
| 1420 | register unsigned long reg0 asm("0") = 0; |
| 1421 | unsigned long stfle_bits; |
| 1422 | asm volatile(".machine push" "\n\t" |
| 1423 | ".machine \"z9-109\"" "\n\t" |
| 1424 | "stfle %0" "\n\t" |
| 1425 | ".machine pop" "\n" |
| 1426 | : "=QS" (stfle_bits), "+d" (reg0) |
| 1427 | : : "cc"); |
| 1428 | |
| 1429 | if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) |
| 1430 | return 0; |
| 1431 | else |
| 1432 | return -1; |
| 1433 | } |
| 1434 | EOF |
| 1435 | if compile_prog "" "" "s390_z196_facilities"; then |
| 1436 | $TMPE |
| 1437 | if [[ $? -eq 0 ]]; then |
| 1438 | s390_z196_facilities="yes" |
| 1439 | fi |
| 1440 | fi |
| 1441 | echo "s390_z196_facilities $s390_z196_facilities" |
| 1442 | |
| 1443 | ########################################## |
| 1444 | # Check if we have required environment variables configured for libhdfs |
| 1445 | if test "$libhdfs" = "yes" ; then |
| 1446 | hdfs_conf_error=0 |
| 1447 | if test "$JAVA_HOME" = "" ; then |
| 1448 | echo "configure: JAVA_HOME should be defined to jdk/jvm path" |
| 1449 | hdfs_conf_error=1 |
| 1450 | fi |
| 1451 | if test "$FIO_LIBHDFS_INCLUDE" = "" ; then |
| 1452 | echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path" |
| 1453 | hdfs_conf_error=1 |
| 1454 | fi |
| 1455 | if test "$FIO_LIBHDFS_LIB" = "" ; then |
| 1456 | echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path" |
| 1457 | hdfs_conf_error=1 |
| 1458 | fi |
| 1459 | if test "$hdfs_conf_error" = "1" ; then |
| 1460 | exit 1 |
| 1461 | fi |
| 1462 | fi |
| 1463 | echo "HDFS engine $libhdfs" |
| 1464 | |
| 1465 | ########################################## |
| 1466 | # Check whether we have MTD |
| 1467 | mtd="no" |
| 1468 | cat > $TMPC << EOF |
| 1469 | #include <string.h> |
| 1470 | #include <mtd/mtd-user.h> |
| 1471 | #include <sys/ioctl.h> |
| 1472 | int main(int argc, char **argv) |
| 1473 | { |
| 1474 | struct mtd_write_req ops; |
| 1475 | struct mtd_info_user info; |
| 1476 | memset(&ops, 0, sizeof(ops)); |
| 1477 | info.type = MTD_MLCNANDFLASH; |
| 1478 | return ioctl(0, MEMGETINFO, &info); |
| 1479 | } |
| 1480 | EOF |
| 1481 | if compile_prog "" "" "mtd"; then |
| 1482 | mtd="yes" |
| 1483 | fi |
| 1484 | echo "MTD $mtd" |
| 1485 | |
| 1486 | ########################################## |
| 1487 | # Report whether pmemblk engine is enabled |
| 1488 | echo "NVML libpmemblk engine $pmemblk" |
| 1489 | |
| 1490 | # Check if we have lex/yacc available |
| 1491 | yacc="no" |
| 1492 | yacc_is_bison="no" |
| 1493 | lex="no" |
| 1494 | arith="no" |
| 1495 | if test "$disable_lex" = "no" || test -z "$disable_lex" ; then |
| 1496 | if test "$targetos" != "SunOS" ; then |
| 1497 | LEX=$(which lex 2> /dev/null) |
| 1498 | if test -x "$LEX" ; then |
| 1499 | lex="yes" |
| 1500 | fi |
| 1501 | YACC=$(which bison 2> /dev/null) |
| 1502 | if test -x "$YACC" ; then |
| 1503 | yacc="yes" |
| 1504 | yacc_is_bison="yes" |
| 1505 | else |
| 1506 | YACC=$(which yacc 2> /dev/null) |
| 1507 | if test -x "$YACC" ; then |
| 1508 | yacc="yes" |
| 1509 | fi |
| 1510 | fi |
| 1511 | if test "$yacc" = "yes" && test "$lex" = "yes" ; then |
| 1512 | arith="yes" |
| 1513 | fi |
| 1514 | |
| 1515 | if test "$arith" = "yes" ; then |
| 1516 | cat > $TMPC << EOF |
| 1517 | extern int yywrap(void); |
| 1518 | |
| 1519 | int main(int argc, char **argv) |
| 1520 | { |
| 1521 | yywrap(); |
| 1522 | return 0; |
| 1523 | } |
| 1524 | EOF |
| 1525 | if compile_prog "" "-ll" "lex"; then |
| 1526 | LIBS="-ll $LIBS" |
| 1527 | else |
| 1528 | arith="no" |
| 1529 | fi |
| 1530 | fi |
| 1531 | fi |
| 1532 | fi |
| 1533 | |
| 1534 | # Check if lex fails using -o |
| 1535 | if test "$arith" = "yes" ; then |
| 1536 | if test "$force_no_lex_o" = "yes" ; then |
| 1537 | lex_use_o="no" |
| 1538 | else |
| 1539 | $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null |
| 1540 | if test "$?" = "0" ; then |
| 1541 | lex_use_o="yes" |
| 1542 | else |
| 1543 | lex_use_o="no" |
| 1544 | fi |
| 1545 | fi |
| 1546 | fi |
| 1547 | |
| 1548 | echo "lex/yacc for arithmetic $arith" |
| 1549 | |
| 1550 | ########################################## |
| 1551 | # Check whether we have setmntent/getmntent |
| 1552 | getmntent="no" |
| 1553 | cat > $TMPC << EOF |
| 1554 | #include <stdio.h> |
| 1555 | #include <mntent.h> |
| 1556 | int main(int argc, char **argv) |
| 1557 | { |
| 1558 | FILE *mtab = setmntent(NULL, "r"); |
| 1559 | struct mntent *mnt = getmntent(mtab); |
| 1560 | endmntent(mtab); |
| 1561 | return 0; |
| 1562 | } |
| 1563 | EOF |
| 1564 | if compile_prog "" "" "getmntent"; then |
| 1565 | getmntent="yes" |
| 1566 | fi |
| 1567 | echo "getmntent $getmntent" |
| 1568 | |
| 1569 | ########################################## |
| 1570 | # Check whether we have getmntinfo |
| 1571 | getmntinfo="no" |
| 1572 | cat > $TMPC << EOF |
| 1573 | #include <stdio.h> |
| 1574 | #include <sys/param.h> |
| 1575 | #include <sys/mount.h> |
| 1576 | int main(int argc, char **argv) |
| 1577 | { |
| 1578 | struct statfs st; |
| 1579 | return getmntinfo(&st, MNT_NOWAIT); |
| 1580 | } |
| 1581 | EOF |
| 1582 | if compile_prog "" "" "getmntinfo"; then |
| 1583 | getmntinfo="yes" |
| 1584 | fi |
| 1585 | echo "getmntinfo $getmntinfo" |
| 1586 | |
| 1587 | ########################################## |
| 1588 | # Check whether we have _Static_assert |
| 1589 | static_assert="no" |
| 1590 | cat > $TMPC << EOF |
| 1591 | #include <assert.h> |
| 1592 | #include <stdlib.h> |
| 1593 | #undef offsetof |
| 1594 | #ifdef __compiler_offsetof |
| 1595 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |
| 1596 | #else |
| 1597 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| 1598 | #endif |
| 1599 | |
| 1600 | #define container_of(ptr, type, member) ({ \ |
| 1601 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
| 1602 | (type *)( (char *)__mptr - offsetof(type,member) );}) |
| 1603 | |
| 1604 | struct foo { |
| 1605 | int a, b; |
| 1606 | }; |
| 1607 | |
| 1608 | int main(int argc, char **argv) |
| 1609 | { |
| 1610 | _Static_assert(offsetof(struct foo, a) == 0 , "Check"); |
| 1611 | return 0 ; |
| 1612 | } |
| 1613 | EOF |
| 1614 | if compile_prog "" "" "static_assert"; then |
| 1615 | static_assert="yes" |
| 1616 | fi |
| 1617 | echo "Static Assert $static_assert" |
| 1618 | |
| 1619 | ########################################## |
| 1620 | # Check whether we have bool / stdbool.h |
| 1621 | have_bool="no" |
| 1622 | cat > $TMPC << EOF |
| 1623 | #include <stdbool.h> |
| 1624 | int main(int argc, char **argv) |
| 1625 | { |
| 1626 | bool var = true; |
| 1627 | return var != false; |
| 1628 | } |
| 1629 | EOF |
| 1630 | if compile_prog "" "" "bool"; then |
| 1631 | have_bool="yes" |
| 1632 | fi |
| 1633 | echo "bool $have_bool" |
| 1634 | |
| 1635 | ############################################################################# |
| 1636 | |
| 1637 | if test "$wordsize" = "64" ; then |
| 1638 | output_sym "CONFIG_64BIT" |
| 1639 | elif test "$wordsize" = "32" ; then |
| 1640 | output_sym "CONFIG_32BIT" |
| 1641 | else |
| 1642 | fatal "Unknown wordsize!" |
| 1643 | fi |
| 1644 | if test "$bigendian" = "yes" ; then |
| 1645 | output_sym "CONFIG_BIG_ENDIAN" |
| 1646 | else |
| 1647 | output_sym "CONFIG_LITTLE_ENDIAN" |
| 1648 | fi |
| 1649 | if test "$zlib" = "yes" ; then |
| 1650 | output_sym "CONFIG_ZLIB" |
| 1651 | fi |
| 1652 | if test "$libaio" = "yes" ; then |
| 1653 | output_sym "CONFIG_LIBAIO" |
| 1654 | fi |
| 1655 | if test "$posix_aio" = "yes" ; then |
| 1656 | output_sym "CONFIG_POSIXAIO" |
| 1657 | fi |
| 1658 | if test "$posix_aio_fsync" = "yes" ; then |
| 1659 | output_sym "CONFIG_POSIXAIO_FSYNC" |
| 1660 | fi |
| 1661 | if test "$linux_fallocate" = "yes" ; then |
| 1662 | output_sym "CONFIG_LINUX_FALLOCATE" |
| 1663 | fi |
| 1664 | if test "$posix_fallocate" = "yes" ; then |
| 1665 | output_sym "CONFIG_POSIX_FALLOCATE" |
| 1666 | fi |
| 1667 | if test "$fdatasync" = "yes" ; then |
| 1668 | output_sym "CONFIG_FDATASYNC" |
| 1669 | fi |
| 1670 | if test "$sync_file_range" = "yes" ; then |
| 1671 | output_sym "CONFIG_SYNC_FILE_RANGE" |
| 1672 | fi |
| 1673 | if test "$sfaa" = "yes" ; then |
| 1674 | output_sym "CONFIG_SFAA" |
| 1675 | fi |
| 1676 | if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then |
| 1677 | output_sym "CONFIG_RDMA" |
| 1678 | fi |
| 1679 | if test "$clock_gettime" = "yes" ; then |
| 1680 | output_sym "CONFIG_CLOCK_GETTIME" |
| 1681 | fi |
| 1682 | if test "$clock_monotonic" = "yes" ; then |
| 1683 | output_sym "CONFIG_CLOCK_MONOTONIC" |
| 1684 | fi |
| 1685 | if test "$clock_monotonic_raw" = "yes" ; then |
| 1686 | output_sym "CONFIG_CLOCK_MONOTONIC_RAW" |
| 1687 | fi |
| 1688 | if test "$clock_monotonic_precise" = "yes" ; then |
| 1689 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
| 1690 | fi |
| 1691 | if test "$gettimeofday" = "yes" ; then |
| 1692 | output_sym "CONFIG_GETTIMEOFDAY" |
| 1693 | fi |
| 1694 | if test "$posix_fadvise" = "yes" ; then |
| 1695 | output_sym "CONFIG_POSIX_FADVISE" |
| 1696 | fi |
| 1697 | if test "$linux_3arg_affinity" = "yes" ; then |
| 1698 | output_sym "CONFIG_3ARG_AFFINITY" |
| 1699 | elif test "$linux_2arg_affinity" = "yes" ; then |
| 1700 | output_sym "CONFIG_2ARG_AFFINITY" |
| 1701 | fi |
| 1702 | if test "$strsep" = "yes" ; then |
| 1703 | output_sym "CONFIG_STRSEP" |
| 1704 | fi |
| 1705 | if test "$strcasestr" = "yes" ; then |
| 1706 | output_sym "CONFIG_STRCASESTR" |
| 1707 | fi |
| 1708 | if test "$strlcat" = "yes" ; then |
| 1709 | output_sym "CONFIG_STRLCAT" |
| 1710 | fi |
| 1711 | if test "$getopt_long_only" = "yes" ; then |
| 1712 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
| 1713 | fi |
| 1714 | if test "$inet_aton" = "yes" ; then |
| 1715 | output_sym "CONFIG_INET_ATON" |
| 1716 | fi |
| 1717 | if test "$socklen_t" = "yes" ; then |
| 1718 | output_sym "CONFIG_SOCKLEN_T" |
| 1719 | fi |
| 1720 | if test "$ext4_me" = "yes" ; then |
| 1721 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
| 1722 | fi |
| 1723 | if test "$linux_splice" = "yes" ; then |
| 1724 | output_sym "CONFIG_LINUX_SPLICE" |
| 1725 | fi |
| 1726 | if test "$guasi" = "yes" ; then |
| 1727 | output_sym "CONFIG_GUASI" |
| 1728 | fi |
| 1729 | if test "$fusion_aw" = "yes" ; then |
| 1730 | output_sym "CONFIG_FUSION_AW" |
| 1731 | fi |
| 1732 | if test "$libnuma_v2" = "yes" ; then |
| 1733 | output_sym "CONFIG_LIBNUMA" |
| 1734 | fi |
| 1735 | if test "$solaris_aio" = "yes" ; then |
| 1736 | output_sym "CONFIG_SOLARISAIO" |
| 1737 | fi |
| 1738 | if test "$tls_thread" = "yes" ; then |
| 1739 | output_sym "CONFIG_TLS_THREAD" |
| 1740 | fi |
| 1741 | if test "$rusage_thread" = "yes" ; then |
| 1742 | output_sym "CONFIG_RUSAGE_THREAD" |
| 1743 | fi |
| 1744 | if test "$gfio" = "yes" ; then |
| 1745 | echo "CONFIG_GFIO=y" >> $config_host_mak |
| 1746 | fi |
| 1747 | if test "$esx" = "yes" ; then |
| 1748 | output_sym "CONFIG_ESX" |
| 1749 | output_sym "CONFIG_NO_SHM" |
| 1750 | fi |
| 1751 | if test "$sched_idle" = "yes" ; then |
| 1752 | output_sym "CONFIG_SCHED_IDLE" |
| 1753 | fi |
| 1754 | if test "$tcp_nodelay" = "yes" ; then |
| 1755 | output_sym "CONFIG_TCP_NODELAY" |
| 1756 | fi |
| 1757 | if test "$window_size" = "yes" ; then |
| 1758 | output_sym "CONFIG_NET_WINDOWSIZE" |
| 1759 | fi |
| 1760 | if test "$mss" = "yes" ; then |
| 1761 | output_sym "CONFIG_NET_MSS" |
| 1762 | fi |
| 1763 | if test "$rlimit_memlock" = "yes" ; then |
| 1764 | output_sym "CONFIG_RLIMIT_MEMLOCK" |
| 1765 | fi |
| 1766 | if test "$pwritev" = "yes" ; then |
| 1767 | output_sym "CONFIG_PWRITEV" |
| 1768 | fi |
| 1769 | if test "$pwritev2" = "yes" ; then |
| 1770 | output_sym "CONFIG_PWRITEV2" |
| 1771 | fi |
| 1772 | if test "$ipv6" = "yes" ; then |
| 1773 | output_sym "CONFIG_IPV6" |
| 1774 | fi |
| 1775 | if test "$rbd" = "yes" ; then |
| 1776 | output_sym "CONFIG_RBD" |
| 1777 | fi |
| 1778 | if test "$rbd_inval" = "yes" ; then |
| 1779 | output_sym "CONFIG_RBD_INVAL" |
| 1780 | fi |
| 1781 | if test "$setvbuf" = "yes" ; then |
| 1782 | output_sym "CONFIG_SETVBUF" |
| 1783 | fi |
| 1784 | if test "$s390_z196_facilities" = "yes" ; then |
| 1785 | output_sym "CONFIG_S390_Z196_FACILITIES" |
| 1786 | CFLAGS="$CFLAGS -march=z9-109" |
| 1787 | fi |
| 1788 | if test "$gfapi" = "yes" ; then |
| 1789 | output_sym "CONFIG_GFAPI" |
| 1790 | fi |
| 1791 | if test "$gf_fadvise" = "yes" ; then |
| 1792 | output_sym "CONFIG_GF_FADVISE" |
| 1793 | fi |
| 1794 | if test "$gf_trim" = "yes" ; then |
| 1795 | output_sym "CONFIG_GF_TRIM" |
| 1796 | fi |
| 1797 | if test "$libhdfs" = "yes" ; then |
| 1798 | output_sym "CONFIG_LIBHDFS" |
| 1799 | echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak |
| 1800 | echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak |
| 1801 | echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak |
| 1802 | fi |
| 1803 | if test "$mtd" = "yes" ; then |
| 1804 | output_sym "CONFIG_MTD" |
| 1805 | fi |
| 1806 | if test "$pmemblk" = "yes" ; then |
| 1807 | output_sym "CONFIG_PMEMBLK" |
| 1808 | fi |
| 1809 | if test "$arith" = "yes" ; then |
| 1810 | output_sym "CONFIG_ARITHMETIC" |
| 1811 | if test "$yacc_is_bison" = "yes" ; then |
| 1812 | echo "YACC=$YACC -y" >> $config_host_mak |
| 1813 | else |
| 1814 | echo "YACC=$YACC" >> $config_host_mak |
| 1815 | fi |
| 1816 | if test "$lex_use_o" = "yes" ; then |
| 1817 | echo "CONFIG_LEX_USE_O=y" >> $config_host_mak |
| 1818 | fi |
| 1819 | fi |
| 1820 | if test "$getmntent" = "yes" ; then |
| 1821 | output_sym "CONFIG_GETMNTENT" |
| 1822 | fi |
| 1823 | if test "$getmntinfo" = "yes" ; then |
| 1824 | output_sym "CONFIG_GETMNTINFO" |
| 1825 | fi |
| 1826 | if test "$static_assert" = "yes" ; then |
| 1827 | output_sym "CONFIG_STATIC_ASSERT" |
| 1828 | fi |
| 1829 | if test "$have_bool" = "yes" ; then |
| 1830 | output_sym "CONFIG_HAVE_BOOL" |
| 1831 | fi |
| 1832 | |
| 1833 | if test "$zlib" = "no" ; then |
| 1834 | echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it." |
| 1835 | fi |
| 1836 | |
| 1837 | echo "LIBS+=$LIBS" >> $config_host_mak |
| 1838 | echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak |
| 1839 | echo "CFLAGS+=$CFLAGS" >> $config_host_mak |
| 1840 | echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak |
| 1841 | echo "CC=$cc" >> $config_host_mak |
| 1842 | echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak |
| 1843 | echo "INSTALL_PREFIX=$prefix" >> $config_host_mak |
| 1844 | |
| 1845 | if [ `dirname $0` != "." -a ! -e Makefile ]; then |
| 1846 | cat > Makefile <<EOF |
| 1847 | SRCDIR:=`dirname $0` |
| 1848 | include \$(SRCDIR)/Makefile |
| 1849 | EOF |
| 1850 | fi |