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