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