* Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
[m4/ericb.git] / configure.ac
blobb7dd23c406f4e7830e13bb0bc01b81c90d235635
1 # Configure template for GNU m4.                        -*-Autoconf-*-
2 # Copyright (C) 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2004, 2005, 2006
3 # Free Software 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.60])
22 ## ------------------------ ##
23 ## Autoconf initialisation. ##
24 ## ------------------------ ##
25 AC_INIT([GNU M4], [1.9a], [bug-m4@gnu.org])
27 AC_CONFIG_SRCDIR([src/m4.h])
28 AC_CONFIG_AUX_DIR([ltdl/config])
29 AC_CONFIG_MACRO_DIR([ltdl/m4])
30 AC_CONFIG_LIBOBJ_DIR([gnu])
31 AC_CONFIG_TESTDIR([tests])
32 AC_CONFIG_HEADERS([config.h:config-h.in])
33 AC_CONFIG_FILES([tests/m4], [chmod +x tests/m4])
37 ## ---------------------------------------- ##
38 ## Display a configure time version banner. ##
39 ## ---------------------------------------- ##
40 TIMESTAMP=
41 case AC_PACKAGE_VERSION in
42   *[[acegikmoqsuwy]])
43     TIMESTAMP=`$CONFIG_SHELL $ac_aux_dir/mkstamp < $srcdir/ChangeLog`
44     test -z "$TIMESTAMP" || TIMESTAMP=" (Build:$TIMESTAMP)"
45     AS_BOX([Configuring AC_PACKAGE_TARNAME][$TIMESTAMP AC_PACKAGE_VERSION])
46     echo
47     ;;
48 esac
49 AC_DEFINE_UNQUOTED([TIMESTAMP], ["$TIMESTAMP"],
50     [Defined to a CVS timestamp for alpha releases of M4])
54 ## -------------------------- ##
55 ## M4 specific configuration. ##
56 ## -------------------------- ##
57 dnl Autoconf recommends that packages use lowercase for their package-specific
58 dnl prefix for cache variables.  But in the case of m4, that collides with
59 dnl the m4_ namespace provided by m4sugar, so we prefer M4_ as our
60 dnl package-specific prefix.  FIXME - consistently use M4_ in the m4 macros
61 dnl that feed the creation of configure.
62 m4_pattern_forbid([^M4_])
63 m4_pattern_allow([^M4_cv_])
65 AC_DEFUN([M4_DEFAULT_PRELOAD], [m4 traditional gnu])
66 AC_MSG_CHECKING([for modules to preload])
67   DLPREOPEN=
69   AC_ARG_WITH([modules],
70     [AS_HELP_STRING([--with-modules=MODULES],
71                     [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])],
72     [use_modules="$withval"],
73     [use_modules="M4_DEFAULT_PRELOAD"])
75   PREOPEN_DEPENDENCIES=
76   DLPREOPEN="-dlpreopen force"
77   if test -z "$use_modules"; then
78     use_modules=none
79   else
80     if test "$use_modules" != yes; then
81       for module in $use_modules; do
82         DLPREOPEN="$DLPREOPEN -dlpreopen modules/$module.la"
83         PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES modules/$module.la"
84       done
85     fi
86   fi
87 AC_MSG_RESULT([$use_modules])
88 AC_SUBST([DLPREOPEN])
89 AC_SUBST([PREOPEN_DEPENDENCIES])
93 ## ------------------------ ##
94 ## Automake Initialisation. ##
95 ## ------------------------ ##
96 AM_INIT_AUTOMAKE([1.9.6 subdir-objects dist-bzip2 gnits])
100 ## ------------------ ##
101 ## C compiler checks. ##
102 ## ------------------ ##
103 AC_PROG_CC
104 M4_EARLY
106 AC_PROG_CPP
107 AM_PROG_CC_C_O
108 M4_CHECK_DEBUGGING
112 ## ----------------------- ##
113 ## Libtool initialisation. ##
114 ## ----------------------- ##
115 LT_PREREQ([2.0])
116 LT_CONFIG_LTDL_DIR([ltdl])
117 LT_INIT([shared dlopen win32-dll])
118 LT_WITH_LTDL([ltdl])
120 # Use gcc's -pipe option if available: for faster compilation.
121 case "$CFLAGS" in
122   *-pipe* ) ;;
123         * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
124                 [M4_cv_prog_compiler_pipe],
125                 [-pipe -c conftest.$ac_ext], [],
126                 [CFLAGS="$CFLAGS -pipe"])
127               ;;
128 esac
132 ## ---------------- ##
133 ## Gettext support. ##
134 ## ---------------- ##
135 AM_GNU_GETTEXT([external], [need-ngettext])
136 AM_GNU_GETTEXT_VERSION([0.14.1])
137 M4_GNU_GETTEXT
141 ## --------------- ##
142 ## Gnulib support, ##
143 ## --------------- ##
144 M4_INIT
146 # Gnulib doesn't always do things quite the way M4 would like...
147 M4_ERROR
148 M4_GETOPT
149 M4_OBSTACK
150 M4_REGEX
153 ## ------------------------ ##
154 ## Other external programs. ##
155 ## ------------------------ ##
156 AC_PATH_PROG([PERL], [perl])
160 ## --------------------------- ##
161 ## C compiler characteristics. ##
162 ## --------------------------- ##
163 AC_TYPE_SIZE_T
164 AC_CHECK_SIZEOF([long long int])
168 ## ------------------------- ##
169 ## C headers required by M4. ##
170 ## ------------------------- ##
171 AC_CHECK_HEADERS_ONCE([limits.h])
173 if test $ac_cv_header_stdbool_h = yes; then
174   INCLUDE_STDBOOL_H='#include <stdbool.h>'
175 else
176   INCLUDE_STDBOOL_H='#include <gnu/stdbool.h>'
178 AC_SUBST([INCLUDE_STDBOOL_H])
182 ## --------------------------------- ##
183 ## Library functions required by M4. ##
184 ## --------------------------------- ##
185 AC_CHECK_FUNCS_ONCE([calloc strerror tmpfile])
187 AM_WITH_DMALLOC
189 M4_SYS_STACKOVF
191 # This is for the modules
192 AC_STRUCT_TM
193 AC_FUNC_STRFTIME
194 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
195 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
197 M4_LIB_GMP
198 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
202 ## -------- ##
203 ## Outputs. ##
204 ## -------- ##
205 AC_CONFIG_FILES([
206 Makefile
207 gnu/Makefile
208 m4/system.h:m4/system_.h
209 tests/atlocal
212 AC_OUTPUT