Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 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" |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 27 | config_host_h="config-host.h" |
| 28 | |
| 29 | rm -rf $config_host_mak |
| 30 | rm -rf $config_host_h |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 31 | |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 32 | # Default CFLAGS |
Jens Axboe | 208e4c8 | 2013-01-29 09:26:07 +0100 | [diff] [blame] | 33 | CFLAGS="-D_GNU_SOURCE" |
| 34 | EXTFLAGS="-include config-host.h" |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 35 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 36 | # Print a helpful header at the top of config.log |
| 37 | echo "# FIO configure log $(date)" >> config.log |
| 38 | printf "# Configured with:" >> config.log |
| 39 | printf " '%s'" "$0" "$@" >> config.log |
| 40 | echo >> config.log |
| 41 | echo "#" >> config.log |
| 42 | |
Jens Axboe | 7560fe7 | 2013-01-25 08:52:28 -0700 | [diff] [blame] | 43 | # Print configure header at the top of $config_host_h |
| 44 | echo "/*" > $config_host_h |
| 45 | echo " * Automatically generated by configure - do not modify" >> $config_host_h |
| 46 | printf " * Configured with:" >> $config_host_h |
| 47 | printf " * '%s'" "$0" "$@" >> $config_host_h |
| 48 | echo "" >> $config_host_h |
| 49 | echo " */" >> $config_host_h |
| 50 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 51 | do_cc() { |
| 52 | # Run the compiler, capturing its output to the log. |
| 53 | echo $cc "$@" >> config.log |
| 54 | $cc "$@" >> config.log 2>&1 || return $? |
| 55 | # Test passed. If this is an --enable-werror build, rerun |
| 56 | # the test with -Werror and bail out if it fails. This |
| 57 | # makes warning-generating-errors in configure test code |
| 58 | # obvious to developers. |
| 59 | if test "$werror" != "yes"; then |
| 60 | return 0 |
| 61 | fi |
| 62 | # Don't bother rerunning the compile if we were already using -Werror |
| 63 | case "$*" in |
| 64 | *-Werror*) |
| 65 | return 0 |
| 66 | ;; |
| 67 | esac |
| 68 | echo $cc -Werror "$@" >> config.log |
| 69 | $cc -Werror "$@" >> config.log 2>&1 && return $? |
| 70 | echo "ERROR: configure test passed without -Werror but failed with -Werror." |
| 71 | echo "This is probably a bug in the configure script. The failing command" |
| 72 | echo "will be at the bottom of config.log." |
| 73 | echo "You can run configure with --disable-werror to bypass this check." |
| 74 | exit 1 |
| 75 | } |
| 76 | |
| 77 | compile_object() { |
| 78 | do_cc $CFLAGS -c -o $TMPO $TMPC |
| 79 | } |
| 80 | |
| 81 | compile_prog() { |
| 82 | local_cflags="$1" |
| 83 | local_ldflags="$2" |
| 84 | echo "Compiling test case $3" >> config.log |
| 85 | do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags |
| 86 | } |
| 87 | |
| 88 | feature_not_found() { |
| 89 | feature=$1 |
| 90 | |
| 91 | echo "ERROR" |
| 92 | echo "ERROR: User requested feature $feature" |
| 93 | echo "ERROR: configure was not able to find it" |
| 94 | echo "ERROR" |
| 95 | exit 1; |
| 96 | } |
| 97 | |
| 98 | has() { |
| 99 | type "$1" >/dev/null 2>&1 |
| 100 | } |
| 101 | |
| 102 | check_define() { |
| 103 | cat > $TMPC <<EOF |
| 104 | #if !defined($1) |
| 105 | #error $1 not defined |
| 106 | #endif |
| 107 | int main(void) |
| 108 | { |
| 109 | return 0; |
| 110 | } |
| 111 | EOF |
| 112 | compile_object |
| 113 | } |
| 114 | |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 115 | output_sym() { |
| 116 | echo "$1=y" >> $config_host_mak |
| 117 | echo "#define $1" >> $config_host_h |
| 118 | } |
| 119 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 120 | targetos="" |
| 121 | cpu="" |
| 122 | |
| 123 | cc="${CC-${cross_prefix}gcc}" |
| 124 | |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 125 | show_help="no" |
| 126 | exit_val=0 |
| 127 | |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 128 | # parse options |
| 129 | for opt do |
| 130 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
| 131 | case "$opt" in |
| 132 | --cc=*) CC="$optarg" |
| 133 | ;; |
Jens Axboe | 208e4c8 | 2013-01-29 09:26:07 +0100 | [diff] [blame] | 134 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
| 135 | ;; |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 136 | --help) |
| 137 | show_help="yes" |
| 138 | ;; |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 139 | *) |
| 140 | echo "Bad option $opt" |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 141 | show_help="yes" |
| 142 | exit_val=1 |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 143 | esac |
| 144 | done |
| 145 | |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 146 | if test "$show_help" = "yes" ; then |
| 147 | echo "--cc= Specify compiler to use" |
| 148 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" |
| 149 | exit $exit_val |
| 150 | fi |
| 151 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 152 | if check_define __linux__ ; then |
| 153 | targetos="Linux" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 154 | elif check_define __OpenBSD__ ; then |
| 155 | targetos='OpenBSD' |
| 156 | elif check_define __sun__ ; then |
| 157 | targetos='SunOS' |
| 158 | else |
| 159 | targetos=`uname -s` |
| 160 | fi |
| 161 | |
| 162 | # Some host OSes need non-standard checks for which CPU to use. |
| 163 | # Note that these checks are broken for cross-compilation: if you're |
| 164 | # cross-compiling to one of these OSes then you'll need to specify |
| 165 | # the correct CPU with the --cpu option. |
| 166 | case $targetos in |
| 167 | Darwin) |
| 168 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if |
| 169 | # we can run 64-bit userspace code. |
| 170 | # If the user didn't specify a CPU explicitly and the kernel says this is |
| 171 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual |
| 172 | # detection code. |
| 173 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then |
| 174 | cpu="x86_64" |
| 175 | fi |
| 176 | ;; |
| 177 | SunOS) |
| 178 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo |
| 179 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
| 180 | cpu="x86_64" |
| 181 | fi |
Jens Axboe | cfd94f7 | 2013-01-23 16:23:48 -0700 | [diff] [blame] | 182 | ;; |
| 183 | CYGWIN*) |
| 184 | echo "Forcing known good options on Windows" |
Jens Axboe | 4578d01 | 2013-01-23 16:26:12 -0700 | [diff] [blame] | 185 | if test -z "$CC" ; then |
| 186 | CC="x86_64-w64-mingw32-gcc" |
| 187 | fi |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 188 | output_sym "CONFIG_LITTLE_ENDIAN" |
| 189 | output_sym "CONFIG_64BIT_LLP64" |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 190 | output_sym "CONFIG_FADVISE" |
| 191 | output_sym "CONFIG_SOCKLEN_T" |
| 192 | output_sym "CONFIG_POSIX_FALLOCATE" |
| 193 | output_sym "CONFIG_FADVISE" |
| 194 | output_sym "CONFIG_SFAA" |
| 195 | output_sym "CONFIG_RUSAGE_THREAD" |
| 196 | output_sym "CONFIG_WINDOWSAIO" |
| 197 | output_sym "CONFIG_FDATASYNC" |
Bruce Cran | 59308a6 | 2013-02-02 20:59:31 +0000 | [diff] [blame^] | 198 | output_sym "CONFIG_CLOCK_MONOTONIC" |
Bruce Cran | dc0518c | 2013-01-28 16:07:15 +0000 | [diff] [blame] | 199 | output_sym "CONFIG_GETTIMEOFDAY" |
| 200 | output_sym "CONFIG_CLOCK_GETTIME" |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 201 | output_sym "CONFIG_SCHED_IDLE" |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 202 | output_sym "CONFIG_TCP_NODELAY" |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 203 | echo "CC=$CC" >> $config_host_mak |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 204 | echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak |
Jens Axboe | cfd94f7 | 2013-01-23 16:23:48 -0700 | [diff] [blame] | 205 | exit 0 |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 206 | esac |
| 207 | |
| 208 | if test ! -z "$cpu" ; then |
| 209 | # command line argument |
| 210 | : |
| 211 | elif check_define __i386__ ; then |
| 212 | cpu="i386" |
| 213 | elif check_define __x86_64__ ; then |
| 214 | cpu="x86_64" |
| 215 | elif check_define __sparc__ ; then |
| 216 | if check_define __arch64__ ; then |
| 217 | cpu="sparc64" |
| 218 | else |
| 219 | cpu="sparc" |
| 220 | fi |
| 221 | elif check_define _ARCH_PPC ; then |
| 222 | if check_define _ARCH_PPC64 ; then |
| 223 | cpu="ppc64" |
| 224 | else |
| 225 | cpu="ppc" |
| 226 | fi |
| 227 | elif check_define __mips__ ; then |
| 228 | cpu="mips" |
| 229 | elif check_define __ia64__ ; then |
| 230 | cpu="ia64" |
| 231 | elif check_define __s390__ ; then |
| 232 | if check_define __s390x__ ; then |
| 233 | cpu="s390x" |
| 234 | else |
| 235 | cpu="s390" |
| 236 | fi |
| 237 | elif check_define __arm__ ; then |
| 238 | cpu="arm" |
| 239 | elif check_define __hppa__ ; then |
| 240 | cpu="hppa" |
| 241 | else |
| 242 | cpu=`uname -m` |
| 243 | fi |
| 244 | |
| 245 | # Normalise host CPU name and set ARCH. |
| 246 | case "$cpu" in |
| 247 | ia64|ppc|ppc64|s390|s390x|sparc64) |
| 248 | cpu="$cpu" |
| 249 | ;; |
| 250 | i386|i486|i586|i686|i86pc|BePC) |
| 251 | cpu="i386" |
| 252 | ;; |
| 253 | x86_64|amd64) |
| 254 | cpu="x86_64" |
| 255 | ;; |
| 256 | armv*b|armv*l|arm) |
| 257 | cpu="arm" |
| 258 | ;; |
| 259 | hppa|parisc|parisc64) |
| 260 | cpu="hppa" |
| 261 | ;; |
| 262 | mips*) |
| 263 | cpu="mips" |
| 264 | ;; |
| 265 | sparc|sun4[cdmuv]) |
| 266 | cpu="sparc" |
| 267 | ;; |
| 268 | *) |
| 269 | echo "Unknown CPU" |
| 270 | exit 1; |
| 271 | ;; |
| 272 | esac |
| 273 | |
Jens Axboe | dcbbf5b | 2013-01-25 14:35:27 -0700 | [diff] [blame] | 274 | if test -z "$CC" ; then |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 275 | if test "$targetos" = "FreeBSD"; then |
| 276 | if has clang; then |
| 277 | CC=clang |
| 278 | else |
| 279 | CC=gcc |
| 280 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 281 | fi |
| 282 | fi |
| 283 | |
| 284 | cc="${CC-${cross_prefix}gcc}" |
| 285 | |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 286 | ########################################## |
| 287 | # check endianness |
| 288 | bigendian="no" |
| 289 | cat > $TMPC <<EOF |
| 290 | #include <inttypes.h> |
| 291 | int main(void) |
| 292 | { |
| 293 | volatile uint32_t i=0x01234567; |
| 294 | return (*((uint8_t*)(&i))) == 0x67; |
| 295 | } |
| 296 | EOF |
| 297 | if compile_prog "" "" "endian"; then |
| 298 | $TMPE && bigendian="yes" |
| 299 | fi |
| 300 | |
| 301 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 302 | echo "Operating system $targetos" |
| 303 | echo "CPU $cpu" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 304 | echo "Big endian $bigendian" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 305 | echo "Compiler $cc" |
| 306 | echo |
| 307 | |
| 308 | ########################################## |
| 309 | # check for wordsize |
| 310 | wordsize="0" |
| 311 | cat > $TMPC <<EOF |
| 312 | #include <stdio.h> |
| 313 | int main(void) |
| 314 | { |
| 315 | unsigned int wsize = sizeof(long) * 8; |
| 316 | printf("%d\n", wsize); |
| 317 | return 0; |
| 318 | } |
| 319 | EOF |
| 320 | if compile_prog "" "" "wordsize"; then |
| 321 | wordsize=$($TMPE) |
| 322 | fi |
| 323 | echo "Wordsize $wordsize" |
| 324 | |
| 325 | ########################################## |
| 326 | # linux-aio probe |
| 327 | libaio="no" |
| 328 | cat > $TMPC <<EOF |
| 329 | #include <libaio.h> |
| 330 | #include <stddef.h> |
| 331 | int main(void) |
| 332 | { |
| 333 | io_setup(0, NULL); |
| 334 | return 0; |
| 335 | } |
| 336 | EOF |
| 337 | if compile_prog "" "-laio" "libaio" ; then |
| 338 | libaio=yes |
| 339 | LIBS="-laio $LIBS" |
| 340 | else |
| 341 | if test "$libaio" = "yes" ; then |
| 342 | feature_not_found "linux AIO" |
| 343 | fi |
| 344 | libaio=no |
| 345 | fi |
| 346 | echo "Linux AIO support $libaio" |
| 347 | |
| 348 | ########################################## |
| 349 | # posix aio probe |
| 350 | posix_aio="no" |
| 351 | posix_aio_lrt="no" |
| 352 | cat > $TMPC <<EOF |
| 353 | #include <aio.h> |
| 354 | int main(void) |
| 355 | { |
| 356 | struct aiocb cb; |
| 357 | aio_read(&cb); |
| 358 | return 0; |
| 359 | } |
| 360 | EOF |
| 361 | if compile_prog "" "" "posixaio" ; then |
| 362 | posix_aio="yes" |
| 363 | elif compile_prog "" "-lrt" "posixaio"; then |
| 364 | posix_aio="yes" |
| 365 | posix_aio_lrt="yes" |
| 366 | LIBS="-lrt $LIBS" |
| 367 | fi |
| 368 | echo "POSIX AIO support $posix_aio" |
| 369 | echo "POSIX AIO support needs -lrt $posix_aio_lrt" |
| 370 | |
| 371 | ########################################## |
| 372 | # posix aio fsync probe |
| 373 | posix_aio_fsync="no" |
| 374 | if test "$posix_aio" = "yes" ; then |
| 375 | cat > $TMPC <<EOF |
| 376 | #include <fcntl.h> |
| 377 | #include <aio.h> |
| 378 | int main(void) |
| 379 | { |
| 380 | struct aiocb cb; |
| 381 | return aio_fsync(O_SYNC, &cb); |
| 382 | return 0; |
| 383 | } |
| 384 | EOF |
| 385 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then |
| 386 | posix_aio_fsync=yes |
| 387 | fi |
| 388 | fi |
| 389 | echo "POSIX AIO fsync $posix_aio_fsync" |
| 390 | |
| 391 | ########################################## |
| 392 | # solaris aio probe |
| 393 | solaris_aio="no" |
| 394 | cat > $TMPC <<EOF |
| 395 | #include <sys/types.h> |
| 396 | #include <sys/asynch.h> |
| 397 | #include <unistd.h> |
| 398 | int main(void) |
| 399 | { |
| 400 | aio_result_t res; |
| 401 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); |
| 402 | return 0; |
| 403 | } |
| 404 | EOF |
| 405 | if compile_prog "" "-laio" "solarisaio" ; then |
| 406 | solaris_aio=yes |
| 407 | LIBS="-laio $LIBS" |
| 408 | fi |
| 409 | echo "Solaris AIO support $solaris_aio" |
| 410 | |
| 411 | ########################################## |
| 412 | # __sync_fetch_and_and test |
| 413 | sfaa="no" |
| 414 | cat > $TMPC << EOF |
| 415 | static int sfaa(int *ptr) |
| 416 | { |
| 417 | return __sync_fetch_and_and(ptr, 0); |
| 418 | } |
| 419 | |
| 420 | int main(int argc, char **argv) |
| 421 | { |
| 422 | int val = 42; |
| 423 | sfaa(&val); |
| 424 | return val; |
| 425 | } |
| 426 | EOF |
| 427 | if compile_prog "" "" "__sync_fetch_and_add()" ; then |
| 428 | sfaa="yes" |
| 429 | fi |
| 430 | echo "__sync_fetch_and add $sfaa" |
| 431 | |
| 432 | ########################################## |
| 433 | # libverbs probe |
| 434 | libverbs="no" |
| 435 | cat > $TMPC << EOF |
| 436 | #include <stdio.h> |
| 437 | #include <infiniband/arch.h> |
| 438 | int main(int argc, char **argv) |
| 439 | { |
| 440 | struct ibv_pd *pd = ibv_alloc_pd(NULL); |
| 441 | return 0; |
| 442 | } |
| 443 | EOF |
| 444 | if compile_prog "" "-libverbs" "libverbs" ; then |
| 445 | libverbs="yes" |
| 446 | LIBS="-libverbs $LIBS" |
| 447 | fi |
| 448 | echo "libverbs $libverbs" |
| 449 | |
| 450 | ########################################## |
| 451 | # rdmacm probe |
| 452 | rdmacm="no" |
| 453 | cat > $TMPC << EOF |
| 454 | #include <stdio.h> |
| 455 | #include <rdma/rdma_cma.h> |
| 456 | int main(int argc, char **argv) |
| 457 | { |
| 458 | rdma_destroy_qp(NULL); |
| 459 | return 0; |
| 460 | } |
| 461 | EOF |
| 462 | if compile_prog "" "-lrdmacm" "rdma"; then |
| 463 | rdmacm="yes" |
| 464 | LIBS="-lrdmacm $LIBS" |
| 465 | fi |
| 466 | echo "rdmacm $rdmacm" |
| 467 | |
| 468 | ########################################## |
| 469 | # Linux fallocate probe |
| 470 | linux_fallocate="no" |
| 471 | cat > $TMPC << EOF |
| 472 | #include <stdio.h> |
| 473 | #include <linux/falloc.h> |
| 474 | int main(int argc, char **argv) |
| 475 | { |
| 476 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); |
| 477 | return r; |
| 478 | } |
| 479 | EOF |
| 480 | if compile_prog "" "" "linux_fallocate"; then |
| 481 | linux_fallocate="yes" |
| 482 | fi |
| 483 | echo "Linux fallocate $linux_fallocate" |
| 484 | |
| 485 | ########################################## |
| 486 | # POSIX fadvise probe |
| 487 | posix_fadvise="no" |
| 488 | cat > $TMPC << EOF |
| 489 | #include <stdio.h> |
| 490 | #include <fcntl.h> |
| 491 | int main(int argc, char **argv) |
| 492 | { |
| 493 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); |
| 494 | return r; |
| 495 | } |
| 496 | EOF |
| 497 | if compile_prog "" "" "posix_fadvise"; then |
| 498 | posix_fadvise="yes" |
| 499 | fi |
| 500 | echo "POSIX fadvise $posix_fadvise" |
| 501 | |
| 502 | ########################################## |
| 503 | # POSIX fallocate probe |
| 504 | posix_fallocate="no" |
| 505 | cat > $TMPC << EOF |
| 506 | #include <stdio.h> |
| 507 | #include <fcntl.h> |
| 508 | int main(int argc, char **argv) |
| 509 | { |
| 510 | int r = posix_fallocate(0, 0, 1024); |
| 511 | return r; |
| 512 | } |
| 513 | EOF |
| 514 | if compile_prog "" "" "posix_fallocate"; then |
| 515 | posix_fallocate="yes" |
| 516 | fi |
| 517 | echo "POSIX fallocate $posix_fallocate" |
| 518 | |
| 519 | ########################################## |
| 520 | # sched_set/getaffinity 2 or 3 argument test |
| 521 | linux_2arg_affinity="no" |
| 522 | linux_3arg_affinity="no" |
| 523 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 524 | #include <sched.h> |
| 525 | int main(int argc, char **argv) |
| 526 | { |
| 527 | cpu_set_t mask; |
| 528 | return sched_setaffinity(0, sizeof(mask), &mask); |
| 529 | } |
| 530 | EOF |
| 531 | if compile_prog "" "" "sched_setaffinity(,,)"; then |
| 532 | linux_3arg_affinity="yes" |
| 533 | else |
| 534 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 535 | #include <sched.h> |
| 536 | int main(int argc, char **argv) |
| 537 | { |
| 538 | cpu_set_t mask; |
| 539 | return sched_setaffinity(0, &mask); |
| 540 | } |
| 541 | EOF |
| 542 | if compile_prog "" "" "sched_setaffinity(,)"; then |
| 543 | linux_2arg_affinity="yes" |
| 544 | fi |
| 545 | fi |
| 546 | echo "sched_setaffinity(3 arg) $linux_3arg_affinity" |
| 547 | echo "sched_setaffinity(2 arg) $linux_2arg_affinity" |
| 548 | |
| 549 | ########################################## |
| 550 | # clock_gettime probe |
| 551 | clock_gettime="no" |
| 552 | cat > $TMPC << EOF |
| 553 | #include <stdio.h> |
| 554 | #include <time.h> |
| 555 | int main(int argc, char **argv) |
| 556 | { |
| 557 | return clock_gettime(0, NULL); |
| 558 | } |
| 559 | EOF |
| 560 | if compile_prog "" "" "clock_gettime"; then |
| 561 | clock_gettime="yes" |
| 562 | elif compile_prog "" "-lrt" "clock_gettime"; then |
| 563 | clock_gettime="yes" |
| 564 | LIBS="-lrt $LIBS" |
| 565 | fi |
| 566 | echo "clock_gettime $clock_gettime" |
| 567 | |
| 568 | ########################################## |
| 569 | # CLOCK_MONOTONIC probe |
| 570 | clock_monotonic="no" |
| 571 | if test "$clock_gettime" = "yes" ; then |
| 572 | cat > $TMPC << EOF |
| 573 | #include <stdio.h> |
| 574 | #include <time.h> |
| 575 | int main(int argc, char **argv) |
| 576 | { |
| 577 | return clock_gettime(CLOCK_MONOTONIC, NULL); |
| 578 | } |
| 579 | EOF |
| 580 | if compile_prog "" "$LIBS" "clock monotonic"; then |
| 581 | clock_monotonic="yes" |
| 582 | fi |
| 583 | fi |
| 584 | echo "CLOCK_MONOTONIC $clock_monotonic" |
| 585 | |
| 586 | ########################################## |
| 587 | # CLOCK_MONOTONIC_PRECISE probe |
| 588 | clock_monotonic_precise="no" |
| 589 | if test "$clock_gettime" = "yes" ; then |
| 590 | cat > $TMPC << EOF |
| 591 | #include <stdio.h> |
| 592 | #include <time.h> |
| 593 | int main(int argc, char **argv) |
| 594 | { |
| 595 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); |
| 596 | } |
| 597 | EOF |
| 598 | if compile_prog "" "$LIBS" "clock monotonic precise"; then |
| 599 | clock_monotonic_precise="yes" |
| 600 | fi |
| 601 | fi |
| 602 | echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise" |
| 603 | |
| 604 | ########################################## |
| 605 | # gettimeofday() probe |
| 606 | gettimeofday="no" |
| 607 | cat > $TMPC << EOF |
| 608 | #include <sys/time.h> |
| 609 | #include <stdio.h> |
| 610 | int main(int argc, char **argv) |
| 611 | { |
| 612 | struct timeval tv; |
| 613 | return gettimeofday(&tv, NULL); |
| 614 | } |
| 615 | EOF |
| 616 | if compile_prog "" "" "gettimeofday"; then |
| 617 | gettimeofday="yes" |
| 618 | fi |
| 619 | echo "gettimeofday $gettimeofday" |
| 620 | |
| 621 | ########################################## |
| 622 | # fdatasync() probe |
| 623 | fdatasync="no" |
| 624 | cat > $TMPC << EOF |
| 625 | #include <stdio.h> |
| 626 | #include <unistd.h> |
| 627 | int main(int argc, char **argv) |
| 628 | { |
| 629 | return fdatasync(0); |
| 630 | } |
| 631 | EOF |
| 632 | if compile_prog "" "" "fdatasync"; then |
| 633 | fdatasync="yes" |
| 634 | fi |
| 635 | echo "fdatasync $fdatasync" |
| 636 | |
| 637 | ########################################## |
| 638 | # sync_file_range() probe |
| 639 | sync_file_range="no" |
| 640 | cat > $TMPC << EOF |
| 641 | #include <stdio.h> |
| 642 | #include <unistd.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 643 | #include <fcntl.h> |
| 644 | #include <linux/fs.h> |
| 645 | int main(int argc, char **argv) |
| 646 | { |
| 647 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | |
| 648 | SYNC_FILE_RANGE_WAIT_AFTER; |
| 649 | return sync_file_range(0, 0, 0, flags); |
| 650 | } |
| 651 | EOF |
| 652 | if compile_prog "" "" "sync_file_range"; then |
| 653 | sync_file_range="yes" |
| 654 | fi |
| 655 | echo "sync_file_range $sync_file_range" |
| 656 | |
| 657 | ########################################## |
| 658 | # ext4 move extent probe |
| 659 | ext4_me="no" |
| 660 | cat > $TMPC << EOF |
| 661 | #include <fcntl.h> |
| 662 | #include <sys/ioctl.h> |
| 663 | int main(int argc, char **argv) |
| 664 | { |
| 665 | struct move_extent me; |
| 666 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); |
| 667 | } |
| 668 | EOF |
Jens Axboe | c7165b8 | 2013-01-12 10:27:53 +0100 | [diff] [blame] | 669 | if compile_prog "" "" "ext4 move extent" ; then |
| 670 | ext4_me="yes" |
| 671 | elif test $targetos = "Linux" ; then |
| 672 | # On Linux, just default to it on and let it error at runtime if we really |
| 673 | # don't have it. None of my updated systems have it defined, but it does |
| 674 | # work. Takes a while to bubble back. |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 675 | ext4_me="yes" |
| 676 | fi |
| 677 | echo "EXT4 move extent $ext4_me" |
| 678 | |
| 679 | ########################################## |
| 680 | # splice probe |
| 681 | linux_splice="no" |
| 682 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 683 | #include <stdio.h> |
| 684 | #include <fcntl.h> |
| 685 | int main(int argc, char **argv) |
| 686 | { |
| 687 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); |
| 688 | } |
| 689 | EOF |
| 690 | if compile_prog "" "" "linux splice"; then |
| 691 | linux_splice="yes" |
| 692 | fi |
| 693 | echo "Linux splice(2) $linux_splice" |
| 694 | |
| 695 | ########################################## |
| 696 | # GUASI probe |
| 697 | guasi="no" |
| 698 | cat > $TMPC << EOF |
| 699 | #include <guasi.h> |
| 700 | #include <guasi_syscalls.h> |
| 701 | int main(int argc, char **argv) |
| 702 | { |
| 703 | guasi_t ctx = guasi_create(0, 0, 0); |
| 704 | return 0; |
| 705 | } |
| 706 | EOF |
| 707 | if compile_prog "" "" "guasi"; then |
| 708 | guasi="yes" |
| 709 | fi |
| 710 | echo "GUASI $guasi" |
| 711 | |
| 712 | ########################################## |
| 713 | # fusion-aw probe |
| 714 | fusion_aw="no" |
| 715 | cat > $TMPC << EOF |
Jens Axboe | 99db656 | 2013-01-14 19:33:40 +0100 | [diff] [blame] | 716 | #include <nvm/vectored_write.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 717 | int main(int argc, char **argv) |
| 718 | { |
| 719 | struct vsl_iovec iov; |
| 720 | return vsl_vectored_write(0, &iov, 0, O_ATOMIC); |
| 721 | } |
| 722 | EOF |
Jens Axboe | 99db656 | 2013-01-14 19:33:40 +0100 | [diff] [blame] | 723 | if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then |
| 724 | LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 725 | fusion_aw="yes" |
| 726 | fi |
| 727 | echo "Fusion-io atomic engine $fusion_aw" |
| 728 | |
| 729 | ########################################## |
| 730 | # libnuma probe |
| 731 | libnuma="no" |
| 732 | cat > $TMPC << EOF |
| 733 | #include <numa.h> |
| 734 | int main(int argc, char **argv) |
| 735 | { |
| 736 | return numa_available(); |
| 737 | } |
| 738 | EOF |
| 739 | if compile_prog "" "-lnuma" "libnuma"; then |
| 740 | libnuma="yes" |
| 741 | LIBS="-lnuma $LIBS" |
| 742 | fi |
| 743 | echo "libnuma $libnuma" |
| 744 | |
| 745 | ########################################## |
| 746 | # strsep() probe |
| 747 | strsep="no" |
| 748 | cat > $TMPC << EOF |
| 749 | #include <string.h> |
| 750 | int main(int argc, char **argv) |
| 751 | { |
| 752 | strsep(NULL, NULL); |
| 753 | return 0; |
| 754 | } |
| 755 | EOF |
| 756 | if compile_prog "" "" "strsep"; then |
| 757 | strsep="yes" |
| 758 | fi |
| 759 | echo "strsep $strsep" |
| 760 | |
| 761 | ########################################## |
| 762 | # getopt_long_only() probe |
| 763 | getopt_long_only="no" |
| 764 | cat > $TMPC << EOF |
| 765 | #include <unistd.h> |
| 766 | #include <stdio.h> |
| 767 | int main(int argc, char **argv) |
| 768 | { |
| 769 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); |
| 770 | return c; |
| 771 | } |
| 772 | EOF |
| 773 | if compile_prog "" "" "getopt_long_only"; then |
| 774 | getopt_long_only="yes" |
| 775 | fi |
| 776 | echo "getopt_long_only() $getopt_long_only" |
| 777 | |
| 778 | ########################################## |
| 779 | # inet_aton() probe |
| 780 | inet_aton="no" |
| 781 | cat > $TMPC << EOF |
| 782 | #include <sys/socket.h> |
| 783 | #include <arpa/inet.h> |
| 784 | #include <stdio.h> |
| 785 | int main(int argc, char **argv) |
| 786 | { |
| 787 | struct in_addr in; |
| 788 | return inet_aton(NULL, &in); |
| 789 | } |
| 790 | EOF |
| 791 | if compile_prog "" "" "inet_aton"; then |
| 792 | inet_aton="yes" |
| 793 | fi |
| 794 | echo "inet_aton $inet_aton" |
| 795 | |
| 796 | ########################################## |
| 797 | # socklen_t probe |
| 798 | socklen_t="no" |
| 799 | cat > $TMPC << EOF |
| 800 | #include <string.h> |
| 801 | #include <netinet/in.h> |
| 802 | int main(int argc, char **argv) |
| 803 | { |
| 804 | socklen_t len = 0; |
| 805 | return len; |
| 806 | } |
| 807 | EOF |
| 808 | if compile_prog "" "" "socklen_t"; then |
| 809 | socklen_t="yes" |
| 810 | fi |
| 811 | echo "socklen_t $socklen_t" |
| 812 | |
| 813 | ########################################## |
| 814 | # Whether or not __thread is supported for TLS |
| 815 | tls_thread="no" |
| 816 | cat > $TMPC << EOF |
| 817 | #include <stdio.h> |
| 818 | static int __thread ret; |
| 819 | int main(int argc, char **argv) |
| 820 | { |
| 821 | return ret; |
| 822 | } |
| 823 | EOF |
| 824 | if compile_prog "" "" "__thread"; then |
| 825 | tls_thread="yes" |
| 826 | fi |
| 827 | echo "__thread $tls_thread" |
| 828 | |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 829 | ########################################## |
| 830 | # Check whether we have getrusage(RUSAGE_THREAD) |
| 831 | rusage_thread="no" |
| 832 | cat > $TMPC << EOF |
| 833 | #include <sys/time.h> |
| 834 | #include <sys/resource.h> |
| 835 | int main(int argc, char **argv) |
| 836 | { |
| 837 | struct rusage ru; |
| 838 | getrusage(RUSAGE_THREAD, &ru); |
| 839 | return 0; |
| 840 | } |
| 841 | EOF |
| 842 | if compile_prog "" "" "RUSAGE_THREAD"; then |
| 843 | rusage_thread="yes" |
| 844 | fi |
| 845 | echo "RUSAGE_THREAD $rusage_thread" |
| 846 | |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 847 | ########################################## |
| 848 | # Check whether we have SCHED_IDLE |
| 849 | sched_idle="no" |
| 850 | cat > $TMPC << EOF |
| 851 | #include <sched.h> |
| 852 | int main(int argc, char **argv) |
| 853 | { |
| 854 | struct sched_param p; |
| 855 | return sched_setscheduler(0, SCHED_IDLE, &p); |
| 856 | } |
| 857 | EOF |
| 858 | if compile_prog "" "" "SCHED_IDLE"; then |
| 859 | sched_idle="yes" |
| 860 | fi |
| 861 | echo "SCHED_IDLE $sched_idle" |
| 862 | |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 863 | ########################################## |
| 864 | # Check whether we have TCP_NODELAY |
| 865 | tcp_nodelay="no" |
| 866 | cat > $TMPC << EOF |
| 867 | #include <stdio.h> |
| 868 | #include <sys/types.h> |
| 869 | #include <sys/socket.h> |
| 870 | #include <netinet/tcp.h> |
| 871 | int main(int argc, char **argv) |
| 872 | { |
| 873 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); |
| 874 | } |
| 875 | EOF |
| 876 | if compile_prog "" "" "TCP_NODELAY"; then |
| 877 | tcp_nodelay="yes" |
| 878 | fi |
| 879 | echo "TCP_NODELAY $tcp_nodelay" |
| 880 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 881 | ############################################################################# |
| 882 | |
| 883 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
| 884 | printf "# Configured with:" >> $config_host_mak |
| 885 | printf " '%s'" "$0" "$@" >> $config_host_mak |
| 886 | echo >> $config_host_mak |
| 887 | |
| 888 | if test "$wordsize" = "64" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 889 | output_sym "CONFIG_64BIT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 890 | elif test "$wordsize" = "32" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 891 | output_sym "CONFIG_32BIT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 892 | else |
| 893 | echo "Unknown wordsize!" |
| 894 | exit 1 |
| 895 | fi |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 896 | if test "$bigendian" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 897 | output_sym "CONFIG_BIG_ENDIAN" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 898 | else |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 899 | output_sym "CONFIG_LITTLE_ENDIAN" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 900 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 901 | if test "$libaio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 902 | output_sym "CONFIG_LIBAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 903 | fi |
| 904 | if test "$posix_aio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 905 | output_sym "CONFIG_POSIXAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 906 | fi |
| 907 | if test "$posix_aio_fsync" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 908 | output_sym "CONFIG_POSIXAIO_FSYNC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 909 | fi |
| 910 | if test "$linux_fallocate" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 911 | output_sym "CONFIG_LINUX_FALLOCATE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 912 | fi |
| 913 | if test "$posix_fallocate" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 914 | output_sym "CONFIG_POSIX_FALLOCATE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 915 | fi |
| 916 | if test "$fdatasync" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 917 | output_sym "CONFIG_FDATASYNC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 918 | fi |
| 919 | if test "$sync_file_range" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 920 | output_sym "CONFIG_SYNC_FILE_RANGE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 921 | fi |
| 922 | if test "$sfaa" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 923 | output_sym "CONFIG_SFAA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 924 | fi |
| 925 | if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 926 | output_sym "CONFIG_RDMA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 927 | fi |
| 928 | if test "$clock_gettime" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 929 | output_sym "CONFIG_CLOCK_GETTIME" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 930 | fi |
| 931 | if test "$clock_monotonic" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 932 | output_sym "CONFIG_CLOCK_MONOTONIC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 933 | fi |
| 934 | if test "$clock_monotonic_precise" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 935 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 936 | fi |
| 937 | if test "$gettimeofday" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 938 | output_sym "CONFIG_GETTIMEOFDAY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 939 | fi |
| 940 | if test "$posix_fadvise" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 941 | output_sym "CONFIG_POSIX_FADVISE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 942 | fi |
| 943 | if test "$linux_3arg_affinity" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 944 | output_sym "CONFIG_3ARG_AFFINITY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 945 | elif test "$linux_2arg_affinity" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 946 | output_sym "CONFIG_2ARG_AFFINITY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 947 | fi |
| 948 | if test "$strsep" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 949 | output_sym "CONFIG_STRSEP" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 950 | fi |
| 951 | if test "$getopt_long_only" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 952 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 953 | fi |
| 954 | if test "$inet_aton" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 955 | output_sym "CONFIG_INET_ATON" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 956 | fi |
| 957 | if test "$socklen_t" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 958 | output_sym "CONFIG_SOCKLEN_T" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 959 | fi |
| 960 | if test "$ext4_me" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 961 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 962 | fi |
| 963 | if test "$linux_splice" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 964 | output_sym "CONFIG_LINUX_SPLICE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 965 | fi |
| 966 | if test "$guasi" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 967 | output_sym "CONFIG_GUASI" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 968 | fi |
| 969 | if test "$fusion_aw" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 970 | output_sym "CONFIG_FUSION_AW" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 971 | fi |
| 972 | if test "$libnuma" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 973 | output_sym "CONFIG_LIBNUMA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 974 | fi |
| 975 | if test "$solaris_aio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 976 | output_sym "CONFIG_SOLARISAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 977 | fi |
| 978 | if test "$tls_thread" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 979 | output_sym "CONFIG_TLS_THREAD" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 980 | fi |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 981 | if test "$rusage_thread" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 982 | output_sym "CONFIG_RUSAGE_THREAD" |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 983 | fi |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 984 | if test "$sched_idle" = "yes" ; then |
| 985 | output_sym "CONFIG_SCHED_IDLE" |
| 986 | fi |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 987 | if test "$tcp_nodelay" = "yes" ; then |
| 988 | output_sym "CONFIG_TCP_NODELAY" |
| 989 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 990 | |
| 991 | echo "LIBS+=$LIBS" >> $config_host_mak |
| 992 | echo "CC=$cc" >> $config_host_mak |
Jens Axboe | 208e4c8 | 2013-01-29 09:26:07 +0100 | [diff] [blame] | 993 | echo "EXTFLAGS=$EXTFLAGS $CFLAGS" >> $config_host_mak |