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