Also reject ' and newline from AC_INIT strings.
[autoconf.git] / lib / autoconf / general.m4
blob8e9c8cf119ce36fbadb0ca50179784e1d89febd8
1 # This file is part of Autoconf.                       -*- Autoconf -*-
2 # Parameterized macros.
3 m4_define([_AC_COPYRIGHT_YEARS], [
4 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
5 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
6 Foundation, Inc.
7 ])
9 # This file is part of Autoconf.  This program is free
10 # software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the
12 # Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
20 # Under Section 7 of GPL version 3, you are granted additional
21 # permissions described in the Autoconf Configure Script Exception,
22 # version 3.0, as published by the Free Software Foundation.
24 # You should have received a copy of the GNU General Public License
25 # and a copy of the Autoconf Configure Script Exception along with
26 # this program; see the files COPYINGv3 and COPYING.EXCEPTION
27 # respectively.  If not, see <http://www.gnu.org/licenses/>.
29 # Written by David MacKenzie, with help from
30 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
31 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
34 ## ---------------- ##
35 ## The diversions.  ##
36 ## ---------------- ##
39 # We heavily use m4's diversions both for the initializations and for
40 # required macros (see AC_REQUIRE), because in both cases we have to
41 # issue high in `configure' something which is discovered late.
43 # KILL is only used to suppress output.
45 # The layers of `configure'.  We let m4 undivert them by itself, when
46 # it reaches the end of `configure.ac'.
48 # - BINSH
49 #   #! /bin/sh
50 # - HEADER-REVISION
51 #   Sent by AC_REVISION
52 # - HEADER-COMMENT
53 #   Purpose of the script.
54 # - HEADER-COPYRIGHT
55 #   Copyright notice(s)
56 # - M4SH-INIT
57 #   Initialization of bottom layers.
59 # - DEFAULTS
60 #   early initializations (defaults)
61 # - PARSE_ARGS
62 #   initialization code, option handling loop.
64 # - HELP_BEGIN
65 #   Handling `configure --help'.
66 # - HELP_CANON
67 #   Help msg for AC_CANONICAL_*
68 # - HELP_ENABLE
69 #   Help msg from AC_ARG_ENABLE.
70 # - HELP_WITH
71 #   Help msg from AC_ARG_WITH.
72 # - HELP_VAR
73 #   Help msg from AC_ARG_VAR.
74 # - HELP_VAR_END
75 #   A small paragraph on the use of the variables.
76 # - HELP_END
77 #   Tail of the handling of --help.
79 # - VERSION_BEGIN
80 #   Head of the handling of --version.
81 # - VERSION_FSF
82 #   FSF copyright notice for --version.
83 # - VERSION_USER
84 #   User copyright notice for --version.
85 # - VERSION_END
86 #   Tail of the handling of --version.
88 # - SHELL_FN
89 #   Shell functions.
91 # - INIT_PREPARE
92 #   Tail of initialization code.
94 # - BODY
95 #   the tests and output code
99 # _m4_divert(DIVERSION-NAME)
100 # --------------------------
101 # Convert a diversion name into its number.  Otherwise, return
102 # DIVERSION-NAME which is supposed to be an actual diversion number.
103 # Of course it would be nicer to use m4_case here, instead of zillions
104 # of little macros, but it then takes twice longer to run `autoconf'!
106 # From M4sugar:
107 #    -1. KILL
108 # 10000. GROW
110 # From M4sh:
111 #    0. BINSH
112 #    1. HEADER-REVISION
113 #    2. HEADER-COMMENT
114 #    3. HEADER-COPYRIGHT
115 #    4. M4SH-INIT
116 # 1000. BODY
117 m4_define([_m4_divert(DEFAULTS)],        10)
118 m4_define([_m4_divert(PARSE_ARGS)],      20)
120 m4_define([_m4_divert(HELP_BEGIN)],     100)
121 m4_define([_m4_divert(HELP_CANON)],     101)
122 m4_define([_m4_divert(HELP_ENABLE)],    102)
123 m4_define([_m4_divert(HELP_WITH)],      103)
124 m4_define([_m4_divert(HELP_VAR)],       104)
125 m4_define([_m4_divert(HELP_VAR_END)],   105)
126 m4_define([_m4_divert(HELP_END)],       106)
128 m4_define([_m4_divert(VERSION_BEGIN)],  200)
129 m4_define([_m4_divert(VERSION_FSF)],    201)
130 m4_define([_m4_divert(VERSION_USER)],   202)
131 m4_define([_m4_divert(VERSION_END)],    203)
133 m4_define([_m4_divert(SHELL_FN)],       250)
135 m4_define([_m4_divert(INIT_PREPARE)],   300)
139 # AC_DIVERT_PUSH(DIVERSION-NAME)
140 # AC_DIVERT_POP
141 # ------------------------------
142 m4_copy([m4_divert_push],[AC_DIVERT_PUSH])
143 m4_copy([m4_divert_pop], [AC_DIVERT_POP])
147 ## ------------------------------------ ##
148 ## Defining/requiring Autoconf macros.  ##
149 ## ------------------------------------ ##
152 # AC_DEFUN(NAME, EXPANSION)
153 # AC_DEFUN_ONCE(NAME, EXPANSION)
154 # AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
155 # AC_REQUIRE(STRING)
156 # AC_PROVIDE(MACRO-NAME)
157 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
158 # -----------------------------------------------------------
159 m4_copy([m4_defun],       [AC_DEFUN])
160 m4_copy([m4_defun_once],  [AC_DEFUN_ONCE])
161 m4_copy([m4_before],      [AC_BEFORE])
162 m4_copy([m4_require],     [AC_REQUIRE])
163 m4_copy([m4_provide],     [AC_PROVIDE])
164 m4_copy([m4_provide_if],  [AC_PROVIDE_IFELSE])
167 # AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION])
168 # ------------------------------------------
169 m4_define([AC_OBSOLETE],
170 [AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
174 ## ----------------------------- ##
175 ## Implementing shell functions. ##
176 ## ----------------------------- ##
179 # AC_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY, [DIVERSION = SHELL_FN]
180 # ------------------------------------------------------------------------
181 # Same as AS_REQUIRE_SHELL_FN except that the default diversion comes
182 # later in the script (speeding up configure --help and --version).
183 AC_DEFUN([AC_REQUIRE_SHELL_FN],
184 [AS_REQUIRE_SHELL_FN([$1], [$2], [$3], m4_default_quoted([$4], [SHELL_FN]))])
188 ## ----------------------------- ##
189 ## Implementing Autoconf loops.  ##
190 ## ----------------------------- ##
193 # AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION)
194 # ------------------------------------------
195 AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]])
196 AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnl
197 AC_DIAGNOSE([obsolete], [The macro `AC_FOREACH' is obsolete.
198 You should run autoupdate.])])
202 ## ----------------------------------- ##
203 ## Helping macros to display strings.  ##
204 ## ----------------------------------- ##
207 # AU::AC_HELP_STRING(LHS, RHS, [COLUMN])
208 # --------------------------------------
209 AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])
213 ## ---------------------------------------------- ##
214 ## Information on the package being Autoconf'ed.  ##
215 ## ---------------------------------------------- ##
218 # It is suggested that the macros in this section appear before
219 # AC_INIT in `configure.ac'.  Nevertheless, this is just stylistic,
220 # and from the implementation point of view, AC_INIT *must* be expanded
221 # beforehand: it puts data in diversions which must appear before the
222 # data provided by the macros of this section.
224 # The solution is to require AC_INIT in each of these macros.  AC_INIT
225 # has the needed magic so that it can't be expanded twice.
227 # _AC_INIT_LITERAL(STRING)
228 # ------------------------
229 # Reject STRING if it contains newline, or if it cannot be used as-is
230 # in single-quoted strings, double-quoted strings, and quoted and
231 # unquoted here-docs.
232 m4_define([_AC_INIT_LITERAL],
233 [m4_if(m4_index(m4_translit([[$1]], [
234 ""], ['']), ['])AS_LITERAL_HEREDOC_IF([$1], [-]), [-1-], [],
235   [m4_warn([syntax], [AC_INIT: not a literal: $1])])])
237 # _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
238 # ---------------------------------------------------------------------
239 m4_define([_AC_INIT_PACKAGE],
240 [_AC_INIT_LITERAL([$1])
241 _AC_INIT_LITERAL([$2])
242 AS_LITERAL_IF([$3], [],  [m4_warn([syntax], [AC_INIT: not a literal: $3])])
243 m4_ifndef([AC_PACKAGE_NAME],
244           [m4_define([AC_PACKAGE_NAME],     [$1])])
245 m4_ifndef([AC_PACKAGE_TARNAME],
246           [m4_define([AC_PACKAGE_TARNAME],
247                      m4_default([$4],
248                                 [m4_bpatsubst(m4_tolower(m4_bpatsubst([[$1]],
249                                                                      [GNU ])),
250                                  [[^_abcdefghijklmnopqrstuvwxyz0123456789]],
251                                  [-])]))])
252 m4_ifndef([AC_PACKAGE_VERSION],
253           [m4_define([AC_PACKAGE_VERSION],   [$2])])
254 m4_ifndef([AC_PACKAGE_STRING],
255           [m4_define([AC_PACKAGE_STRING],    [$1 $2])])
256 m4_ifndef([AC_PACKAGE_BUGREPORT],
257           [m4_define([AC_PACKAGE_BUGREPORT], [$3])])
258 m4_ifndef([AC_PACKAGE_URL],
259           [m4_define([AC_PACKAGE_URL],
260   m4_if([$5], [], [m4_if(m4_index([$1], [GNU ]), [0],
261           [[http://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]])],
262         [[$5]]))])
266 # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER],
267 #              [FILTER = m4_newline])
268 # ------------------------------------------------------
269 # Emit TEXT, a copyright notice, in the top of `configure' and in
270 # --version output.  Macros in TEXT are evaluated once.  Process
271 # the --version output through FILTER (m4_newline, m4_do, and
272 # m4_copyright_condense are common filters).
273 m4_define([AC_COPYRIGHT],
274 [AS_COPYRIGHT([$1])[]]dnl
275 [m4_divert_text(m4_default_quoted([$2], [VERSION_USER]),
276 [m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT
279 # AC_REVISION(REVISION-INFO)
280 # --------------------------
281 # The second quote in the translit is just to cope with font-lock-mode
282 # which sees the opening of a string.
283 m4_define([AC_REVISION],
284 [m4_divert_text([HEADER-REVISION],
285                 [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
291 ## ---------------------------------------- ##
292 ## Requirements over the Autoconf version.  ##
293 ## ---------------------------------------- ##
296 # AU::AC_PREREQ(VERSION)
297 # ----------------------
298 # Update this `AC_PREREQ' statement to require the current version of
299 # Autoconf.  But fail if ever this autoupdate is too old.
301 # Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before
302 # calling `AU_DEFUN', i.e., it is hard coded.  Otherwise it would be
303 # quite complex for autoupdate to import the value of
304 # `m4_PACKAGE_VERSION'.  We could `AU_DEFUN' `m4_PACKAGE_VERSION', but
305 # this would replace all its occurrences with the current version of
306 # Autoconf, which is certainly not what the user intended.
307 AU_DEFUN([AC_PREREQ],
308 [m4_version_prereq([$1])[]dnl
309 [AC_PREREQ(]]m4_dquote(m4_dquote(m4_defn([m4_PACKAGE_VERSION])))[[)]])
312 # AC_PREREQ(VERSION)
313 # ------------------
314 # Complain and exit if the Autoconf version is less than VERSION.
315 m4_undefine([AC_PREREQ])
316 m4_copy([m4_version_prereq], [AC_PREREQ])
319 # AC_AUTOCONF_VERSION
320 # -------------------
321 # The current version of Autoconf parsing this file.
322 m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])
328 ## ---------------- ##
329 ## Initialization.  ##
330 ## ---------------- ##
333 # All the following macros are used by AC_INIT.  Ideally, they should
334 # be presented in the order in which they are output.  Please, help us
335 # sorting it, or at least, don't augment the entropy.
338 # _AC_INIT_NOTICE
339 # ---------------
340 # Provide useful headers; override the HEADER-COMMENT created by M4sh.
341 m4_define([_AC_INIT_NOTICE],
342 [m4_cleardivert([HEADER-COMMENT])]dnl
343 [m4_divert_text([HEADER-COMMENT],
344 [@%:@ Guess values for system-dependent variables and create Makefiles.
345 @%:@ Generated by m4_PACKAGE_STRING[]dnl
346 m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
348 m4_ifset([AC_PACKAGE_BUGREPORT],
349          [m4_divert_text([HEADER-COMMENT],
350                          [@%:@
351 @%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
355 # _AC_INIT_COPYRIGHT
356 # ------------------
357 # We dump to VERSION_FSF to make sure we are inserted before the
358 # user copyrights, and after the setup of the --version handling.
359 m4_define([_AC_INIT_COPYRIGHT],
360 [AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [
361 m4_copyright_condense])dnl
362 AC_COPYRIGHT(
363 [This configure script is free software; the Free Software Foundation
364 gives unlimited permission to copy, distribute and modify it.],
365              [VERSION_FSF], [m4_echo])])
368 # File Descriptors
369 # ----------------
370 # Set up the file descriptors used by `configure'.
371 # File descriptor usage:
372 # 0 standard input (/dev/null)
373 # 1 file creation
374 # 2 errors and warnings
375 # AS_MESSAGE_LOG_FD compiler messages saved in config.log
376 # AS_MESSAGE_FD checking for... messages and results
377 # AS_ORIGINAL_STDIN_FD original standard input (still open)
379 # stdin is /dev/null because checks that run programs may
380 # inadvertently run interactive ones, which would stop configuration
381 # until someone typed an EOF.
382 m4_define([AS_MESSAGE_FD], 6)
383 m4_define([AS_ORIGINAL_STDIN_FD], 7)
384 # That's how they used to be named.
385 AU_ALIAS([AC_FD_CC],  [AS_MESSAGE_LOG_FD])
386 AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
389 # _AC_INIT_DEFAULTS
390 # -----------------
391 # Values which defaults can be set from `configure.ac'.
392 # `/bin/machine' is used in `glibcbug'.  The others are used in config.*
393 m4_define([_AC_INIT_DEFAULTS],
394 [m4_divert_push([DEFAULTS])dnl
396 test -n "$DJDIR" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null
397 exec AS_MESSAGE_FD>&1
399 # Name of the host.
400 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
401 # so uname gets run too.
402 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
405 # Initializations.
407 ac_default_prefix=/usr/local
408 ac_clean_files=
409 ac_config_libobj_dir=.
410 LIB@&t@OBJS=
411 cross_compiling=no
412 subdirs=
413 MFLAGS=
414 MAKEFLAGS=
415 AC_SUBST([SHELL])dnl
416 AC_SUBST([PATH_SEPARATOR])dnl
418 # Identity of this package.
419 AC_SUBST([PACKAGE_NAME],
420          [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])dnl
421 AC_SUBST([PACKAGE_TARNAME],
422          [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
423 AC_SUBST([PACKAGE_VERSION],
424          [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
425 AC_SUBST([PACKAGE_STRING],
426          [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
427 AC_SUBST([PACKAGE_BUGREPORT],
428          [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
429 AC_SUBST([PACKAGE_URL],
430          [m4_ifdef([AC_PACKAGE_URL],       ['AC_PACKAGE_URL'])])dnl
432 m4_divert_pop([DEFAULTS])dnl
433 m4_wrap_lifo([m4_divert_text([DEFAULTS],
434 [ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)'
435 ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
436 ac_user_opts='
437 enable_option_checking
438 m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS])
440 m4_ifdef([_AC_PRECIOUS_VARS],
441   [_AC_ARG_VAR_STORE[]dnl
442    _AC_ARG_VAR_VALIDATE[]dnl
443    ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])'])
444 m4_ifdef([_AC_LIST_SUBDIRS],
445   [ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl
446 ])])dnl
447 ])# _AC_INIT_DEFAULTS
450 # AC_PREFIX_DEFAULT(PREFIX)
451 # -------------------------
452 AC_DEFUN([AC_PREFIX_DEFAULT],
453 [m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
456 # AC_PREFIX_PROGRAM(PROGRAM)
457 # --------------------------
458 # Guess the value for the `prefix' variable by looking for
459 # the argument program along PATH and taking its parent.
460 # Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
461 # set `prefix' to /usr/local/gnu.
462 # This comes too late to find a site file based on the prefix,
463 # and it might use a cached value for the path.
464 # No big loss, I think, since most configures don't use this macro anyway.
465 AC_DEFUN([AC_PREFIX_PROGRAM],
466 [if test "x$prefix" = xNONE; then
467 dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
468   _AS_ECHO_N([checking for prefix by ])
469   AC_PATH_PROG(ac_prefix_program, [$1])
470   if test -n "$ac_prefix_program"; then
471     prefix=`AS_DIRNAME(["$ac_prefix_program"])`
472     prefix=`AS_DIRNAME(["$prefix"])`
473   fi
475 ])# AC_PREFIX_PROGRAM
478 # AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
479 # ---------------------------------------------
480 # UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package,
481 # relative to the directory that configure is in, which we can look
482 # for to find out if srcdir is correct.
483 AC_DEFUN([AC_CONFIG_SRCDIR],
484 [m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
487 # _AC_INIT_DIRCHECK
488 # -----------------
489 # Set ac_pwd, and sanity-check it and the source and installation directories.
491 # (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
493 AC_DEFUN([_AC_INIT_DIRCHECK],
494 [m4_divert_push([PARSE_ARGS])dnl
496 ac_pwd=`pwd` && test -n "$ac_pwd" &&
497 ac_ls_di=`ls -di .` &&
498 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
499   AC_MSG_ERROR([working directory cannot be determined])
500 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
501   AC_MSG_ERROR([pwd does not report name of working directory])
503 m4_divert_pop([PARSE_ARGS])dnl
504 ])# _AC_INIT_DIRCHECK
506 # _AC_INIT_SRCDIR
507 # ---------------
508 # Compute `srcdir' based on `$ac_unique_file'.
510 # (We have to AC_DEFUN it, since we use AC_REQUIRE.)
512 AC_DEFUN([_AC_INIT_SRCDIR],
513 [AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
514 m4_divert_push([PARSE_ARGS])dnl
516 # Find the source files, if location was not specified.
517 if test -z "$srcdir"; then
518   ac_srcdir_defaulted=yes
519   # Try the directory containing this script, then the parent directory.
520   ac_confdir=`AS_DIRNAME(["$as_myself"])`
521   srcdir=$ac_confdir
522   if test ! -r "$srcdir/$ac_unique_file"; then
523     srcdir=..
524   fi
525 else
526   ac_srcdir_defaulted=no
528 if test ! -r "$srcdir/$ac_unique_file"; then
529   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
530   AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
532 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
533 ac_abs_confdir=`(
534         cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
535         pwd)`
536 # When building in place, set srcdir=.
537 if test "$ac_abs_confdir" = "$ac_pwd"; then
538   srcdir=.
540 # Remove unnecessary trailing slashes from srcdir.
541 # Double slashes in file names in object file debugging info
542 # mess up M-x gdb in Emacs.
543 case $srcdir in
544 */) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
545 esac
546 m4_divert_pop([PARSE_ARGS])dnl
547 ])# _AC_INIT_SRCDIR
550 # _AC_INIT_PARSE_ARGS
551 # -------------------
552 m4_define([_AC_INIT_PARSE_ARGS],
553 [m4_divert_push([PARSE_ARGS])dnl
555 # Initialize some variables set by options.
556 ac_init_help=
557 ac_init_version=false
558 ac_unrecognized_opts=
559 ac_unrecognized_sep=
560 # The variables have the same names as the options, with
561 # dashes changed to underlines.
562 cache_file=/dev/null
563 AC_SUBST(exec_prefix, NONE)dnl
564 no_create=
565 no_recursion=
566 AC_SUBST(prefix, NONE)dnl
567 program_prefix=NONE
568 program_suffix=NONE
569 AC_SUBST(program_transform_name, [s,x,x,])dnl
570 silent=
571 site=
572 srcdir=
573 verbose=
574 x_includes=NONE
575 x_libraries=NONE
577 # Installation directory options.
578 # These are left unexpanded so users can "make install exec_prefix=/foo"
579 # and all the variables that are supposed to be based on exec_prefix
580 # by default will actually change.
581 # Use braces instead of parens because sh, perl, etc. also accept them.
582 # (The list follows the same order as the GNU Coding Standards.)
583 AC_SUBST([bindir],         ['${exec_prefix}/bin'])dnl
584 AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
585 AC_SUBST([libexecdir],     ['${exec_prefix}/libexec'])dnl
586 AC_SUBST([datarootdir],    ['${prefix}/share'])dnl
587 AC_SUBST([datadir],        ['${datarootdir}'])dnl
588 AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
589 AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
590 AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
591 AC_SUBST([includedir],     ['${prefix}/include'])dnl
592 AC_SUBST([oldincludedir],  ['/usr/include'])dnl
593 AC_SUBST([docdir],         [m4_ifset([AC_PACKAGE_TARNAME],
594                                      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
595                                      ['${datarootdir}/doc/${PACKAGE}'])])dnl
596 AC_SUBST([infodir],        ['${datarootdir}/info'])dnl
597 AC_SUBST([htmldir],        ['${docdir}'])dnl
598 AC_SUBST([dvidir],         ['${docdir}'])dnl
599 AC_SUBST([pdfdir],         ['${docdir}'])dnl
600 AC_SUBST([psdir],          ['${docdir}'])dnl
601 AC_SUBST([libdir],         ['${exec_prefix}/lib'])dnl
602 AC_SUBST([localedir],      ['${datarootdir}/locale'])dnl
603 AC_SUBST([mandir],         ['${datarootdir}/man'])dnl
605 ac_prev=
606 ac_dashdash=
607 for ac_option
609   # If the previous option needs an argument, assign it.
610   if test -n "$ac_prev"; then
611     eval $ac_prev=\$ac_option
612     ac_prev=
613     continue
614   fi
616   case $ac_option in
617   *=?*) ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;;
618   *=)   ac_optarg= ;;
619   *)    ac_optarg=yes ;;
620   esac
622   # Accept the important Cygnus configure options, so we can diagnose typos.
624   case $ac_dashdash$ac_option in
625   --)
626     ac_dashdash=yes ;;
628   -bindir | --bindir | --bindi | --bind | --bin | --bi)
629     ac_prev=bindir ;;
630   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
631     bindir=$ac_optarg ;;
633   -build | --build | --buil | --bui | --bu)
634     ac_prev=build_alias ;;
635   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
636     build_alias=$ac_optarg ;;
638   -cache-file | --cache-file | --cache-fil | --cache-fi \
639   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
640     ac_prev=cache_file ;;
641   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
642   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
643     cache_file=$ac_optarg ;;
645   --config-cache | -C)
646     cache_file=config.cache ;;
648   -datadir | --datadir | --datadi | --datad)
649     ac_prev=datadir ;;
650   -datadir=* | --datadir=* | --datadi=* | --datad=*)
651     datadir=$ac_optarg ;;
653   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
654   | --dataroo | --dataro | --datar)
655     ac_prev=datarootdir ;;
656   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
657   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
658     datarootdir=$ac_optarg ;;
660   _AC_INIT_PARSE_ENABLE([disable])
662   -docdir | --docdir | --docdi | --doc | --do)
663     ac_prev=docdir ;;
664   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
665     docdir=$ac_optarg ;;
667   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
668     ac_prev=dvidir ;;
669   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
670     dvidir=$ac_optarg ;;
672   _AC_INIT_PARSE_ENABLE([enable])
674   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
675   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
676   | --exec | --exe | --ex)
677     ac_prev=exec_prefix ;;
678   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
679   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
680   | --exec=* | --exe=* | --ex=*)
681     exec_prefix=$ac_optarg ;;
683   -gas | --gas | --ga | --g)
684     # Obsolete; use --with-gas.
685     with_gas=yes ;;
687   -help | --help | --hel | --he | -h)
688     ac_init_help=long ;;
689   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
690     ac_init_help=recursive ;;
691   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
692     ac_init_help=short ;;
694   -host | --host | --hos | --ho)
695     ac_prev=host_alias ;;
696   -host=* | --host=* | --hos=* | --ho=*)
697     host_alias=$ac_optarg ;;
699   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
700     ac_prev=htmldir ;;
701   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
702   | --ht=*)
703     htmldir=$ac_optarg ;;
705   -includedir | --includedir | --includedi | --included | --include \
706   | --includ | --inclu | --incl | --inc)
707     ac_prev=includedir ;;
708   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
709   | --includ=* | --inclu=* | --incl=* | --inc=*)
710     includedir=$ac_optarg ;;
712   -infodir | --infodir | --infodi | --infod | --info | --inf)
713     ac_prev=infodir ;;
714   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
715     infodir=$ac_optarg ;;
717   -libdir | --libdir | --libdi | --libd)
718     ac_prev=libdir ;;
719   -libdir=* | --libdir=* | --libdi=* | --libd=*)
720     libdir=$ac_optarg ;;
722   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
723   | --libexe | --libex | --libe)
724     ac_prev=libexecdir ;;
725   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
726   | --libexe=* | --libex=* | --libe=*)
727     libexecdir=$ac_optarg ;;
729   -localedir | --localedir | --localedi | --localed | --locale)
730     ac_prev=localedir ;;
731   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
732     localedir=$ac_optarg ;;
734   -localstatedir | --localstatedir | --localstatedi | --localstated \
735   | --localstate | --localstat | --localsta | --localst | --locals)
736     ac_prev=localstatedir ;;
737   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
738   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
739     localstatedir=$ac_optarg ;;
741   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
742     ac_prev=mandir ;;
743   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
744     mandir=$ac_optarg ;;
746   -nfp | --nfp | --nf)
747     # Obsolete; use --without-fp.
748     with_fp=no ;;
750   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
751   | --no-cr | --no-c | -n)
752     no_create=yes ;;
754   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
755   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
756     no_recursion=yes ;;
758   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
759   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
760   | --oldin | --oldi | --old | --ol | --o)
761     ac_prev=oldincludedir ;;
762   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
763   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
764   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
765     oldincludedir=$ac_optarg ;;
767   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
768     ac_prev=prefix ;;
769   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
770     prefix=$ac_optarg ;;
772   -program-prefix | --program-prefix | --program-prefi | --program-pref \
773   | --program-pre | --program-pr | --program-p)
774     ac_prev=program_prefix ;;
775   -program-prefix=* | --program-prefix=* | --program-prefi=* \
776   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
777     program_prefix=$ac_optarg ;;
779   -program-suffix | --program-suffix | --program-suffi | --program-suff \
780   | --program-suf | --program-su | --program-s)
781     ac_prev=program_suffix ;;
782   -program-suffix=* | --program-suffix=* | --program-suffi=* \
783   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
784     program_suffix=$ac_optarg ;;
786   -program-transform-name | --program-transform-name \
787   | --program-transform-nam | --program-transform-na \
788   | --program-transform-n | --program-transform- \
789   | --program-transform | --program-transfor \
790   | --program-transfo | --program-transf \
791   | --program-trans | --program-tran \
792   | --progr-tra | --program-tr | --program-t)
793     ac_prev=program_transform_name ;;
794   -program-transform-name=* | --program-transform-name=* \
795   | --program-transform-nam=* | --program-transform-na=* \
796   | --program-transform-n=* | --program-transform-=* \
797   | --program-transform=* | --program-transfor=* \
798   | --program-transfo=* | --program-transf=* \
799   | --program-trans=* | --program-tran=* \
800   | --progr-tra=* | --program-tr=* | --program-t=*)
801     program_transform_name=$ac_optarg ;;
803   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
804     ac_prev=pdfdir ;;
805   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
806     pdfdir=$ac_optarg ;;
808   -psdir | --psdir | --psdi | --psd | --ps)
809     ac_prev=psdir ;;
810   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
811     psdir=$ac_optarg ;;
813   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
814   | -silent | --silent | --silen | --sile | --sil)
815     silent=yes ;;
817   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
818     ac_prev=sbindir ;;
819   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
820   | --sbi=* | --sb=*)
821     sbindir=$ac_optarg ;;
823   -sharedstatedir | --sharedstatedir | --sharedstatedi \
824   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
825   | --sharedst | --shareds | --shared | --share | --shar \
826   | --sha | --sh)
827     ac_prev=sharedstatedir ;;
828   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
829   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
830   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
831   | --sha=* | --sh=*)
832     sharedstatedir=$ac_optarg ;;
834   -site | --site | --sit)
835     ac_prev=site ;;
836   -site=* | --site=* | --sit=*)
837     site=$ac_optarg ;;
839   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
840     ac_prev=srcdir ;;
841   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
842     srcdir=$ac_optarg ;;
844   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
845   | --syscon | --sysco | --sysc | --sys | --sy)
846     ac_prev=sysconfdir ;;
847   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
848   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
849     sysconfdir=$ac_optarg ;;
851   -target | --target | --targe | --targ | --tar | --ta | --t)
852     ac_prev=target_alias ;;
853   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
854     target_alias=$ac_optarg ;;
856   -v | -verbose | --verbose | --verbos | --verbo | --verb)
857     verbose=yes ;;
859   -version | --version | --versio | --versi | --vers | -V)
860     ac_init_version=: ;;
862   _AC_INIT_PARSE_ENABLE([with])
864   _AC_INIT_PARSE_ENABLE([without])
866   --x)
867     # Obsolete; use --with-x.
868     with_x=yes ;;
870   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
871   | --x-incl | --x-inc | --x-in | --x-i)
872     ac_prev=x_includes ;;
873   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
874   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
875     x_includes=$ac_optarg ;;
877   -x-libraries | --x-libraries | --x-librarie | --x-librari \
878   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
879     ac_prev=x_libraries ;;
880   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
881   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
882     x_libraries=$ac_optarg ;;
884   -*) AC_MSG_ERROR([unrecognized option: `$ac_option'
885 Try `$[0] --help' for more information])
886     ;;
888   *=*)
889     ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
890     # Reject names that are not valid shell variable names.
891     case $ac_envvar in #(
892       '' | [[0-9]]* | *[[!_$as_cr_alnum]]* )
893       AC_MSG_ERROR([invalid variable name: `$ac_envvar']) ;;
894     esac
895     eval $ac_envvar=\$ac_optarg
896     export $ac_envvar ;;
898   *)
899     # FIXME: should be removed in autoconf 3.0.
900     AC_MSG_WARN([you should use --build, --host, --target])
901     expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
902       AC_MSG_WARN([invalid host type: $ac_option])
903     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
904     ;;
906   esac
907 done
909 if test -n "$ac_prev"; then
910   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
911   AC_MSG_ERROR([missing argument to $ac_option])
914 if test -n "$ac_unrecognized_opts"; then
915   case $enable_option_checking in
916     no) ;;
917     fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
918     *)     AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;
919   esac
922 # Check all directory arguments for consistency.
923 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
924                 datadir sysconfdir sharedstatedir localstatedir includedir \
925                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
926                 libdir localedir mandir
928   eval ac_val=\$$ac_var
929   # Remove trailing slashes.
930   case $ac_val in
931     */ )
932       ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'`
933       eval $ac_var=\$ac_val;;
934   esac
935   # Be sure to have absolute directory names.
936   case $ac_val in
937     [[\\/$]]* | ?:[[\\/]]* )  continue;;
938     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
939   esac
940   AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val])
941 done
943 # There might be people who depend on the old broken behavior: `$host'
944 # used to hold the argument of --host etc.
945 # FIXME: To remove some day.
946 build=$build_alias
947 host=$host_alias
948 target=$target_alias
950 # FIXME: To remove some day.
951 if test "x$host_alias" != x; then
952   if test "x$build_alias" = x; then
953     cross_compiling=maybe
954     AC_MSG_WARN([if you wanted to set the --build type, don't use --host.
955     If a cross compiler is detected then cross compile mode will be used])
956   elif test "x$build_alias" != "x$host_alias"; then
957     cross_compiling=yes
958   fi
961 ac_tool_prefix=
962 test -n "$host_alias" && ac_tool_prefix=$host_alias-
964 test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
966 m4_divert_pop([PARSE_ARGS])dnl
967 ])# _AC_INIT_PARSE_ARGS
970 # _AC_INIT_PARSE_ENABLE(OPTION-NAME)
971 # ----------------------------------
972 # A trivial front-end for _AC_INIT_PARSE_ENABLE2.
974 m4_define([_AC_INIT_PARSE_ENABLE],
975 [m4_bmatch([$1], [^with],
976            [_AC_INIT_PARSE_ENABLE2([$1], [with])],
977            [_AC_INIT_PARSE_ENABLE2([$1], [enable])])])
980 # _AC_INIT_PARSE_ENABLE2(OPTION-NAME, POSITIVE-NAME)
981 # --------------------------------------------------
982 # Handle an `--enable' or a `--with' option.
984 # OPTION-NAME is `enable', `disable', `with', or `without'.
985 # POSITIVE-NAME is the corresponding positive variant, i.e. `enable' or `with'.
987 # Positive variant of the option is recognized by the condition
988 #       OPTION-NAME == POSITIVE-NAME .
990 m4_define([_AC_INIT_PARSE_ENABLE2],
991 [-$1-* | --$1-*)
992     ac_useropt=`expr "x$ac_option" : 'x-*$1-\(m4_if([$1], [$2], [[[^=]]], [.])*\)'`
993     # Reject names that are not valid shell variable names.
994     expr "x$ac_useropt" : "[.*[^-+._$as_cr_alnum]]" >/dev/null &&
995       AC_MSG_ERROR(
996         [invalid ]m4_if([$2], [with], [package], [feature])[ name: $ac_useropt])
997     ac_useropt_orig=$ac_useropt
998     ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-+.]]/_/g'`
999     case $ac_user_opts in
1000       *"
1001 "$2_$ac_useropt"
1002 "*) ;;
1003       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt_orig"
1004          ac_unrecognized_sep=', ';;
1005     esac
1006     eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl
1010 # _AC_INIT_HELP
1011 # -------------
1012 # Handle the `configure --help' message.
1013 m4_define([_AC_INIT_HELP],
1014 [m4_divert_push([HELP_BEGIN])dnl
1017 # Report the --help message.
1019 if test "$ac_init_help" = "long"; then
1020   # Omit some internal or obsolete options to make the list less imposing.
1021   # This message is too long to be a string in the A/UX 3.1 sh.
1022   cat <<_ACEOF
1023 \`configure' configures m4_ifset([AC_PACKAGE_STRING],
1024                         [AC_PACKAGE_STRING],
1025                         [this package]) to adapt to many kinds of systems.
1027 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
1029 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
1030 VAR=VALUE.  See below for descriptions of some of the useful variables.
1032 Defaults for the options are specified in brackets.
1034 Configuration:
1035   -h, --help              display this help and exit
1036       --help=short        display options specific to this package
1037       --help=recursive    display the short help of all the included packages
1038   -V, --version           display version information and exit
1039   -q, --quiet, --silent   do not print \`checking ...' messages
1040       --cache-file=FILE   cache test results in FILE [disabled]
1041   -C, --config-cache      alias for \`--cache-file=config.cache'
1042   -n, --no-create         do not create output files
1043       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1045 Installation directories:
1046 ]AS_HELP_STRING([--prefix=PREFIX],
1047   [install architecture-independent files in PREFIX [$ac_default_prefix]])
1048 AS_HELP_STRING([--exec-prefix=EPREFIX],
1049   [install architecture-dependent files in EPREFIX [PREFIX]])[
1051 By default, \`make install' will install all the files in
1052 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1053 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1054 for instance \`--prefix=\$HOME'.
1056 For better control, use the options below.
1058 Fine tuning of the installation directories:
1059   --bindir=DIR            user executables [EPREFIX/bin]
1060   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1061   --libexecdir=DIR        program executables [EPREFIX/libexec]
1062   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1063   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1064   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1065   --libdir=DIR            object code libraries [EPREFIX/lib]
1066   --includedir=DIR        C header files [PREFIX/include]
1067   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1068   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1069   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1070   --infodir=DIR           info documentation [DATAROOTDIR/info]
1071   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1072   --mandir=DIR            man documentation [DATAROOTDIR/man]
1073 ]AS_HELP_STRING([--docdir=DIR],
1074   [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME],
1075     [AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[
1076   --htmldir=DIR           html documentation [DOCDIR]
1077   --dvidir=DIR            dvi documentation [DOCDIR]
1078   --pdfdir=DIR            pdf documentation [DOCDIR]
1079   --psdir=DIR             ps documentation [DOCDIR]
1080 _ACEOF
1082   cat <<\_ACEOF]
1083 m4_divert_pop([HELP_BEGIN])dnl
1084 dnl The order of the diversions here is
1085 dnl - HELP_BEGIN
1086 dnl   which may be extended by extra generic options such as with X or
1087 dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
1089 dnl - HELP_CANON
1090 dnl   Support for cross compilation (--build, --host and --target).
1091 dnl   Display only in long --help.
1093 dnl - HELP_ENABLE
1094 dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
1095 dnl   then implements the header of the non generic options.
1097 dnl - HELP_WITH
1099 dnl - HELP_VAR
1101 dnl - HELP_VAR_END
1103 dnl - HELP_END
1104 dnl   initialized below, in which we dump the trailer (handling of the
1105 dnl   recursion for instance).
1106 m4_divert_push([HELP_ENABLE])dnl
1107 _ACEOF
1110 if test -n "$ac_init_help"; then
1111 m4_ifset([AC_PACKAGE_STRING],
1112 [  case $ac_init_help in
1113      short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
1114    esac])
1115   cat <<\_ACEOF
1116 m4_divert_pop([HELP_ENABLE])dnl
1117 m4_divert_push([HELP_END])dnl
1119 Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
1120   [the package provider]).dnl
1121 m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
1122 AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
1123 m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
1124 General help using GNU software: <http://www.gnu.org/gethelp/>.])])
1125 _ACEOF
1126 ac_status=$?
1129 if test "$ac_init_help" = "recursive"; then
1130   # If there are subdirs, report their specific --help.
1131   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1132     test -d "$ac_dir" ||
1133       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1134       continue
1135     _AC_SRCDIRS(["$ac_dir"])
1136     cd "$ac_dir" || { ac_status=$?; continue; }
1137     # Check for guested configure.
1138     if test -f "$ac_srcdir/configure.gnu"; then
1139       echo &&
1140       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1141     elif test -f "$ac_srcdir/configure"; then
1142       echo &&
1143       $SHELL "$ac_srcdir/configure" --help=recursive
1144     else
1145       AC_MSG_WARN([no configuration information is in $ac_dir])
1146     fi || ac_status=$?
1147     cd "$ac_pwd" || { ac_status=$?; break; }
1148   done
1151 test -n "$ac_init_help" && exit $ac_status
1152 m4_divert_pop([HELP_END])dnl
1153 ])# _AC_INIT_HELP
1156 # _AC_INIT_VERSION
1157 # ----------------
1158 # Handle the `configure --version' message.
1159 m4_define([_AC_INIT_VERSION],
1160 [m4_divert_text([VERSION_BEGIN],
1161 [if $ac_init_version; then
1162   cat <<\_ACEOF
1163 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
1164 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1165 generated by m4_PACKAGE_STRING])
1166 m4_divert_text([VERSION_END],
1167 [_ACEOF
1168   exit
1169 fi])dnl
1170 ])# _AC_INIT_VERSION
1173 # _AC_INIT_CONFIG_LOG
1174 # -------------------
1175 # Initialize the config.log file descriptor and write header to it.
1176 m4_define([_AC_INIT_CONFIG_LOG],
1177 [m4_divert_text([INIT_PREPARE],
1178 [m4_define([AS_MESSAGE_LOG_FD], 5)dnl
1179 cat >config.log <<_ACEOF
1180 This file contains any messages produced by compilers while
1181 running configure, to aid debugging if configure makes a mistake.
1183 It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1184 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1185 generated by m4_PACKAGE_STRING.  Invocation command line was
1187   $ $[0] $[@]
1189 _ACEOF
1190 exec AS_MESSAGE_LOG_FD>>config.log
1191 AS_UNAME >&AS_MESSAGE_LOG_FD
1193 cat >&AS_MESSAGE_LOG_FD <<_ACEOF
1196 m4_text_box([Core tests.])
1198 _ACEOF
1199 ])])# _AC_INIT_CONFIG_LOG
1202 # _AC_INIT_PREPARE
1203 # ----------------
1204 # Called by AC_INIT to build the preamble of the `configure' scripts.
1205 # 1. Trap and clean up various tmp files.
1206 # 2. Set up the fd and output files
1207 # 3. Remember the options given to `configure' for `config.status --recheck'.
1208 # 4. Initiates confdefs.h
1209 # 5. Loads site and cache files
1210 m4_define([_AC_INIT_PREPARE],
1211 [m4_divert_push([INIT_PREPARE])dnl
1213 # Keep a trace of the command line.
1214 # Strip out --no-create and --no-recursion so they do not pile up.
1215 # Strip out --silent because we don't want to record it for future runs.
1216 # Also quote any args containing shell meta-characters.
1217 # Make two passes to allow for proper duplicate-argument suppression.
1218 ac_configure_args=
1219 ac_configure_args0=
1220 ac_configure_args1=
1221 ac_must_keep_next=false
1222 for ac_pass in 1 2
1224   for ac_arg
1225   do
1226     case $ac_arg in
1227     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1228     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1229     | -silent | --silent | --silen | --sile | --sil)
1230       continue ;;
1231     *\'*)
1232       ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1233     esac
1234     case $ac_pass in
1235     1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
1236     2)
1237       AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
1238 dnl If trying to remove duplicates, be sure to (i) keep the *last*
1239 dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
1240 dnl and (ii) not to strip long options (--prefix foo --prefix bar might
1241 dnl give --prefix foo bar).
1242       if test $ac_must_keep_next = true; then
1243         ac_must_keep_next=false # Got value, back to normal.
1244       else
1245         case $ac_arg in
1246 dnl Use broad patterns, as arguments that would have already made configure
1247 dnl exit don't matter.
1248           *=* | --config-cache | -C | -disable-* | --disable-* \
1249           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1250           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1251           | -with-* | --with-* | -without-* | --without-* | --x)
1252             case "$ac_configure_args0 " in
1253               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1254             esac
1255             ;;
1256           -* ) ac_must_keep_next=true ;;
1257         esac
1258       fi
1259       AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
1260       ;;
1261     esac
1262   done
1263 done
1264 AS_UNSET(ac_configure_args0)
1265 AS_UNSET(ac_configure_args1)
1267 # When interrupted or exit'd, cleanup temporary files, and complete
1268 # config.log.  We remove comments because anyway the quotes in there
1269 # would cause problems or look ugly.
1270 # WARNING: Use '\'' to represent an apostrophe within the trap.
1271 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1272 trap 'exit_status=$?
1273   # Save into config.log some information that might help in debugging.
1274   {
1275     echo
1277     AS_BOX([Cache variables.])
1278     echo
1279     m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]),
1280                   [^ *\(#.*\)?
1281 ],                [],
1282                   ['], ['\\''])
1283     echo
1285     AS_BOX([Output variables.])
1286     echo
1287     for ac_var in $ac_subst_vars
1288     do
1289       eval ac_val=\$$ac_var
1290       case $ac_val in
1291       *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1292       esac
1293       AS_ECHO(["$ac_var='\''$ac_val'\''"])
1294     done | sort
1295     echo
1297     if test -n "$ac_subst_files"; then
1298       AS_BOX([File substitutions.])
1299       echo
1300       for ac_var in $ac_subst_files
1301       do
1302         eval ac_val=\$$ac_var
1303         case $ac_val in
1304         *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1305         esac
1306         AS_ECHO(["$ac_var='\''$ac_val'\''"])
1307       done | sort
1308       echo
1309     fi
1311     if test -s confdefs.h; then
1312       AS_BOX([confdefs.h.])
1313       echo
1314       cat confdefs.h
1315       echo
1316     fi
1317     test "$ac_signal" != 0 &&
1318       AS_ECHO(["$as_me: caught signal $ac_signal"])
1319     AS_ECHO(["$as_me: exit $exit_status"])
1320   } >&AS_MESSAGE_LOG_FD
1321   rm -f core *.core core.conftest.* &&
1322     rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
1323     exit $exit_status
1324 ' 0
1325 for ac_signal in 1 2 13 15; do
1326   trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
1327 done
1328 ac_signal=0
1330 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1331 rm -f -r conftest* confdefs.h
1333 dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
1334 dnl containing less than 14 bytes (including the newline).
1335 AS_ECHO(["/* confdefs.h */"]) > confdefs.h
1337 # Predefined preprocessor variables.
1338 AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
1339                    [Define to the full name of this package.])dnl
1340 AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
1341                    [Define to the one symbol short name of this package.])dnl
1342 AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
1343                    [Define to the version of this package.])dnl
1344 AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
1345                    [Define to the full name and version of this package.])dnl
1346 AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
1347                    [Define to the address where bug reports for this package
1348                     should be sent.])dnl
1349 AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"],
1350                    [Define to the home page for this package.])
1352 # Let the site file select an alternate cache file if it wants to.
1353 AC_SITE_LOAD
1354 AC_CACHE_LOAD
1355 m4_divert_pop([INIT_PREPARE])dnl
1356 ])# _AC_INIT_PREPARE
1359 # AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
1360 # ----------------------------------------
1361 # This macro is used only for Autoupdate.
1362 AU_DEFUN([AC_INIT],
1363 [m4_ifval([$2], [[AC_INIT($@)]],
1364           [m4_ifval([$1],
1365 [[AC_INIT]
1366 AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
1370 # AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
1371 # ----------------------------------------------------------
1372 # Include the user macro files, prepare the diversions, and output the
1373 # preamble of the `configure' script.
1375 # If BUG-REPORT is omitted, do without (unless the user previously
1376 # defined the m4 macro AC_PACKAGE_BUGREPORT).  If TARNAME is omitted,
1377 # use PACKAGE to seed it.  If URL is omitted, use
1378 # `http://www.gnu.org/software/TARNAME/' if PACKAGE begins with `GNU',
1379 # otherwise, do without.
1381 # Note that the order is important: first initialize, then set the
1382 # AC_CONFIG_SRCDIR.
1383 m4_define([AC_INIT],
1384 [# Forbidden tokens and exceptions.
1385 m4_pattern_forbid([^_?A[CHUM]_])
1386 m4_pattern_forbid([_AC_])
1387 m4_pattern_forbid([^LIBOBJS$],
1388                   [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
1389 # Actually reserved by M4sh.
1390 m4_pattern_allow([^AS_FLAGS$])
1391 AS_INIT[]dnl
1392 AS_PREPARE[]dnl
1393 m4_divert_push([KILL])
1394 m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
1395 _AC_INIT_DEFAULTS
1396 _AC_INIT_PARSE_ARGS
1397 _AC_INIT_DIRCHECK
1398 _AC_INIT_SRCDIR
1399 _AC_INIT_HELP
1400 _AC_INIT_VERSION
1401 _AC_INIT_CONFIG_LOG
1402 _AC_INIT_PREPARE
1403 _AC_INIT_NOTICE
1404 _AC_INIT_COPYRIGHT
1405 m4_divert_text([SHELL_FN], [
1406 m4_text_box([Autoconf initialization.])])
1407 m4_divert_pop
1408 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1410 dnl Substitute for predefined variables.
1411 AC_SUBST([DEFS])dnl
1412 AC_SUBST([ECHO_C])dnl
1413 AC_SUBST([ECHO_N])dnl
1414 AC_SUBST([ECHO_T])dnl
1415 AC_SUBST([LIBS])dnl
1416 _AC_ARG_VAR_PRECIOUS([build_alias])AC_SUBST([build_alias])dnl
1417 _AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl
1418 _AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl
1420 AC_LANG_PUSH(C)
1426 ## ------------------------------------------------------------- ##
1427 ## Selecting optional features, working with optional software.  ##
1428 ## ------------------------------------------------------------- ##
1430 # AC_PRESERVE_HELP_ORDER
1431 # ----------------------
1432 # Emit help strings in the order given, rather than grouping all --enable-FOO
1433 # and all --with-BAR.
1434 AC_DEFUN([AC_PRESERVE_HELP_ORDER],
1435 [m4_divert_once([HELP_ENABLE], [[
1436 Optional Features and Packages:
1437   --disable-option-checking  ignore unrecognized --enable/--with options
1438   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1439   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1440   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1441   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
1442 m4_define([_m4_divert(HELP_ENABLE)],    _m4_divert(HELP_WITH))
1443 ])# AC_PRESERVE_HELP_ORDER
1445 # _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1446 # -------------------------------------------------------------------
1447 # Common code for AC_ARG_ENABLE and AC_ARG_WITH.
1448 # OPTION is either "enable" or "with".
1450 m4_define([_AC_ENABLE_IF],
1451 [@%:@ Check whether --$1-$2 was given.
1452 _AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-+.], [___]), [$3], [$4])
1455 m4_define([_AC_ENABLE_IF_ACTION],
1456 [m4_append_uniq([_AC_USER_OPTS], [$1_$2], [
1457 ])dnl
1458 AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl
1461 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1462 # ------------------------------------------------------------------------
1463 AC_DEFUN([AC_ARG_ENABLE],
1464 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1466 [m4_divert_once([HELP_ENABLE], [[
1467 Optional Features:
1468   --disable-option-checking  ignore unrecognized --enable/--with options
1469   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1470   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])])dnl
1471 m4_divert_once([HELP_ENABLE], [$2])dnl
1472 _AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl
1473 ])# AC_ARG_ENABLE
1476 AU_DEFUN([AC_ENABLE],
1477 [AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])])
1480 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
1481 # --------------------------------------------------------------------
1482 AC_DEFUN([AC_ARG_WITH],
1483 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1485 [m4_divert_once([HELP_WITH], [[
1486 Optional Packages:
1487   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1488   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])])
1489 m4_divert_once([HELP_WITH], [$2])dnl
1490 _AC_ENABLE_IF([with], [$1], [$3], [$4])dnl
1491 ])# AC_ARG_WITH
1493 AU_DEFUN([AC_WITH],
1494 [AC_ARG_WITH([$1], [  --with-$1], [$2], [$3])])
1496 # AC_DISABLE_OPTION_CHECKING
1497 # --------------------------
1498 AC_DEFUN([AC_DISABLE_OPTION_CHECKING],
1499 [m4_divert_once([DEFAULTS], [enable_option_checking=no])
1500 ])# AC_DISABLE_OPTION_CHECKING
1503 ## ----------------------------------------- ##
1504 ## Remembering variables for reconfiguring.  ##
1505 ## ----------------------------------------- ##
1508 # AC_ARG_VAR(VARNAME, DOCUMENTATION)
1509 # ----------------------------------
1510 # Register VARNAME as a precious variable, and document it in
1511 # `configure --help' (but only once).
1512 AC_DEFUN([AC_ARG_VAR],
1513 [m4_divert_once([HELP_VAR], [[
1514 Some influential environment variables:]])dnl
1515 m4_divert_once([HELP_VAR_END], [[
1516 Use these variables to override the choices made by `configure' or to help
1517 it to find libraries and programs with nonstandard names/locations.]])dnl
1518 m4_expand_once([m4_divert_text([HELP_VAR],
1519                                [AS_HELP_STRING([$1], [$2], [              ])])],
1520                [$0($1)])dnl
1521 AC_SUBST([$1])dnl
1522 _AC_ARG_VAR_PRECIOUS([$1])dnl
1523 ])# AC_ARG_VAR
1526 # _AC_ARG_VAR_PRECIOUS(VARNAME)
1527 # -----------------------------
1528 # Declare VARNAME is precious.
1529 m4_define([_AC_ARG_VAR_PRECIOUS],
1530 [m4_append_uniq([_AC_PRECIOUS_VARS], [$1], [
1531 ])dnl
1535 # _AC_ARG_VAR_STORE
1536 # -----------------
1537 # We try to diagnose when precious variables have changed.  To do this,
1538 # make two early snapshots (after the option processing to take
1539 # explicit variables into account) of those variables: one (ac_env_)
1540 # which represents the current run, and a second (ac_cv_env_) which,
1541 # at the first run, will be saved in the cache.  As an exception to
1542 # the cache mechanism, its loading will override these variables (non
1543 # `ac_cv_env_' cache value are only set when unset).
1545 # In subsequent runs, after having loaded the cache, compare
1546 # ac_cv_env_foo against ac_env_foo.  See _AC_ARG_VAR_VALIDATE.
1547 m4_define([_AC_ARG_VAR_STORE],
1548 [m4_divert_text([PARSE_ARGS],
1549 [for ac_var in $ac_precious_vars; do
1550   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1551   eval ac_env_${ac_var}_value=\$${ac_var}
1552   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1553   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1554 done])dnl
1558 # _AC_ARG_VAR_VALIDATE
1559 # --------------------
1560 # The precious variables are saved twice at the beginning of
1561 # configure.  E.g., PRECIOUS is saved as `ac_env_PRECIOUS_set' and
1562 # `ac_env_PRECIOUS_value' on the one hand and `ac_cv_env_PRECIOUS_set'
1563 # and `ac_cv_env_PRECIOUS_value' on the other hand.
1565 # Now the cache has just been loaded, so `ac_cv_env_' represents the
1566 # content of the cached values, while `ac_env_' represents that of the
1567 # current values.
1569 # So we check that `ac_env_' and `ac_cv_env_' are consistent.  If
1570 # they aren't, die.
1571 m4_define([_AC_ARG_VAR_VALIDATE],
1572 [m4_divert_text([INIT_PREPARE],
1573 [# Check that the precious variables saved in the cache have kept the same
1574 # value.
1575 ac_cache_corrupted=false
1576 for ac_var in $ac_precious_vars; do
1577   eval ac_old_set=\$ac_cv_env_${ac_var}_set
1578   eval ac_new_set=\$ac_env_${ac_var}_set
1579   eval ac_old_val=\$ac_cv_env_${ac_var}_value
1580   eval ac_new_val=\$ac_env_${ac_var}_value
1581   case $ac_old_set,$ac_new_set in
1582     set,)
1583       AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2)
1584       ac_cache_corrupted=: ;;
1585     ,set)
1586       AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2)
1587       ac_cache_corrupted=: ;;
1588     ,);;
1589     *)
1590       if test "x$ac_old_val" != "x$ac_new_val"; then
1591         # differences in whitespace do not lead to failure.
1592         ac_old_val_w=`echo x $ac_old_val`
1593         ac_new_val_w=`echo x $ac_new_val`
1594         if test "$ac_old_val_w" != "$ac_new_val_w"; then
1595           AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
1596           ac_cache_corrupted=:
1597         else
1598           AS_MESSAGE([warning: ignoring whitespace changes in `$ac_var' since the previous run:], 2)
1599           eval $ac_var=\$ac_old_val
1600         fi
1601         AS_MESSAGE([  former value:  `$ac_old_val'], 2)
1602         AS_MESSAGE([  current value: `$ac_new_val'], 2)
1603       fi;;
1604   esac
1605   # Pass precious variables to config.status.
1606   if test "$ac_new_set" = set; then
1607     case $ac_new_val in
1608     *\'*) ac_arg=$ac_var=`AS_ECHO(["$ac_new_val"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1609     *) ac_arg=$ac_var=$ac_new_val ;;
1610     esac
1611     case " $ac_configure_args " in
1612       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1613       *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
1614     esac
1615   fi
1616 done
1617 if $ac_cache_corrupted; then
1618   AS_MESSAGE([error: in `$ac_pwd':], 2)
1619   AS_MESSAGE([error: changes in the environment can compromise the build], 2)
1620   AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
1621 fi])dnl
1622 ])# _AC_ARG_VAR_VALIDATE
1628 ## ---------------------------- ##
1629 ## Transforming program names.  ##
1630 ## ---------------------------- ##
1633 # AC_ARG_PROGRAM
1634 # --------------
1635 # This macro is expanded only once, to avoid that `foo' ends up being
1636 # installed as `ggfoo'.
1637 AC_DEFUN_ONCE([AC_ARG_PROGRAM],
1638 [dnl Document the options.
1639 m4_divert_push([HELP_BEGIN])dnl
1641 Program names:
1642   --program-prefix=PREFIX            prepend PREFIX to installed program names
1643   --program-suffix=SUFFIX            append SUFFIX to installed program names
1644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
1645 m4_divert_pop([HELP_BEGIN])dnl
1646 test "$program_prefix" != NONE &&
1647   program_transform_name="s&^&$program_prefix&;$program_transform_name"
1648 # Use a double $ so make ignores it.
1649 test "$program_suffix" != NONE &&
1650   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
1651 # Double any \ or $.
1652 # By default was `s,x,x', remove it if useless.
1653 [ac_script='s/[\\$]/&&/g;s/;s,x,x,$//']
1654 program_transform_name=`AS_ECHO(["$program_transform_name"]) | sed "$ac_script"`
1655 ])# AC_ARG_PROGRAM
1661 ## ------------------------- ##
1662 ## Finding auxiliary files.  ##
1663 ## ------------------------- ##
1666 # AC_CONFIG_AUX_DIR(DIR)
1667 # ----------------------
1668 # Find install-sh, config.sub, config.guess, and Cygnus configure
1669 # in directory DIR.  These are auxiliary files used in configuration.
1670 # DIR can be either absolute or relative to $srcdir.
1671 AC_DEFUN([AC_CONFIG_AUX_DIR],
1672 [AC_CONFIG_AUX_DIRS($1 "$srcdir"/$1)])
1675 # AC_CONFIG_AUX_DIR_DEFAULT
1676 # -------------------------
1677 # The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
1678 # There's no need to call this macro explicitly; just AC_REQUIRE it.
1679 AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
1680 [AC_CONFIG_AUX_DIRS("$srcdir" "$srcdir/.." "$srcdir/../..")])
1683 # AC_CONFIG_AUX_DIRS(DIR ...)
1684 # ---------------------------
1685 # Internal subroutine.
1686 # Search for the configuration auxiliary files in directory list $1.
1687 # We look only for install-sh, so users of AC_PROG_INSTALL
1688 # do not automatically need to distribute the other auxiliary files.
1689 AC_DEFUN([AC_CONFIG_AUX_DIRS],
1690 [ac_aux_dir=
1691 for ac_dir in $1; do
1692   if test -f "$ac_dir/install-sh"; then
1693     ac_aux_dir=$ac_dir
1694     ac_install_sh="$ac_aux_dir/install-sh -c"
1695     break
1696   elif test -f "$ac_dir/install.sh"; then
1697     ac_aux_dir=$ac_dir
1698     ac_install_sh="$ac_aux_dir/install.sh -c"
1699     break
1700   elif test -f "$ac_dir/shtool"; then
1701     ac_aux_dir=$ac_dir
1702     ac_install_sh="$ac_aux_dir/shtool install -c"
1703     break
1704   fi
1705 done
1706 if test -z "$ac_aux_dir"; then
1707   AC_MSG_ERROR([cannot find install-sh, install.sh, or shtool in $1])
1710 # These three variables are undocumented and unsupported,
1711 # and are intended to be withdrawn in a future Autoconf release.
1712 # They can cause serious problems if a builder's source tree is in a directory
1713 # whose full name contains unusual characters.
1714 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
1715 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
1716 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
1718 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1719 ])# AC_CONFIG_AUX_DIRS
1724 ## ------------------------ ##
1725 ## Finding aclocal macros.  ##
1726 ## ------------------------ ##
1729 # AC_CONFIG_MACRO_DIR(DIR)
1730 # ------------------------
1731 # Declare directory containing additional macros for aclocal.
1732 AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
1736 ## --------------------- ##
1737 ## Requiring aux files.  ##
1738 ## --------------------- ##
1740 # AC_REQUIRE_AUX_FILE(FILE)
1741 # -------------------------
1742 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
1743 # It announces FILE is required in the auxdir.
1744 m4_define([AC_REQUIRE_AUX_FILE],
1745 [AS_LITERAL_WORD_IF([$1], [],
1746                [m4_fatal([$0: requires a literal argument])])])
1750 ## ----------------------------------- ##
1751 ## Getting the canonical system type.  ##
1752 ## ----------------------------------- ##
1754 # The inputs are:
1755 #    configure --host=HOST --target=TARGET --build=BUILD
1757 # The rules are:
1758 # 1. Build defaults to the current platform, as determined by config.guess.
1759 # 2. Host defaults to build.
1760 # 3. Target defaults to host.
1763 # _AC_CANONICAL_SPLIT(THING)
1764 # --------------------------
1765 # Generate the variables THING, THING_{alias cpu vendor os}.
1766 m4_define([_AC_CANONICAL_SPLIT],
1767 [case $ac_cv_$1 in
1768 *-*-*) ;;
1769 *) AC_MSG_ERROR([invalid value of canonical $1]);;
1770 esac
1771 AC_SUBST([$1], [$ac_cv_$1])dnl
1772 ac_save_IFS=$IFS; IFS='-'
1773 set x $ac_cv_$1
1774 shift
1775 AC_SUBST([$1_cpu], [$[1]])dnl
1776 AC_SUBST([$1_vendor], [$[2]])dnl
1777 shift; shift
1778 [# Remember, the first character of IFS is used to create $]*,
1779 # except with old shells:
1780 $1_os=$[*]
1781 IFS=$ac_save_IFS
1782 case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac
1783 AC_SUBST([$1_os])dnl
1784 ])# _AC_CANONICAL_SPLIT
1787 # AC_CANONICAL_BUILD
1788 # ------------------
1789 AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
1790 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1791 AC_REQUIRE_AUX_FILE([config.sub])dnl
1792 AC_REQUIRE_AUX_FILE([config.guess])dnl
1793 m4_divert_once([HELP_CANON],
1795 System types:
1796   --build=BUILD     configure for building on BUILD [guessed]]])dnl
1797 # Make sure we can run config.sub.
1798 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
1799   AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub])
1801 AC_CACHE_CHECK([build system type], [ac_cv_build],
1802 [ac_build_alias=$build_alias
1803 test "x$ac_build_alias" = x &&
1804   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
1805 test "x$ac_build_alias" = x &&
1806   AC_MSG_ERROR([cannot guess build type; you must specify one])
1807 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
1808   AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])
1810 _AC_CANONICAL_SPLIT(build)
1811 ])# AC_CANONICAL_BUILD
1814 # AC_CANONICAL_HOST
1815 # -----------------
1816 AC_DEFUN_ONCE([AC_CANONICAL_HOST],
1817 [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1818 m4_divert_once([HELP_CANON],
1819 [[  --host=HOST       cross-compile to build programs to run on HOST [BUILD]]])dnl
1820 AC_CACHE_CHECK([host system type], [ac_cv_host],
1821 [if test "x$host_alias" = x; then
1822   ac_cv_host=$ac_cv_build
1823 else
1824   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
1825     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])
1828 _AC_CANONICAL_SPLIT([host])
1829 ])# AC_CANONICAL_HOST
1832 # AC_CANONICAL_TARGET
1833 # -------------------
1834 AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
1835 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1836 AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
1837 m4_divert_once([HELP_CANON],
1838 [[  --target=TARGET   configure for building compilers for TARGET [HOST]]])dnl
1839 AC_CACHE_CHECK([target system type], [ac_cv_target],
1840 [if test "x$target_alias" = x; then
1841   ac_cv_target=$ac_cv_host
1842 else
1843   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
1844     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])
1847 _AC_CANONICAL_SPLIT([target])
1849 # The aliases save the names the user supplied, while $host etc.
1850 # will get canonicalized.
1851 test -n "$target_alias" &&
1852   test "$program_prefix$program_suffix$program_transform_name" = \
1853     NONENONEs,x,x, &&
1854   program_prefix=${target_alias}-[]dnl
1855 ])# AC_CANONICAL_TARGET
1858 AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
1861 # AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
1862 # ------------------------------------------
1863 # If the cache file is inconsistent with the current host,
1864 # target and build system types, execute CMD or print a default
1865 # error message.  Now handled via _AC_ARG_VAR_PRECIOUS.
1866 AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])
1869 ## ---------------------- ##
1870 ## Caching test results.  ##
1871 ## ---------------------- ##
1874 # AC_SITE_LOAD
1875 # ------------
1876 # Look for site- or system-specific initialization scripts.
1877 m4_define([AC_SITE_LOAD],
1878 [# Prefer an explicitly selected file to automatically selected ones.
1879 ac_site_file1=NONE
1880 ac_site_file2=NONE
1881 if test -n "$CONFIG_SITE"; then
1882   # We do not want a PATH search for config.site.
1883   case $CONFIG_SITE in @%:@((
1884     -*)  ac_site_file1=./$CONFIG_SITE;;
1885     */*) ac_site_file1=$CONFIG_SITE;;
1886     *)   ac_site_file1=./$CONFIG_SITE;;
1887   esac
1888 elif test "x$prefix" != xNONE; then
1889   ac_site_file1=$prefix/share/config.site
1890   ac_site_file2=$prefix/etc/config.site
1891 else
1892   ac_site_file1=$ac_default_prefix/share/config.site
1893   ac_site_file2=$ac_default_prefix/etc/config.site
1895 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
1897   test "x$ac_site_file" = xNONE && continue
1898   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
1899     AC_MSG_NOTICE([loading site script $ac_site_file])
1900     sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
1901     . "$ac_site_file" \
1902       || AC_MSG_FAILURE([failed to load site script $ac_site_file])
1903   fi
1904 done
1908 # AC_CACHE_LOAD
1909 # -------------
1910 m4_define([AC_CACHE_LOAD],
1911 [if test -r "$cache_file"; then
1912   # Some versions of bash will fail to source /dev/null (special files
1913   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
1914   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
1915     AC_MSG_NOTICE([loading cache $cache_file])
1916     case $cache_file in
1917       [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";;
1918       *)                      . "./$cache_file";;
1919     esac
1920   fi
1921 else
1922   AC_MSG_NOTICE([creating cache $cache_file])
1923   >$cache_file
1925 ])# AC_CACHE_LOAD
1928 # _AC_CACHE_DUMP
1929 # --------------
1930 # Dump the cache to stdout.  It can be in a pipe (this is a requirement).
1931 m4_define([_AC_CACHE_DUMP],
1932 [# The following way of writing the cache mishandles newlines in values,
1933 # but we know of no workaround that is simple, portable, and efficient.
1934 # So, we kill variables containing newlines.
1935 # Ultrix sh set writes to stderr and can't be redirected directly,
1936 # and sets the high bit in the cache file unless we assign to the vars.
1938   for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do
1939     eval ac_val=\$$ac_var
1940     case $ac_val in #(
1941     *${as_nl}*)
1942       case $ac_var in #(
1943       *_cv_*) AC_MSG_WARN([cache variable $ac_var contains a newline]) ;;
1944       esac
1945       case $ac_var in #(
1946       _ | IFS | as_nl) ;; #(
1947       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1948       *) AS_UNSET([$ac_var]) ;;
1949       esac ;;
1950     esac
1951   done
1953   (set) 2>&1 |
1954     case $as_nl`(ac_space=' '; set) 2>&1` in #(
1955     *${as_nl}ac_space=\ *)
1956       # `set' does not quote correctly, so add quotes: double-quote
1957       # substitution turns \\\\ into \\, and sed turns \\ into \.
1958       sed -n \
1959         ["s/'/'\\\\''/g;
1960           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
1961       ;; #(
1962     *)
1963       # `set' quotes correctly as required by POSIX, so do not add quotes.
1964       sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"]
1965       ;;
1966     esac |
1967     sort
1968 )dnl
1969 ])# _AC_CACHE_DUMP
1972 # AC_CACHE_SAVE
1973 # -------------
1974 # Save the cache.
1975 # Allow a site initialization script to override cache values.
1976 m4_define([AC_CACHE_SAVE],
1977 [cat >confcache <<\_ACEOF
1978 # This file is a shell script that caches the results of configure
1979 # tests run on this system so they can be shared between configure
1980 # scripts and configure runs, see configure's option --config-cache.
1981 # It is not useful on other systems.  If it contains results you don't
1982 # want to keep, you may remove or edit it.
1984 # config.status only pays attention to the cache file if you give it
1985 # the --recheck option to rerun configure.
1987 # `ac_cv_env_foo' variables (set or unset) will be overridden when
1988 # loading this file, other *unset* `ac_cv_foo' will be assigned the
1989 # following values.
1991 _ACEOF
1993 _AC_CACHE_DUMP() |
1994   sed ['
1995      /^ac_cv_env_/b end
1996      t clear
1997      :clear
1998      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
1999      t end
2000      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
2001      :end'] >>confcache
2002 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
2003   if test -w "$cache_file"; then
2004     test "x$cache_file" != "x/dev/null" &&
2005       AC_MSG_NOTICE([updating cache $cache_file])
2006     cat confcache >$cache_file
2007   else
2008     AC_MSG_NOTICE([not updating unwritable cache $cache_file])
2009   fi
2011 rm -f confcache[]dnl
2012 ])# AC_CACHE_SAVE
2015 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
2016 # ------------------------------------------
2017 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
2018 # Should be dnl'ed.  Try to catch common mistakes.
2019 m4_defun([AC_CACHE_VAL],
2020 [AS_LITERAL_WORD_IF([$1], [m4_if(m4_index(m4_quote($1), [_cv_]), [-1],
2021                             [AC_DIAGNOSE([syntax],
2022 [$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])])dnl
2023 m4_if(m4_index([$2], [AC_DEFINE]), [-1], [],
2024       [AC_DIAGNOSE([syntax],
2025 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
2026 [where no actions should be taken])])dnl
2027 m4_if(m4_index([$2], [AC_SUBST]), [-1], [],
2028       [AC_DIAGNOSE([syntax],
2029 [$0($1, ...): suspicious presence of an AC_SUBST in the second argument, ]dnl
2030 [where no actions should be taken])])dnl
2031 AS_VAR_SET_IF([$1],
2032               [_AS_ECHO_N([(cached) ])],
2033               [$2])
2037 # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
2038 # -------------------------------------------
2039 # Do not call this macro with a dnl right behind.
2040 m4_defun([AC_CACHE_CHECK],
2041 [AC_MSG_CHECKING([$1])
2042 AC_CACHE_VAL([$2], [$3])dnl
2043 AS_LITERAL_WORD_IF([$2],
2044               [AC_MSG_RESULT([$$2])],
2045               [AS_VAR_COPY([ac_res], [$2])
2046                AC_MSG_RESULT([$ac_res])])dnl
2049 # _AC_CACHE_CHECK_INT(MESSAGE, CACHE-ID, EXPRESSION,
2050 #                     [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS])
2051 # --------------------------------------------------------------
2052 AC_DEFUN([_AC_CACHE_CHECK_INT],
2053 [AC_CACHE_CHECK([$1], [$2],
2054    [AC_COMPUTE_INT([$2], [$3], [$4], [$5])])
2055 ])# _AC_CACHE_CHECK_INT
2059 ## ---------------------- ##
2060 ## Defining CPP symbols.  ##
2061 ## ---------------------- ##
2064 # AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
2065 # -------------------------------------------
2066 # Used by --trace to collect the list of AC_DEFINEd macros.
2067 m4_define([AC_DEFINE_TRACE_LITERAL],
2068 [m4_pattern_allow([^$1$])dnl
2069 AS_IDENTIFIER_IF([$1], [],
2070   [m4_warn([syntax], [AC_DEFINE: not an identifier: $1])])dnl
2071 ])# AC_DEFINE_TRACE_LITERAL
2074 # AC_DEFINE_TRACE(CPP-SYMBOL)
2075 # ---------------------------
2076 # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
2077 # out non literal symbols.  CPP-SYMBOL must not include any parameters.
2078 m4_define([AC_DEFINE_TRACE],
2079 [AS_LITERAL_WORD_IF([$1], [AC_DEFINE_TRACE_LITERAL(_m4_expand([$1]))])])
2082 # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
2083 # -------------------------------------------
2084 # Set VARIABLE to VALUE, verbatim, or 1.  Remember the value
2085 # and if VARIABLE is affected the same VALUE, do nothing, else
2086 # die.  The third argument is used by autoheader.
2087 m4_define([AC_DEFINE], [_AC_DEFINE_Q([_$0], $@)])
2089 # _AC_DEFINE(STRING)
2090 # ------------------
2091 # Append the pre-expanded STRING and a newline to confdefs.h, as if by
2092 # a quoted here-doc.
2093 m4_define([_AC_DEFINE],
2094 [AS_ECHO(["AS_ESCAPE([[$1]])"]) >>confdefs.h])
2097 # AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
2098 # ----------------------------------------------------
2099 # Similar, but perform shell substitutions $ ` \ once on VALUE, as
2100 # in an unquoted here-doc.
2101 m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([_$0], $@)])
2103 # _AC_DEFINE_UNQUOTED(STRING)
2104 # ---------------------------
2105 # Append the pre-expanded STRING and a newline to confdefs.h, as if
2106 # with an unquoted here-doc, but avoiding a fork in the common case of
2107 # no backslash, no command substitution, no complex variable
2108 # substitution, and no quadrigraphs.
2109 m4_define([_AC_DEFINE_UNQUOTED],
2110 [m4_if(m4_bregexp([$1], [\\\|`\|\$(\|\${\|@]), [-1],
2111        [AS_ECHO(["AS_ESCAPE([$1], [""])"]) >>confdefs.h],
2112        [cat >>confdefs.h <<_ACEOF
2113 [$1]
2114 _ACEOF])])
2117 # _AC_DEFINE_Q(MACRO, VARIABLE, [VALUE], [DESCRIPTION])
2118 # -----------------------------------------------------
2119 # Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}.
2120 # MACRO must take one argument, which is the fully expanded string to
2121 # append to confdefs.h as if by a possibly-quoted here-doc.
2123 # m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so we use
2124 # m4_format rather than regex to grab prefix up to first ().  AC_name
2125 # is defined with over-quotation, so that we can avoid m4_defn; this
2126 # is only safe because the name should not contain $.
2128 # Guarantee a match in m4_index, so as to avoid a bug with precision
2129 # -1 in m4_format in older m4.
2130 m4_define([_AC_DEFINE_Q],
2131 [m4_pushdef([AC_name], m4_format([[[%.*s]]], m4_index([$2(], [(]), [$2]))]dnl
2132 [AC_DEFINE_TRACE(AC_name)]dnl
2133 [m4_cond([m4_index([$3], [
2134 ])], [-1], [],
2135         [m4_bregexp([[$3]], [[^\\]
2136 ], [-])], [], [],
2137         [m4_warn([syntax], [AC_DEFINE]m4_if([$1], [_AC_DEFINE], [],
2138   [[_UNQUOTED]])[: `$3' is not a valid preprocessor define value])])]dnl
2139 [m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])
2140 ])_m4_popdef([AC_name])]dnl
2141 [$1(m4_expand([[@%:@define] $2 ]m4_if([$#], 2, 1,
2142   [$3], [], [/**/], [[$3]])))
2147 ## -------------------------- ##
2148 ## Setting output variables.  ##
2149 ## -------------------------- ##
2152 # AC_SUBST_TRACE(VARIABLE)
2153 # ------------------------
2154 # This macro is used with --trace to collect the list of substituted variables.
2155 m4_define([AC_SUBST_TRACE])
2158 # AC_SUBST(VARIABLE, [VALUE])
2159 # ---------------------------
2160 # Create an output variable from a shell VARIABLE.  If VALUE is given
2161 # assign it to VARIABLE.  Use `""' if you want to set VARIABLE to an
2162 # empty value, not an empty second argument.
2164 m4_define([AC_SUBST],
2165 [AS_IDENTIFIER_IF([$1], [],
2166   [m4_fatal([$0: `$1' is not a valid shell variable name])])]dnl
2167 [AC_SUBST_TRACE([$1])]dnl
2168 [m4_pattern_allow([^$1$])]dnl
2169 [m4_ifvaln([$2], [$1=$2])[]]dnl
2170 [m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST
2173 # AC_SUBST_FILE(VARIABLE)
2174 # -----------------------
2175 # Read the comments of the preceding macro.
2176 m4_define([AC_SUBST_FILE],
2177 [m4_pattern_allow([^$1$])dnl
2178 m4_append_uniq([_AC_SUBST_FILES], [$1], [
2179 ])])
2183 ## --------------------------------------- ##
2184 ## Printing messages at autoconf runtime.  ##
2185 ## --------------------------------------- ##
2187 # In fact, I think we should promote the use of m4_warn and m4_fatal
2188 # directly.  This will also avoid to some people to get it wrong
2189 # between AC_FATAL and AC_MSG_ERROR.
2192 # AC_DIAGNOSE(CATEGORY, MESSAGE)
2193 # AC_FATAL(MESSAGE, [EXIT-STATUS])
2194 # --------------------------------
2195 m4_define([AC_DIAGNOSE], [m4_warn($@)])
2196 m4_define([AC_FATAL],    [m4_fatal($@)])
2199 # AC_WARNING(MESSAGE)
2200 # -------------------
2201 # Report a MESSAGE to the user of autoconf if `-W' or `-W all' was
2202 # specified.
2203 m4_define([AC_WARNING],
2204 [AC_DIAGNOSE([syntax], [$1])])
2209 ## ---------------------------------------- ##
2210 ## Printing messages at configure runtime.  ##
2211 ## ---------------------------------------- ##
2214 # AC_MSG_CHECKING(FEATURE)
2215 # ------------------------
2216 m4_define([AC_MSG_CHECKING],
2217 [{ _AS_ECHO_LOG([checking $1])
2218 _AS_ECHO_N([checking $1... ]); }dnl
2222 # AC_MSG_RESULT(RESULT)
2223 # ---------------------
2224 m4_define([AC_MSG_RESULT],
2225 [{ _AS_ECHO_LOG([result: $1])
2226 _AS_ECHO([$1]); }dnl
2230 # AC_MSG_WARN(PROBLEM)
2231 # AC_MSG_NOTICE(STRING)
2232 # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
2233 # AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
2234 # ----------------------------------------
2235 m4_copy([AS_WARN],    [AC_MSG_WARN])
2236 m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
2237 m4_copy([AS_ERROR],   [AC_MSG_ERROR])
2238 m4_define([AC_MSG_FAILURE],
2239 [{ AS_MESSAGE([error: in `$ac_pwd':], 2)
2240 AC_MSG_ERROR([$1
2241 See `config.log' for more details], [$2]); }])
2244 # _AC_MSG_LOG_CONFTEST
2245 # --------------------
2246 m4_define([_AC_MSG_LOG_CONFTEST],
2247 [AS_ECHO(["$as_me: failed program was:"]) >&AS_MESSAGE_LOG_FD
2248 sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2252 # AU::AC_CHECKING(FEATURE)
2253 # ------------------------
2254 AU_DEFUN([AC_CHECKING],
2255 [AS_MESSAGE([checking $1...])])
2258 # AU::AC_MSG_RESULT_UNQUOTED(RESULT)
2259 # ----------------------------------
2260 # No escaping, so it performed also backtick substitution.
2261 AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
2262 [_AS_ECHO_UNQUOTED([$as_me:${as_lineno-$LINENO}: result: $1], AS_MESSAGE_LOG_FD)
2263 _AS_ECHO_UNQUOTED([$1])[]dnl
2267 # AU::AC_VERBOSE(STRING)
2268 # ----------------------
2269 AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])
2276 ## ---------------------------- ##
2277 ## Compiler-running mechanics.  ##
2278 ## ---------------------------- ##
2281 # _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
2282 # ----------------------------------
2283 # Eval COMMAND, save the exit status in ac_status, and log it.  The return
2284 # code is 0 if COMMAND succeeded, so that it can be used directly in AS_IF
2285 # constructs.
2286 AC_DEFUN([_AC_RUN_LOG],
2287 [{ { $2; } >&AS_MESSAGE_LOG_FD
2288   ($1) 2>&AS_MESSAGE_LOG_FD
2289   ac_status=$?
2290   _AS_ECHO_LOG([\$? = $ac_status])
2291   test $ac_status = 0; }])
2294 # _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
2295 # -----------------------------------------
2296 # Run COMMAND, save its stderr into conftest.err, save the exit status
2297 # in ac_status, and log it.  Don't forget to clean up conftest.err after
2298 # use.
2299 # Note that when tracing, most shells will leave the traces in stderr
2300 # starting with "+": that's what this macro tries to address.
2301 # The return code is 0 if COMMAND succeeded, so that it can be used directly
2302 # in AS_IF constructs.
2303 AC_DEFUN([_AC_RUN_LOG_STDERR],
2304 [{ { $2; } >&AS_MESSAGE_LOG_FD
2305   ($1) 2>conftest.err
2306   ac_status=$?
2307   if test -s conftest.err; then
2308     grep -v '^ *+' conftest.err >conftest.er1
2309     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2310     mv -f conftest.er1 conftest.err
2311   fi
2312   _AS_ECHO_LOG([\$? = $ac_status])
2313   test $ac_status = 0; }])
2316 # _AC_RUN_LOG_LIMIT(COMMAND, LOG-COMMANDS, [LINES])
2317 # -------------------------------------------------
2318 # Like _AC_RUN_LOG, but only log LINES lines from stderr,
2319 # defaulting to 10 lines.
2320 AC_DEFUN([_AC_RUN_LOG_LIMIT],
2321 [{ { $2; } >&AS_MESSAGE_LOG_FD
2322   ($1) 2>conftest.err
2323   ac_status=$?
2324   if test -s conftest.err; then
2325     sed 'm4_default([$3], [10])a\
2326 ... rest of stderr output deleted ...
2327          m4_default([$3], [10])q' conftest.err >conftest.er1
2328     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2329   fi
2330   rm -f conftest.er1 conftest.err
2331   _AS_ECHO_LOG([\$? = $ac_status])
2332   test $ac_status = 0; }])
2335 # _AC_DO_ECHO(COMMAND)
2336 # --------------------
2337 # Echo COMMAND.  This is designed to be used just before evaluating COMMAND.
2338 AC_DEFUN([_AC_DO_ECHO],
2339 [m4_if([$1], [$ac_try], [], [ac_try="$1"
2340 ])]dnl
2341 dnl If the string contains '\"', '`', or '\\', then just echo it rather
2342 dnl than expanding it.  This is a hack, but it is safer, while also
2343 dnl typically expanding simple substrings like '$CC', which is what we want.
2345 dnl Much of this macro body is quoted, to work around misuses like
2346 dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
2347 dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
2348 dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse
2349 dnl underquoting misuses, such as
2350 dnl `AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'.
2351 dnl We normally wouldn't bother with this kind of workaround for invalid code
2352 dnl but this change was put in just before Autoconf 2.60 and we wanted to
2353 dnl minimize the integration hassle.
2354 [[case "(($ac_try" in
2355   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2356   *) ac_try_echo=$ac_try;;
2357 esac
2358 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""]
2359 AS_ECHO(["$ac_try_echo"])])
2361 # _AC_DO(COMMAND)
2362 # ---------------
2363 # Eval COMMAND, save the exit status in ac_status, and log it.
2364 # For internal use only.
2365 AC_DEFUN([_AC_DO],
2366 [_AC_RUN_LOG([eval "$1"],
2367              [_AC_DO_ECHO([$1])])])
2370 # _AC_DO_STDERR(COMMAND)
2371 # ----------------------
2372 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2373 AC_DEFUN([_AC_DO_STDERR],
2374 [_AC_RUN_LOG_STDERR([eval "$1"],
2375                     [_AC_DO_ECHO([$1])])])
2378 # _AC_DO_VAR(VARIABLE)
2379 # --------------------
2380 # Evaluate "$VARIABLE", which should be a valid shell command.
2381 # The purpose of this macro is to write "configure:123: command line"
2382 # into config.log for every test run.
2383 AC_DEFUN([_AC_DO_VAR],
2384 [_AC_DO([$$1])])
2387 # _AC_DO_TOKENS(COMMAND)
2388 # ----------------------
2389 # Like _AC_DO_VAR, but execute COMMAND instead, where COMMAND is a series of
2390 # tokens of the shell command language.
2391 AC_DEFUN([_AC_DO_TOKENS],
2392 [{ ac_try='$1'
2393   _AC_DO([$ac_try]); }])
2396 # _AC_DO_LIMIT(COMMAND, [LINES])
2397 # ------------------------------
2398 # Like _AC_DO, but limit the amount of stderr lines logged to LINES.
2399 # For internal use only.
2400 AC_DEFUN([_AC_DO_LIMIT],
2401 [_AC_RUN_LOG_LIMIT([eval "$1"],
2402                    [_AC_DO_ECHO([$1])], [$2])])
2405 # _AC_EVAL(COMMAND)
2406 # -----------------
2407 # Eval COMMAND, save the exit status in ac_status, and log it.
2408 # Unlike _AC_DO, this macro mishandles quoted arguments in some cases.
2409 # It is present only for backward compatibility with previous Autoconf versions.
2410 AC_DEFUN([_AC_EVAL],
2411 [_AC_RUN_LOG([eval $1],
2412              [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2415 # _AC_EVAL_STDERR(COMMAND)
2416 # ------------------------
2417 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2418 # Unlike _AC_DO_STDERR, this macro mishandles quoted arguments in some cases.
2419 # It is present only for backward compatibility with previous Autoconf versions.
2420 AC_DEFUN([_AC_EVAL_STDERR],
2421 [_AC_RUN_LOG_STDERR([eval $1],
2422                     [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2425 # AC_TRY_EVAL(VARIABLE)
2426 # ---------------------
2427 # Evaluate $VARIABLE, which should be a valid shell command.
2428 # The purpose of this macro is to write "configure:123: command line"
2429 # into config.log for every test run.
2431 # The AC_TRY_EVAL and AC_TRY_COMMAND macros are dangerous and
2432 # undocumented, and should not be used.
2433 # They may be removed or their API changed in a future release.
2434 # Autoconf itself no longer uses these two macros; they are present
2435 # only for backward compatibility with previous versions of Autoconf.
2436 # Not every shell command will work due to problems with eval
2437 # and quoting, and the rules for exactly what does work are tricky.
2438 # Worse, due to double-expansion during evaluation, arbitrary unintended
2439 # shell commands could be executed in some situations.
2440 AC_DEFUN([AC_TRY_EVAL],
2441 [_AC_EVAL([$$1])])
2444 # AC_TRY_COMMAND(COMMAND)
2445 # -----------------------
2446 # Like AC_TRY_EVAL, but execute COMMAND instead, where COMMAND is a series of
2447 # tokens of the shell command language.
2448 # This macro should not be used; see the comments under AC_TRY_EVAL for why.
2449 AC_DEFUN([AC_TRY_COMMAND],
2450 [{ ac_try='$1'
2451   _AC_EVAL([$ac_try]); }])
2454 # AC_RUN_LOG(COMMAND)
2455 # -------------------
2456 AC_DEFUN([AC_RUN_LOG],
2457 [_AC_RUN_LOG([$1],
2458              [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"])])])
2463 ## ------------------------ ##
2464 ## Examining declarations.  ##
2465 ## ------------------------ ##
2468 # _AC_PREPROC_IFELSE_BODY
2469 # -----------------------
2470 # Shell function body for _AC_PREPROC_IFELSE.
2471 m4_define([_AC_PREPROC_IFELSE_BODY],
2472 [  AS_LINENO_PUSH([$[]1])
2473   AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) > conftest.i && {
2474          test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2475          test ! -s conftest.err
2476        }],
2477     [ac_retval=0],
2478     [_AC_MSG_LOG_CONFTEST
2479     ac_retval=1])
2480   AS_LINENO_POP
2481   AS_SET_STATUS([$ac_retval])
2482 ])# _AC_PREPROC_IFELSE_BODY
2485 # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2486 # ----------------------------------------------------------------
2487 # Try to preprocess PROGRAM.
2489 # This macro can be used during the selection of a preprocessor.
2490 # eval is necessary to expand ac_cpp.
2491 AC_DEFUN([_AC_PREPROC_IFELSE],
2492 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_cpp],
2493   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
2494     [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
2495   [$0_BODY])]dnl
2496 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2497 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
2498 rm -f conftest.err conftest.i[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2499 ])# _AC_PREPROC_IFELSE
2501 # AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2502 # ---------------------------------------------------------------
2503 # Try to preprocess PROGRAM.  Requires that the preprocessor for the
2504 # current language was checked for, hence do not use this macro in macros
2505 # looking for a preprocessor.
2506 AC_DEFUN([AC_PREPROC_IFELSE],
2507 [AC_LANG_PREPROC_REQUIRE()dnl
2508 _AC_PREPROC_IFELSE($@)])
2511 # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2512 # ---------------------------------------------------------
2513 # AC_TRY_CPP is used to check whether particular header files exist.
2514 # (But it actually tests whether INCLUDES produces no CPP errors.)
2516 # INCLUDES are not defaulted and are double quoted.
2517 AU_DEFUN([AC_TRY_CPP],
2518 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
2521 # AC_EGREP_CPP(PATTERN, PROGRAM,
2522 #              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2523 # ------------------------------------------------------
2524 # Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
2525 # come early, it is not included in AC_BEFORE checks.
2526 AC_DEFUN([AC_EGREP_CPP],
2527 [AC_LANG_PREPROC_REQUIRE()dnl
2528 AC_REQUIRE([AC_PROG_EGREP])dnl
2529 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
2530 AS_IF([dnl eval is necessary to expand ac_cpp.
2531 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
2532 (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
2533 dnl Quote $1 to prevent m4 from eating character classes
2534   $EGREP "[$1]" >/dev/null 2>&1],
2535   [$3],
2536   [$4])
2537 rm -f conftest*
2538 ])# AC_EGREP_CPP
2541 # AC_EGREP_HEADER(PATTERN, HEADER-FILE,
2542 #                 [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2543 # ---------------------------------------------------------
2544 AC_DEFUN([AC_EGREP_HEADER],
2545 [AC_EGREP_CPP([$1],
2546 [#include <$2>
2547 ], [$3], [$4])])
2552 ## ------------------ ##
2553 ## Examining syntax.  ##
2554 ## ------------------ ##
2556 # _AC_COMPILE_IFELSE_BODY
2557 # -----------------------
2558 # Shell function body for _AC_COMPILE_IFELSE.
2559 m4_define([_AC_COMPILE_IFELSE_BODY],
2560 [  AS_LINENO_PUSH([$[]1])
2561   rm -f conftest.$ac_objext
2562   AS_IF([_AC_DO_STDERR($ac_compile) && {
2563          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2564          test ! -s conftest.err
2565        } && test -s conftest.$ac_objext],
2566       [ac_retval=0],
2567       [_AC_MSG_LOG_CONFTEST
2568         ac_retval=1])
2569   AS_LINENO_POP
2570   AS_SET_STATUS([$ac_retval])
2571 ])# _AC_COMPILE_IFELSE_BODY
2574 # _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2575 # ----------------------------------------------------------------
2576 # Try to compile PROGRAM.
2577 # This macro can be used during the selection of a compiler.
2578 AC_DEFUN([_AC_COMPILE_IFELSE],
2579 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_compile],
2580   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_compile], [LINENO],
2581     [Try to compile conftest.$ac_ext, and return whether this succeeded.])],
2582   [$0_BODY])]dnl
2583 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2584 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
2585 rm -f core conftest.err conftest.$ac_objext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2586 ])# _AC_COMPILE_IFELSE
2589 # AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2590 # ---------------------------------------------------------------
2591 # Try to compile PROGRAM.  Requires that the compiler for the current
2592 # language was checked for, hence do not use this macro in macros looking
2593 # for a compiler.
2594 AC_DEFUN([AC_COMPILE_IFELSE],
2595 [AC_LANG_COMPILER_REQUIRE()dnl
2596 _AC_COMPILE_IFELSE($@)])
2599 # AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
2600 #                [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2601 # ---------------------------------------------------
2602 AU_DEFUN([AC_TRY_COMPILE],
2603 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2607 ## --------------------- ##
2608 ## Examining libraries.  ##
2609 ## --------------------- ##
2612 # _AC_LINK_IFELSE_BODY
2613 # --------------------
2614 # Shell function body for _AC_LINK_IFELSE.
2615 m4_define([_AC_LINK_IFELSE_BODY],
2616 [  AS_LINENO_PUSH([$[]1])
2617   rm -f conftest.$ac_objext conftest$ac_exeext
2618   AS_IF([_AC_DO_STDERR($ac_link) && {
2619          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2620          test ! -s conftest.err
2621        } && test -s conftest$ac_exeext && {
2622          test "$cross_compiling" = yes ||
2623          AS_TEST_X([conftest$ac_exeext])
2624        }],
2625       [ac_retval=0],
2626       [_AC_MSG_LOG_CONFTEST
2627         ac_retval=1])
2628   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2629   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2630   # interfere with the next link command; also delete a directory that is
2631   # left behind by Apple's compiler.  We do this before executing the actions.
2632   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2633   AS_LINENO_POP
2634   AS_SET_STATUS([$ac_retval])
2635 ])# _AC_LINK_IFELSE_BODY
2638 # _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2639 # -------------------------------------------------------------
2640 # Try to link PROGRAM.
2641 # This macro can be used during the selection of a compiler.
2643 # Test that resulting file is executable; see the problem reported by mwoehlke
2644 # in <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00048.html>.
2645 # But skip the test when cross-compiling, to prevent problems like the one
2646 # reported by Chris Johns in
2647 # <http://lists.gnu.org/archive/html/autoconf/2007-03/msg00085.html>.
2649 AC_DEFUN([_AC_LINK_IFELSE],
2650 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_link],
2651   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_link], [LINENO],
2652     [Try to link conftest.$ac_ext, and return whether this succeeded.])],
2653   [$0_BODY])]dnl
2654 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2655 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_link "$LINENO"], [$2], [$3])
2656 rm -f core conftest.err conftest.$ac_objext \
2657     conftest$ac_exeext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2658 ])# _AC_LINK_IFELSE
2661 # AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2662 # ------------------------------------------------------------
2663 # Try to link PROGRAM.  Requires that the compiler for the current
2664 # language was checked for, hence do not use this macro in macros looking
2665 # for a compiler.
2666 AC_DEFUN([AC_LINK_IFELSE],
2667 [AC_LANG_COMPILER_REQUIRE()dnl
2668 _AC_LINK_IFELSE($@)])
2671 # AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
2672 #             [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2673 # ------------------------------------------------
2674 # Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
2675 AU_DEFUN([AC_TRY_LINK],
2676 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2679 # AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
2680 #                  ACTION-IF-TRUE, [ACTION-IF-FALSE])
2681 # ---------------------------------------------------
2682 AU_DEFUN([AC_COMPILE_CHECK],
2683 [m4_ifvaln([$1], [AC_MSG_CHECKING([for $1])])dnl
2684 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])])
2689 ## ------------------------------- ##
2690 ## Checking for runtime features.  ##
2691 ## ------------------------------- ##
2694 # _AC_RUN_IFELSE_BODY
2695 # -------------------
2696 # Shell function body for _AC_RUN_IFELSE.
2697 m4_define([_AC_RUN_IFELSE_BODY],
2698 [  AS_LINENO_PUSH([$[]1])
2699   AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
2700       [ac_retval=0],
2701       [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
2702        _AC_MSG_LOG_CONFTEST
2703        ac_retval=$ac_status])
2704   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2705   AS_LINENO_POP
2706   AS_SET_STATUS([$ac_retval])
2707 ])# _AC_RUN_IFELSE_BODY
2710 # _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2711 # ------------------------------------------------------------
2712 # Compile, link, and run.
2713 # This macro can be used during the selection of a compiler.
2714 # We also remove conftest.o as if the compilation fails, some compilers
2715 # don't remove it.  We remove gmon.out and bb.out, which may be
2716 # created during the run if the program is built with profiling support.
2717 AC_DEFUN([_AC_RUN_IFELSE],
2718 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run],
2719   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run], [LINENO],
2720     [Try to link conftest.$ac_ext, and return whether this succeeded.
2721      Assumes that executables *can* be run.])],
2722   [$0_BODY])]dnl
2723 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2724 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run "$LINENO"], [$2], [$3])
2725 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2726   conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2727 ])# _AC_RUN_IFELSE
2729 # AC_RUN_IFELSE(PROGRAM,
2730 #               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2731 #               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2732 # ----------------------------------------------------------
2733 # Compile, link, and run. Requires that the compiler for the current
2734 # language was checked for, hence do not use this macro in macros looking
2735 # for a compiler.
2736 AC_DEFUN([AC_RUN_IFELSE],
2737 [AC_LANG_COMPILER_REQUIRE()dnl
2738 m4_ifval([$4], [],
2739          [AC_DIAGNOSE([cross],
2740                      [$0 called without default to allow cross compiling])])dnl
2741 AS_IF([test "$cross_compiling" = yes],
2742   [m4_default([$4],
2743            [AC_MSG_FAILURE([cannot run test program while cross compiling])])],
2744   [_AC_RUN_IFELSE($@)])
2748 # AC_TRY_RUN(PROGRAM,
2749 #            [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2750 #            [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2751 # -------------------------------------------------------
2752 AU_DEFUN([AC_TRY_RUN],
2753 [AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])
2757 ## ------------------------------------- ##
2758 ## Checking for the existence of files.  ##
2759 ## ------------------------------------- ##
2761 # AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2762 # -------------------------------------------------------------
2764 # Check for the existence of FILE.
2765 AC_DEFUN([AC_CHECK_FILE],
2766 [AC_DIAGNOSE([cross],
2767              [cannot check for file existence when cross compiling])dnl
2768 AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
2769 AC_CACHE_CHECK([for $1], [ac_File],
2770 [test "$cross_compiling" = yes &&
2771   AC_MSG_ERROR([cannot check for file existence when cross compiling])
2772 if test -r "$1"; then
2773   AS_VAR_SET([ac_File], [yes])
2774 else
2775   AS_VAR_SET([ac_File], [no])
2776 fi])
2777 AS_VAR_IF([ac_File], [yes], [$2], [$3])
2778 AS_VAR_POPDEF([ac_File])dnl
2779 ])# AC_CHECK_FILE
2782 # _AC_CHECK_FILES(FILE)
2783 # ---------------------
2784 # Helper to AC_CHECK_FILES, which generates two of the three arguments
2785 # to AC_CHECK_FILE based on FILE.
2786 m4_define([_AC_CHECK_FILES],
2787 [[$1], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
2788   [Define to 1 if you have the file `$1'.])]])
2791 # AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2792 # -----------------------------------------------------------------
2793 # For each word in the whitespace-separated FILE list, perform either
2794 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.  For files that exist, also
2795 # provide the preprocessor variable HAVE_FILE.
2796 AC_DEFUN([AC_CHECK_FILES],
2797 [m4_map_args_w([$1], [AC_CHECK_FILE(_$0(], [)[$2], [$3])])])
2800 ## ------------------------------- ##
2801 ## Checking for declared symbols.  ##
2802 ## ------------------------------- ##
2805 # _AC_CHECK_DECL_BODY
2806 # -------------------
2807 # Shell function body for AC_CHECK_DECL.
2808 m4_define([_AC_CHECK_DECL_BODY],
2809 [  AS_LINENO_PUSH([$[]1])
2810   [as_decl_name=`echo $][2|sed 's/ *(.*//'`]
2811   [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
2812   AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
2813   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
2814 [@%:@ifndef $[]as_decl_name
2815 @%:@ifdef __cplusplus
2816   (void) $[]as_decl_use;
2817 @%:@else
2818   (void) $[]as_decl_name;
2819 @%:@endif
2820 @%:@endif
2821 ])],
2822                    [AS_VAR_SET([$[]3], [yes])],
2823                    [AS_VAR_SET([$[]3], [no])])])
2824   AS_LINENO_POP
2825 ])# _AC_CHECK_DECL_BODY
2827 # AC_CHECK_DECL(SYMBOL,
2828 #               [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2829 #               [INCLUDES = DEFAULT-INCLUDES])
2830 # -------------------------------------------------------
2831 # Check whether SYMBOL (a function, variable, or constant) is declared.
2832 AC_DEFUN([AC_CHECK_DECL],
2833 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_decl],
2834   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_decl],
2835     [LINENO SYMBOL VAR INCLUDES],
2836     [Tests whether SYMBOL is declared in INCLUDES, setting cache variable
2837      VAR accordingly.])],
2838   [_$0_BODY])]dnl
2839 [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl
2840 [ac_fn_[]_AC_LANG_ABBREV[]_check_decl ]dnl
2841 ["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])"
2842 AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])
2843 AS_VAR_POPDEF([ac_Symbol])dnl
2844 ])# AC_CHECK_DECL
2847 # _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
2848 #                 INCLUDES)
2849 # -------------------------------------------------------------
2850 # Helper to AC_CHECK_DECLS, which generates the check for a single
2851 # SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
2852 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
2853 m4_define([_AC_CHECK_DECLS],
2854 [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
2855 [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])),
2856   [$ac_have_decl],
2857   [Define to 1 if you have the declaration of `$1',
2858    and to 0 if you don't.])]dnl
2859 [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
2861 # AC_CHECK_DECLS(SYMBOLS,
2862 #                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2863 #                [INCLUDES = DEFAULT-INCLUDES])
2864 # --------------------------------------------------------
2865 # Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise.  See the
2866 # documentation for a detailed explanation of this difference with
2867 # other AC_CHECK_*S macros.  SYMBOLS is an m4 list.
2868 AC_DEFUN([AC_CHECK_DECLS],
2869 [m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)])
2872 # _AC_CHECK_DECL_ONCE(SYMBOL)
2873 # ---------------------------
2874 # Check for a single SYMBOL once.
2875 m4_define([_AC_CHECK_DECL_ONCE],
2876 [AC_DEFUN([_AC_Check_Decl_$1], [_AC_CHECK_DECLS([$1])])]dnl
2877 [AC_REQUIRE([_AC_Check_Decl_$1])])
2879 # AC_CHECK_DECLS_ONCE(SYMBOLS)
2880 # ----------------------------
2881 # Like AC_CHECK_DECLS(SYMBOLS), but do it at most once.
2882 AC_DEFUN([AC_CHECK_DECLS_ONCE],
2883 [m4_map_args_sep([_AC_CHECK_DECL_ONCE(], [)], [], $1)])
2887 ## ---------------------------------- ##
2888 ## Replacement of library functions.  ##
2889 ## ---------------------------------- ##
2892 # AC_CONFIG_LIBOBJ_DIR(DIRNAME)
2893 # -----------------------------
2894 # Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME.
2895 AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR],
2896 [m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])])
2899 # AC_LIBSOURCE(FILE-NAME)
2900 # -----------------------
2901 # Announce we might need the file `FILE-NAME'.
2902 m4_define([AC_LIBSOURCE], [])
2905 # AC_LIBSOURCES([FILE-NAME1, ...])
2906 # --------------------------------
2907 # Announce we might need these files.
2908 AC_DEFUN([AC_LIBSOURCES],
2909 [m4_map_args([AC_LIBSOURCE], $1)])
2912 # _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR)
2913 # --------------------------------------------
2914 # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
2915 m4_define([_AC_LIBOBJ],
2916 [AS_LITERAL_WORD_IF([$1],
2917                [AC_LIBSOURCE([$1.c])],
2918                [$2])dnl
2919 case " $LIB@&t@OBJS " in
2920   *" $1.$ac_objext "* ) ;;
2921   *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;;
2922 esac
2926 # AC_LIBOBJ(FILE-NAME-NOEXT)
2927 # --------------------------
2928 # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
2929 AC_DEFUN([AC_LIBOBJ],
2930 [_AC_LIBOBJ([$1],
2931             [AC_DIAGNOSE(syntax,
2932                          [$0($1): you should use literals])])dnl
2936 # _AC_LIBOBJS_NORMALIZE
2937 # ---------------------
2938 # Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext,
2939 # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
2940 # Used with AC_CONFIG_COMMANDS_PRE.
2941 AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
2942 [ac_libobjs=
2943 ac_ltlibobjs=
2944 m4_ifndef([AM_C_PROTOTYPES], [U=
2945 ])dnl
2946 for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
2947   # 1. Remove the extension, and $U if already installed.
2948   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
2949   ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
2950   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
2951   #    will be set to the directory where LIBOBJS objects are built.
2952   AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
2953   AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
2954 done
2955 AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
2956 AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
2960 ## ----------------------------------- ##
2961 ## Checking compiler characteristics.  ##
2962 ## ----------------------------------- ##
2965 # _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
2966 #                         [IF-FAILURE])
2967 # ---------------------------------------------------------------------
2968 # Compute the integer EXPRESSION and store the result in the VARIABLE.
2969 # Works OK if cross compiling, but assumes twos-complement arithmetic.
2970 m4_define([_AC_COMPUTE_INT_COMPILE],
2971 [# Depending upon the size, compute the lo and hi bounds.
2972 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
2973  [ac_lo=0 ac_mid=0
2974   while :; do
2975     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2976                        [ac_hi=$ac_mid; break],
2977                        [AS_VAR_ARITH([ac_lo], [$ac_mid + 1])
2978                         if test $ac_lo -le $ac_mid; then
2979                           ac_lo= ac_hi=
2980                           break
2981                         fi
2982                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid + 1])])
2983   done],
2984 [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
2985  [ac_hi=-1 ac_mid=-1
2986   while :; do
2987     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
2988                        [ac_lo=$ac_mid; break],
2989                        [AS_VAR_ARITH([ac_hi], ['(' $ac_mid ')' - 1])
2990                         if test $ac_mid -le $ac_hi; then
2991                           ac_lo= ac_hi=
2992                           break
2993                         fi
2994                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid])])
2995   done],
2996  [ac_lo= ac_hi=])])
2997 # Binary search between lo and hi bounds.
2998 while test "x$ac_lo" != "x$ac_hi"; do
2999   AS_VAR_ARITH([ac_mid], ['(' $ac_hi - $ac_lo ')' / 2 + $ac_lo])
3000   _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
3001                      [ac_hi=$ac_mid],
3002                      [AS_VAR_ARITH([ac_lo], ['(' $ac_mid ')' + 1])])
3003 done
3004 case $ac_lo in @%:@((
3005 ?*) AS_VAR_SET([$2], [$ac_lo]); $4 ;;
3006 '') $5 ;;
3007 esac[]dnl
3008 ])# _AC_COMPUTE_INT_COMPILE
3011 # _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
3012 #                     [IF-FAILURE])
3013 # -----------------------------------------------------------------
3014 # Store the evaluation of the integer EXPRESSION in VARIABLE.
3016 # AC_LANG_INT_SAVE intentionally does not end the file in a newline, so
3017 # we must add one to make it a text file before passing it to read.
3018 m4_define([_AC_COMPUTE_INT_RUN],
3019 [_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
3020                 [echo >>conftest.val; read $2 <conftest.val; $4], [$5])
3021 rm -f conftest.val
3022 ])# _AC_COMPUTE_INT_RUN
3025 # _AC_COMPUTE_INT_BODY
3026 # --------------------
3027 # Shell function body for AC_COMPUTE_INT.
3028 m4_define([_AC_COMPUTE_INT_BODY],
3029 [  AS_LINENO_PUSH([$[]1])
3030   if test "$cross_compiling" = yes; then
3031     _AC_COMPUTE_INT_COMPILE([$[]2], [$[]3], [$[]4],
3032                             [ac_retval=0], [ac_retval=1])
3033   else
3034     _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4],
3035                         [ac_retval=0], [ac_retval=1])
3036   fi
3037   AS_LINENO_POP
3038   AS_SET_STATUS([$ac_retval])
3039 ])# _AC_COMPUTE_INT_BODY
3041 # AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
3042 # ----------------------------------------------------------
3043 # Store into the shell variable VARIABLE the value of the integer C expression
3044 # EXPRESSION.  The value should fit in an initializer in a C variable of type
3045 # `signed long'.  If no PROLOGUE are specified, the default includes are used.
3046 # IF-FAILS is evaluated if the value cannot be found (which includes the
3047 # case of cross-compilation, if EXPRESSION is not computable at compile-time.
3048 AC_DEFUN([AC_COMPUTE_INT],
3049 [AC_LANG_COMPILER_REQUIRE()]dnl
3050 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3051   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3052     [LINENO EXPR VAR INCLUDES],
3053     [Tries to find the compile-time value of EXPR in a program that includes
3054      INCLUDES, setting VAR accordingly.  Returns whether the value could
3055      be computed])],
3056     [_$0_BODY])]dnl
3057 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_compute_int "$LINENO" "$2" "$1" ]dnl
3058        ["AS_ESCAPE([$3], [""])"],
3059        [], [$4])
3060 ])# AC_COMPUTE_INT
3062 # _AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
3063 # -----------------------------------------------------------
3064 # FIXME: this private interface was used by several packages.
3065 # Give them time to transition to AC_COMPUTE_INT and then delete this one.
3066 AC_DEFUN([_AC_COMPUTE_INT],
3067 [AC_COMPUTE_INT([$2], [$1], [$3], [$4])
3068 AC_DIAGNOSE([obsolete],
3069 [The macro `_AC_COMPUTE_INT' is obsolete and will be deleted in a
3070 future version or Autoconf.  Hence, it is suggested that you use
3071 instead the public AC_COMPUTE_INT macro.  Note that the arguments are
3072 slightly different between the two.])dnl
3073 ])# _AC_COMPUTE_INT