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