Also, some of the files here were never updated from the previous
[m4.git] / configure.ac
blob05beb8d837838e4de92c9cdc6512d8c8524eb2f4
1 # Configure template for GNU M4.                        -*-Autoconf-*-
2 # Copyright (C) 1991, 1993, 1994, 2004, 2005 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 # 02110-1301  USA
20 AC_INIT([GNU M4], [1.4.3a], [bug-m4@gnu.org])
21 PACKAGE=$PACKAGE_TARNAME; AC_SUBST(PACKAGE)
22 VERSION=$PACKAGE_VERSION; AC_SUBST(VERSION)
24 AC_CONFIG_SRCDIR([src/m4.h])
25 AC_CONFIG_HEADERS([config.h:config-h.in])
26 AC_ARG_PROGRAM
28 AC_PROG_AWK
29 AC_PROG_CC
30 AC_PROG_INSTALL
31 AC_PROG_MAKE_SET
32 AC_PROG_RANLIB
34 AC_AIX
35 AC_ISC_POSIX
36 AC_MINIX
37 fp_C_PROTOTYPES
38 AC_C_CONST
40 AC_CHECK_HEADERS([limits.h memory.h siginfo.h string.h unistd.h])
41 AC_CHECK_HEADERS([signal.h sys/signal.h], [break])
42 AC_HEADER_STDC
43 AC_TYPE_SIGNAL
44 AC_TYPE_SIZE_T
46 AC_CHECK_FUNCS([mkstemp sigaction sigaltstack sigstack sigvec strerror tmpfile])
47 AC_FUNC_ALLOCA
48 AC_FUNC_VPRINTF
49 AC_REPLACE_FUNCS([strtol])
52 AC_MSG_CHECKING([ecvt declaration])
53 AC_EGREP_HEADER([ecvt], [stdlib.h],
54   [AC_MSG_RESULT(yes)
55    AC_DEFINE([HAVE_EFGCVT], [2],
56      [Define to 1 if you have ecvt(3), fcvt(3) and gcvt(3).  Define to 2 if they are declared in stdlib.h])
57   ],
58   [AC_MSG_RESULT(no); AC_CHECK_FUNCS(ecvt)])
61 AC_MSG_CHECKING(if stack overflow is detectable)
62 # Code from Jim Avera <jima@netcom.com>.
63 # stackovf.c requires:
64 #  1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK
65 #  2. Either sigaltstack or sigstack
66 #  3. getrlimit, including support for RLIMIT_STACK
67 use_stackovf=no
68 if test "$ac_cv_func_sigaction" = yes || test "$ac_cv_func_sigvec" = yes; then
69   if test "$ac_cv_func_sigaltstack" = yes || test "$ac_cv_func_sigstack" = yes; then
70     AC_TRY_LINK([#include <sys/time.h>
71 #include <sys/resource.h>
72 #include <signal.h>],
73       [struct rlimit r; int i; getrlimit (RLIMIT_STACK, &r)
74 #if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \
75     && (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK))
76 choke me                /* SA_ONSTACK and/or SV_ONSTACK are not defined */
77 #endif],
78       use_stackovf=yes)
79   fi
81 AC_MSG_RESULT($use_stackovf)
82 if test "$use_stackovf" = yes; then
83   AC_DEFINE([USE_STACKOVF], [1],
84     [Define to 1 if using stack overflow detection])
85   STACKOVF=stackovf.${U}o
86   AC_SUBST(STACKOVF)
87   AC_EGREP_HEADER([rlim_t], [sys/resource.h], [],
88     [AC_DEFINE([rlim_t], [int],
89       [Define to int if rlim_t is not defined in sys/resource.h])
90   ])
91   AC_EGREP_HEADER([stack_t], [signal.h], [],
92     [AC_DEFINE([stack_t], [struct sigaltstack],
93       [Define to struct sigaltstack if stack_t is not in sys/signal.h])
94   ])
95   AC_EGREP_HEADER([sigcontext], [signal.h],
96     [AC_DEFINE([HAVE_SIGCONTEXT], [1],
97       [Define to 1 if signal.h declares struct sigcontext])
98   ])
101 AC_MSG_CHECKING([[if changeword is wanted]])
102 AC_ARG_ENABLE([changeword],
103   [[  --enable-changeword     enable -W and changeword() builtin]],
104   [if test "$enableval" = yes; then
105     AC_MSG_RESULT(yes)
106     AC_DEFINE([ENABLE_CHANGEWORD], [1],
107       [Define to 1 if the changeword(REGEXP) functionality is wanted])
108   else
109     AC_MSG_RESULT(no)
110   fi], [AC_MSG_RESULT(no)])
112 fp_WITH_DMALLOC
114 AC_CONFIG_FILES([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]])
116 AC_CONFIG_FILES([Makefile
117                  doc/Makefile
118                  lib/Makefile
119                  src/Makefile
120                  checks/Makefile
121                  examples/Makefile
124 AC_OUTPUT