Add per-device polling support.
[dragonfly.git] / contrib / awk / configure.in
1 dnl
2 dnl configure.in --- autoconf input file for gawk
3 dnl 
4 dnl Copyright (C) 1995-2000 the Free Software Foundation, Inc.
5 dnl 
6 dnl This file is part of GAWK, the GNU implementation of the
7 dnl AWK Programming Language.
8 dnl 
9 dnl GAWK is free software; you can redistribute it and/or modify
10 dnl it under the terms of the GNU General Public License as published by
11 dnl the Free Software Foundation; either version 2 of the License, or
12 dnl (at your option) any later version.
13 dnl 
14 dnl GAWK is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 dnl GNU General Public License for more details.
18 dnl 
19 dnl You should have received a copy of the GNU General Public License
20 dnl along with this program; if not, write to the Free Software
21 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
22 dnl
23
24 dnl Process this file with autoconf to produce a configure script.
25
26 dnl this makes sure that the local install-sh gets found
27 dnl define(AC_CONFIG_AUX_DIR,)
28
29 dnl This is the configure.in script proper
30 AC_INIT(awk.h)
31 AC_PREREQ(2.12)
32 AC_CONFIG_HEADER(config.h:configh.in)
33
34 dnl Additional argument stuff
35 AC_ARG_ENABLE(bitops, [  --enable-bitops        Enable Octal and Hex constants and bit functions], AC_DEFINE(BITOPS))
36 AC_ARG_ENABLE(non-decimal-data, [  --enable-non-decimal-data    Enable Octal and Hex constants as valid input data], AC_DEFINE(NONDECDATA))
37
38 dnl checks for programs
39 AC_PROG_YACC
40 AC_PROG_LN_S
41 AC_PROG_CC
42 AC_PROG_CPP
43
44 # This is a hack. Different versions of install on different systems
45 # are just too different. Chuck it and use install-sh.
46 INSTALL="$srcdir/install-sh -c"; export INSTALL
47 AC_PROG_INSTALL
48
49 AC_PROG_MAKE_SET
50
51 if test "$CFLAGS" = ""
52 then
53 dnl     no user provided CFLAGS, feel free to do this our way
54         if test "$GCC" = yes
55         then
56                 CFLAGS="-g -O"
57         else
58 dnl             go for speed, not debugging. :-)
59                 CFLAGS="-O"
60         fi
61 fi
62
63 # This is mainly for my use during testing and development.
64 # Yes, it's a bit of a hack.
65 if test -f $srcdir/.developing
66 then
67         AC_DEFINE(BITOPS)
68         AC_DEFINE(NONDECDATA)
69         CFLAGS="$CFLAGS -DARRAYDEBUG"
70 fi
71
72 AC_SUBST(CFLAGS)
73
74 dnl checks for systems
75 AC_AIX
76 AC_ISC_POSIX
77 AC_MINIX
78 GAWK_AC_SYS_LARGEFILE
79 GAWK_AC_AIX_TWEAK
80
81 if test "$ISC" = 1      # will be set by test for ISC
82 then
83 dnl     need -D_SYSV3 for ISC
84         CFLAGS="$CFLAGS -D_SYSV3"
85 fi
86
87 dnl checks for header files
88 AC_HEADER_STDC
89 AC_HEADER_SYS_WAIT
90 AC_CHECK_HEADERS(limits.h locale.h stdarg.h unistd.h signum.h sys/param.h string.h)
91 if test "$ac_cv_header_string_h" = yes
92 then
93         AC_CHECK_HEADERS(memory.h)
94 else
95         AC_CHECK_HEADERS(strings.h)
96 fi
97
98 dnl checks for typedefs
99 AC_TYPE_PID_T
100 AC_TYPE_SIGNAL
101 AC_SIZE_T
102 AC_TYPE_GETGROUPS
103 AC_EGREP_HEADER([int.*sprintf], stdio.h,
104         AC_DEFINE(SPRINTF_RET, int),
105         AC_DEFINE(SPRINTF_RET, char *))
106
107 dnl checks for functions
108 if test "$YACC" = "bison -y" ||
109  { test -f $srcdir/awktab.c && grep 'alloca *(' $srcdir/awktab.c > /dev/null; }
110 then
111         AC_FUNC_ALLOCA
112 fi
113 AC_DEFINE(REGEX_MALLOC)
114 AC_FUNC_VPRINTF
115
116 AC_CHECK_LIB(m, fmod)
117 AC_CHECK_FUNCS(madvise memset memcpy memcmp fmod setlocale strchr strerror \
118                 strftime strncasecmp strtod system tzset)
119
120 dnl see if we have mmap
121 AC_FUNC_MMAP
122
123 dnl check for how to use getpgrp
124 dnl have to hardwire it for VMS POSIX. Sigh.
125 if (uname) > /dev/null 2>&1
126 then
127         case `uname` in
128         *VMS*|*BeOS*)
129                 AC_DEFINE(GETPGRP_VOID)
130                 ;;
131         *HP-UX*)        # not getpgrp related
132                 if test "$GCC" = yes
133                 then
134                         :
135                 else
136                         # stupid HP linker leaves the output file
137                         # around even when a link fails. This confuses
138                         # the alloca tests, so we have to do this
139                         # manually. Sucks big time.
140                         LIBS="$LIBS -lPW"
141                 fi
142
143                 # have to do the getpgrp test since won't
144                 # fall into the default
145                 AC_FUNC_GETPGRP
146                 ;;
147         *)      AC_FUNC_GETPGRP
148                 ;;
149         esac
150 else
151         AC_FUNC_GETPGRP
152 fi
153
154 dnl checks for structure members
155 AC_STRUCT_ST_BLKSIZE
156 AC_HEADER_TIME
157 AC_STRUCT_TM
158 AC_STRUCT_TIMEZONE
159
160 dnl checks for compiler characteristics
161 AC_C_CHAR_UNSIGNED
162 AC_C_CONST
163 GAWK_AC_C_STRINGIZE
164
165 AC_OUTPUT(Makefile doc/Makefile test/Makefile awklib/Makefile, [date > stamp-h])