* configure.ac (AC_INIT): Bump version number.
[m4/ericb.git] / configure.ac
blob197a186313e9693a1d637dc646bc122da1b901f8
1 # Configure template for GNU M4.                        -*-Autoconf-*-
2 # Copyright (C) 1991, 1993, 1994, 2004, 2005, 2006 Free Software
3 # Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301  USA
20 AC_PREREQ([2.59])
21 AC_INIT([GNU M4], [1.4.4c], [bug-m4@gnu.org])
22 AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 gnu])
23 PACKAGE=$PACKAGE_TARNAME; AC_SUBST([PACKAGE])
24 VERSION=$PACKAGE_VERSION; AC_SUBST([VERSION])
26 m4_pattern_forbid([^M4_])
28 AC_CONFIG_SRCDIR([src/m4.h])
29 AC_CONFIG_HEADERS([config.h:config-h.in])
31 AC_PROG_CC
32 M4_EARLY
34 AC_CHECK_HEADERS([limits.h siginfo.h])
35 AC_CHECK_HEADERS([signal.h sys/signal.h], [break])
36 AC_TYPE_SIGNAL
37 AC_TYPE_SIZE_T
39 AC_CHECK_FUNCS([mkstemp sigaction sigaltstack sigstack sigvec strerror tmpfile])
41 M4_INIT
43 AC_MSG_CHECKING([ecvt declaration])
44 AC_EGREP_HEADER([ecvt], [stdlib.h],
45   [AC_MSG_RESULT([yes])
46    AC_DEFINE([HAVE_EFGCVT], [2],
47      [Define to 1 if you have ecvt(3), fcvt(3) and gcvt(3).  Define to 2 if
48 they are declared in stdlib.h])
49   ],
50   [AC_MSG_RESULT([no]); AC_CHECK_FUNCS([ecvt])])
53 AC_MSG_CHECKING([if stack overflow is detectable])
54 # Code from Jim Avera <jima@netcom.com>.
55 # stackovf.c requires:
56 #  1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK
57 #  2. Either sigaltstack or sigstack
58 #  3. getrlimit, including support for RLIMIT_STACK
59 use_stackovf=no
60 if test "$ac_cv_func_sigaction" = yes || test "$ac_cv_func_sigvec" = yes; then
61   if test "$ac_cv_func_sigaltstack" = yes || test "$ac_cv_func_sigstack" = yes; then
62     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
63 #include <sys/resource.h>
64 #include <signal.h>]],
65       [[struct rlimit r; int i; getrlimit (RLIMIT_STACK, &r)
66 #if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \
67     && (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK))
68 choke me                /* SA_ONSTACK and/or SV_ONSTACK are not defined */
69 #endif]])],[use_stackovf=yes],[])
70   fi
72 AC_MSG_RESULT([$use_stackovf])
73 AM_CONDITIONAL([STACKOVF], [test "$use_stackovf" = yes])
74 if test "$use_stackovf" = yes; then
75   AC_DEFINE([USE_STACKOVF], [1],
76     [Define to 1 if using stack overflow detection])
77   AC_EGREP_HEADER([rlim_t], [sys/resource.h], [],
78     [AC_DEFINE([rlim_t], [int],
79       [Define to int if rlim_t is not defined in sys/resource.h])
80   ])
81   AC_EGREP_HEADER([stack_t], [signal.h], [],
82     [AC_DEFINE([stack_t], [struct sigaltstack],
83       [Define to struct sigaltstack if stack_t is not in sys/signal.h])
84   ])
85   AC_EGREP_HEADER([sigcontext], [signal.h],
86     [AC_DEFINE([HAVE_SIGCONTEXT], [1],
87       [Define to 1 if signal.h declares struct sigcontext])
88   ])
91 dnl Don't let changeword get in our way, if bootstrapping with a version of
92 dnl m4 that already turned the feature on.
93 m4_ifdef([changeword], [m4_undefine([changeword])])dnl
95 AC_MSG_CHECKING([[if changeword is wanted]])
96 AC_ARG_ENABLE([changeword],
97   [AS_HELP_STRING([--enable-changeword],
98      [enable -W and changeword() builtin])],
99   [if test "$enableval" = yes; then
100     AC_MSG_RESULT([yes])
101     AC_DEFINE([ENABLE_CHANGEWORD], [1],
102       [Define to 1 if the changeword(REGEXP) functionality is wanted])
103   else
104     AC_MSG_RESULT([no])
105   fi], [AC_MSG_RESULT([no])])
107 M4_WITH_DMALLOC
109 AC_CONFIG_COMMANDS([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]])
111 AC_CONFIG_FILES([Makefile
112                  doc/Makefile
113                  lib/Makefile
114                  src/Makefile
115                  checks/Makefile
116                  examples/Makefile
119 AC_OUTPUT