2 dnl configure.in --- autoconf input file for gawk
4 dnl Copyright (C) 1995-2000 the Free Software Foundation, Inc.
6 dnl This file is part of GAWK, the GNU implementation of the
7 dnl AWK Programming Language.
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.
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.
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
24 dnl Process this file with autoconf to produce a configure script.
26 dnl this makes sure that the local install-sh gets found
27 dnl define(AC_CONFIG_AUX_DIR,)
29 dnl This is the configure.in script proper
32 AC_CONFIG_HEADER(config.h:configh.in)
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))
38 dnl checks for programs
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
51 if test "$CFLAGS" = ""
53 dnl no user provided CFLAGS, feel free to do this our way
58 dnl go for speed, not debugging. :-)
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
69 CFLAGS="$CFLAGS -DARRAYDEBUG"
74 dnl checks for systems
81 if test "$ISC" = 1 # will be set by test for ISC
83 dnl need -D_SYSV3 for ISC
84 CFLAGS="$CFLAGS -D_SYSV3"
87 dnl checks for header files
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
93 AC_CHECK_HEADERS(memory.h)
95 AC_CHECK_HEADERS(strings.h)
98 dnl checks for typedefs
103 AC_EGREP_HEADER([int.*sprintf], stdio.h,
104 AC_DEFINE(SPRINTF_RET, int),
105 AC_DEFINE(SPRINTF_RET, char *))
107 dnl checks for functions
108 if test "$YACC" = "bison -y" ||
109 { test -f $srcdir/awktab.c && grep 'alloca *(' $srcdir/awktab.c > /dev/null; }
113 AC_DEFINE(REGEX_MALLOC)
116 AC_CHECK_LIB(m, fmod)
117 AC_CHECK_FUNCS(madvise memset memcpy memcmp fmod setlocale strchr strerror \
118 strftime strncasecmp strtod system tzset)
120 dnl see if we have mmap
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
129 AC_DEFINE(GETPGRP_VOID)
131 *HP-UX*) # not getpgrp related
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.
143 # have to do the getpgrp test since won't
144 # fall into the default
154 dnl checks for structure members
160 dnl checks for compiler characteristics
165 AC_OUTPUT(Makefile doc/Makefile test/Makefile awklib/Makefile, [date > stamp-h])