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 | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 41 | CFLAGS="-D_GNU_SOURCE -include config-host.h" |
| 42 | BUILD_CFLAGS="" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 43 | |
| 44 | # Print a helpful header at the top of config.log |
| 45 | echo "# FIO configure log $(date)" >> config.log |
| 46 | printf "# Configured with:" >> config.log |
| 47 | printf " '%s'" "$0" "$@" >> config.log |
| 48 | echo >> config.log |
| 49 | echo "#" >> config.log |
| 50 | |
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" |
Jens Axboe | adaa46d | 2013-02-28 22:10:22 +0100 | [diff] [blame] | 90 | local_ldflags="$2 $LIBS" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 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 |
Jens Axboe | c55d728 | 2013-04-12 10:16:43 +0200 | [diff] [blame] | 97 | packages=$2 |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 98 | |
| 99 | echo "ERROR" |
| 100 | echo "ERROR: User requested feature $feature" |
Jens Axboe | c55d728 | 2013-04-12 10:16:43 +0200 | [diff] [blame] | 101 | if test ! -z "$packages" ; then |
| 102 | echo "ERROR: That feature needs $packages installed" |
| 103 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 104 | echo "ERROR: configure was not able to find it" |
Jens Axboe | d7145a7 | 2013-02-11 13:21:54 +0100 | [diff] [blame] | 105 | fatal "ERROR" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | has() { |
| 109 | type "$1" >/dev/null 2>&1 |
| 110 | } |
| 111 | |
| 112 | check_define() { |
| 113 | cat > $TMPC <<EOF |
| 114 | #if !defined($1) |
| 115 | #error $1 not defined |
| 116 | #endif |
| 117 | int main(void) |
| 118 | { |
| 119 | return 0; |
| 120 | } |
| 121 | EOF |
| 122 | compile_object |
| 123 | } |
| 124 | |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 125 | output_sym() { |
| 126 | echo "$1=y" >> $config_host_mak |
| 127 | echo "#define $1" >> $config_host_h |
| 128 | } |
| 129 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 130 | targetos="" |
| 131 | cpu="" |
| 132 | |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 133 | # default options |
Jens Axboe | 47f4463 | 2013-01-24 10:34:14 -0700 | [diff] [blame] | 134 | show_help="no" |
| 135 | exit_val=0 |
Jens Axboe | 135be49 | 2013-01-29 10:09:55 +0100 | [diff] [blame] | 136 | gfio="no" |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 137 | |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 138 | # parse options |
| 139 | for opt do |
| 140 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
| 141 | case "$opt" in |
Jens Axboe | 8b156d8 | 2013-02-10 15:48:34 +0100 | [diff] [blame] | 142 | --cpu=*) cpu="$optarg" |
| 143 | ;; |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 144 | # esx is cross compiled and cannot be detect through simple uname calls |
| 145 | --esx) |
| 146 | esx="yes" |
| 147 | ;; |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 148 | --cc=*) CC="$optarg" |
| 149 | ;; |
Jens Axboe | 208e4c8 | 2013-01-29 09:26:07 +0100 | [diff] [blame] | 150 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 151 | ;; |
Jens Axboe | b7c1279 | 2013-05-01 13:00:26 +0200 | [diff] [blame] | 152 | --build-32bit-win) build_32bit_win="yes" |
Huadong Liu | 7409711 | 2013-02-05 08:43:14 +0100 | [diff] [blame] | 153 | ;; |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 154 | --enable-gfio) |
Jens Axboe | 9db01ef | 2013-02-07 15:45:39 +0100 | [diff] [blame] | 155 | gfio="yes" |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 156 | ;; |
Castor Fu | 4446251 | 2013-10-31 11:00:54 -0600 | [diff] [blame] | 157 | --disable-numa) disable_numa="yes" |
| 158 | ;; |
Tiziano Müller | aa48efe | 2014-06-26 14:20:20 +0200 | [diff] [blame] | 159 | --disable-rbd) disable_rbd="yes" |
| 160 | ;; |
| 161 | --disable-gfapi) disable_gfapi="yes" |
| 162 | ;; |
Jens Axboe | 827da4f | 2013-01-24 10:27:26 -0700 | [diff] [blame] | 163 | --help) |
Jens Axboe | 47f4463 | 2013-01-24 10:34:14 -0700 | [diff] [blame] | 164 | show_help="yes" |
Jens Axboe | 827da4f | 2013-01-24 10:27:26 -0700 | [diff] [blame] | 165 | ;; |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 166 | *) |
| 167 | echo "Bad option $opt" |
Jens Axboe | 47f4463 | 2013-01-24 10:34:14 -0700 | [diff] [blame] | 168 | show_help="yes" |
| 169 | exit_val=1 |
Jens Axboe | cb1125b | 2013-01-23 13:47:54 -0700 | [diff] [blame] | 170 | esac |
| 171 | done |
| 172 | |
Jens Axboe | 47f4463 | 2013-01-24 10:34:14 -0700 | [diff] [blame] | 173 | if test "$show_help" = "yes" ; then |
Jens Axboe | 8b156d8 | 2013-02-10 15:48:34 +0100 | [diff] [blame] | 174 | echo "--cpu= Specify target CPU if auto-detect fails" |
Jens Axboe | b7a9931 | 2013-02-04 12:46:54 +0100 | [diff] [blame] | 175 | echo "--cc= Specify compiler to use" |
Jens Axboe | 899fab3 | 2013-01-29 10:06:30 +0100 | [diff] [blame] | 176 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" |
Jens Axboe | b7c1279 | 2013-05-01 13:00:26 +0200 | [diff] [blame] | 177 | echo "--build-32bit-win Enable 32-bit build on Windows" |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 178 | echo "--esx Configure build options for esx" |
Jens Axboe | b7a9931 | 2013-02-04 12:46:54 +0100 | [diff] [blame] | 179 | echo "--enable-gfio Enable building of gtk gfio" |
Castor Fu | 4446251 | 2013-10-31 11:00:54 -0600 | [diff] [blame] | 180 | echo "--disable-numa Disable libnuma even if found" |
Jens Axboe | b7a9931 | 2013-02-04 12:46:54 +0100 | [diff] [blame] | 181 | exit $exit_val |
Jens Axboe | 47f4463 | 2013-01-24 10:34:14 -0700 | [diff] [blame] | 182 | fi |
| 183 | |
Stefan Hajnoczi | 4798633 | 2014-03-06 18:41:58 +0100 | [diff] [blame] | 184 | cross_prefix=${cross_prefix-${CROSS_COMPILE}} |
| 185 | cc="${CC-${cross_prefix}gcc}" |
| 186 | |
Aaron Carroll | 6d0e9f8 | 2013-02-12 09:58:14 +0100 | [diff] [blame] | 187 | if check_define __ANDROID__ ; then |
| 188 | targetos="Android" |
| 189 | elif check_define __linux__ ; then |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 190 | targetos="Linux" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 191 | elif check_define __OpenBSD__ ; then |
| 192 | targetos='OpenBSD' |
| 193 | elif check_define __sun__ ; then |
| 194 | targetos='SunOS' |
Jens Axboe | 7cb024f | 2013-11-06 15:37:35 -0700 | [diff] [blame] | 195 | CFLAGS="$CFLAGS -D_REENTRANT" |
Stefan Hajnoczi | b24f59a | 2014-03-06 18:41:59 +0100 | [diff] [blame] | 196 | elif check_define _WIN32 ; then |
| 197 | targetos='CYGWIN' |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 198 | else |
| 199 | targetos=`uname -s` |
| 200 | fi |
| 201 | |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 202 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
| 203 | printf "# Configured with:" >> $config_host_mak |
| 204 | printf " '%s'" "$0" "$@" >> $config_host_mak |
| 205 | echo >> $config_host_mak |
| 206 | echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak |
| 207 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 208 | # Some host OSes need non-standard checks for which CPU to use. |
| 209 | # Note that these checks are broken for cross-compilation: if you're |
| 210 | # cross-compiling to one of these OSes then you'll need to specify |
| 211 | # the correct CPU with the --cpu option. |
| 212 | case $targetos in |
| 213 | Darwin) |
| 214 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if |
| 215 | # we can run 64-bit userspace code. |
| 216 | # If the user didn't specify a CPU explicitly and the kernel says this is |
| 217 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual |
| 218 | # detection code. |
| 219 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then |
| 220 | cpu="x86_64" |
| 221 | fi |
| 222 | ;; |
| 223 | SunOS) |
| 224 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo |
| 225 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
| 226 | cpu="x86_64" |
| 227 | fi |
Jens Axboe | adaa46d | 2013-02-28 22:10:22 +0100 | [diff] [blame] | 228 | LIBS="-lnsl -lsocket" |
Jens Axboe | cfd94f7 | 2013-01-23 16:23:48 -0700 | [diff] [blame] | 229 | ;; |
| 230 | CYGWIN*) |
| 231 | echo "Forcing known good options on Windows" |
Jens Axboe | 4578d01 | 2013-01-23 16:26:12 -0700 | [diff] [blame] | 232 | if test -z "$CC" ; then |
Huadong Liu | 7409711 | 2013-02-05 08:43:14 +0100 | [diff] [blame] | 233 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
| 234 | CC="i686-w64-mingw32-gcc" |
| 235 | else |
| 236 | CC="x86_64-w64-mingw32-gcc" |
| 237 | fi |
Jens Axboe | 4578d01 | 2013-01-23 16:26:12 -0700 | [diff] [blame] | 238 | fi |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 239 | output_sym "CONFIG_LITTLE_ENDIAN" |
Huadong Liu | 7409711 | 2013-02-05 08:43:14 +0100 | [diff] [blame] | 240 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
| 241 | output_sym "CONFIG_32BIT" |
| 242 | else |
| 243 | output_sym "CONFIG_64BIT_LLP64" |
| 244 | fi |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 245 | output_sym "CONFIG_FADVISE" |
| 246 | output_sym "CONFIG_SOCKLEN_T" |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 247 | output_sym "CONFIG_FADVISE" |
| 248 | output_sym "CONFIG_SFAA" |
| 249 | output_sym "CONFIG_RUSAGE_THREAD" |
| 250 | output_sym "CONFIG_WINDOWSAIO" |
| 251 | output_sym "CONFIG_FDATASYNC" |
Bruce Cran | 59308a6 | 2013-02-02 20:59:31 +0000 | [diff] [blame] | 252 | output_sym "CONFIG_CLOCK_MONOTONIC" |
Bruce Cran | dc0518c | 2013-01-28 16:07:15 +0000 | [diff] [blame] | 253 | output_sym "CONFIG_GETTIMEOFDAY" |
| 254 | output_sym "CONFIG_CLOCK_GETTIME" |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 255 | output_sym "CONFIG_SCHED_IDLE" |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 256 | output_sym "CONFIG_TCP_NODELAY" |
Bruce Cran | 7d6be13 | 2013-11-07 14:04:00 +0000 | [diff] [blame] | 257 | output_sym "CONFIG_TLS_THREAD" |
Bruce Cran | ef07baa | 2014-01-28 17:34:08 -0700 | [diff] [blame] | 258 | output_sym "CONFIG_IPV6" |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 259 | echo "CC=$CC" >> $config_host_mak |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 260 | echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak |
Jens Axboe | cfd94f7 | 2013-01-23 16:23:48 -0700 | [diff] [blame] | 261 | exit 0 |
Aaron Carroll | 6d0e9f8 | 2013-02-12 09:58:14 +0100 | [diff] [blame] | 262 | ;; |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 263 | esac |
| 264 | |
| 265 | if test ! -z "$cpu" ; then |
| 266 | # command line argument |
| 267 | : |
| 268 | elif check_define __i386__ ; then |
| 269 | cpu="i386" |
| 270 | elif check_define __x86_64__ ; then |
| 271 | cpu="x86_64" |
| 272 | elif check_define __sparc__ ; then |
| 273 | if check_define __arch64__ ; then |
| 274 | cpu="sparc64" |
| 275 | else |
| 276 | cpu="sparc" |
| 277 | fi |
| 278 | elif check_define _ARCH_PPC ; then |
| 279 | if check_define _ARCH_PPC64 ; then |
| 280 | cpu="ppc64" |
| 281 | else |
| 282 | cpu="ppc" |
| 283 | fi |
| 284 | elif check_define __mips__ ; then |
| 285 | cpu="mips" |
| 286 | elif check_define __ia64__ ; then |
| 287 | cpu="ia64" |
| 288 | elif check_define __s390__ ; then |
| 289 | if check_define __s390x__ ; then |
| 290 | cpu="s390x" |
| 291 | else |
| 292 | cpu="s390" |
| 293 | fi |
| 294 | elif check_define __arm__ ; then |
| 295 | cpu="arm" |
| 296 | elif check_define __hppa__ ; then |
| 297 | cpu="hppa" |
| 298 | else |
| 299 | cpu=`uname -m` |
| 300 | fi |
| 301 | |
| 302 | # Normalise host CPU name and set ARCH. |
| 303 | case "$cpu" in |
| 304 | ia64|ppc|ppc64|s390|s390x|sparc64) |
| 305 | cpu="$cpu" |
| 306 | ;; |
| 307 | i386|i486|i586|i686|i86pc|BePC) |
| 308 | cpu="i386" |
| 309 | ;; |
| 310 | x86_64|amd64) |
| 311 | cpu="x86_64" |
| 312 | ;; |
| 313 | armv*b|armv*l|arm) |
| 314 | cpu="arm" |
| 315 | ;; |
| 316 | hppa|parisc|parisc64) |
| 317 | cpu="hppa" |
| 318 | ;; |
| 319 | mips*) |
| 320 | cpu="mips" |
| 321 | ;; |
| 322 | sparc|sun4[cdmuv]) |
| 323 | cpu="sparc" |
| 324 | ;; |
| 325 | *) |
Jens Axboe | 8b156d8 | 2013-02-10 15:48:34 +0100 | [diff] [blame] | 326 | echo "Unknown CPU" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 327 | ;; |
| 328 | esac |
| 329 | |
Jens Axboe | dcbbf5b | 2013-01-25 14:35:27 -0700 | [diff] [blame] | 330 | if test -z "$CC" ; then |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 331 | if test "$targetos" = "FreeBSD"; then |
| 332 | if has clang; then |
| 333 | CC=clang |
| 334 | else |
| 335 | CC=gcc |
| 336 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 337 | fi |
| 338 | fi |
| 339 | |
| 340 | cc="${CC-${cross_prefix}gcc}" |
| 341 | |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 342 | ########################################## |
Aaron Carroll | 1a17cfd | 2013-03-14 16:57:40 +1100 | [diff] [blame] | 343 | # check cross compile |
| 344 | |
| 345 | cross_compile="no" |
| 346 | cat > $TMPC <<EOF |
| 347 | int main(void) |
| 348 | { |
| 349 | return 0; |
| 350 | } |
| 351 | EOF |
| 352 | if compile_prog "" "" "cross"; then |
| 353 | $TMPE 2>/dev/null || cross_compile="yes" |
| 354 | else |
| 355 | fatal "compile test failed" |
| 356 | fi |
| 357 | |
| 358 | ########################################## |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 359 | # check endianness |
| 360 | bigendian="no" |
Aaron Carroll | 1a17cfd | 2013-03-14 16:57:40 +1100 | [diff] [blame] | 361 | if test "$cross_compile" = "no" ; then |
| 362 | cat > $TMPC <<EOF |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 363 | #include <inttypes.h> |
| 364 | int main(void) |
| 365 | { |
| 366 | volatile uint32_t i=0x01234567; |
| 367 | return (*((uint8_t*)(&i))) == 0x67; |
| 368 | } |
| 369 | EOF |
Aaron Carroll | 1a17cfd | 2013-03-14 16:57:40 +1100 | [diff] [blame] | 370 | if compile_prog "" "" "endian"; then |
| 371 | $TMPE && bigendian="yes" |
| 372 | fi |
| 373 | else |
| 374 | # If we're cross compiling, try our best to work it out and rely on the |
| 375 | # run-time check to fail if we get it wrong. |
| 376 | cat > $TMPC <<EOF |
| 377 | #include <endian.h> |
| 378 | int main(void) |
| 379 | { |
| 380 | #if __BYTE_ORDER != __BIG_ENDIAN |
| 381 | # error "Unknown endianness" |
| 382 | #endif |
| 383 | } |
| 384 | EOF |
| 385 | compile_prog "" "" "endian" && bigendian="yes" |
| 386 | check_define "__ARMEB__" && bigendian="yes" |
| 387 | check_define "__MIPSEB__" && bigendian="yes" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 388 | fi |
| 389 | |
| 390 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 391 | echo "Operating system $targetos" |
| 392 | echo "CPU $cpu" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 393 | echo "Big endian $bigendian" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 394 | echo "Compiler $cc" |
Aaron Carroll | 1a17cfd | 2013-03-14 16:57:40 +1100 | [diff] [blame] | 395 | echo "Cross compile $cross_compile" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 396 | echo |
| 397 | |
| 398 | ########################################## |
| 399 | # check for wordsize |
| 400 | wordsize="0" |
| 401 | cat > $TMPC <<EOF |
Aaron Carroll | 142429e | 2013-03-14 16:57:39 +1100 | [diff] [blame] | 402 | #include <limits.h> |
| 403 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 404 | int main(void) |
| 405 | { |
Aaron Carroll | 142429e | 2013-03-14 16:57:39 +1100 | [diff] [blame] | 406 | BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE); |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 407 | return 0; |
| 408 | } |
| 409 | EOF |
Aaron Carroll | 142429e | 2013-03-14 16:57:39 +1100 | [diff] [blame] | 410 | if compile_prog "-DWORDSIZE=32" "" "wordsize"; then |
| 411 | wordsize="32" |
| 412 | elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then |
| 413 | wordsize="64" |
| 414 | else |
| 415 | fatal "Unknown wordsize" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 416 | fi |
| 417 | echo "Wordsize $wordsize" |
| 418 | |
| 419 | ########################################## |
Jens Axboe | a9bca4a | 2013-04-05 12:55:42 +0200 | [diff] [blame] | 420 | # zlib probe |
| 421 | zlib="no" |
| 422 | cat > $TMPC <<EOF |
Jens Axboe | 31c9cd4 | 2014-07-03 14:17:02 -0600 | [diff] [blame] | 423 | #include <zlib.h> |
Jens Axboe | a9bca4a | 2013-04-05 12:55:42 +0200 | [diff] [blame] | 424 | int main(void) |
| 425 | { |
| 426 | z_stream stream; |
| 427 | if (inflateInit(&stream) != Z_OK) |
| 428 | return 1; |
| 429 | return 0; |
| 430 | } |
| 431 | EOF |
| 432 | if compile_prog "" "-lz" "zlib" ; then |
| 433 | zlib=yes |
| 434 | LIBS="-lz $LIBS" |
Jens Axboe | a9bca4a | 2013-04-05 12:55:42 +0200 | [diff] [blame] | 435 | fi |
| 436 | echo "zlib $zlib" |
| 437 | |
| 438 | ########################################## |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 439 | # linux-aio probe |
| 440 | libaio="no" |
| 441 | cat > $TMPC <<EOF |
| 442 | #include <libaio.h> |
| 443 | #include <stddef.h> |
| 444 | int main(void) |
| 445 | { |
| 446 | io_setup(0, NULL); |
| 447 | return 0; |
| 448 | } |
| 449 | EOF |
| 450 | if compile_prog "" "-laio" "libaio" ; then |
| 451 | libaio=yes |
| 452 | LIBS="-laio $LIBS" |
| 453 | else |
| 454 | if test "$libaio" = "yes" ; then |
Jens Axboe | c55d728 | 2013-04-12 10:16:43 +0200 | [diff] [blame] | 455 | feature_not_found "linux AIO" "libaio-dev or libaio-devel" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 456 | fi |
| 457 | libaio=no |
| 458 | fi |
| 459 | echo "Linux AIO support $libaio" |
| 460 | |
| 461 | ########################################## |
| 462 | # posix aio probe |
| 463 | posix_aio="no" |
| 464 | posix_aio_lrt="no" |
| 465 | cat > $TMPC <<EOF |
| 466 | #include <aio.h> |
| 467 | int main(void) |
| 468 | { |
| 469 | struct aiocb cb; |
| 470 | aio_read(&cb); |
| 471 | return 0; |
| 472 | } |
| 473 | EOF |
| 474 | if compile_prog "" "" "posixaio" ; then |
| 475 | posix_aio="yes" |
| 476 | elif compile_prog "" "-lrt" "posixaio"; then |
| 477 | posix_aio="yes" |
| 478 | posix_aio_lrt="yes" |
| 479 | LIBS="-lrt $LIBS" |
| 480 | fi |
| 481 | echo "POSIX AIO support $posix_aio" |
| 482 | echo "POSIX AIO support needs -lrt $posix_aio_lrt" |
| 483 | |
| 484 | ########################################## |
| 485 | # posix aio fsync probe |
| 486 | posix_aio_fsync="no" |
| 487 | if test "$posix_aio" = "yes" ; then |
| 488 | cat > $TMPC <<EOF |
| 489 | #include <fcntl.h> |
| 490 | #include <aio.h> |
| 491 | int main(void) |
| 492 | { |
| 493 | struct aiocb cb; |
| 494 | return aio_fsync(O_SYNC, &cb); |
| 495 | return 0; |
| 496 | } |
| 497 | EOF |
| 498 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then |
| 499 | posix_aio_fsync=yes |
| 500 | fi |
| 501 | fi |
| 502 | echo "POSIX AIO fsync $posix_aio_fsync" |
| 503 | |
| 504 | ########################################## |
| 505 | # solaris aio probe |
| 506 | solaris_aio="no" |
| 507 | cat > $TMPC <<EOF |
| 508 | #include <sys/types.h> |
| 509 | #include <sys/asynch.h> |
| 510 | #include <unistd.h> |
| 511 | int main(void) |
| 512 | { |
| 513 | aio_result_t res; |
| 514 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); |
| 515 | return 0; |
| 516 | } |
| 517 | EOF |
| 518 | if compile_prog "" "-laio" "solarisaio" ; then |
| 519 | solaris_aio=yes |
| 520 | LIBS="-laio $LIBS" |
| 521 | fi |
| 522 | echo "Solaris AIO support $solaris_aio" |
| 523 | |
| 524 | ########################################## |
| 525 | # __sync_fetch_and_and test |
| 526 | sfaa="no" |
| 527 | cat > $TMPC << EOF |
| 528 | static int sfaa(int *ptr) |
| 529 | { |
Jens Axboe | 9c639a7 | 2013-02-28 22:13:29 +0100 | [diff] [blame] | 530 | return __sync_fetch_and_add(ptr, 0); |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 531 | } |
| 532 | |
| 533 | int main(int argc, char **argv) |
| 534 | { |
| 535 | int val = 42; |
| 536 | sfaa(&val); |
| 537 | return val; |
| 538 | } |
| 539 | EOF |
| 540 | if compile_prog "" "" "__sync_fetch_and_add()" ; then |
| 541 | sfaa="yes" |
| 542 | fi |
Jens Axboe | 9c639a7 | 2013-02-28 22:13:29 +0100 | [diff] [blame] | 543 | echo "__sync_fetch_and_add $sfaa" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 544 | |
| 545 | ########################################## |
| 546 | # libverbs probe |
| 547 | libverbs="no" |
| 548 | cat > $TMPC << EOF |
| 549 | #include <stdio.h> |
| 550 | #include <infiniband/arch.h> |
| 551 | int main(int argc, char **argv) |
| 552 | { |
| 553 | struct ibv_pd *pd = ibv_alloc_pd(NULL); |
| 554 | return 0; |
| 555 | } |
| 556 | EOF |
| 557 | if compile_prog "" "-libverbs" "libverbs" ; then |
| 558 | libverbs="yes" |
| 559 | LIBS="-libverbs $LIBS" |
| 560 | fi |
| 561 | echo "libverbs $libverbs" |
| 562 | |
| 563 | ########################################## |
| 564 | # rdmacm probe |
| 565 | rdmacm="no" |
| 566 | cat > $TMPC << EOF |
| 567 | #include <stdio.h> |
| 568 | #include <rdma/rdma_cma.h> |
| 569 | int main(int argc, char **argv) |
| 570 | { |
| 571 | rdma_destroy_qp(NULL); |
| 572 | return 0; |
| 573 | } |
| 574 | EOF |
| 575 | if compile_prog "" "-lrdmacm" "rdma"; then |
| 576 | rdmacm="yes" |
| 577 | LIBS="-lrdmacm $LIBS" |
| 578 | fi |
| 579 | echo "rdmacm $rdmacm" |
| 580 | |
| 581 | ########################################## |
| 582 | # Linux fallocate probe |
| 583 | linux_fallocate="no" |
| 584 | cat > $TMPC << EOF |
| 585 | #include <stdio.h> |
Castor Fu | aa6738a | 2013-12-19 23:00:46 -0800 | [diff] [blame] | 586 | #include <fcntl.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 587 | #include <linux/falloc.h> |
| 588 | int main(int argc, char **argv) |
| 589 | { |
| 590 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); |
| 591 | return r; |
| 592 | } |
| 593 | EOF |
| 594 | if compile_prog "" "" "linux_fallocate"; then |
| 595 | linux_fallocate="yes" |
| 596 | fi |
| 597 | echo "Linux fallocate $linux_fallocate" |
| 598 | |
| 599 | ########################################## |
| 600 | # POSIX fadvise probe |
| 601 | posix_fadvise="no" |
| 602 | cat > $TMPC << EOF |
| 603 | #include <stdio.h> |
| 604 | #include <fcntl.h> |
| 605 | int main(int argc, char **argv) |
| 606 | { |
| 607 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); |
| 608 | return r; |
| 609 | } |
| 610 | EOF |
| 611 | if compile_prog "" "" "posix_fadvise"; then |
| 612 | posix_fadvise="yes" |
| 613 | fi |
| 614 | echo "POSIX fadvise $posix_fadvise" |
| 615 | |
| 616 | ########################################## |
| 617 | # POSIX fallocate probe |
| 618 | posix_fallocate="no" |
| 619 | cat > $TMPC << EOF |
| 620 | #include <stdio.h> |
| 621 | #include <fcntl.h> |
| 622 | int main(int argc, char **argv) |
| 623 | { |
| 624 | int r = posix_fallocate(0, 0, 1024); |
| 625 | return r; |
| 626 | } |
| 627 | EOF |
| 628 | if compile_prog "" "" "posix_fallocate"; then |
| 629 | posix_fallocate="yes" |
| 630 | fi |
| 631 | echo "POSIX fallocate $posix_fallocate" |
| 632 | |
| 633 | ########################################## |
| 634 | # sched_set/getaffinity 2 or 3 argument test |
| 635 | linux_2arg_affinity="no" |
| 636 | linux_3arg_affinity="no" |
| 637 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 638 | #include <sched.h> |
| 639 | int main(int argc, char **argv) |
| 640 | { |
| 641 | cpu_set_t mask; |
| 642 | return sched_setaffinity(0, sizeof(mask), &mask); |
| 643 | } |
| 644 | EOF |
| 645 | if compile_prog "" "" "sched_setaffinity(,,)"; then |
| 646 | linux_3arg_affinity="yes" |
| 647 | else |
| 648 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 649 | #include <sched.h> |
| 650 | int main(int argc, char **argv) |
| 651 | { |
| 652 | cpu_set_t mask; |
| 653 | return sched_setaffinity(0, &mask); |
| 654 | } |
| 655 | EOF |
| 656 | if compile_prog "" "" "sched_setaffinity(,)"; then |
| 657 | linux_2arg_affinity="yes" |
| 658 | fi |
| 659 | fi |
| 660 | echo "sched_setaffinity(3 arg) $linux_3arg_affinity" |
| 661 | echo "sched_setaffinity(2 arg) $linux_2arg_affinity" |
| 662 | |
| 663 | ########################################## |
| 664 | # clock_gettime probe |
| 665 | clock_gettime="no" |
| 666 | cat > $TMPC << EOF |
| 667 | #include <stdio.h> |
| 668 | #include <time.h> |
| 669 | int main(int argc, char **argv) |
| 670 | { |
| 671 | return clock_gettime(0, NULL); |
| 672 | } |
| 673 | EOF |
| 674 | if compile_prog "" "" "clock_gettime"; then |
| 675 | clock_gettime="yes" |
| 676 | elif compile_prog "" "-lrt" "clock_gettime"; then |
| 677 | clock_gettime="yes" |
| 678 | LIBS="-lrt $LIBS" |
| 679 | fi |
| 680 | echo "clock_gettime $clock_gettime" |
| 681 | |
| 682 | ########################################## |
| 683 | # CLOCK_MONOTONIC probe |
| 684 | clock_monotonic="no" |
| 685 | if test "$clock_gettime" = "yes" ; then |
| 686 | cat > $TMPC << EOF |
| 687 | #include <stdio.h> |
| 688 | #include <time.h> |
| 689 | int main(int argc, char **argv) |
| 690 | { |
| 691 | return clock_gettime(CLOCK_MONOTONIC, NULL); |
| 692 | } |
| 693 | EOF |
| 694 | if compile_prog "" "$LIBS" "clock monotonic"; then |
| 695 | clock_monotonic="yes" |
| 696 | fi |
| 697 | fi |
| 698 | echo "CLOCK_MONOTONIC $clock_monotonic" |
| 699 | |
| 700 | ########################################## |
| 701 | # CLOCK_MONOTONIC_PRECISE probe |
| 702 | clock_monotonic_precise="no" |
| 703 | if test "$clock_gettime" = "yes" ; then |
| 704 | cat > $TMPC << EOF |
| 705 | #include <stdio.h> |
| 706 | #include <time.h> |
| 707 | int main(int argc, char **argv) |
| 708 | { |
| 709 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); |
| 710 | } |
| 711 | EOF |
| 712 | if compile_prog "" "$LIBS" "clock monotonic precise"; then |
| 713 | clock_monotonic_precise="yes" |
| 714 | fi |
| 715 | fi |
| 716 | echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise" |
| 717 | |
| 718 | ########################################## |
| 719 | # gettimeofday() probe |
| 720 | gettimeofday="no" |
| 721 | cat > $TMPC << EOF |
| 722 | #include <sys/time.h> |
| 723 | #include <stdio.h> |
| 724 | int main(int argc, char **argv) |
| 725 | { |
| 726 | struct timeval tv; |
| 727 | return gettimeofday(&tv, NULL); |
| 728 | } |
| 729 | EOF |
| 730 | if compile_prog "" "" "gettimeofday"; then |
| 731 | gettimeofday="yes" |
| 732 | fi |
| 733 | echo "gettimeofday $gettimeofday" |
| 734 | |
| 735 | ########################################## |
| 736 | # fdatasync() probe |
| 737 | fdatasync="no" |
| 738 | cat > $TMPC << EOF |
| 739 | #include <stdio.h> |
| 740 | #include <unistd.h> |
| 741 | int main(int argc, char **argv) |
| 742 | { |
| 743 | return fdatasync(0); |
| 744 | } |
| 745 | EOF |
| 746 | if compile_prog "" "" "fdatasync"; then |
| 747 | fdatasync="yes" |
| 748 | fi |
| 749 | echo "fdatasync $fdatasync" |
| 750 | |
| 751 | ########################################## |
| 752 | # sync_file_range() probe |
| 753 | sync_file_range="no" |
| 754 | cat > $TMPC << EOF |
| 755 | #include <stdio.h> |
| 756 | #include <unistd.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 757 | #include <fcntl.h> |
| 758 | #include <linux/fs.h> |
| 759 | int main(int argc, char **argv) |
| 760 | { |
| 761 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | |
| 762 | SYNC_FILE_RANGE_WAIT_AFTER; |
| 763 | return sync_file_range(0, 0, 0, flags); |
| 764 | } |
| 765 | EOF |
| 766 | if compile_prog "" "" "sync_file_range"; then |
| 767 | sync_file_range="yes" |
| 768 | fi |
| 769 | echo "sync_file_range $sync_file_range" |
| 770 | |
| 771 | ########################################## |
| 772 | # ext4 move extent probe |
| 773 | ext4_me="no" |
| 774 | cat > $TMPC << EOF |
| 775 | #include <fcntl.h> |
| 776 | #include <sys/ioctl.h> |
| 777 | int main(int argc, char **argv) |
| 778 | { |
| 779 | struct move_extent me; |
| 780 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); |
| 781 | } |
| 782 | EOF |
Jens Axboe | c7165b8 | 2013-01-12 10:27:53 +0100 | [diff] [blame] | 783 | if compile_prog "" "" "ext4 move extent" ; then |
| 784 | ext4_me="yes" |
| 785 | elif test $targetos = "Linux" ; then |
| 786 | # On Linux, just default to it on and let it error at runtime if we really |
| 787 | # don't have it. None of my updated systems have it defined, but it does |
| 788 | # work. Takes a while to bubble back. |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 789 | ext4_me="yes" |
| 790 | fi |
| 791 | echo "EXT4 move extent $ext4_me" |
| 792 | |
| 793 | ########################################## |
| 794 | # splice probe |
| 795 | linux_splice="no" |
| 796 | cat > $TMPC << EOF |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 797 | #include <stdio.h> |
| 798 | #include <fcntl.h> |
| 799 | int main(int argc, char **argv) |
| 800 | { |
| 801 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); |
| 802 | } |
| 803 | EOF |
| 804 | if compile_prog "" "" "linux splice"; then |
| 805 | linux_splice="yes" |
| 806 | fi |
| 807 | echo "Linux splice(2) $linux_splice" |
| 808 | |
| 809 | ########################################## |
| 810 | # GUASI probe |
| 811 | guasi="no" |
| 812 | cat > $TMPC << EOF |
| 813 | #include <guasi.h> |
| 814 | #include <guasi_syscalls.h> |
| 815 | int main(int argc, char **argv) |
| 816 | { |
| 817 | guasi_t ctx = guasi_create(0, 0, 0); |
| 818 | return 0; |
| 819 | } |
| 820 | EOF |
| 821 | if compile_prog "" "" "guasi"; then |
| 822 | guasi="yes" |
| 823 | fi |
| 824 | echo "GUASI $guasi" |
| 825 | |
| 826 | ########################################## |
| 827 | # fusion-aw probe |
| 828 | fusion_aw="no" |
| 829 | cat > $TMPC << EOF |
Santhosh Koundinya | b2c77c2 | 2013-05-18 08:44:01 +0200 | [diff] [blame] | 830 | #include <nvm/nvm_primitives.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 831 | int main(int argc, char **argv) |
| 832 | { |
Santhosh Koundinya | b2c77c2 | 2013-05-18 08:44:01 +0200 | [diff] [blame] | 833 | nvm_version_t ver_info; |
| 834 | nvm_handle_t handle; |
| 835 | |
| 836 | handle = nvm_get_handle(0, &ver_info); |
| 837 | return nvm_atomic_write(handle, 0, 0, 0); |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 838 | } |
| 839 | EOF |
Santhosh Koundinya | b2c77c2 | 2013-05-18 08:44:01 +0200 | [diff] [blame] | 840 | if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then |
| 841 | LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 842 | fusion_aw="yes" |
| 843 | fi |
| 844 | echo "Fusion-io atomic engine $fusion_aw" |
| 845 | |
| 846 | ########################################## |
| 847 | # libnuma probe |
| 848 | libnuma="no" |
| 849 | cat > $TMPC << EOF |
| 850 | #include <numa.h> |
| 851 | int main(int argc, char **argv) |
| 852 | { |
| 853 | return numa_available(); |
| 854 | } |
| 855 | EOF |
Castor Fu | 4446251 | 2013-10-31 11:00:54 -0600 | [diff] [blame] | 856 | if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 857 | libnuma="yes" |
| 858 | LIBS="-lnuma $LIBS" |
| 859 | fi |
| 860 | echo "libnuma $libnuma" |
| 861 | |
| 862 | ########################################## |
Jens Axboe | 50206d9 | 2013-03-25 13:20:08 -0600 | [diff] [blame] | 863 | # libnuma 2.x version API |
| 864 | if test "$libnuma" = "yes" ; then |
| 865 | libnuma_v2="no" |
| 866 | cat > $TMPC << EOF |
| 867 | #include <numa.h> |
| 868 | int main(int argc, char **argv) |
| 869 | { |
| 870 | struct bitmask *mask = numa_parse_nodestring(NULL); |
| 871 | return 0; |
| 872 | } |
| 873 | EOF |
| 874 | if compile_prog "" "" "libnuma api"; then |
| 875 | libnuma_v2="yes" |
| 876 | fi |
| 877 | echo "libnuma v2 $libnuma_v2" |
| 878 | fi |
| 879 | |
| 880 | ########################################## |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 881 | # strsep() probe |
| 882 | strsep="no" |
| 883 | cat > $TMPC << EOF |
| 884 | #include <string.h> |
| 885 | int main(int argc, char **argv) |
| 886 | { |
| 887 | strsep(NULL, NULL); |
| 888 | return 0; |
| 889 | } |
| 890 | EOF |
| 891 | if compile_prog "" "" "strsep"; then |
| 892 | strsep="yes" |
| 893 | fi |
| 894 | echo "strsep $strsep" |
| 895 | |
| 896 | ########################################## |
Jens Axboe | 9ad8da8 | 2013-04-05 14:44:03 +0200 | [diff] [blame] | 897 | # strcasestr() probe |
| 898 | strcasestr="no" |
| 899 | cat > $TMPC << EOF |
| 900 | #include <string.h> |
| 901 | int main(int argc, char **argv) |
| 902 | { |
Castor Fu | aa6738a | 2013-12-19 23:00:46 -0800 | [diff] [blame] | 903 | return strcasestr(argv[0], argv[1]) != NULL; |
Jens Axboe | 9ad8da8 | 2013-04-05 14:44:03 +0200 | [diff] [blame] | 904 | } |
| 905 | EOF |
| 906 | if compile_prog "" "" "strcasestr"; then |
| 907 | strcasestr="yes" |
| 908 | fi |
| 909 | echo "strcasestr $strcasestr" |
| 910 | |
| 911 | ########################################## |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 912 | # getopt_long_only() probe |
| 913 | getopt_long_only="no" |
| 914 | cat > $TMPC << EOF |
| 915 | #include <unistd.h> |
| 916 | #include <stdio.h> |
Castor Fu | aa6738a | 2013-12-19 23:00:46 -0800 | [diff] [blame] | 917 | #include <getopt.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 918 | int main(int argc, char **argv) |
| 919 | { |
| 920 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); |
| 921 | return c; |
| 922 | } |
| 923 | EOF |
| 924 | if compile_prog "" "" "getopt_long_only"; then |
| 925 | getopt_long_only="yes" |
| 926 | fi |
| 927 | echo "getopt_long_only() $getopt_long_only" |
| 928 | |
| 929 | ########################################## |
| 930 | # inet_aton() probe |
| 931 | inet_aton="no" |
| 932 | cat > $TMPC << EOF |
| 933 | #include <sys/socket.h> |
| 934 | #include <arpa/inet.h> |
| 935 | #include <stdio.h> |
| 936 | int main(int argc, char **argv) |
| 937 | { |
| 938 | struct in_addr in; |
| 939 | return inet_aton(NULL, &in); |
| 940 | } |
| 941 | EOF |
| 942 | if compile_prog "" "" "inet_aton"; then |
| 943 | inet_aton="yes" |
| 944 | fi |
| 945 | echo "inet_aton $inet_aton" |
| 946 | |
| 947 | ########################################## |
| 948 | # socklen_t probe |
| 949 | socklen_t="no" |
| 950 | cat > $TMPC << EOF |
Aaron Carroll | f648261 | 2013-03-14 16:57:41 +1100 | [diff] [blame] | 951 | #include <sys/socket.h> |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 952 | int main(int argc, char **argv) |
| 953 | { |
| 954 | socklen_t len = 0; |
| 955 | return len; |
| 956 | } |
| 957 | EOF |
| 958 | if compile_prog "" "" "socklen_t"; then |
| 959 | socklen_t="yes" |
| 960 | fi |
| 961 | echo "socklen_t $socklen_t" |
| 962 | |
| 963 | ########################################## |
| 964 | # Whether or not __thread is supported for TLS |
| 965 | tls_thread="no" |
| 966 | cat > $TMPC << EOF |
| 967 | #include <stdio.h> |
Castor Fu | aa6738a | 2013-12-19 23:00:46 -0800 | [diff] [blame] | 968 | static __thread int ret; |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 969 | int main(int argc, char **argv) |
| 970 | { |
| 971 | return ret; |
| 972 | } |
| 973 | EOF |
| 974 | if compile_prog "" "" "__thread"; then |
| 975 | tls_thread="yes" |
| 976 | fi |
| 977 | echo "__thread $tls_thread" |
| 978 | |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 979 | ########################################## |
Jens Axboe | 2639f05 | 2013-04-10 14:41:08 +0200 | [diff] [blame] | 980 | # Check if we have required gtk/glib support for gfio |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 981 | if test "$gfio" = "yes" ; then |
| 982 | cat > $TMPC << EOF |
| 983 | #include <glib.h> |
| 984 | #include <cairo.h> |
| 985 | #include <gtk/gtk.h> |
| 986 | int main(void) |
| 987 | { |
| 988 | gdk_threads_enter(); |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 989 | gdk_threads_leave(); |
Jens Axboe | b7a9931 | 2013-02-04 12:46:54 +0100 | [diff] [blame] | 990 | |
| 991 | printf("%d", GTK_CHECK_VERSION(2, 18, 0)); |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 992 | } |
| 993 | EOF |
| 994 | GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) |
| 995 | if test "$?" != "0" ; then |
| 996 | echo "configure: gtk and gthread not found" |
| 997 | exit 1 |
| 998 | fi |
| 999 | GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0) |
| 1000 | if test "$?" != "0" ; then |
| 1001 | echo "configure: gtk and gthread not found" |
| 1002 | exit 1 |
| 1003 | fi |
Jens Axboe | b7a9931 | 2013-02-04 12:46:54 +0100 | [diff] [blame] | 1004 | if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then |
| 1005 | r=$($TMPE) |
| 1006 | if test "$r" != "0" ; then |
| 1007 | gfio="yes" |
| 1008 | LIBS="$LIBS $GTK_LIBS" |
| 1009 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 1010 | else |
| 1011 | echo "GTK found, but need version 2.18 or higher" |
| 1012 | gfio="no" |
| 1013 | fi |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 1014 | else |
| 1015 | echo "Please install gtk and gdk libraries" |
| 1016 | gfio="no" |
| 1017 | fi |
| 1018 | fi |
| 1019 | |
Jens Axboe | 2639f05 | 2013-04-10 14:41:08 +0200 | [diff] [blame] | 1020 | echo "gtk 2.18 or higher $gfio" |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 1021 | |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 1022 | # Check whether we have getrusage(RUSAGE_THREAD) |
| 1023 | rusage_thread="no" |
| 1024 | cat > $TMPC << EOF |
| 1025 | #include <sys/time.h> |
| 1026 | #include <sys/resource.h> |
| 1027 | int main(int argc, char **argv) |
| 1028 | { |
| 1029 | struct rusage ru; |
| 1030 | getrusage(RUSAGE_THREAD, &ru); |
| 1031 | return 0; |
| 1032 | } |
| 1033 | EOF |
| 1034 | if compile_prog "" "" "RUSAGE_THREAD"; then |
| 1035 | rusage_thread="yes" |
| 1036 | fi |
| 1037 | echo "RUSAGE_THREAD $rusage_thread" |
| 1038 | |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 1039 | ########################################## |
| 1040 | # Check whether we have SCHED_IDLE |
| 1041 | sched_idle="no" |
| 1042 | cat > $TMPC << EOF |
| 1043 | #include <sched.h> |
| 1044 | int main(int argc, char **argv) |
| 1045 | { |
| 1046 | struct sched_param p; |
| 1047 | return sched_setscheduler(0, SCHED_IDLE, &p); |
| 1048 | } |
| 1049 | EOF |
| 1050 | if compile_prog "" "" "SCHED_IDLE"; then |
| 1051 | sched_idle="yes" |
| 1052 | fi |
| 1053 | echo "SCHED_IDLE $sched_idle" |
| 1054 | |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 1055 | ########################################## |
| 1056 | # Check whether we have TCP_NODELAY |
| 1057 | tcp_nodelay="no" |
| 1058 | cat > $TMPC << EOF |
| 1059 | #include <stdio.h> |
| 1060 | #include <sys/types.h> |
| 1061 | #include <sys/socket.h> |
| 1062 | #include <netinet/tcp.h> |
| 1063 | int main(int argc, char **argv) |
| 1064 | { |
| 1065 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); |
| 1066 | } |
| 1067 | EOF |
| 1068 | if compile_prog "" "" "TCP_NODELAY"; then |
| 1069 | tcp_nodelay="yes" |
| 1070 | fi |
| 1071 | echo "TCP_NODELAY $tcp_nodelay" |
| 1072 | |
Jens Axboe | 38b9354 | 2013-02-28 08:28:05 +0100 | [diff] [blame] | 1073 | ########################################## |
| 1074 | # Check whether we have RLIMIT_MEMLOCK |
| 1075 | rlimit_memlock="no" |
| 1076 | cat > $TMPC << EOF |
| 1077 | #include <sys/time.h> |
| 1078 | #include <sys/resource.h> |
| 1079 | int main(int argc, char **argv) |
| 1080 | { |
| 1081 | struct rlimit rl; |
| 1082 | return getrlimit(RLIMIT_MEMLOCK, &rl); |
| 1083 | } |
| 1084 | EOF |
| 1085 | if compile_prog "" "" "RLIMIT_MEMLOCK"; then |
| 1086 | rlimit_memlock="yes" |
| 1087 | fi |
| 1088 | echo "RLIMIT_MEMLOCK $rlimit_memlock" |
| 1089 | |
Jens Axboe | 07fc0ac | 2013-05-16 20:36:57 +0200 | [diff] [blame] | 1090 | ########################################## |
| 1091 | # Check whether we have pwritev/preadv |
| 1092 | pwritev="no" |
| 1093 | cat > $TMPC << EOF |
| 1094 | #include <stdio.h> |
| 1095 | #include <sys/uio.h> |
| 1096 | int main(int argc, char **argv) |
| 1097 | { |
| 1098 | return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0); |
| 1099 | } |
| 1100 | EOF |
| 1101 | if compile_prog "" "" "pwritev"; then |
| 1102 | pwritev="yes" |
| 1103 | fi |
| 1104 | echo "pwritev/preadv $pwritev" |
| 1105 | |
Jens Axboe | ecad55e | 2014-01-24 18:56:34 -0800 | [diff] [blame] | 1106 | ########################################## |
| 1107 | # Check whether we have the required functions for ipv6 |
| 1108 | ipv6="no" |
| 1109 | cat > $TMPC << EOF |
| 1110 | #include <sys/types.h> |
| 1111 | #include <sys/socket.h> |
Bruce Cran | d219028 | 2014-02-13 09:06:20 -0700 | [diff] [blame] | 1112 | #include <netinet/in.h> |
Jens Axboe | ecad55e | 2014-01-24 18:56:34 -0800 | [diff] [blame] | 1113 | #include <netdb.h> |
| 1114 | #include <stdio.h> |
| 1115 | int main(int argc, char **argv) |
| 1116 | { |
| 1117 | struct addrinfo hints; |
| 1118 | struct in6_addr addr; |
| 1119 | int ret; |
| 1120 | |
| 1121 | ret = getaddrinfo(NULL, NULL, &hints, NULL); |
| 1122 | freeaddrinfo(NULL); |
| 1123 | printf("%s\n", gai_strerror(ret)); |
| 1124 | addr = in6addr_any; |
| 1125 | return 0; |
| 1126 | } |
| 1127 | EOF |
| 1128 | if compile_prog "" "" "ipv6"; then |
| 1129 | ipv6="yes" |
| 1130 | fi |
| 1131 | echo "IPv6 helpers $ipv6" |
Jens Axboe | 07fc0ac | 2013-05-16 20:36:57 +0200 | [diff] [blame] | 1132 | |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 1133 | ########################################## |
| 1134 | # check for rbd |
| 1135 | rbd="no" |
| 1136 | cat > $TMPC << EOF |
| 1137 | #include <rbd/librbd.h> |
| 1138 | |
| 1139 | int main(int argc, char **argv) |
| 1140 | { |
| 1141 | |
| 1142 | rados_t cluster; |
| 1143 | rados_ioctx_t io_ctx; |
| 1144 | const char pool[] = "rbd"; |
| 1145 | |
| 1146 | int major, minor, extra; |
| 1147 | rbd_version(&major, &minor, &extra); |
| 1148 | |
| 1149 | rados_ioctx_create(cluster, pool, &io_ctx); |
| 1150 | return 0; |
| 1151 | } |
| 1152 | EOF |
Tiziano Müller | aa48efe | 2014-06-26 14:20:20 +0200 | [diff] [blame] | 1153 | if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 1154 | LIBS="-lrbd -lrados $LIBS" |
| 1155 | rbd="yes" |
| 1156 | fi |
| 1157 | echo "Rados Block Device engine $rbd" |
| 1158 | |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1159 | ########################################## |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1160 | # check for gfapi |
| 1161 | gfapi="no" |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1162 | cat > $TMPC << EOF |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1163 | #include <glusterfs/api/glfs.h> |
| 1164 | |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1165 | int main(int argc, char **argv) |
| 1166 | { |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1167 | |
| 1168 | glfs_t *g = glfs_new("foo"); |
| 1169 | |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1170 | return 0; |
| 1171 | } |
| 1172 | EOF |
Tiziano Müller | aa48efe | 2014-06-26 14:20:20 +0200 | [diff] [blame] | 1173 | if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1174 | LIBS="-lgfapi -lglusterfs $LIBS" |
| 1175 | gfapi="yes" |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1176 | fi |
chenh | 54fe20f | 2014-04-08 13:02:26 -0400 | [diff] [blame] | 1177 | echo "Gluster API engine $gfapi" |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1178 | |
chenh | 54fe20f | 2014-04-08 13:02:26 -0400 | [diff] [blame] | 1179 | ########################################## |
| 1180 | # check for gfapi fadvise support |
| 1181 | gf_fadvise="no" |
| 1182 | cat > $TMPC << EOF |
| 1183 | #include <glusterfs/api/glfs.h> |
| 1184 | |
| 1185 | int main(int argc, char **argv) |
| 1186 | { |
| 1187 | struct glfs_fd *fd; |
| 1188 | int ret = glfs_fadvise(fd, 0, 0, 1); |
| 1189 | |
| 1190 | return 0; |
| 1191 | } |
| 1192 | EOF |
| 1193 | |
| 1194 | if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
| 1195 | gf_fadvise="yes" |
| 1196 | fi |
| 1197 | echo "Gluster API use fadvise $gf_fadvise" |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 1198 | |
Christian Ehrhardt | 81795ce | 2014-04-10 15:09:47 +0200 | [diff] [blame] | 1199 | ########################################## |
| 1200 | # Check if we support stckf on s390 |
| 1201 | s390_z196_facilities="no" |
| 1202 | cat > $TMPC << EOF |
| 1203 | #define STFLE_BITS_Z196 45 /* various z196 facilities ... */ |
| 1204 | int main(int argc, char **argv) |
| 1205 | { |
| 1206 | /* We want just 1 double word to be returned. */ |
| 1207 | register unsigned long reg0 asm("0") = 0; |
| 1208 | unsigned long stfle_bits; |
| 1209 | asm volatile(".machine push" "\n\t" |
| 1210 | ".machine \"z9-109\"" "\n\t" |
| 1211 | "stfle %0" "\n\t" |
| 1212 | ".machine pop" "\n" |
| 1213 | : "=QS" (stfle_bits), "+d" (reg0) |
| 1214 | : : "cc"); |
| 1215 | |
| 1216 | if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) |
| 1217 | return 0; |
| 1218 | else |
| 1219 | return -1; |
| 1220 | } |
| 1221 | EOF |
| 1222 | if compile_prog "" "" "s390_z196_facilities"; then |
| 1223 | $TMPE |
| 1224 | if [[ $? -eq 0 ]]; then |
| 1225 | s390_z196_facilities="yes" |
| 1226 | fi |
| 1227 | fi |
| 1228 | echo "s390_z196_facilities $s390_z196_facilities" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1229 | ############################################################################# |
| 1230 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1231 | if test "$wordsize" = "64" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1232 | output_sym "CONFIG_64BIT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1233 | elif test "$wordsize" = "32" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1234 | output_sym "CONFIG_32BIT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1235 | else |
Jens Axboe | d7145a7 | 2013-02-11 13:21:54 +0100 | [diff] [blame] | 1236 | fatal "Unknown wordsize!" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1237 | fi |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 1238 | if test "$bigendian" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1239 | output_sym "CONFIG_BIG_ENDIAN" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 1240 | else |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1241 | output_sym "CONFIG_LITTLE_ENDIAN" |
Jens Axboe | 0dcebdf | 2013-01-23 15:42:16 -0700 | [diff] [blame] | 1242 | fi |
Jens Axboe | 3989b14 | 2013-04-12 13:13:24 +0200 | [diff] [blame] | 1243 | if test "$zlib" = "yes" ; then |
| 1244 | output_sym "CONFIG_ZLIB" |
| 1245 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1246 | if test "$libaio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1247 | output_sym "CONFIG_LIBAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1248 | fi |
| 1249 | if test "$posix_aio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1250 | output_sym "CONFIG_POSIXAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1251 | fi |
| 1252 | if test "$posix_aio_fsync" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1253 | output_sym "CONFIG_POSIXAIO_FSYNC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1254 | fi |
| 1255 | if test "$linux_fallocate" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1256 | output_sym "CONFIG_LINUX_FALLOCATE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1257 | fi |
| 1258 | if test "$posix_fallocate" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1259 | output_sym "CONFIG_POSIX_FALLOCATE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1260 | fi |
| 1261 | if test "$fdatasync" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1262 | output_sym "CONFIG_FDATASYNC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1263 | fi |
| 1264 | if test "$sync_file_range" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1265 | output_sym "CONFIG_SYNC_FILE_RANGE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1266 | fi |
| 1267 | if test "$sfaa" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1268 | output_sym "CONFIG_SFAA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1269 | fi |
Yufei Ren | 954cd73 | 2013-07-22 20:58:05 -0600 | [diff] [blame] | 1270 | if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1271 | output_sym "CONFIG_RDMA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1272 | fi |
| 1273 | if test "$clock_gettime" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1274 | output_sym "CONFIG_CLOCK_GETTIME" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1275 | fi |
| 1276 | if test "$clock_monotonic" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1277 | output_sym "CONFIG_CLOCK_MONOTONIC" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1278 | fi |
| 1279 | if test "$clock_monotonic_precise" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1280 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1281 | fi |
| 1282 | if test "$gettimeofday" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1283 | output_sym "CONFIG_GETTIMEOFDAY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1284 | fi |
| 1285 | if test "$posix_fadvise" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1286 | output_sym "CONFIG_POSIX_FADVISE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1287 | fi |
| 1288 | if test "$linux_3arg_affinity" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1289 | output_sym "CONFIG_3ARG_AFFINITY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1290 | elif test "$linux_2arg_affinity" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1291 | output_sym "CONFIG_2ARG_AFFINITY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1292 | fi |
| 1293 | if test "$strsep" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1294 | output_sym "CONFIG_STRSEP" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1295 | fi |
Jens Axboe | 9ad8da8 | 2013-04-05 14:44:03 +0200 | [diff] [blame] | 1296 | if test "$strcasestr" = "yes" ; then |
| 1297 | output_sym "CONFIG_STRCASESTR" |
| 1298 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1299 | if test "$getopt_long_only" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1300 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1301 | fi |
| 1302 | if test "$inet_aton" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1303 | output_sym "CONFIG_INET_ATON" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1304 | fi |
| 1305 | if test "$socklen_t" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1306 | output_sym "CONFIG_SOCKLEN_T" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1307 | fi |
| 1308 | if test "$ext4_me" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1309 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1310 | fi |
| 1311 | if test "$linux_splice" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1312 | output_sym "CONFIG_LINUX_SPLICE" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1313 | fi |
| 1314 | if test "$guasi" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1315 | output_sym "CONFIG_GUASI" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1316 | fi |
| 1317 | if test "$fusion_aw" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1318 | output_sym "CONFIG_FUSION_AW" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1319 | fi |
Jens Axboe | 50206d9 | 2013-03-25 13:20:08 -0600 | [diff] [blame] | 1320 | if test "$libnuma_v2" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1321 | output_sym "CONFIG_LIBNUMA" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1322 | fi |
| 1323 | if test "$solaris_aio" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1324 | output_sym "CONFIG_SOLARISAIO" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1325 | fi |
| 1326 | if test "$tls_thread" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1327 | output_sym "CONFIG_TLS_THREAD" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1328 | fi |
Jens Axboe | 44404c5 | 2013-01-24 14:20:09 -0700 | [diff] [blame] | 1329 | if test "$rusage_thread" = "yes" ; then |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 1330 | output_sym "CONFIG_RUSAGE_THREAD" |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1331 | fi |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 1332 | if test "$gfio" = "yes" ; then |
| 1333 | echo "CONFIG_GFIO=y" >> $config_host_mak |
| 1334 | fi |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 1335 | if test "$esx" = "yes" ; then |
| 1336 | output_sym "CONFIG_ESX" |
| 1337 | output_sym "CONFIG_NO_SHM" |
| 1338 | fi |
Jens Axboe | 7e09a9f | 2013-01-30 13:58:58 +0100 | [diff] [blame] | 1339 | if test "$sched_idle" = "yes" ; then |
| 1340 | output_sym "CONFIG_SCHED_IDLE" |
| 1341 | fi |
Jens Axboe | 1eafa37 | 2013-01-31 10:19:51 +0100 | [diff] [blame] | 1342 | if test "$tcp_nodelay" = "yes" ; then |
| 1343 | output_sym "CONFIG_TCP_NODELAY" |
| 1344 | fi |
Jens Axboe | 38b9354 | 2013-02-28 08:28:05 +0100 | [diff] [blame] | 1345 | if test "$rlimit_memlock" = "yes" ; then |
| 1346 | output_sym "CONFIG_RLIMIT_MEMLOCK" |
| 1347 | fi |
Jens Axboe | 07fc0ac | 2013-05-16 20:36:57 +0200 | [diff] [blame] | 1348 | if test "$pwritev" = "yes" ; then |
| 1349 | output_sym "CONFIG_PWRITEV" |
| 1350 | fi |
Jens Axboe | ecad55e | 2014-01-24 18:56:34 -0800 | [diff] [blame] | 1351 | if test "$ipv6" = "yes" ; then |
| 1352 | output_sym "CONFIG_IPV6" |
| 1353 | fi |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 1354 | if test "$rbd" = "yes" ; then |
| 1355 | output_sym "CONFIG_RBD" |
| 1356 | fi |
Jens Axboe | 2e80228 | 2014-04-02 21:47:27 -0600 | [diff] [blame] | 1357 | if test "$setvbuf" = "yes" ; then |
| 1358 | output_sym "CONFIG_SETVBUF" |
| 1359 | fi |
Christian Ehrhardt | 81795ce | 2014-04-10 15:09:47 +0200 | [diff] [blame] | 1360 | if test "$s390_z196_facilities" = "yes" ; then |
| 1361 | output_sym "CONFIG_S390_Z196_FACILITIES" |
| 1362 | CFLAGS="$CFLAGS -march=z9-109" |
| 1363 | fi |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 1364 | if test "$gfapi" = "yes" ; then |
| 1365 | output_sym "CONFIG_GFAPI" |
| 1366 | fi |
chenh | 54fe20f | 2014-04-08 13:02:26 -0400 | [diff] [blame] | 1367 | if test "$gf_fadvise" = "yes" ; then |
| 1368 | output_sym "CONFIG_GF_FADVISE" |
| 1369 | fi |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1370 | |
| 1371 | echo "LIBS+=$LIBS" >> $config_host_mak |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 1372 | echo "CFLAGS+=$CFLAGS" >> $config_host_mak |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1373 | echo "CC=$cc" >> $config_host_mak |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 1374 | echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak |