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