Get rid of the last 'differs in signedness' compiler warnings:
[m4/ericb.git] / configure.ac
blobb523776af8d9e5d386477dd659959dc8708e11d8
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
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_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.0])
91 LT_CONFIG_LTDL_DIR([ltdl])
92 LT_INIT([shared dlopen win32-dll])
93 LT_WITH_LTDL([ltdl])
95 # Use gcc's -pipe option if available: for faster compilation.
96 case "$CFLAGS" in
97   *-pipe* ) ;;
98         * ) _LT_COMPILER_OPTION([if $compiler supports -pipe],
99                 [M4_cv_prog_compiler_pipe],
100                 [-pipe -c conftest.$ac_ext], [],
101                 [CFLAGS="$CFLAGS -pipe"])
102               ;;
103 esac
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])
113   DLPREOPEN=
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
124     use_modules=none
125   else
126     if test "$use_modules" != yes; then
127       for module in $use_modules; do
128         case $module in
129           no|none) break ;;
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])
133             ;;
134         esac
135         DLPREOPEN="$DLPREOPEN -dlpreopen $dir/$module.la"
136         PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES $dir/$module.la"
137       done
138     fi
139   fi
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])
162 M4_GNU_GETTEXT
166 ## --------------- ##
167 ## Gnulib support. ##
168 ## --------------- ##
169 M4_INIT
171 # Gnulib doesn't always do things quite the way M4 would like...
172 M4_ERROR
173 M4_GETOPT
174 M4_OBSTACK
175 M4_REGEX
178 ## ------------------------ ##
179 ## Other external programs. ##
180 ## ------------------------ ##
181 AC_PATH_PROG([PERL], [perl])
185 ## --------------------------- ##
186 ## C compiler characteristics. ##
187 ## --------------------------- ##
188 AC_TYPE_SIZE_T
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>'
200 else
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])
212 AM_WITH_DMALLOC
214 M4_SYS_STACKOVF
216 # This is for the modules
217 AC_STRUCT_TM
218 AC_FUNC_STRFTIME
219 AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
220 AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
222 M4_LIB_GMP
223 AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
227 ## -------- ##
228 ## Outputs. ##
229 ## -------- ##
230 AC_CONFIG_FILES([
231 Makefile
232 gnu/Makefile
233 m4/system.h:m4/system_.h
234 tests/atlocal
237 AC_OUTPUT