configure revision cb1125b0b197278894896af14fe8ecdf7b92756d
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
8if test ! -z "$TMPDIR" ; then
9    TMPDIR1="${TMPDIR}"
10elif test ! -z "$TEMPDIR" ; then
11    TMPDIR1="${TEMPDIR}"
12else
13    TMPDIR1="/tmp"
14fi
15
16TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
18TMPE="${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>
22trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
23
24rm -rf config.log
25
26config_host_mak="config-host.mak"
27config_host_ld="config-host.ld"
28
29# Print a helpful header at the top of config.log
30echo "# FIO configure log $(date)" >> config.log
31printf "# Configured with:" >> config.log
32printf " '%s'" "$0" "$@" >> config.log
33echo >> config.log
34echo "#" >> config.log
35
36do_cc() {
37    # Run the compiler, capturing its output to the log.
38    echo $cc "$@" >> config.log
39    $cc "$@" >> config.log 2>&1 || return $?
40    # Test passed. If this is an --enable-werror build, rerun
41    # the test with -Werror and bail out if it fails. This
42    # makes warning-generating-errors in configure test code
43    # obvious to developers.
44    if test "$werror" != "yes"; then
45        return 0
46    fi
47    # Don't bother rerunning the compile if we were already using -Werror
48    case "$*" in
49        *-Werror*)
50           return 0
51        ;;
52    esac
53    echo $cc -Werror "$@" >> config.log
54    $cc -Werror "$@" >> config.log 2>&1 && return $?
55    echo "ERROR: configure test passed without -Werror but failed with -Werror."
56    echo "This is probably a bug in the configure script. The failing command"
57    echo "will be at the bottom of config.log."
58    echo "You can run configure with --disable-werror to bypass this check."
59    exit 1
60}
61
62compile_object() {
63  do_cc $CFLAGS -c -o $TMPO $TMPC
64}
65
66compile_prog() {
67  local_cflags="$1"
68  local_ldflags="$2"
69  echo "Compiling test case $3" >> config.log
70  do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
71}
72
73feature_not_found() {
74  feature=$1
75
76  echo "ERROR"
77  echo "ERROR: User requested feature $feature"
78  echo "ERROR: configure was not able to find it"
79  echo "ERROR"
80  exit 1;
81}
82
83has() {
84  type "$1" >/dev/null 2>&1
85}
86
87check_define() {
88  cat > $TMPC <<EOF
89#if !defined($1)
90#error $1 not defined
91#endif
92int main(void)
93{
94  return 0;
95}
96EOF
97  compile_object
98}
99
100targetos=""
101cpu=""
102
103cc="${CC-${cross_prefix}gcc}"
104
105# parse options
106for opt do
107  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
108  case "$opt" in
109  --cc=*) CC="$optarg"
110  ;;
111  *)
112  echo "Bad option $opt"
113  exit 1
114  esac
115done
116
117if check_define __linux__ ; then
118  targetos="Linux"
119elif check_define _WIN32 ; then
120  echo "Forcing known good options on Windows"
121  echo "CONFIG_64BIT_LLP64=y"      >> $config_host_mak
122  echo "CONFIG_CLOCK_GETTIME=y"    >> $config_host_mak
123  echo "CONFIG_CLOCK_MONOTONIC=y"  >> $config_host_mak
124  echo "CONFIG_GETTIMEOFDAY=y"     >> $config_host_mak
125  echo "CONFIG_FADVISE=y"          >> $config_host_mak
126  echo "CONFIG_STRSEP=y"           >> $config_host_mak
127  echo "CONFIG_SOCKLEN_T=y"        >> $config_host_mak
128  echo "CONFIG_POSIX_FALLOCATE=y"  >> $config_host_mak
129  echo "CONFIG_FADVISE=y"          >> $config_host_mak
130  echo "CONFIG_SFAA=y"             >> $config_host_mak
131  exit 0
132elif check_define __OpenBSD__ ; then
133  targetos='OpenBSD'
134elif check_define __sun__ ; then
135  targetos='SunOS'
136else
137  targetos=`uname -s`
138fi
139
140# Some host OSes need non-standard checks for which CPU to use.
141# Note that these checks are broken for cross-compilation: if you're
142# cross-compiling to one of these OSes then you'll need to specify
143# the correct CPU with the --cpu option.
144case $targetos in
145Darwin)
146  # on Leopard most of the system is 32-bit, so we have to ask the kernel if
147  # we can run 64-bit userspace code.
148  # If the user didn't specify a CPU explicitly and the kernel says this is
149  # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
150  # detection code.
151  if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
152    cpu="x86_64"
153  fi
154  ;;
155SunOS)
156  # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
157  if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
158    cpu="x86_64"
159  fi
160esac
161
162if test ! -z "$cpu" ; then
163  # command line argument
164  :
165elif check_define __i386__ ; then
166  cpu="i386"
167elif check_define __x86_64__ ; then
168  cpu="x86_64"
169elif check_define __sparc__ ; then
170  if check_define __arch64__ ; then
171    cpu="sparc64"
172  else
173    cpu="sparc"
174  fi
175elif check_define _ARCH_PPC ; then
176  if check_define _ARCH_PPC64 ; then
177    cpu="ppc64"
178  else
179    cpu="ppc"
180  fi
181elif check_define __mips__ ; then
182  cpu="mips"
183elif check_define __ia64__ ; then
184  cpu="ia64"
185elif check_define __s390__ ; then
186  if check_define __s390x__ ; then
187    cpu="s390x"
188  else
189    cpu="s390"
190  fi
191elif check_define __arm__ ; then
192  cpu="arm"
193elif check_define __hppa__ ; then
194  cpu="hppa"
195else
196  cpu=`uname -m`
197fi
198
199# Normalise host CPU name and set ARCH.
200case "$cpu" in
201  ia64|ppc|ppc64|s390|s390x|sparc64)
202    cpu="$cpu"
203  ;;
204  i386|i486|i586|i686|i86pc|BePC)
205    cpu="i386"
206  ;;
207  x86_64|amd64)
208    cpu="x86_64"
209  ;;
210  armv*b|armv*l|arm)
211    cpu="arm"
212  ;;
213  hppa|parisc|parisc64)
214    cpu="hppa"
215  ;;
216  mips*)
217    cpu="mips"
218  ;;
219  sparc|sun4[cdmuv])
220    cpu="sparc"
221  ;;
222  *)
223    echo "Unknown CPU"
224    exit 1;
225  ;;
226esac
227
228if test -z $CC; then
229  if test "$targetos" = "FreeBSD"; then
230    if has clang; then
231      CC=clang
232    else
233      CC=gcc
234    fi
235  fi
236fi
237
238cc="${CC-${cross_prefix}gcc}"
239
240echo "Operating system              $targetos"
241echo "CPU                           $cpu"
242echo "Compiler                      $cc"
243echo
244
245##########################################
246# check for wordsize
247wordsize="0"
248cat > $TMPC <<EOF
249#include <stdio.h>
250int main(void)
251{
252  unsigned int wsize = sizeof(long) * 8;
253  printf("%d\n", wsize);
254  return 0;
255}
256EOF
257if compile_prog "" "" "wordsize"; then
258  wordsize=$($TMPE)
259fi
260echo "Wordsize                      $wordsize"
261
262##########################################
263# linux-aio probe
264libaio="no"
265cat > $TMPC <<EOF
266#include <libaio.h>
267#include <stddef.h>
268int main(void)
269{
270  io_setup(0, NULL);
271  return 0;
272}
273EOF
274if compile_prog "" "-laio" "libaio" ; then
275  libaio=yes
276  LIBS="-laio $LIBS"
277else
278  if test "$libaio" = "yes" ; then
279    feature_not_found "linux AIO"
280  fi
281  libaio=no
282fi
283echo "Linux AIO support             $libaio"
284
285##########################################
286# posix aio probe
287posix_aio="no"
288posix_aio_lrt="no"
289cat > $TMPC <<EOF
290#include <aio.h>
291int main(void)
292{
293  struct aiocb cb;
294  aio_read(&cb);
295  return 0;
296}
297EOF
298if compile_prog "" "" "posixaio" ; then
299  posix_aio="yes"
300elif compile_prog "" "-lrt" "posixaio"; then
301  posix_aio="yes"
302  posix_aio_lrt="yes"
303  LIBS="-lrt $LIBS"
304fi
305echo "POSIX AIO support             $posix_aio"
306echo "POSIX AIO support needs -lrt  $posix_aio_lrt"
307
308##########################################
309# posix aio fsync probe
310posix_aio_fsync="no"
311if test "$posix_aio" = "yes" ; then
312  cat > $TMPC <<EOF
313#include <fcntl.h>
314#include <aio.h>
315int main(void)
316{
317  struct aiocb cb;
318  return aio_fsync(O_SYNC, &cb);
319  return 0;
320}
321EOF
322  if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
323    posix_aio_fsync=yes
324  fi
325fi
326echo "POSIX AIO fsync               $posix_aio_fsync"
327
328##########################################
329# solaris aio probe
330solaris_aio="no"
331cat > $TMPC <<EOF
332#include <sys/types.h>
333#include <sys/asynch.h>
334#include <unistd.h>
335int main(void)
336{
337  aio_result_t res;
338  return aioread(0, NULL, 0, 0, SEEK_SET, &res);
339  return 0;
340}
341EOF
342if compile_prog "" "-laio" "solarisaio" ; then
343  solaris_aio=yes
344  LIBS="-laio $LIBS"
345fi
346echo "Solaris AIO support           $solaris_aio"
347
348##########################################
349# __sync_fetch_and_and test
350sfaa="no"
351cat > $TMPC << EOF
352static int sfaa(int *ptr)
353{
354  return __sync_fetch_and_and(ptr, 0);
355}
356
357int main(int argc, char **argv)
358{
359  int val = 42;
360  sfaa(&val);
361  return val;
362}
363EOF
364if compile_prog "" "" "__sync_fetch_and_add()" ; then
365    sfaa="yes"
366fi
367echo "__sync_fetch_and add          $sfaa"
368
369##########################################
370# libverbs probe
371libverbs="no"
372cat > $TMPC << EOF
373#include <stdio.h>
374#include <infiniband/arch.h>
375int main(int argc, char **argv)
376{
377  struct ibv_pd *pd = ibv_alloc_pd(NULL);
378  return 0;
379}
380EOF
381if compile_prog "" "-libverbs" "libverbs" ; then
382    libverbs="yes"
383    LIBS="-libverbs $LIBS"
384fi
385echo "libverbs                      $libverbs"
386
387##########################################
388# rdmacm probe
389rdmacm="no"
390cat > $TMPC << EOF
391#include <stdio.h>
392#include <rdma/rdma_cma.h>
393int main(int argc, char **argv)
394{
395  rdma_destroy_qp(NULL);
396  return 0;
397}
398EOF
399if compile_prog "" "-lrdmacm" "rdma"; then
400    rdmacm="yes"
401    LIBS="-lrdmacm $LIBS"
402fi
403echo "rdmacm                        $rdmacm"
404
405##########################################
406# Linux fallocate probe
407linux_fallocate="no"
408cat > $TMPC << EOF
409#include <stdio.h>
410#include <linux/falloc.h>
411int main(int argc, char **argv)
412{
413  int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
414  return r;
415}
416EOF
417if compile_prog "" "" "linux_fallocate"; then
418    linux_fallocate="yes"
419fi
420echo "Linux fallocate               $linux_fallocate"
421
422##########################################
423# POSIX fadvise probe
424posix_fadvise="no"
425cat > $TMPC << EOF
426#include <stdio.h>
427#include <fcntl.h>
428int main(int argc, char **argv)
429{
430  int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
431  return r;
432}
433EOF
434if compile_prog "" "" "posix_fadvise"; then
435    posix_fadvise="yes"
436fi
437echo "POSIX fadvise                 $posix_fadvise"
438
439##########################################
440# POSIX fallocate probe
441posix_fallocate="no"
442cat > $TMPC << EOF
443#include <stdio.h>
444#include <fcntl.h>
445int main(int argc, char **argv)
446{
447  int r = posix_fallocate(0, 0, 1024);
448  return r;
449}
450EOF
451if compile_prog "" "" "posix_fallocate"; then
452    posix_fallocate="yes"
453fi
454echo "POSIX fallocate               $posix_fallocate"
455
456##########################################
457# sched_set/getaffinity 2 or 3 argument test
458linux_2arg_affinity="no"
459linux_3arg_affinity="no"
460cat > $TMPC << EOF
461#define _GNU_SOURCE
462#include <sched.h>
463int main(int argc, char **argv)
464{
465  cpu_set_t mask;
466  return sched_setaffinity(0, sizeof(mask), &mask);
467}
468EOF
469if compile_prog "" "" "sched_setaffinity(,,)"; then
470  linux_3arg_affinity="yes"
471else
472  cat > $TMPC << EOF
473#define _GNU_SOURCE
474#include <sched.h>
475int main(int argc, char **argv)
476{
477  cpu_set_t mask;
478  return sched_setaffinity(0, &mask);
479}
480EOF
481  if compile_prog "" "" "sched_setaffinity(,)"; then
482    linux_2arg_affinity="yes"
483  fi
484fi
485echo "sched_setaffinity(3 arg)      $linux_3arg_affinity"
486echo "sched_setaffinity(2 arg)      $linux_2arg_affinity"
487
488##########################################
489# clock_gettime probe
490clock_gettime="no"
491cat > $TMPC << EOF
492#include <stdio.h>
493#include <time.h>
494int main(int argc, char **argv)
495{
496  return clock_gettime(0, NULL);
497}
498EOF
499if compile_prog "" "" "clock_gettime"; then
500    clock_gettime="yes"
501elif compile_prog "" "-lrt" "clock_gettime"; then
502    clock_gettime="yes"
503    LIBS="-lrt $LIBS"
504fi
505echo "clock_gettime                 $clock_gettime"
506
507##########################################
508# CLOCK_MONOTONIC probe
509clock_monotonic="no"
510if test "$clock_gettime" = "yes" ; then
511  cat > $TMPC << EOF
512#include <stdio.h>
513#include <time.h>
514int main(int argc, char **argv)
515{
516  return clock_gettime(CLOCK_MONOTONIC, NULL);
517}
518EOF
519  if compile_prog "" "$LIBS" "clock monotonic"; then
520      clock_monotonic="yes"
521  fi
522fi
523echo "CLOCK_MONOTONIC               $clock_monotonic"
524
525##########################################
526# CLOCK_MONOTONIC_PRECISE probe
527clock_monotonic_precise="no"
528if test "$clock_gettime" = "yes" ; then
529  cat > $TMPC << EOF
530#include <stdio.h>
531#include <time.h>
532int main(int argc, char **argv)
533{
534  return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
535}
536EOF
537  if compile_prog "" "$LIBS" "clock monotonic precise"; then
538      clock_monotonic_precise="yes"
539  fi
540fi
541echo "CLOCK_MONOTONIC_PRECISE       $clock_monotonic_precise"
542
543##########################################
544# gettimeofday() probe
545gettimeofday="no"
546cat > $TMPC << EOF
547#include <sys/time.h>
548#include <stdio.h>
549int main(int argc, char **argv)
550{
551  struct timeval tv;
552  return gettimeofday(&tv, NULL);
553}
554EOF
555if compile_prog "" "" "gettimeofday"; then
556    gettimeofday="yes"
557fi
558echo "gettimeofday                  $gettimeofday"
559
560##########################################
561# fdatasync() probe
562fdatasync="no"
563cat > $TMPC << EOF
564#include <stdio.h>
565#include <unistd.h>
566int main(int argc, char **argv)
567{
568  return fdatasync(0);
569}
570EOF
571if compile_prog "" "" "fdatasync"; then
572  fdatasync="yes"
573fi
574echo "fdatasync                     $fdatasync"
575
576##########################################
577# sync_file_range() probe
578sync_file_range="no"
579cat > $TMPC << EOF
580#include <stdio.h>
581#include <unistd.h>
582#define _GNU_SOURCE
583#include <fcntl.h>
584#include <linux/fs.h>
585int main(int argc, char **argv)
586{
587  unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
588			SYNC_FILE_RANGE_WAIT_AFTER;
589  return sync_file_range(0, 0, 0, flags);
590}
591EOF
592if compile_prog "" "" "sync_file_range"; then
593  sync_file_range="yes"
594fi
595echo "sync_file_range               $sync_file_range"
596
597##########################################
598# ext4 move extent probe
599ext4_me="no"
600cat > $TMPC << EOF
601#include <fcntl.h>
602#include <sys/ioctl.h>
603int main(int argc, char **argv)
604{
605  struct move_extent me;
606  return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
607}
608EOF
609if compile_prog "" "" "ext4 move extent" ; then
610  ext4_me="yes"
611elif test $targetos = "Linux" ; then
612  # On Linux, just default to it on and let it error at runtime if we really
613  # don't have it. None of my updated systems have it defined, but it does
614  # work. Takes a while to bubble back.
615  ext4_me="yes"
616fi
617echo "EXT4 move extent              $ext4_me"
618
619##########################################
620# splice probe
621linux_splice="no"
622cat > $TMPC << EOF
623#define _GNU_SOURCE
624#include <stdio.h>
625#include <fcntl.h>
626int main(int argc, char **argv)
627{
628  return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
629}
630EOF
631if compile_prog "" "" "linux splice"; then
632  linux_splice="yes"
633fi
634echo "Linux splice(2)               $linux_splice"
635
636##########################################
637# GUASI probe
638guasi="no"
639cat > $TMPC << EOF
640#include <guasi.h>
641#include <guasi_syscalls.h>
642int main(int argc, char **argv)
643{
644  guasi_t ctx = guasi_create(0, 0, 0);
645  return 0;
646}
647EOF
648if compile_prog "" "" "guasi"; then
649  guasi="yes"
650fi
651echo "GUASI                         $guasi"
652
653##########################################
654# fusion-aw probe
655fusion_aw="no"
656cat > $TMPC << EOF
657#include <nvm/vectored_write.h>
658int main(int argc, char **argv)
659{
660  struct vsl_iovec iov;
661  return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
662}
663EOF
664if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then
665  LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS"
666  fusion_aw="yes"
667fi
668echo "Fusion-io atomic engine       $fusion_aw"
669
670##########################################
671# libnuma probe
672libnuma="no"
673cat > $TMPC << EOF
674#include <numa.h>
675int main(int argc, char **argv)
676{
677  return numa_available();
678}
679EOF
680if compile_prog "" "-lnuma" "libnuma"; then
681  libnuma="yes"
682  LIBS="-lnuma $LIBS"
683fi
684echo "libnuma                       $libnuma"
685
686##########################################
687# strsep() probe
688strsep="no"
689cat > $TMPC << EOF
690#include <string.h>
691int main(int argc, char **argv)
692{
693  strsep(NULL, NULL);
694  return 0;
695}
696EOF
697if compile_prog "" "" "strsep"; then
698  strsep="yes"
699fi
700echo "strsep                        $strsep"
701
702##########################################
703# getopt_long_only() probe
704getopt_long_only="no"
705cat > $TMPC << EOF
706#include <unistd.h>
707#include <stdio.h>
708int main(int argc, char **argv)
709{
710  int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
711  return c;
712}
713EOF
714if compile_prog "" "" "getopt_long_only"; then
715  getopt_long_only="yes"
716fi
717echo "getopt_long_only()            $getopt_long_only"
718
719##########################################
720# inet_aton() probe
721inet_aton="no"
722cat > $TMPC << EOF
723#include <sys/socket.h>
724#include <arpa/inet.h>
725#include <stdio.h>
726int main(int argc, char **argv)
727{
728  struct in_addr in;
729  return inet_aton(NULL, &in);
730}
731EOF
732if compile_prog "" "" "inet_aton"; then
733  inet_aton="yes"
734fi
735echo "inet_aton                     $inet_aton"
736
737##########################################
738# socklen_t probe
739socklen_t="no"
740cat > $TMPC << EOF
741#include <string.h>
742#include <netinet/in.h>
743int main(int argc, char **argv)
744{
745  socklen_t len = 0;
746  return len;
747}
748EOF
749if compile_prog "" "" "socklen_t"; then
750  socklen_t="yes"
751fi
752echo "socklen_t                     $socklen_t"
753
754##########################################
755# Whether or not __thread is supported for TLS
756tls_thread="no"
757cat > $TMPC << EOF
758#include <stdio.h>
759static int __thread ret;
760int main(int argc, char **argv)
761{
762  return ret;
763}
764EOF
765if compile_prog "" "" "__thread"; then
766  tls_thread="yes"
767fi
768echo "__thread                      $tls_thread"
769
770#############################################################################
771
772echo "# Automatically generated by configure - do not modify" > $config_host_mak
773printf "# Configured with:" >> $config_host_mak
774printf " '%s'" "$0" "$@" >> $config_host_mak
775echo >> $config_host_mak
776
777if test "$wordsize" = "64" ; then
778  echo "CONFIG_64BIT=y" >> $config_host_mak
779elif test "$wordsize" = "32" ; then
780  echo "CONFIG_32BIT=y" >> $config_host_mak
781else
782  echo "Unknown wordsize!"
783  exit 1
784fi
785if test "$libaio" = "yes" ; then
786  echo "CONFIG_LIBAIO=y" >> $config_host_mak
787fi
788if test "$posix_aio" = "yes" ; then
789  echo "CONFIG_POSIXAIO=y" >> $config_host_mak
790fi
791if test "$posix_aio_fsync" = "yes" ; then
792  echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
793fi
794if test "$linux_fallocate" = "yes" ; then
795  echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
796fi
797if test "$posix_fallocate" = "yes" ; then
798  echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
799fi
800if test "$fdatasync" = "yes" ; then
801  echo "CONFIG_FDATASYNC=y" >> $config_host_mak
802fi
803if test "$sync_file_range" = "yes" ; then
804  echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
805fi
806if test "$sfaa" = "yes" ; then
807  echo "CONFIG_SFAA=y" >> $config_host_mak
808fi
809if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
810  echo "CONFIG_RDMA=y" >> $config_host_mak
811fi
812if test "$clock_gettime" = "yes" ; then
813  echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
814fi
815if test "$clock_monotonic" = "yes" ; then
816  echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
817fi
818if test "$clock_monotonic_precise" = "yes" ; then
819  echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
820fi
821if test "$gettimeofday" = "yes" ; then
822  echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
823fi
824if test "$posix_fadvise" = "yes" ; then
825  echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
826fi
827if test "$linux_3arg_affinity" = "yes" ; then
828  echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
829elif test "$linux_2arg_affinity" = "yes" ; then
830  echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
831fi
832if test "$strsep" = "yes" ; then
833  echo "CONFIG_STRSEP=y" >> $config_host_mak
834fi
835if test "$getopt_long_only" = "yes" ; then
836  echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
837fi
838if test "$inet_aton" = "yes" ; then
839  echo "CONFIG_INET_ATON=y" >> $config_host_mak
840fi
841if test "$socklen_t" = "yes" ; then
842  echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
843fi
844if test "$ext4_me" = "yes" ; then
845  echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
846fi
847if test "$linux_splice" = "yes" ; then
848  echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
849fi
850if test "$guasi" = "yes" ; then
851  echo "CONFIG_GUASI=y" >> $config_host_mak
852fi
853if test "$fusion_aw" = "yes" ; then
854  echo "CONFIG_FUSION_AW=y" >> $config_host_mak
855fi
856if test "$libnuma" = "yes" ; then
857  echo "CONFIG_LIBNUMA=y" >> $config_host_mak
858fi
859if test "$solaris_aio" = "yes" ; then
860  echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
861fi
862if test "$tls_thread" = "yes" ; then
863  echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
864fi
865
866echo "LIBS+=$LIBS" >> $config_host_mak
867echo "CC=$cc" >> $config_host_mak
868