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
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])
40 AC_CHECK_HEADERS([limits.h memory.h siginfo.h string.h unistd.h])
41 AC_CHECK_HEADERS([signal.h sys/signal.h], [break])
46 AC_CHECK_FUNCS([mkstemp sigaction sigaltstack sigstack sigvec strerror tmpfile])
49 AC_REPLACE_FUNCS([strtol])
52 AC_MSG_CHECKING([ecvt declaration])
53 AC_EGREP_HEADER([ecvt], [stdlib.h],
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])
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
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>
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 */
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
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])
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])
95 AC_EGREP_HEADER([sigcontext], [signal.h],
96 [AC_DEFINE([HAVE_SIGCONTEXT], [1],
97 [Define to 1 if signal.h declares struct sigcontext])
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
106 AC_DEFINE([ENABLE_CHANGEWORD], [1],
107 [Define to 1 if the changeword(REGEXP) functionality is wanted])
110 fi], [AC_MSG_RESULT(no)])
114 AC_CONFIG_FILES([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]])
116 AC_CONFIG_FILES([Makefile