* bootstrap (AUTORECONF): New variable to allow user overriding of
[m4/ericb.git] / configure.ac
blob0b4c15043974aac910a9e10e4c5bdf504eca5cbe
1 # Configure template for GNU m4.                        -*-Autoconf-*-
2 # Copyright (C) 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2004, 2005
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.59])
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 m4_pattern_allow([^m4_cv_])
59 # We use some of Jim's macros.
60 dnl m4_pattern_forbid([^jm_])
61 dnl m4_pattern_allow([^jm_cv_])
62 dnl m4_pattern_allow([^jm_ac_cv_])
63 dnl m4_pattern_allow([^jm_with_])
65 AC_MSG_CHECKING(for modules to preload)
66   m4_pattern_allow([^m4_default_preload$])
67   m4_default_preload="m4 traditional gnu"
68   DLPREOPEN=
70   AC_ARG_WITH([modules],
71     [AC_HELP_STRING([--with-modules=MODULES],
72                     [preload MODULES @<:@default: $m4_default_preload@:>@])],
73     [use_modules="$withval"],
74     [use_modules="$m4_default_preload"])
76   PREOPEN_DEPENDENCIES=
77   DLPREOPEN="-dlpreopen force"
78   if test -z "$use_modules"; then
79     use_modules=none
80   else
81     if test "$use_modules" != yes; then
82       for module in $use_modules; do
83         DLPREOPEN="$DLPREOPEN -dlpreopen modules/$module.la"
84         PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES modules/$module.la"
85       done
86     fi
87   fi
88 AC_MSG_RESULT($use_modules)
89 AC_SUBST(DLPREOPEN)
90 AC_SUBST(PREOPEN_DEPENDENCIES)
94 ## ------------------------ ##
95 ## Automake Initialisation. ##
96 ## ------------------------ ##
97 AM_INIT_AUTOMAKE([1.9.5 subdir-objects dist-bzip2])
101 ## ------------------ ##
102 ## C compiler checks. ##
103 ## ------------------ ##
104 AC_PROG_CC
106 gl_EARLY
107 AC_ISC_POSIX
108 AM_PROG_CC_STDC
109 AC_PROG_CPP
110 AM_PROG_CC_C_O
111 m4_CHECK_DEBUGGING
113 # Use gcc's -pipe option if available: for faster compilation.
114 case "$CFLAGS" in
115   *-pipe* ) ;;
116         * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
117                 [m4_cv_prog_compiler_pipe],
118                 [-pipe -c conftest.$ac_ext], [],
119                 [CFLAGS="$CFLAGS -pipe"])
120               ;;
121 esac
125 ## ----------------------- ##
126 ## Libtool initialisation. ##
127 ## ----------------------- ##
128 LT_PREREQ([2.0])
129 LT_INIT([shared dlopen win32-dll])
130 LT_WITH_LTDL([ltdl])
134 ## ---------------- ##
135 ## Gettext support. ##
136 ## ---------------- ##
137 AM_GNU_GETTEXT(external, need-ngettext)
138 AM_GNU_GETTEXT_VERSION(0.14.1)
139 m4_GNU_GETTEXT
143 ## --------------- ##
144 ## Gnulib support, ##
145 ## --------------- ##
146 gl_SOURCE_BASE(gnu)
147 gl_M4_BASE(ltdl/m4)
148 # We also use getopt and version-etc, but they are copied into
149 # the project tree by bootstrap since they are used only by m4 itself.
150 gl_MODULES(assert error exit free gettext mkstemp obstack progname regex stdbool strtol xalloc xalloc-die xstrndup)
151 gl_INIT
153 # Gnulib doesn't always do things quite the way M4 would like...
154 m4_ERROR
155 m4_GETOPT
156 m4_OBSTACK
157 m4_REGEX
160 ## ------------------------ ##
161 ## Other external programs. ##
162 ## ------------------------ ##
163 AC_PROG_INSTALL
164 AC_PROG_MAKE_SET
165 AC_PATH_PROG(PERL, perl)
166 AC_PROG_AWK
170 ## --------------------------- ##
171 ## C compiler characteristics. ##
172 ## --------------------------- ##
173 AM_C_PROTOTYPES
174 AC_C_CONST
175 AC_TYPE_SIZE_T
176 AC_CHECK_SIZEOF([long long int])
180 ## ------------------------- ##
181 ## C headers required by M4. ##
182 ## ------------------------- ##
183 AC_HEADER_STDC
184 AC_CHECK_HEADERS([limits.h locale.h memory.h string.h unistd.h errno.h])
185 AC_CHECK_HEADERS([signal.h sys/signal.h], break)
187 if test $ac_cv_header_stdbool_h = yes; then
188   INCLUDE_STDBOOL_H='#include <stdbool.h>'
189 else
190   INCLUDE_STDBOOL_H='#include <gnu/stdbool.h>'
192 AC_SUBST([INCLUDE_STDBOOL_H])
196 ## --------------------------------- ##
197 ## Library functions required by M4. ##
198 ## --------------------------------- ##
199 AC_CHECK_FUNCS([bzero calloc mkstemp mktemp strerror tmpfile])
200 AC_FUNC_ALLOCA
201 AC_FUNC_VPRINTF
203 AM_WITH_DMALLOC
205 m4_SYS_STACKOVF
207 # This is for the modules
208 AC_STRUCT_TM
209 AC_FUNC_STRFTIME
210 AC_CHECK_FUNCS(getcwd gethostname mktime uname)
211 AC_CHECK_FUNCS(setenv unsetenv putenv clearenv)
213 m4_LIB_GMP
214 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
218 ## -------- ##
219 ## Outputs. ##
220 ## -------- ##
221 AC_CONFIG_FILES([
222 Makefile
223 gnu/Makefile
224 m4/system.h:m4/system_.h
225 tests/atlocal
228 AC_OUTPUT