* Makefile.am (dist_pkgdata_DATA): Distribute recently-added
[m4.git] / configure.ac
blobd93146b87de25a9a0ea15e3c2d51109a15da4808
1 # Configure template for GNU m4.                        -*-Autoconf-*-
2 # Copyright (C) 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2004, 2005, 2006
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.60])
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 ## ---------------------------------------- ##
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 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 ## ------------------ ##
77 AC_PROG_CC
78 M4_EARLY
80 AC_PROG_CPP
81 AM_PROG_CC_C_O
82 M4_CHECK_DEBUGGING
86 ## ----------------------- ##
87 ## Libtool initialization. ##
88 ## ----------------------- ##
89 LT_PREREQ([2.0])
90 LT_CONFIG_LTDL_DIR([ltdl])
91 LT_INIT([shared dlopen win32-dll])
92 LT_WITH_LTDL([ltdl])
94 # Use gcc's -pipe option if available: for faster compilation.
95 case "$CFLAGS" in
96   *-pipe* ) ;;
97         * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
98                 [M4_cv_prog_compiler_pipe],
99                 [-pipe -c conftest.$ac_ext], [],
100                 [CFLAGS="$CFLAGS -pipe"])
101               ;;
102 esac
104 ## ------------------------------- ##
105 ## Preloaded module configuration. ##
106 ## ------------------------------- ##
107 AS_IF([test "x$enable_shared" != xno],
108       [DYNAMIC_MODULES=yes], [DYNAMIC_MODULES=no])
109 AC_SUBST([DYNAMIC_MODULES], [$DYNAMIC_MODULES])
111 AC_MSG_CHECKING([for modules to preload])
112   DLPREOPEN=
114   AC_ARG_WITH([modules],
115     [AS_HELP_STRING([--with-modules=MODULES],
116                     [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])],
117     [use_modules="$withval"],
118     [use_modules="$M4_default_preload"])
120   PREOPEN_DEPENDENCIES=
121   DLPREOPEN="-dlpreopen force"
122   if test -z "$use_modules"; then
123     use_modules=none
124   else
125     if test "$use_modules" != yes; then
126       for module in $use_modules; do
127         DLPREOPEN="$DLPREOPEN -dlpreopen modules/$module.la"
128         PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES modules/$module.la"
129       done
130     fi
131   fi
132 AC_MSG_RESULT([$use_modules])
133 AC_SUBST([DLPREOPEN])
134 AC_SUBST([PREOPEN_DEPENDENCIES])
137 ## ---------------- ##
138 ## Gettext support. ##
139 ## ---------------- ##
140 AM_GNU_GETTEXT([external], [need-formatstring-macros])
141 AM_GNU_GETTEXT_VERSION([0.15])
142 M4_GNU_GETTEXT
146 ## --------------- ##
147 ## Gnulib support, ##
148 ## --------------- ##
149 M4_INIT
151 # Gnulib doesn't always do things quite the way M4 would like...
152 M4_ERROR
153 M4_GETOPT
154 M4_OBSTACK
155 M4_REGEX
158 ## ------------------------ ##
159 ## Other external programs. ##
160 ## ------------------------ ##
161 AC_PATH_PROG([PERL], [perl])
165 ## --------------------------- ##
166 ## C compiler characteristics. ##
167 ## --------------------------- ##
168 AC_TYPE_SIZE_T
169 AC_CHECK_SIZEOF([long long int])
173 ## ------------------------- ##
174 ## C headers required by M4. ##
175 ## ------------------------- ##
176 AC_CHECK_HEADERS_ONCE([limits.h sys/wait.h])
178 if test $ac_cv_header_stdbool_h = yes; then
179   INCLUDE_STDBOOL_H='#include <stdbool.h>'
180 else
181   INCLUDE_STDBOOL_H='#include <gnu/stdbool.h>'
183 AC_SUBST([INCLUDE_STDBOOL_H])
187 ## --------------------------------- ##
188 ## Library functions required by M4. ##
189 ## --------------------------------- ##
190 AC_CHECK_FUNCS_ONCE([calloc strerror])
192 AM_WITH_DMALLOC
194 M4_SYS_STACKOVF
196 # This is for the modules
197 AC_STRUCT_TM
198 AC_FUNC_STRFTIME
199 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
200 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
202 M4_LIB_GMP
203 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
207 ## -------- ##
208 ## Outputs. ##
209 ## -------- ##
210 AC_CONFIG_FILES([
211 Makefile
212 gnu/Makefile
213 m4/system.h:m4/system_.h
214 tests/atlocal
217 AC_OUTPUT