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