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