1 # Configure template for GNU m4. -*-Autoconf-*-
2 # Copyright (C) 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2004, 2005, 2006,
3 # 2007 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 initialization. ##
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([gnu/config.h:gnu/config.hin])
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 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.
61 m4_pattern_forbid([^M4_[A-Z]])
63 AC_DEFUN([M4_DEFAULT_PRELOAD], [m4 traditional gnu])
64 M4_default_preload="M4_DEFAULT_PRELOAD"
67 ## ------------------------ ##
68 ## Automake Initialization. ##
69 ## ------------------------ ##
70 AM_INIT_AUTOMAKE([1.10a subdir-objects dist-bzip2 gnits])
74 ## ------------------ ##
75 ## C compiler checks. ##
76 ## ------------------ ##
87 ## ----------------------- ##
88 ## Libtool initialization. ##
89 ## ----------------------- ##
91 LT_CONFIG_LTDL_DIR([ltdl])
92 LT_INIT([shared dlopen win32-dll])
95 # Use gcc's -pipe option if available: for faster compilation.
98 * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
99 [M4_cv_prog_compiler_pipe],
100 [-pipe -c conftest.$ac_ext], [],
101 [CFLAGS="$CFLAGS -pipe"])
105 ## ------------------------------- ##
106 ## Preloaded module configuration. ##
107 ## ------------------------------- ##
108 AS_IF([test "x$enable_shared" != xno],
109 [DYNAMIC_MODULES=yes], [DYNAMIC_MODULES=no])
110 AC_SUBST([DYNAMIC_MODULES], [$DYNAMIC_MODULES])
112 AC_MSG_CHECKING([for modules to preload])
115 AC_ARG_WITH([modules],
116 [AS_HELP_STRING([--with-modules=MODULES],
117 [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])],
118 [use_modules="$withval"],
119 [use_modules="$M4_default_preload"])
121 PREOPEN_DEPENDENCIES=
122 DLPREOPEN="-dlpreopen force"
123 if test -z "$use_modules"; then
126 if test "$use_modules" != yes; then
127 for module in $use_modules; do
130 m4|traditional|gnu|load|mpeval) dir=modules ;;
131 import|modtest|shadow|stdlib|time) dir=tests ;;
132 *) AC_MSG_ERROR([Unrecognized module `$module' in --with-modules])
135 DLPREOPEN="$DLPREOPEN -dlpreopen $dir/$module.la"
136 PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES $dir/$module.la"
140 AC_MSG_RESULT([$use_modules])
141 AC_SUBST([DLPREOPEN])
142 AC_SUBST([PREOPEN_DEPENDENCIES])
145 ## ---------------- ##
146 ## Gettext support. ##
147 ## ---------------- ##
148 dnl M4 1.4.4 and earlier had a bug that tracing a macro made it falsely
149 dnl appear as defined with an empty definition, even though `invoking'
150 dnl the macro resulted in the macro name. Gettext relies on whether
151 dnl AM_GNU_GETTEXT_INTL_SUBDIR is defined, and automake traces this
152 dnl macro, but we don't want to use an intl subdir, hence this workaround
153 dnl to allow bootstrapping even on systems with old M4.
154 dnl http://lists.gnu.org/archive/html/bug-gnu-utils/2006-11/msg00096.html
155 m4_ifdef([AM_GNU_GETTEXT_INTL_SUBDIR],
156 [m4_if(m4_defn([AM_GNU_GETTEXT_INTL_SUBDIR]),[],
157 [m4_ifval(AM_GNU_GETTEXT_INTL_SUBDIR,
158 [m4_popdef([AM_GNU_GETTEXT_INTL_SUBDIR])])])])
160 AM_GNU_GETTEXT([external], [need-formatstring-macros])
161 AM_GNU_GETTEXT_VERSION([0.16])
166 ## --------------- ##
167 ## Gnulib support. ##
168 ## --------------- ##
171 # Gnulib doesn't always do things quite the way M4 would like...
178 ## ------------------------ ##
179 ## Other external programs. ##
180 ## ------------------------ ##
181 AC_PATH_PROG([PERL], [perl])
185 ## --------------------------- ##
186 ## C compiler characteristics. ##
187 ## --------------------------- ##
189 AC_CHECK_SIZEOF([long long int])
193 ## ------------------------- ##
194 ## C headers required by M4. ##
195 ## ------------------------- ##
196 AC_CHECK_HEADERS_ONCE([limits.h sys/wait.h])
198 if test $ac_cv_header_stdbool_h = yes; then
199 INCLUDE_STDBOOL_H='#include <stdbool.h>'
201 INCLUDE_STDBOOL_H='#include <gnu/stdbool.h>'
203 AC_SUBST([INCLUDE_STDBOOL_H])
207 ## --------------------------------- ##
208 ## Library functions required by M4. ##
209 ## --------------------------------- ##
210 AC_CHECK_FUNCS_ONCE([calloc strerror])
216 # This is for the modules
219 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
220 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
223 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
233 m4/system.h:m4/system_.h