1 # Configure template for GNU m4. -*-Autoconf-*-
2 # Copyright (C) 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2004, 2005, 2006,
3 # 2007, 2008 Free Software Foundation, Inc.
5 # This file is part of GNU M4.
7 # GNU M4 is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # GNU M4 is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 dnl We depend on autotest's ./testsuite -C.
21 AC_PREREQ([2.61a.347])
23 ## ------------------------ ##
24 ## Autoconf initialization. ##
25 ## ------------------------ ##
26 AC_INIT([GNU M4], [1.9a], [bug-m4@gnu.org])
28 AC_CONFIG_SRCDIR([src/m4.h])
29 AC_CONFIG_AUX_DIR([build-aux])
30 AC_CONFIG_MACRO_DIR([ltdl/m4])
31 AC_CONFIG_LIBOBJ_DIR([gnu])
32 AC_CONFIG_TESTDIR([tests])
33 AC_CONFIG_HEADERS([gnu/config.h:gnu/config.hin])
34 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.10.1 subdir-objects dist-bzip2 dist-lzma 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])
93 LTDL_INIT([nonrecursive])
95 # The lt_dlhandle_iterate symbol was added with libtool-2.2
96 if test "x$with_included_ltdl" != "xyes"; then
98 save_LDFLAGS="$LDFLAGS"
99 CFLAGS="$CFLAGS $LTDLINCL"
100 LDFLAGS="$LDFLAGS $LIBLTDL"
101 AC_CHECK_LIB([ltdl], [lt_dlhandle_iterate],
103 [AC_MSG_ERROR([installed libltdl is too old])])
104 LDFLAGS="$save_LDFLAGS"
105 CFLAGS="$save_CFLAGS"
109 # Use gcc's -pipe option if available: for faster compilation.
112 * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
113 [M4_cv_prog_compiler_pipe],
114 [-pipe -c conftest.$ac_ext], [],
115 [CFLAGS="$CFLAGS -pipe"])
119 ## ------------------------------- ##
120 ## Preloaded module configuration. ##
121 ## ------------------------------- ##
122 AS_IF([test "x$enable_shared" != xno],
123 [DYNAMIC_MODULES=yes], [DYNAMIC_MODULES=no])
124 AC_SUBST([DYNAMIC_MODULES], [$DYNAMIC_MODULES])
126 AC_MSG_CHECKING([for modules to preload])
129 AC_ARG_WITH([modules],
130 [AS_HELP_STRING([--with-modules=MODULES],
131 [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])],
132 [use_modules="$withval"],
133 [use_modules="$M4_default_preload"])
135 PREOPEN_DEPENDENCIES=
136 DLPREOPEN="-dlpreopen force"
137 if test -z "$use_modules"; then
140 if test "$use_modules" != yes; then
141 for module in $use_modules; do
144 m4|traditional|gnu|load|mpeval) dir=modules ;;
145 import|modtest|shadow|stdlib|time) dir=tests ;;
146 *) AC_MSG_ERROR([Unrecognized module `$module' in --with-modules])
149 DLPREOPEN="$DLPREOPEN -dlpreopen $dir/$module.la"
150 PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES $dir/$module.la"
154 AC_MSG_RESULT([$use_modules])
155 AC_SUBST([DLPREOPEN])
156 AC_SUBST([PREOPEN_DEPENDENCIES])
159 ## ---------------- ##
160 ## Gettext support. ##
161 ## ---------------- ##
162 AM_GNU_GETTEXT([external], [need-formatstring-macros])
163 AM_GNU_GETTEXT_VERSION([0.16])
168 ## --------------- ##
169 ## Gnulib support. ##
170 ## --------------- ##
173 # Gnulib doesn't always do things quite the way M4 would like...
180 ## ------------------------ ##
181 ## Other external programs. ##
182 ## ------------------------ ##
183 AC_PATH_PROG([PERL], [perl])
187 ## --------------------------- ##
188 ## C compiler characteristics. ##
189 ## --------------------------- ##
191 AC_CHECK_SIZEOF([long long int])
195 ## ------------------------- ##
196 ## C headers required by M4. ##
197 ## ------------------------- ##
198 AC_CHECK_HEADERS_ONCE([limits.h sys/wait.h])
200 if test $ac_cv_header_stdbool_h = yes; then
201 INCLUDE_STDBOOL_H='#include <stdbool.h>'
203 INCLUDE_STDBOOL_H='#include <gnu/stdbool.h>'
205 AC_SUBST([INCLUDE_STDBOOL_H])
209 ## --------------------------------- ##
210 ## Library functions required by M4. ##
211 ## --------------------------------- ##
212 AC_CHECK_FUNCS_ONCE([calloc strerror])
218 # This is for the modules
221 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
222 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
225 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
235 m4/system.h:m4/system_.h