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
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 ## ---------------------------------------- ##
41 case AC_PACKAGE_VERSION in
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])
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"
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"])
77 DLPREOPEN="-dlpreopen force"
78 if test -z "$use_modules"; then
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"
88 AC_MSG_RESULT($use_modules)
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 ## ------------------ ##
113 # Use gcc's -pipe option if available: for faster compilation.
116 * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
117 [m4_cv_prog_compiler_pipe],
118 [-pipe -c conftest.$ac_ext], [],
119 [CFLAGS="$CFLAGS -pipe"])
125 ## ----------------------- ##
126 ## Libtool initialisation. ##
127 ## ----------------------- ##
129 LT_INIT([shared dlopen win32-dll])
134 ## ---------------- ##
135 ## Gettext support. ##
136 ## ---------------- ##
137 AM_GNU_GETTEXT(external, need-ngettext)
138 AM_GNU_GETTEXT_VERSION(0.14.1)
143 ## --------------- ##
144 ## Gnulib support, ##
145 ## --------------- ##
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)
153 # Gnulib doesn't always do things quite the way M4 would like...
160 ## ------------------------ ##
161 ## Other external programs. ##
162 ## ------------------------ ##
165 AC_PATH_PROG(PERL, perl)
170 ## --------------------------- ##
171 ## C compiler characteristics. ##
172 ## --------------------------- ##
176 AC_CHECK_SIZEOF([long long int])
180 ## ------------------------- ##
181 ## C headers required by M4. ##
182 ## ------------------------- ##
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>'
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])
207 # This is for the modules
210 AC_CHECK_FUNCS(getcwd gethostname mktime uname)
211 AC_CHECK_FUNCS(setenv unsetenv putenv clearenv)
214 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
224 m4/system.h:m4/system_.h