Fix regression in argument collection, from 2008-01-21.
[m4/ericb.git] / configure.ac
blob589c4b1315e359e2db873b41ac00f3aca32d3641
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 ## ---------------------------------------- ##
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])
51 AB_INIT()
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 ## ------------------ ##
77 AC_PROG_CC
78 M4_EARLY
80 AC_SYS_LARGEFILE
81 AC_PROG_CPP
82 AM_PROG_CC_C_O
83 M4_CHECK_DEBUGGING
87 ## ----------------------- ##
88 ## Libtool initialization. ##
89 ## ----------------------- ##
90 LT_PREREQ([2.1b])
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
97   save_CFLAGS="$CFLAGS"
98   save_LDFLAGS="$LDFLAGS"
99   CFLAGS="$CFLAGS $LTDLINCL"
100   LDFLAGS="$LDFLAGS $LIBLTDL"
101   AC_CHECK_LIB([ltdl], [lt_dlhandle_iterate],
102              [],
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.
110 case "$CFLAGS" in
111   *-pipe* ) ;;
112         * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
113                 [M4_cv_prog_compiler_pipe],
114                 [-pipe -c conftest.$ac_ext], [],
115                 [CFLAGS="$CFLAGS -pipe"])
116               ;;
117 esac
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])
127   DLPREOPEN=
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
138     use_modules=none
139   else
140     if test "$use_modules" != yes; then
141       for module in $use_modules; do
142         case $module in
143           no|none) break ;;
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])
147             ;;
148         esac
149         DLPREOPEN="$DLPREOPEN -dlpreopen $dir/$module.la"
150         PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES $dir/$module.la"
151       done
152     fi
153   fi
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])
164 M4_GNU_GETTEXT
168 ## --------------- ##
169 ## Gnulib support. ##
170 ## --------------- ##
171 M4_INIT
173 # Gnulib doesn't always do things quite the way M4 would like...
174 M4_ERROR
175 M4_GETOPT
176 M4_OBSTACK
177 M4_REGEX
180 ## ------------------------ ##
181 ## Other external programs. ##
182 ## ------------------------ ##
183 AC_PATH_PROG([PERL], [perl])
187 ## --------------------------- ##
188 ## C compiler characteristics. ##
189 ## --------------------------- ##
190 AC_TYPE_SIZE_T
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>'
202 else
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])
214 AM_WITH_DMALLOC
216 M4_SYS_STACKOVF
218 # This is for the modules
219 AC_STRUCT_TM
220 AC_FUNC_STRFTIME
221 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
222 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
224 M4_LIB_GMP
225 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
229 ## -------- ##
230 ## Outputs. ##
231 ## -------- ##
232 AC_CONFIG_FILES([
233 Makefile
234 gnu/Makefile
235 m4/system.h:m4/system_.h
236 tests/atlocal
237 tests/gnu/Makefile
240 AC_OUTPUT