Relax AC_INIT requirements for PACKAGE and VERSION strings again.
[autoconf.git] / lib / autoconf / general.m4
blob2873660119c1fa44cbc235bce71807d2d6dfc5d7
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.
229 # _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
230 # ---------------------------------------------------------------------
231 m4_define([_AC_INIT_PACKAGE],
232 [AS_LITERAL_HEREDOC_IF([$1], [],
233                        [m4_warn([syntax], [AC_INIT: not a literal: $1])])
234 AS_LITERAL_HEREDOC_IF([$2], [],
235                       [m4_warn([syntax], [AC_INIT: not a literal: $2])])
236 AS_LITERAL_IF([$3], [],  [m4_warn([syntax], [AC_INIT: not a literal: $3])])
237 m4_ifndef([AC_PACKAGE_NAME],
238           [m4_define([AC_PACKAGE_NAME],     [$1])])
239 m4_ifndef([AC_PACKAGE_TARNAME],
240           [m4_define([AC_PACKAGE_TARNAME],
241                      m4_default([$4],
242                                 [m4_bpatsubst(m4_tolower(m4_bpatsubst([[$1]],
243                                                                      [GNU ])),
244                                  [[^_abcdefghijklmnopqrstuvwxyz0123456789]],
245                                  [-])]))])
246 m4_ifndef([AC_PACKAGE_VERSION],
247           [m4_define([AC_PACKAGE_VERSION],   [$2])])
248 m4_ifndef([AC_PACKAGE_STRING],
249           [m4_define([AC_PACKAGE_STRING],    [$1 $2])])
250 m4_ifndef([AC_PACKAGE_BUGREPORT],
251           [m4_define([AC_PACKAGE_BUGREPORT], [$3])])
252 m4_ifndef([AC_PACKAGE_URL],
253           [m4_define([AC_PACKAGE_URL],
254   m4_if([$5], [], [m4_if(m4_index([$1], [GNU ]), [0],
255           [[http://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]])],
256         [[$5]]))])
260 # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER],
261 #              [FILTER = m4_newline])
262 # ------------------------------------------------------
263 # Emit TEXT, a copyright notice, in the top of `configure' and in
264 # --version output.  Macros in TEXT are evaluated once.  Process
265 # the --version output through FILTER (m4_newline, m4_do, and
266 # m4_copyright_condense are common filters).
267 m4_define([AC_COPYRIGHT],
268 [AS_COPYRIGHT([$1])[]]dnl
269 [m4_divert_text(m4_default_quoted([$2], [VERSION_USER]),
270 [m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT
273 # AC_REVISION(REVISION-INFO)
274 # --------------------------
275 # The second quote in the translit is just to cope with font-lock-mode
276 # which sees the opening of a string.
277 m4_define([AC_REVISION],
278 [m4_divert_text([HEADER-REVISION],
279                 [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
285 ## ---------------------------------------- ##
286 ## Requirements over the Autoconf version.  ##
287 ## ---------------------------------------- ##
290 # AU::AC_PREREQ(VERSION)
291 # ----------------------
292 # Update this `AC_PREREQ' statement to require the current version of
293 # Autoconf.  But fail if ever this autoupdate is too old.
295 # Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before
296 # calling `AU_DEFUN', i.e., it is hard coded.  Otherwise it would be
297 # quite complex for autoupdate to import the value of
298 # `m4_PACKAGE_VERSION'.  We could `AU_DEFUN' `m4_PACKAGE_VERSION', but
299 # this would replace all its occurrences with the current version of
300 # Autoconf, which is certainly not what the user intended.
301 AU_DEFUN([AC_PREREQ],
302 [m4_version_prereq([$1])[]dnl
303 [AC_PREREQ(]]m4_dquote(m4_dquote(m4_defn([m4_PACKAGE_VERSION])))[[)]])
306 # AC_PREREQ(VERSION)
307 # ------------------
308 # Complain and exit if the Autoconf version is less than VERSION.
309 m4_undefine([AC_PREREQ])
310 m4_copy([m4_version_prereq], [AC_PREREQ])
313 # AC_AUTOCONF_VERSION
314 # -------------------
315 # The current version of Autoconf parsing this file.
316 m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])
322 ## ---------------- ##
323 ## Initialization.  ##
324 ## ---------------- ##
327 # All the following macros are used by AC_INIT.  Ideally, they should
328 # be presented in the order in which they are output.  Please, help us
329 # sorting it, or at least, don't augment the entropy.
332 # _AC_INIT_NOTICE
333 # ---------------
334 # Provide useful headers; override the HEADER-COMMENT created by M4sh.
335 m4_define([_AC_INIT_NOTICE],
336 [m4_cleardivert([HEADER-COMMENT])]dnl
337 [m4_divert_text([HEADER-COMMENT],
338 [@%:@ Guess values for system-dependent variables and create Makefiles.
339 @%:@ Generated by m4_PACKAGE_STRING[]dnl
340 m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
342 m4_ifset([AC_PACKAGE_BUGREPORT],
343          [m4_divert_text([HEADER-COMMENT],
344                          [@%:@
345 @%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
349 # _AC_INIT_COPYRIGHT
350 # ------------------
351 # We dump to VERSION_FSF to make sure we are inserted before the
352 # user copyrights, and after the setup of the --version handling.
353 m4_define([_AC_INIT_COPYRIGHT],
354 [AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [
355 m4_copyright_condense])dnl
356 AC_COPYRIGHT(
357 [This configure script is free software; the Free Software Foundation
358 gives unlimited permission to copy, distribute and modify it.],
359              [VERSION_FSF], [m4_echo])])
362 # File Descriptors
363 # ----------------
364 # Set up the file descriptors used by `configure'.
365 # File descriptor usage:
366 # 0 standard input (/dev/null)
367 # 1 file creation
368 # 2 errors and warnings
369 # AS_MESSAGE_LOG_FD compiler messages saved in config.log
370 # AS_MESSAGE_FD checking for... messages and results
371 # AS_ORIGINAL_STDIN_FD original standard input (still open)
373 # stdin is /dev/null because checks that run programs may
374 # inadvertently run interactive ones, which would stop configuration
375 # until someone typed an EOF.
376 m4_define([AS_MESSAGE_FD], 6)
377 m4_define([AS_ORIGINAL_STDIN_FD], 7)
378 # That's how they used to be named.
379 AU_ALIAS([AC_FD_CC],  [AS_MESSAGE_LOG_FD])
380 AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
383 # _AC_INIT_DEFAULTS
384 # -----------------
385 # Values which defaults can be set from `configure.ac'.
386 # `/bin/machine' is used in `glibcbug'.  The others are used in config.*
387 m4_define([_AC_INIT_DEFAULTS],
388 [m4_divert_push([DEFAULTS])dnl
390 test -n "$DJDIR" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null
391 exec AS_MESSAGE_FD>&1
393 # Name of the host.
394 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
395 # so uname gets run too.
396 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
399 # Initializations.
401 ac_default_prefix=/usr/local
402 ac_clean_files=
403 ac_config_libobj_dir=.
404 LIB@&t@OBJS=
405 cross_compiling=no
406 subdirs=
407 MFLAGS=
408 MAKEFLAGS=
409 AC_SUBST([SHELL])dnl
410 AC_SUBST([PATH_SEPARATOR])dnl
412 # Identity of this package.
413 AC_SUBST([PACKAGE_NAME],
414          [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])dnl
415 AC_SUBST([PACKAGE_TARNAME],
416          [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
417 AC_SUBST([PACKAGE_VERSION],
418          [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
419 AC_SUBST([PACKAGE_STRING],
420          [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
421 AC_SUBST([PACKAGE_BUGREPORT],
422          [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
423 AC_SUBST([PACKAGE_URL],
424          [m4_ifdef([AC_PACKAGE_URL],       ['AC_PACKAGE_URL'])])dnl
426 m4_divert_pop([DEFAULTS])dnl
427 m4_wrap_lifo([m4_divert_text([DEFAULTS],
428 [ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)'
429 ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
430 ac_user_opts='
431 enable_option_checking
432 m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS])
434 m4_ifdef([_AC_PRECIOUS_VARS],
435   [_AC_ARG_VAR_STORE[]dnl
436    _AC_ARG_VAR_VALIDATE[]dnl
437    ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])'])
438 m4_ifdef([_AC_LIST_SUBDIRS],
439   [ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl
440 ])])dnl
441 ])# _AC_INIT_DEFAULTS
444 # AC_PREFIX_DEFAULT(PREFIX)
445 # -------------------------
446 AC_DEFUN([AC_PREFIX_DEFAULT],
447 [m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
450 # AC_PREFIX_PROGRAM(PROGRAM)
451 # --------------------------
452 # Guess the value for the `prefix' variable by looking for
453 # the argument program along PATH and taking its parent.
454 # Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
455 # set `prefix' to /usr/local/gnu.
456 # This comes too late to find a site file based on the prefix,
457 # and it might use a cached value for the path.
458 # No big loss, I think, since most configures don't use this macro anyway.
459 AC_DEFUN([AC_PREFIX_PROGRAM],
460 [if test "x$prefix" = xNONE; then
461 dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
462   _AS_ECHO_N([checking for prefix by ])
463   AC_PATH_PROG(ac_prefix_program, [$1])
464   if test -n "$ac_prefix_program"; then
465     prefix=`AS_DIRNAME(["$ac_prefix_program"])`
466     prefix=`AS_DIRNAME(["$prefix"])`
467   fi
469 ])# AC_PREFIX_PROGRAM
472 # AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
473 # ---------------------------------------------
474 # UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package,
475 # relative to the directory that configure is in, which we can look
476 # for to find out if srcdir is correct.
477 AC_DEFUN([AC_CONFIG_SRCDIR],
478 [m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
481 # _AC_INIT_DIRCHECK
482 # -----------------
483 # Set ac_pwd, and sanity-check it and the source and installation directories.
485 # (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
487 AC_DEFUN([_AC_INIT_DIRCHECK],
488 [m4_divert_push([PARSE_ARGS])dnl
490 ac_pwd=`pwd` && test -n "$ac_pwd" &&
491 ac_ls_di=`ls -di .` &&
492 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
493   AC_MSG_ERROR([working directory cannot be determined])
494 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
495   AC_MSG_ERROR([pwd does not report name of working directory])
497 m4_divert_pop([PARSE_ARGS])dnl
498 ])# _AC_INIT_DIRCHECK
500 # _AC_INIT_SRCDIR
501 # ---------------
502 # Compute `srcdir' based on `$ac_unique_file'.
504 # (We have to AC_DEFUN it, since we use AC_REQUIRE.)
506 AC_DEFUN([_AC_INIT_SRCDIR],
507 [AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
508 m4_divert_push([PARSE_ARGS])dnl
510 # Find the source files, if location was not specified.
511 if test -z "$srcdir"; then
512   ac_srcdir_defaulted=yes
513   # Try the directory containing this script, then the parent directory.
514   ac_confdir=`AS_DIRNAME(["$as_myself"])`
515   srcdir=$ac_confdir
516   if test ! -r "$srcdir/$ac_unique_file"; then
517     srcdir=..
518   fi
519 else
520   ac_srcdir_defaulted=no
522 if test ! -r "$srcdir/$ac_unique_file"; then
523   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
524   AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
526 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
527 ac_abs_confdir=`(
528         cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
529         pwd)`
530 # When building in place, set srcdir=.
531 if test "$ac_abs_confdir" = "$ac_pwd"; then
532   srcdir=.
534 # Remove unnecessary trailing slashes from srcdir.
535 # Double slashes in file names in object file debugging info
536 # mess up M-x gdb in Emacs.
537 case $srcdir in
538 */) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
539 esac
540 m4_divert_pop([PARSE_ARGS])dnl
541 ])# _AC_INIT_SRCDIR
544 # _AC_INIT_PARSE_ARGS
545 # -------------------
546 m4_define([_AC_INIT_PARSE_ARGS],
547 [m4_divert_push([PARSE_ARGS])dnl
549 # Initialize some variables set by options.
550 ac_init_help=
551 ac_init_version=false
552 ac_unrecognized_opts=
553 ac_unrecognized_sep=
554 # The variables have the same names as the options, with
555 # dashes changed to underlines.
556 cache_file=/dev/null
557 AC_SUBST(exec_prefix, NONE)dnl
558 no_create=
559 no_recursion=
560 AC_SUBST(prefix, NONE)dnl
561 program_prefix=NONE
562 program_suffix=NONE
563 AC_SUBST(program_transform_name, [s,x,x,])dnl
564 silent=
565 site=
566 srcdir=
567 verbose=
568 x_includes=NONE
569 x_libraries=NONE
571 # Installation directory options.
572 # These are left unexpanded so users can "make install exec_prefix=/foo"
573 # and all the variables that are supposed to be based on exec_prefix
574 # by default will actually change.
575 # Use braces instead of parens because sh, perl, etc. also accept them.
576 # (The list follows the same order as the GNU Coding Standards.)
577 AC_SUBST([bindir],         ['${exec_prefix}/bin'])dnl
578 AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
579 AC_SUBST([libexecdir],     ['${exec_prefix}/libexec'])dnl
580 AC_SUBST([datarootdir],    ['${prefix}/share'])dnl
581 AC_SUBST([datadir],        ['${datarootdir}'])dnl
582 AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
583 AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
584 AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
585 AC_SUBST([includedir],     ['${prefix}/include'])dnl
586 AC_SUBST([oldincludedir],  ['/usr/include'])dnl
587 AC_SUBST([docdir],         [m4_ifset([AC_PACKAGE_TARNAME],
588                                      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
589                                      ['${datarootdir}/doc/${PACKAGE}'])])dnl
590 AC_SUBST([infodir],        ['${datarootdir}/info'])dnl
591 AC_SUBST([htmldir],        ['${docdir}'])dnl
592 AC_SUBST([dvidir],         ['${docdir}'])dnl
593 AC_SUBST([pdfdir],         ['${docdir}'])dnl
594 AC_SUBST([psdir],          ['${docdir}'])dnl
595 AC_SUBST([libdir],         ['${exec_prefix}/lib'])dnl
596 AC_SUBST([localedir],      ['${datarootdir}/locale'])dnl
597 AC_SUBST([mandir],         ['${datarootdir}/man'])dnl
599 ac_prev=
600 ac_dashdash=
601 for ac_option
603   # If the previous option needs an argument, assign it.
604   if test -n "$ac_prev"; then
605     eval $ac_prev=\$ac_option
606     ac_prev=
607     continue
608   fi
610   case $ac_option in
611   *=*)  ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;;
612   *)    ac_optarg=yes ;;
613   esac
615   # Accept the important Cygnus configure options, so we can diagnose typos.
617   case $ac_dashdash$ac_option in
618   --)
619     ac_dashdash=yes ;;
621   -bindir | --bindir | --bindi | --bind | --bin | --bi)
622     ac_prev=bindir ;;
623   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
624     bindir=$ac_optarg ;;
626   -build | --build | --buil | --bui | --bu)
627     ac_prev=build_alias ;;
628   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
629     build_alias=$ac_optarg ;;
631   -cache-file | --cache-file | --cache-fil | --cache-fi \
632   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
633     ac_prev=cache_file ;;
634   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
635   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
636     cache_file=$ac_optarg ;;
638   --config-cache | -C)
639     cache_file=config.cache ;;
641   -datadir | --datadir | --datadi | --datad)
642     ac_prev=datadir ;;
643   -datadir=* | --datadir=* | --datadi=* | --datad=*)
644     datadir=$ac_optarg ;;
646   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
647   | --dataroo | --dataro | --datar)
648     ac_prev=datarootdir ;;
649   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
650   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
651     datarootdir=$ac_optarg ;;
653   _AC_INIT_PARSE_ENABLE([disable])
655   -docdir | --docdir | --docdi | --doc | --do)
656     ac_prev=docdir ;;
657   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
658     docdir=$ac_optarg ;;
660   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
661     ac_prev=dvidir ;;
662   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
663     dvidir=$ac_optarg ;;
665   _AC_INIT_PARSE_ENABLE([enable])
667   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
668   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
669   | --exec | --exe | --ex)
670     ac_prev=exec_prefix ;;
671   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
672   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
673   | --exec=* | --exe=* | --ex=*)
674     exec_prefix=$ac_optarg ;;
676   -gas | --gas | --ga | --g)
677     # Obsolete; use --with-gas.
678     with_gas=yes ;;
680   -help | --help | --hel | --he | -h)
681     ac_init_help=long ;;
682   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
683     ac_init_help=recursive ;;
684   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
685     ac_init_help=short ;;
687   -host | --host | --hos | --ho)
688     ac_prev=host_alias ;;
689   -host=* | --host=* | --hos=* | --ho=*)
690     host_alias=$ac_optarg ;;
692   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
693     ac_prev=htmldir ;;
694   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
695   | --ht=*)
696     htmldir=$ac_optarg ;;
698   -includedir | --includedir | --includedi | --included | --include \
699   | --includ | --inclu | --incl | --inc)
700     ac_prev=includedir ;;
701   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
702   | --includ=* | --inclu=* | --incl=* | --inc=*)
703     includedir=$ac_optarg ;;
705   -infodir | --infodir | --infodi | --infod | --info | --inf)
706     ac_prev=infodir ;;
707   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
708     infodir=$ac_optarg ;;
710   -libdir | --libdir | --libdi | --libd)
711     ac_prev=libdir ;;
712   -libdir=* | --libdir=* | --libdi=* | --libd=*)
713     libdir=$ac_optarg ;;
715   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
716   | --libexe | --libex | --libe)
717     ac_prev=libexecdir ;;
718   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
719   | --libexe=* | --libex=* | --libe=*)
720     libexecdir=$ac_optarg ;;
722   -localedir | --localedir | --localedi | --localed | --locale)
723     ac_prev=localedir ;;
724   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
725     localedir=$ac_optarg ;;
727   -localstatedir | --localstatedir | --localstatedi | --localstated \
728   | --localstate | --localstat | --localsta | --localst | --locals)
729     ac_prev=localstatedir ;;
730   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
731   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
732     localstatedir=$ac_optarg ;;
734   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
735     ac_prev=mandir ;;
736   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
737     mandir=$ac_optarg ;;
739   -nfp | --nfp | --nf)
740     # Obsolete; use --without-fp.
741     with_fp=no ;;
743   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
744   | --no-cr | --no-c | -n)
745     no_create=yes ;;
747   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
748   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
749     no_recursion=yes ;;
751   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
752   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
753   | --oldin | --oldi | --old | --ol | --o)
754     ac_prev=oldincludedir ;;
755   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
756   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
757   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
758     oldincludedir=$ac_optarg ;;
760   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
761     ac_prev=prefix ;;
762   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
763     prefix=$ac_optarg ;;
765   -program-prefix | --program-prefix | --program-prefi | --program-pref \
766   | --program-pre | --program-pr | --program-p)
767     ac_prev=program_prefix ;;
768   -program-prefix=* | --program-prefix=* | --program-prefi=* \
769   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
770     program_prefix=$ac_optarg ;;
772   -program-suffix | --program-suffix | --program-suffi | --program-suff \
773   | --program-suf | --program-su | --program-s)
774     ac_prev=program_suffix ;;
775   -program-suffix=* | --program-suffix=* | --program-suffi=* \
776   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
777     program_suffix=$ac_optarg ;;
779   -program-transform-name | --program-transform-name \
780   | --program-transform-nam | --program-transform-na \
781   | --program-transform-n | --program-transform- \
782   | --program-transform | --program-transfor \
783   | --program-transfo | --program-transf \
784   | --program-trans | --program-tran \
785   | --progr-tra | --program-tr | --program-t)
786     ac_prev=program_transform_name ;;
787   -program-transform-name=* | --program-transform-name=* \
788   | --program-transform-nam=* | --program-transform-na=* \
789   | --program-transform-n=* | --program-transform-=* \
790   | --program-transform=* | --program-transfor=* \
791   | --program-transfo=* | --program-transf=* \
792   | --program-trans=* | --program-tran=* \
793   | --progr-tra=* | --program-tr=* | --program-t=*)
794     program_transform_name=$ac_optarg ;;
796   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
797     ac_prev=pdfdir ;;
798   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
799     pdfdir=$ac_optarg ;;
801   -psdir | --psdir | --psdi | --psd | --ps)
802     ac_prev=psdir ;;
803   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
804     psdir=$ac_optarg ;;
806   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
807   | -silent | --silent | --silen | --sile | --sil)
808     silent=yes ;;
810   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
811     ac_prev=sbindir ;;
812   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
813   | --sbi=* | --sb=*)
814     sbindir=$ac_optarg ;;
816   -sharedstatedir | --sharedstatedir | --sharedstatedi \
817   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
818   | --sharedst | --shareds | --shared | --share | --shar \
819   | --sha | --sh)
820     ac_prev=sharedstatedir ;;
821   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
822   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
823   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
824   | --sha=* | --sh=*)
825     sharedstatedir=$ac_optarg ;;
827   -site | --site | --sit)
828     ac_prev=site ;;
829   -site=* | --site=* | --sit=*)
830     site=$ac_optarg ;;
832   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
833     ac_prev=srcdir ;;
834   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
835     srcdir=$ac_optarg ;;
837   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
838   | --syscon | --sysco | --sysc | --sys | --sy)
839     ac_prev=sysconfdir ;;
840   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
841   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
842     sysconfdir=$ac_optarg ;;
844   -target | --target | --targe | --targ | --tar | --ta | --t)
845     ac_prev=target_alias ;;
846   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
847     target_alias=$ac_optarg ;;
849   -v | -verbose | --verbose | --verbos | --verbo | --verb)
850     verbose=yes ;;
852   -version | --version | --versio | --versi | --vers | -V)
853     ac_init_version=: ;;
855   _AC_INIT_PARSE_ENABLE([with])
857   _AC_INIT_PARSE_ENABLE([without])
859   --x)
860     # Obsolete; use --with-x.
861     with_x=yes ;;
863   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
864   | --x-incl | --x-inc | --x-in | --x-i)
865     ac_prev=x_includes ;;
866   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
867   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
868     x_includes=$ac_optarg ;;
870   -x-libraries | --x-libraries | --x-librarie | --x-librari \
871   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
872     ac_prev=x_libraries ;;
873   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
874   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
875     x_libraries=$ac_optarg ;;
877   -*) AC_MSG_ERROR([unrecognized option: `$ac_option'
878 Try `$[0] --help' for more information])
879     ;;
881   *=*)
882     ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
883     # Reject names that are not valid shell variable names.
884     case $ac_envvar in #(
885       '' | [[0-9]]* | *[[!_$as_cr_alnum]]* )
886       AC_MSG_ERROR([invalid variable name: `$ac_envvar']) ;;
887     esac
888     eval $ac_envvar=\$ac_optarg
889     export $ac_envvar ;;
891   *)
892     # FIXME: should be removed in autoconf 3.0.
893     AC_MSG_WARN([you should use --build, --host, --target])
894     expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
895       AC_MSG_WARN([invalid host type: $ac_option])
896     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
897     ;;
899   esac
900 done
902 if test -n "$ac_prev"; then
903   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
904   AC_MSG_ERROR([missing argument to $ac_option])
907 if test -n "$ac_unrecognized_opts"; then
908   case $enable_option_checking in
909     no) ;;
910     fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
911     *)     AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;
912   esac
915 # Check all directory arguments for consistency.
916 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
917                 datadir sysconfdir sharedstatedir localstatedir includedir \
918                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
919                 libdir localedir mandir
921   eval ac_val=\$$ac_var
922   # Remove trailing slashes.
923   case $ac_val in
924     */ )
925       ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'`
926       eval $ac_var=\$ac_val;;
927   esac
928   # Be sure to have absolute directory names.
929   case $ac_val in
930     [[\\/$]]* | ?:[[\\/]]* )  continue;;
931     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
932   esac
933   AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val])
934 done
936 # There might be people who depend on the old broken behavior: `$host'
937 # used to hold the argument of --host etc.
938 # FIXME: To remove some day.
939 build=$build_alias
940 host=$host_alias
941 target=$target_alias
943 # FIXME: To remove some day.
944 if test "x$host_alias" != x; then
945   if test "x$build_alias" = x; then
946     cross_compiling=maybe
947     AC_MSG_WARN([if you wanted to set the --build type, don't use --host.
948     If a cross compiler is detected then cross compile mode will be used])
949   elif test "x$build_alias" != "x$host_alias"; then
950     cross_compiling=yes
951   fi
954 ac_tool_prefix=
955 test -n "$host_alias" && ac_tool_prefix=$host_alias-
957 test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
959 m4_divert_pop([PARSE_ARGS])dnl
960 ])# _AC_INIT_PARSE_ARGS
963 # _AC_INIT_PARSE_ENABLE(OPTION-NAME)
964 # ----------------------------------
965 # A trivial front-end for _AC_INIT_PARSE_ENABLE2.
967 m4_define([_AC_INIT_PARSE_ENABLE],
968 [m4_bmatch([$1], [^with],
969            [_AC_INIT_PARSE_ENABLE2([$1], [with])],
970            [_AC_INIT_PARSE_ENABLE2([$1], [enable])])])
973 # _AC_INIT_PARSE_ENABLE2(OPTION-NAME, POSITIVE-NAME)
974 # --------------------------------------------------
975 # Handle an `--enable' or a `--with' option.
977 # OPTION-NAME is `enable', `disable', `with', or `without'.
978 # POSITIVE-NAME is the corresponding positive variant, i.e. `enable' or `with'.
980 # Positive variant of the option is recognized by the condition
981 #       OPTION-NAME == POSITIVE-NAME .
983 m4_define([_AC_INIT_PARSE_ENABLE2],
984 [-$1-* | --$1-*)
985     ac_useropt=`expr "x$ac_option" : 'x-*$1-\(m4_if([$1], [$2], [[[^=]]], [.])*\)'`
986     # Reject names that are not valid shell variable names.
987     expr "x$ac_useropt" : "[.*[^-+._$as_cr_alnum]]" >/dev/null &&
988       AC_MSG_ERROR(
989         [invalid ]m4_if([$2], [with], [package], [feature])[ name: $ac_useropt])
990     ac_useropt_orig=$ac_useropt
991     ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-+.]]/_/g'`
992     case $ac_user_opts in
993       *"
994 "$2_$ac_useropt"
995 "*) ;;
996       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt_orig"
997          ac_unrecognized_sep=', ';;
998     esac
999     eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl
1003 # _AC_INIT_HELP
1004 # -------------
1005 # Handle the `configure --help' message.
1006 m4_define([_AC_INIT_HELP],
1007 [m4_divert_push([HELP_BEGIN])dnl
1010 # Report the --help message.
1012 if test "$ac_init_help" = "long"; then
1013   # Omit some internal or obsolete options to make the list less imposing.
1014   # This message is too long to be a string in the A/UX 3.1 sh.
1015   cat <<_ACEOF
1016 \`configure' configures m4_ifset([AC_PACKAGE_STRING],
1017                         [AC_PACKAGE_STRING],
1018                         [this package]) to adapt to many kinds of systems.
1020 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
1022 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
1023 VAR=VALUE.  See below for descriptions of some of the useful variables.
1025 Defaults for the options are specified in brackets.
1027 Configuration:
1028   -h, --help              display this help and exit
1029       --help=short        display options specific to this package
1030       --help=recursive    display the short help of all the included packages
1031   -V, --version           display version information and exit
1032   -q, --quiet, --silent   do not print \`checking ...' messages
1033       --cache-file=FILE   cache test results in FILE [disabled]
1034   -C, --config-cache      alias for \`--cache-file=config.cache'
1035   -n, --no-create         do not create output files
1036       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1038 Installation directories:
1039 ]AS_HELP_STRING([--prefix=PREFIX],
1040   [install architecture-independent files in PREFIX [$ac_default_prefix]])
1041 AS_HELP_STRING([--exec-prefix=EPREFIX],
1042   [install architecture-dependent files in EPREFIX [PREFIX]])[
1044 By default, \`make install' will install all the files in
1045 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1046 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1047 for instance \`--prefix=\$HOME'.
1049 For better control, use the options below.
1051 Fine tuning of the installation directories:
1052   --bindir=DIR            user executables [EPREFIX/bin]
1053   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1054   --libexecdir=DIR        program executables [EPREFIX/libexec]
1055   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1056   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1057   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1058   --libdir=DIR            object code libraries [EPREFIX/lib]
1059   --includedir=DIR        C header files [PREFIX/include]
1060   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1061   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1062   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1063   --infodir=DIR           info documentation [DATAROOTDIR/info]
1064   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1065   --mandir=DIR            man documentation [DATAROOTDIR/man]
1066 ]AS_HELP_STRING([--docdir=DIR],
1067   [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME],
1068     [AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[
1069   --htmldir=DIR           html documentation [DOCDIR]
1070   --dvidir=DIR            dvi documentation [DOCDIR]
1071   --pdfdir=DIR            pdf documentation [DOCDIR]
1072   --psdir=DIR             ps documentation [DOCDIR]
1073 _ACEOF
1075   cat <<\_ACEOF]
1076 m4_divert_pop([HELP_BEGIN])dnl
1077 dnl The order of the diversions here is
1078 dnl - HELP_BEGIN
1079 dnl   which may be extended by extra generic options such as with X or
1080 dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
1082 dnl - HELP_CANON
1083 dnl   Support for cross compilation (--build, --host and --target).
1084 dnl   Display only in long --help.
1086 dnl - HELP_ENABLE
1087 dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
1088 dnl   then implements the header of the non generic options.
1090 dnl - HELP_WITH
1092 dnl - HELP_VAR
1094 dnl - HELP_VAR_END
1096 dnl - HELP_END
1097 dnl   initialized below, in which we dump the trailer (handling of the
1098 dnl   recursion for instance).
1099 m4_divert_push([HELP_ENABLE])dnl
1100 _ACEOF
1103 if test -n "$ac_init_help"; then
1104 m4_ifset([AC_PACKAGE_STRING],
1105 [  case $ac_init_help in
1106      short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
1107    esac])
1108   cat <<\_ACEOF
1109 m4_divert_pop([HELP_ENABLE])dnl
1110 m4_divert_push([HELP_END])dnl
1112 Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
1113   [the package provider]).dnl
1114 m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
1115 AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
1116 m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
1117 General help using GNU software: <http://www.gnu.org/gethelp/>.])])
1118 _ACEOF
1119 ac_status=$?
1122 if test "$ac_init_help" = "recursive"; then
1123   # If there are subdirs, report their specific --help.
1124   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1125     test -d "$ac_dir" ||
1126       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1127       continue
1128     _AC_SRCDIRS(["$ac_dir"])
1129     cd "$ac_dir" || { ac_status=$?; continue; }
1130     # Check for guested configure.
1131     if test -f "$ac_srcdir/configure.gnu"; then
1132       echo &&
1133       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1134     elif test -f "$ac_srcdir/configure"; then
1135       echo &&
1136       $SHELL "$ac_srcdir/configure" --help=recursive
1137     else
1138       AC_MSG_WARN([no configuration information is in $ac_dir])
1139     fi || ac_status=$?
1140     cd "$ac_pwd" || { ac_status=$?; break; }
1141   done
1144 test -n "$ac_init_help" && exit $ac_status
1145 m4_divert_pop([HELP_END])dnl
1146 ])# _AC_INIT_HELP
1149 # _AC_INIT_VERSION
1150 # ----------------
1151 # Handle the `configure --version' message.
1152 m4_define([_AC_INIT_VERSION],
1153 [m4_divert_text([VERSION_BEGIN],
1154 [if $ac_init_version; then
1155   cat <<\_ACEOF
1156 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
1157 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1158 generated by m4_PACKAGE_STRING])
1159 m4_divert_text([VERSION_END],
1160 [_ACEOF
1161   exit
1162 fi])dnl
1163 ])# _AC_INIT_VERSION
1166 # _AC_INIT_CONFIG_LOG
1167 # -------------------
1168 # Initialize the config.log file descriptor and write header to it.
1169 m4_define([_AC_INIT_CONFIG_LOG],
1170 [m4_divert_text([INIT_PREPARE],
1171 [m4_define([AS_MESSAGE_LOG_FD], 5)dnl
1172 cat >config.log <<_ACEOF
1173 This file contains any messages produced by compilers while
1174 running configure, to aid debugging if configure makes a mistake.
1176 It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1177 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1178 generated by m4_PACKAGE_STRING.  Invocation command line was
1180   $ $[0] $[@]
1182 _ACEOF
1183 exec AS_MESSAGE_LOG_FD>>config.log
1184 AS_UNAME >&AS_MESSAGE_LOG_FD
1186 cat >&AS_MESSAGE_LOG_FD <<_ACEOF
1189 m4_text_box([Core tests.])
1191 _ACEOF
1192 ])])# _AC_INIT_CONFIG_LOG
1195 # _AC_INIT_PREPARE
1196 # ----------------
1197 # Called by AC_INIT to build the preamble of the `configure' scripts.
1198 # 1. Trap and clean up various tmp files.
1199 # 2. Set up the fd and output files
1200 # 3. Remember the options given to `configure' for `config.status --recheck'.
1201 # 4. Initiates confdefs.h
1202 # 5. Loads site and cache files
1203 m4_define([_AC_INIT_PREPARE],
1204 [m4_divert_push([INIT_PREPARE])dnl
1206 # Keep a trace of the command line.
1207 # Strip out --no-create and --no-recursion so they do not pile up.
1208 # Strip out --silent because we don't want to record it for future runs.
1209 # Also quote any args containing shell meta-characters.
1210 # Make two passes to allow for proper duplicate-argument suppression.
1211 ac_configure_args=
1212 ac_configure_args0=
1213 ac_configure_args1=
1214 ac_must_keep_next=false
1215 for ac_pass in 1 2
1217   for ac_arg
1218   do
1219     case $ac_arg in
1220     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1221     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1222     | -silent | --silent | --silen | --sile | --sil)
1223       continue ;;
1224     *\'*)
1225       ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1226     esac
1227     case $ac_pass in
1228     1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
1229     2)
1230       AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
1231 dnl If trying to remove duplicates, be sure to (i) keep the *last*
1232 dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
1233 dnl and (ii) not to strip long options (--prefix foo --prefix bar might
1234 dnl give --prefix foo bar).
1235       if test $ac_must_keep_next = true; then
1236         ac_must_keep_next=false # Got value, back to normal.
1237       else
1238         case $ac_arg in
1239 dnl Use broad patterns, as arguments that would have already made configure
1240 dnl exit don't matter.
1241           *=* | --config-cache | -C | -disable-* | --disable-* \
1242           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1243           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1244           | -with-* | --with-* | -without-* | --without-* | --x)
1245             case "$ac_configure_args0 " in
1246               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1247             esac
1248             ;;
1249           -* ) ac_must_keep_next=true ;;
1250         esac
1251       fi
1252       AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
1253       ;;
1254     esac
1255   done
1256 done
1257 AS_UNSET(ac_configure_args0)
1258 AS_UNSET(ac_configure_args1)
1260 # When interrupted or exit'd, cleanup temporary files, and complete
1261 # config.log.  We remove comments because anyway the quotes in there
1262 # would cause problems or look ugly.
1263 # WARNING: Use '\'' to represent an apostrophe within the trap.
1264 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1265 trap 'exit_status=$?
1266   # Save into config.log some information that might help in debugging.
1267   {
1268     echo
1270     AS_BOX([Cache variables.])
1271     echo
1272     m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]),
1273                   [^ *\(#.*\)?
1274 ],                [],
1275                   ['], ['\\''])
1276     echo
1278     AS_BOX([Output variables.])
1279     echo
1280     for ac_var in $ac_subst_vars
1281     do
1282       eval ac_val=\$$ac_var
1283       case $ac_val in
1284       *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1285       esac
1286       AS_ECHO(["$ac_var='\''$ac_val'\''"])
1287     done | sort
1288     echo
1290     if test -n "$ac_subst_files"; then
1291       AS_BOX([File substitutions.])
1292       echo
1293       for ac_var in $ac_subst_files
1294       do
1295         eval ac_val=\$$ac_var
1296         case $ac_val in
1297         *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1298         esac
1299         AS_ECHO(["$ac_var='\''$ac_val'\''"])
1300       done | sort
1301       echo
1302     fi
1304     if test -s confdefs.h; then
1305       AS_BOX([confdefs.h.])
1306       echo
1307       cat confdefs.h
1308       echo
1309     fi
1310     test "$ac_signal" != 0 &&
1311       AS_ECHO(["$as_me: caught signal $ac_signal"])
1312     AS_ECHO(["$as_me: exit $exit_status"])
1313   } >&AS_MESSAGE_LOG_FD
1314   rm -f core *.core core.conftest.* &&
1315     rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
1316     exit $exit_status
1317 ' 0
1318 for ac_signal in 1 2 13 15; do
1319   trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
1320 done
1321 ac_signal=0
1323 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1324 rm -f -r conftest* confdefs.h
1326 dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
1327 dnl containing less than 14 bytes (including the newline).
1328 AS_ECHO(["/* confdefs.h */"]) > confdefs.h
1330 # Predefined preprocessor variables.
1331 AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
1332                    [Define to the full name of this package.])dnl
1333 AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
1334                    [Define to the one symbol short name of this package.])dnl
1335 AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
1336                    [Define to the version of this package.])dnl
1337 AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
1338                    [Define to the full name and version of this package.])dnl
1339 AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
1340                    [Define to the address where bug reports for this package
1341                     should be sent.])dnl
1342 AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"],
1343                    [Define to the home page for this package.])
1345 # Let the site file select an alternate cache file if it wants to.
1346 AC_SITE_LOAD
1347 AC_CACHE_LOAD
1348 m4_divert_pop([INIT_PREPARE])dnl
1349 ])# _AC_INIT_PREPARE
1352 # AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
1353 # ----------------------------------------
1354 # This macro is used only for Autoupdate.
1355 AU_DEFUN([AC_INIT],
1356 [m4_ifval([$2], [[AC_INIT($@)]],
1357           [m4_ifval([$1],
1358 [[AC_INIT]
1359 AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
1363 # AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
1364 # ----------------------------------------------------------
1365 # Include the user macro files, prepare the diversions, and output the
1366 # preamble of the `configure' script.
1368 # If BUG-REPORT is omitted, do without (unless the user previously
1369 # defined the m4 macro AC_PACKAGE_BUGREPORT).  If TARNAME is omitted,
1370 # use PACKAGE to seed it.  If URL is omitted, use
1371 # `http://www.gnu.org/software/TARNAME/' if PACKAGE begins with `GNU',
1372 # otherwise, do without.
1374 # Note that the order is important: first initialize, then set the
1375 # AC_CONFIG_SRCDIR.
1376 m4_define([AC_INIT],
1377 [# Forbidden tokens and exceptions.
1378 m4_pattern_forbid([^_?A[CHUM]_])
1379 m4_pattern_forbid([_AC_])
1380 m4_pattern_forbid([^LIBOBJS$],
1381                   [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
1382 # Actually reserved by M4sh.
1383 m4_pattern_allow([^AS_FLAGS$])
1384 AS_INIT[]dnl
1385 AS_PREPARE[]dnl
1386 m4_divert_push([KILL])
1387 m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
1388 _AC_INIT_DEFAULTS
1389 _AC_INIT_PARSE_ARGS
1390 _AC_INIT_DIRCHECK
1391 _AC_INIT_SRCDIR
1392 _AC_INIT_HELP
1393 _AC_INIT_VERSION
1394 _AC_INIT_CONFIG_LOG
1395 _AC_INIT_PREPARE
1396 _AC_INIT_NOTICE
1397 _AC_INIT_COPYRIGHT
1398 m4_divert_text([SHELL_FN], [
1399 m4_text_box([Autoconf initialization.])])
1400 m4_divert_pop
1401 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1403 dnl Substitute for predefined variables.
1404 AC_SUBST([DEFS])dnl
1405 AC_SUBST([ECHO_C])dnl
1406 AC_SUBST([ECHO_N])dnl
1407 AC_SUBST([ECHO_T])dnl
1408 AC_SUBST([LIBS])dnl
1409 _AC_ARG_VAR_PRECIOUS([build_alias])AC_SUBST([build_alias])dnl
1410 _AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl
1411 _AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl
1413 AC_LANG_PUSH(C)
1419 ## ------------------------------------------------------------- ##
1420 ## Selecting optional features, working with optional software.  ##
1421 ## ------------------------------------------------------------- ##
1423 # AC_PRESERVE_HELP_ORDER
1424 # ----------------------
1425 # Emit help strings in the order given, rather than grouping all --enable-FOO
1426 # and all --with-BAR.
1427 AC_DEFUN([AC_PRESERVE_HELP_ORDER],
1428 [m4_divert_once([HELP_ENABLE], [[
1429 Optional Features and Packages:
1430   --disable-option-checking  ignore unrecognized --enable/--with options
1431   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1432   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1433   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1434   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
1435 m4_define([_m4_divert(HELP_ENABLE)],    _m4_divert(HELP_WITH))
1436 ])# AC_PRESERVE_HELP_ORDER
1438 # _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1439 # -------------------------------------------------------------------
1440 # Common code for AC_ARG_ENABLE and AC_ARG_WITH.
1441 # OPTION is either "enable" or "with".
1443 m4_define([_AC_ENABLE_IF],
1444 [@%:@ Check whether --$1-$2 was given.
1445 _AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-+.], [___]), [$3], [$4])
1448 m4_define([_AC_ENABLE_IF_ACTION],
1449 [m4_append_uniq([_AC_USER_OPTS], [$1_$2], [
1450 ])dnl
1451 AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl
1454 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1455 # ------------------------------------------------------------------------
1456 AC_DEFUN([AC_ARG_ENABLE],
1457 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1459 [m4_divert_once([HELP_ENABLE], [[
1460 Optional Features:
1461   --disable-option-checking  ignore unrecognized --enable/--with options
1462   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1463   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])])dnl
1464 m4_divert_once([HELP_ENABLE], [$2])dnl
1465 _AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl
1466 ])# AC_ARG_ENABLE
1469 AU_DEFUN([AC_ENABLE],
1470 [AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])])
1473 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
1474 # --------------------------------------------------------------------
1475 AC_DEFUN([AC_ARG_WITH],
1476 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1478 [m4_divert_once([HELP_WITH], [[
1479 Optional Packages:
1480   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1481   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])])
1482 m4_divert_once([HELP_WITH], [$2])dnl
1483 _AC_ENABLE_IF([with], [$1], [$3], [$4])dnl
1484 ])# AC_ARG_WITH
1486 AU_DEFUN([AC_WITH],
1487 [AC_ARG_WITH([$1], [  --with-$1], [$2], [$3])])
1489 # AC_DISABLE_OPTION_CHECKING
1490 # --------------------------
1491 AC_DEFUN([AC_DISABLE_OPTION_CHECKING],
1492 [m4_divert_once([DEFAULTS], [enable_option_checking=no])
1493 ])# AC_DISABLE_OPTION_CHECKING
1496 ## ----------------------------------------- ##
1497 ## Remembering variables for reconfiguring.  ##
1498 ## ----------------------------------------- ##
1501 # AC_ARG_VAR(VARNAME, DOCUMENTATION)
1502 # ----------------------------------
1503 # Register VARNAME as a precious variable, and document it in
1504 # `configure --help' (but only once).
1505 AC_DEFUN([AC_ARG_VAR],
1506 [m4_divert_once([HELP_VAR], [[
1507 Some influential environment variables:]])dnl
1508 m4_divert_once([HELP_VAR_END], [[
1509 Use these variables to override the choices made by `configure' or to help
1510 it to find libraries and programs with nonstandard names/locations.]])dnl
1511 m4_expand_once([m4_divert_text([HELP_VAR],
1512                                [AS_HELP_STRING([$1], [$2], [              ])])],
1513                [$0($1)])dnl
1514 AC_SUBST([$1])dnl
1515 _AC_ARG_VAR_PRECIOUS([$1])dnl
1516 ])# AC_ARG_VAR
1519 # _AC_ARG_VAR_PRECIOUS(VARNAME)
1520 # -----------------------------
1521 # Declare VARNAME is precious.
1522 m4_define([_AC_ARG_VAR_PRECIOUS],
1523 [m4_append_uniq([_AC_PRECIOUS_VARS], [$1], [
1524 ])dnl
1528 # _AC_ARG_VAR_STORE
1529 # -----------------
1530 # We try to diagnose when precious variables have changed.  To do this,
1531 # make two early snapshots (after the option processing to take
1532 # explicit variables into account) of those variables: one (ac_env_)
1533 # which represents the current run, and a second (ac_cv_env_) which,
1534 # at the first run, will be saved in the cache.  As an exception to
1535 # the cache mechanism, its loading will override these variables (non
1536 # `ac_cv_env_' cache value are only set when unset).
1538 # In subsequent runs, after having loaded the cache, compare
1539 # ac_cv_env_foo against ac_env_foo.  See _AC_ARG_VAR_VALIDATE.
1540 m4_define([_AC_ARG_VAR_STORE],
1541 [m4_divert_text([PARSE_ARGS],
1542 [for ac_var in $ac_precious_vars; do
1543   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1544   eval ac_env_${ac_var}_value=\$${ac_var}
1545   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1546   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1547 done])dnl
1551 # _AC_ARG_VAR_VALIDATE
1552 # --------------------
1553 # The precious variables are saved twice at the beginning of
1554 # configure.  E.g., PRECIOUS is saved as `ac_env_PRECIOUS_set' and
1555 # `ac_env_PRECIOUS_value' on the one hand and `ac_cv_env_PRECIOUS_set'
1556 # and `ac_cv_env_PRECIOUS_value' on the other hand.
1558 # Now the cache has just been loaded, so `ac_cv_env_' represents the
1559 # content of the cached values, while `ac_env_' represents that of the
1560 # current values.
1562 # So we check that `ac_env_' and `ac_cv_env_' are consistent.  If
1563 # they aren't, die.
1564 m4_define([_AC_ARG_VAR_VALIDATE],
1565 [m4_divert_text([INIT_PREPARE],
1566 [# Check that the precious variables saved in the cache have kept the same
1567 # value.
1568 ac_cache_corrupted=false
1569 for ac_var in $ac_precious_vars; do
1570   eval ac_old_set=\$ac_cv_env_${ac_var}_set
1571   eval ac_new_set=\$ac_env_${ac_var}_set
1572   eval ac_old_val=\$ac_cv_env_${ac_var}_value
1573   eval ac_new_val=\$ac_env_${ac_var}_value
1574   case $ac_old_set,$ac_new_set in
1575     set,)
1576       AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2)
1577       ac_cache_corrupted=: ;;
1578     ,set)
1579       AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2)
1580       ac_cache_corrupted=: ;;
1581     ,);;
1582     *)
1583       if test "x$ac_old_val" != "x$ac_new_val"; then
1584         # differences in whitespace do not lead to failure.
1585         ac_old_val_w=`echo x $ac_old_val`
1586         ac_new_val_w=`echo x $ac_new_val`
1587         if test "$ac_old_val_w" != "$ac_new_val_w"; then
1588           AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
1589           ac_cache_corrupted=:
1590         else
1591           AS_MESSAGE([warning: ignoring whitespace changes in `$ac_var' since the previous run:], 2)
1592           eval $ac_var=\$ac_old_val
1593         fi
1594         AS_MESSAGE([  former value:  `$ac_old_val'], 2)
1595         AS_MESSAGE([  current value: `$ac_new_val'], 2)
1596       fi;;
1597   esac
1598   # Pass precious variables to config.status.
1599   if test "$ac_new_set" = set; then
1600     case $ac_new_val in
1601     *\'*) ac_arg=$ac_var=`AS_ECHO(["$ac_new_val"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1602     *) ac_arg=$ac_var=$ac_new_val ;;
1603     esac
1604     case " $ac_configure_args " in
1605       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1606       *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
1607     esac
1608   fi
1609 done
1610 if $ac_cache_corrupted; then
1611   AS_MESSAGE([error: in `$ac_pwd':], 2)
1612   AS_MESSAGE([error: changes in the environment can compromise the build], 2)
1613   AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
1614 fi])dnl
1615 ])# _AC_ARG_VAR_VALIDATE
1621 ## ---------------------------- ##
1622 ## Transforming program names.  ##
1623 ## ---------------------------- ##
1626 # AC_ARG_PROGRAM
1627 # --------------
1628 # This macro is expanded only once, to avoid that `foo' ends up being
1629 # installed as `ggfoo'.
1630 AC_DEFUN_ONCE([AC_ARG_PROGRAM],
1631 [dnl Document the options.
1632 m4_divert_push([HELP_BEGIN])dnl
1634 Program names:
1635   --program-prefix=PREFIX            prepend PREFIX to installed program names
1636   --program-suffix=SUFFIX            append SUFFIX to installed program names
1637   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
1638 m4_divert_pop([HELP_BEGIN])dnl
1639 test "$program_prefix" != NONE &&
1640   program_transform_name="s&^&$program_prefix&;$program_transform_name"
1641 # Use a double $ so make ignores it.
1642 test "$program_suffix" != NONE &&
1643   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
1644 # Double any \ or $.
1645 # By default was `s,x,x', remove it if useless.
1646 [ac_script='s/[\\$]/&&/g;s/;s,x,x,$//']
1647 program_transform_name=`AS_ECHO(["$program_transform_name"]) | sed "$ac_script"`
1648 ])# AC_ARG_PROGRAM
1654 ## ------------------------- ##
1655 ## Finding auxiliary files.  ##
1656 ## ------------------------- ##
1659 # AC_CONFIG_AUX_DIR(DIR)
1660 # ----------------------
1661 # Find install-sh, config.sub, config.guess, and Cygnus configure
1662 # in directory DIR.  These are auxiliary files used in configuration.
1663 # DIR can be either absolute or relative to $srcdir.
1664 AC_DEFUN([AC_CONFIG_AUX_DIR],
1665 [AC_CONFIG_AUX_DIRS($1 "$srcdir"/$1)])
1668 # AC_CONFIG_AUX_DIR_DEFAULT
1669 # -------------------------
1670 # The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
1671 # There's no need to call this macro explicitly; just AC_REQUIRE it.
1672 AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
1673 [AC_CONFIG_AUX_DIRS("$srcdir" "$srcdir/.." "$srcdir/../..")])
1676 # AC_CONFIG_AUX_DIRS(DIR ...)
1677 # ---------------------------
1678 # Internal subroutine.
1679 # Search for the configuration auxiliary files in directory list $1.
1680 # We look only for install-sh, so users of AC_PROG_INSTALL
1681 # do not automatically need to distribute the other auxiliary files.
1682 AC_DEFUN([AC_CONFIG_AUX_DIRS],
1683 [ac_aux_dir=
1684 for ac_dir in $1; do
1685   if test -f "$ac_dir/install-sh"; then
1686     ac_aux_dir=$ac_dir
1687     ac_install_sh="$ac_aux_dir/install-sh -c"
1688     break
1689   elif test -f "$ac_dir/install.sh"; then
1690     ac_aux_dir=$ac_dir
1691     ac_install_sh="$ac_aux_dir/install.sh -c"
1692     break
1693   elif test -f "$ac_dir/shtool"; then
1694     ac_aux_dir=$ac_dir
1695     ac_install_sh="$ac_aux_dir/shtool install -c"
1696     break
1697   fi
1698 done
1699 if test -z "$ac_aux_dir"; then
1700   AC_MSG_ERROR([cannot find install-sh, install.sh, or shtool in $1])
1703 # These three variables are undocumented and unsupported,
1704 # and are intended to be withdrawn in a future Autoconf release.
1705 # They can cause serious problems if a builder's source tree is in a directory
1706 # whose full name contains unusual characters.
1707 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
1708 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
1709 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
1711 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1712 ])# AC_CONFIG_AUX_DIRS
1717 ## ------------------------ ##
1718 ## Finding aclocal macros.  ##
1719 ## ------------------------ ##
1722 # AC_CONFIG_MACRO_DIR(DIR)
1723 # ------------------------
1724 # Declare directory containing additional macros for aclocal.
1725 AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
1729 ## --------------------- ##
1730 ## Requiring aux files.  ##
1731 ## --------------------- ##
1733 # AC_REQUIRE_AUX_FILE(FILE)
1734 # -------------------------
1735 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
1736 # It announces FILE is required in the auxdir.
1737 m4_define([AC_REQUIRE_AUX_FILE],
1738 [AS_LITERAL_WORD_IF([$1], [],
1739                [m4_fatal([$0: requires a literal argument])])])
1743 ## ----------------------------------- ##
1744 ## Getting the canonical system type.  ##
1745 ## ----------------------------------- ##
1747 # The inputs are:
1748 #    configure --host=HOST --target=TARGET --build=BUILD
1750 # The rules are:
1751 # 1. Build defaults to the current platform, as determined by config.guess.
1752 # 2. Host defaults to build.
1753 # 3. Target defaults to host.
1756 # _AC_CANONICAL_SPLIT(THING)
1757 # --------------------------
1758 # Generate the variables THING, THING_{alias cpu vendor os}.
1759 m4_define([_AC_CANONICAL_SPLIT],
1760 [case $ac_cv_$1 in
1761 *-*-*) ;;
1762 *) AC_MSG_ERROR([invalid value of canonical $1]);;
1763 esac
1764 AC_SUBST([$1], [$ac_cv_$1])dnl
1765 ac_save_IFS=$IFS; IFS='-'
1766 set x $ac_cv_$1
1767 shift
1768 AC_SUBST([$1_cpu], [$[1]])dnl
1769 AC_SUBST([$1_vendor], [$[2]])dnl
1770 shift; shift
1771 [# Remember, the first character of IFS is used to create $]*,
1772 # except with old shells:
1773 $1_os=$[*]
1774 IFS=$ac_save_IFS
1775 case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac
1776 AC_SUBST([$1_os])dnl
1777 ])# _AC_CANONICAL_SPLIT
1780 # AC_CANONICAL_BUILD
1781 # ------------------
1782 AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
1783 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1784 AC_REQUIRE_AUX_FILE([config.sub])dnl
1785 AC_REQUIRE_AUX_FILE([config.guess])dnl
1786 m4_divert_once([HELP_CANON],
1788 System types:
1789   --build=BUILD     configure for building on BUILD [guessed]]])dnl
1790 # Make sure we can run config.sub.
1791 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
1792   AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub])
1794 AC_CACHE_CHECK([build system type], [ac_cv_build],
1795 [ac_build_alias=$build_alias
1796 test "x$ac_build_alias" = x &&
1797   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
1798 test "x$ac_build_alias" = x &&
1799   AC_MSG_ERROR([cannot guess build type; you must specify one])
1800 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
1801   AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])
1803 _AC_CANONICAL_SPLIT(build)
1804 ])# AC_CANONICAL_BUILD
1807 # AC_CANONICAL_HOST
1808 # -----------------
1809 AC_DEFUN_ONCE([AC_CANONICAL_HOST],
1810 [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1811 m4_divert_once([HELP_CANON],
1812 [[  --host=HOST       cross-compile to build programs to run on HOST [BUILD]]])dnl
1813 AC_CACHE_CHECK([host system type], [ac_cv_host],
1814 [if test "x$host_alias" = x; then
1815   ac_cv_host=$ac_cv_build
1816 else
1817   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
1818     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])
1821 _AC_CANONICAL_SPLIT([host])
1822 ])# AC_CANONICAL_HOST
1825 # AC_CANONICAL_TARGET
1826 # -------------------
1827 AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
1828 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1829 AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
1830 m4_divert_once([HELP_CANON],
1831 [[  --target=TARGET   configure for building compilers for TARGET [HOST]]])dnl
1832 AC_CACHE_CHECK([target system type], [ac_cv_target],
1833 [if test "x$target_alias" = x; then
1834   ac_cv_target=$ac_cv_host
1835 else
1836   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
1837     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])
1840 _AC_CANONICAL_SPLIT([target])
1842 # The aliases save the names the user supplied, while $host etc.
1843 # will get canonicalized.
1844 test -n "$target_alias" &&
1845   test "$program_prefix$program_suffix$program_transform_name" = \
1846     NONENONEs,x,x, &&
1847   program_prefix=${target_alias}-[]dnl
1848 ])# AC_CANONICAL_TARGET
1851 AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
1854 # AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
1855 # ------------------------------------------
1856 # If the cache file is inconsistent with the current host,
1857 # target and build system types, execute CMD or print a default
1858 # error message.  Now handled via _AC_ARG_VAR_PRECIOUS.
1859 AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])
1862 ## ---------------------- ##
1863 ## Caching test results.  ##
1864 ## ---------------------- ##
1867 # AC_SITE_LOAD
1868 # ------------
1869 # Look for site- or system-specific initialization scripts.
1870 m4_define([AC_SITE_LOAD],
1871 [# Prefer an explicitly selected file to automatically selected ones.
1872 ac_site_file1=NONE
1873 ac_site_file2=NONE
1874 if test -n "$CONFIG_SITE"; then
1875   # We do not want a PATH search for config.site.
1876   case $CONFIG_SITE in @%:@((
1877     -*)  ac_site_file1=./$CONFIG_SITE;;
1878     */*) ac_site_file1=$CONFIG_SITE;;
1879     *)   ac_site_file1=./$CONFIG_SITE;;
1880   esac
1881 elif test "x$prefix" != xNONE; then
1882   ac_site_file1=$prefix/share/config.site
1883   ac_site_file2=$prefix/etc/config.site
1884 else
1885   ac_site_file1=$ac_default_prefix/share/config.site
1886   ac_site_file2=$ac_default_prefix/etc/config.site
1888 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
1890   test "x$ac_site_file" = xNONE && continue
1891   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
1892     AC_MSG_NOTICE([loading site script $ac_site_file])
1893     sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
1894     . "$ac_site_file" \
1895       || AC_MSG_FAILURE([failed to load site script $ac_site_file])
1896   fi
1897 done
1901 # AC_CACHE_LOAD
1902 # -------------
1903 m4_define([AC_CACHE_LOAD],
1904 [if test -r "$cache_file"; then
1905   # Some versions of bash will fail to source /dev/null (special files
1906   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
1907   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
1908     AC_MSG_NOTICE([loading cache $cache_file])
1909     case $cache_file in
1910       [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";;
1911       *)                      . "./$cache_file";;
1912     esac
1913   fi
1914 else
1915   AC_MSG_NOTICE([creating cache $cache_file])
1916   >$cache_file
1918 ])# AC_CACHE_LOAD
1921 # _AC_CACHE_DUMP
1922 # --------------
1923 # Dump the cache to stdout.  It can be in a pipe (this is a requirement).
1924 m4_define([_AC_CACHE_DUMP],
1925 [# The following way of writing the cache mishandles newlines in values,
1926 # but we know of no workaround that is simple, portable, and efficient.
1927 # So, we kill variables containing newlines.
1928 # Ultrix sh set writes to stderr and can't be redirected directly,
1929 # and sets the high bit in the cache file unless we assign to the vars.
1931   for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do
1932     eval ac_val=\$$ac_var
1933     case $ac_val in #(
1934     *${as_nl}*)
1935       case $ac_var in #(
1936       *_cv_*) AC_MSG_WARN([cache variable $ac_var contains a newline]) ;;
1937       esac
1938       case $ac_var in #(
1939       _ | IFS | as_nl) ;; #(
1940       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1941       *) AS_UNSET([$ac_var]) ;;
1942       esac ;;
1943     esac
1944   done
1946   (set) 2>&1 |
1947     case $as_nl`(ac_space=' '; set) 2>&1` in #(
1948     *${as_nl}ac_space=\ *)
1949       # `set' does not quote correctly, so add quotes: double-quote
1950       # substitution turns \\\\ into \\, and sed turns \\ into \.
1951       sed -n \
1952         ["s/'/'\\\\''/g;
1953           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
1954       ;; #(
1955     *)
1956       # `set' quotes correctly as required by POSIX, so do not add quotes.
1957       sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"]
1958       ;;
1959     esac |
1960     sort
1961 )dnl
1962 ])# _AC_CACHE_DUMP
1965 # AC_CACHE_SAVE
1966 # -------------
1967 # Save the cache.
1968 # Allow a site initialization script to override cache values.
1969 m4_define([AC_CACHE_SAVE],
1970 [cat >confcache <<\_ACEOF
1971 # This file is a shell script that caches the results of configure
1972 # tests run on this system so they can be shared between configure
1973 # scripts and configure runs, see configure's option --config-cache.
1974 # It is not useful on other systems.  If it contains results you don't
1975 # want to keep, you may remove or edit it.
1977 # config.status only pays attention to the cache file if you give it
1978 # the --recheck option to rerun configure.
1980 # `ac_cv_env_foo' variables (set or unset) will be overridden when
1981 # loading this file, other *unset* `ac_cv_foo' will be assigned the
1982 # following values.
1984 _ACEOF
1986 _AC_CACHE_DUMP() |
1987   sed ['
1988      /^ac_cv_env_/b end
1989      t clear
1990      :clear
1991      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
1992      t end
1993      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
1994      :end'] >>confcache
1995 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
1996   if test -w "$cache_file"; then
1997     test "x$cache_file" != "x/dev/null" &&
1998       AC_MSG_NOTICE([updating cache $cache_file])
1999     cat confcache >$cache_file
2000   else
2001     AC_MSG_NOTICE([not updating unwritable cache $cache_file])
2002   fi
2004 rm -f confcache[]dnl
2005 ])# AC_CACHE_SAVE
2008 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
2009 # ------------------------------------------
2010 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
2011 # Should be dnl'ed.  Try to catch common mistakes.
2012 m4_defun([AC_CACHE_VAL],
2013 [AS_LITERAL_WORD_IF([$1], [m4_if(m4_index(m4_quote($1), [_cv_]), [-1],
2014                             [AC_DIAGNOSE([syntax],
2015 [$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])])dnl
2016 m4_if(m4_index([$2], [AC_DEFINE]), [-1], [],
2017       [AC_DIAGNOSE([syntax],
2018 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
2019 [where no actions should be taken])])dnl
2020 m4_if(m4_index([$2], [AC_SUBST]), [-1], [],
2021       [AC_DIAGNOSE([syntax],
2022 [$0($1, ...): suspicious presence of an AC_SUBST in the second argument, ]dnl
2023 [where no actions should be taken])])dnl
2024 AS_VAR_SET_IF([$1],
2025               [_AS_ECHO_N([(cached) ])],
2026               [$2])
2030 # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
2031 # -------------------------------------------
2032 # Do not call this macro with a dnl right behind.
2033 m4_defun([AC_CACHE_CHECK],
2034 [AC_MSG_CHECKING([$1])
2035 AC_CACHE_VAL([$2], [$3])dnl
2036 AS_LITERAL_WORD_IF([$2],
2037               [AC_MSG_RESULT([$$2])],
2038               [AS_VAR_COPY([ac_res], [$2])
2039                AC_MSG_RESULT([$ac_res])])dnl
2042 # _AC_CACHE_CHECK_INT(MESSAGE, CACHE-ID, EXPRESSION,
2043 #                     [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS])
2044 # --------------------------------------------------------------
2045 AC_DEFUN([_AC_CACHE_CHECK_INT],
2046 [AC_CACHE_CHECK([$1], [$2],
2047    [AC_COMPUTE_INT([$2], [$3], [$4], [$5])])
2048 ])# _AC_CACHE_CHECK_INT
2052 ## ---------------------- ##
2053 ## Defining CPP symbols.  ##
2054 ## ---------------------- ##
2057 # AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
2058 # -------------------------------------------
2059 # Used by --trace to collect the list of AC_DEFINEd macros.
2060 m4_define([AC_DEFINE_TRACE_LITERAL],
2061 [m4_pattern_allow([^$1$])dnl
2062 AS_IDENTIFIER_IF([$1], [],
2063   [m4_warn([syntax], [AC_DEFINE: not an identifier: $1])])dnl
2064 ])# AC_DEFINE_TRACE_LITERAL
2067 # AC_DEFINE_TRACE(CPP-SYMBOL)
2068 # ---------------------------
2069 # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
2070 # out non literal symbols.  CPP-SYMBOL must not include any parameters.
2071 m4_define([AC_DEFINE_TRACE],
2072 [AS_LITERAL_WORD_IF([$1], [AC_DEFINE_TRACE_LITERAL(_m4_expand([$1]))])])
2075 # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
2076 # -------------------------------------------
2077 # Set VARIABLE to VALUE, verbatim, or 1.  Remember the value
2078 # and if VARIABLE is affected the same VALUE, do nothing, else
2079 # die.  The third argument is used by autoheader.
2080 m4_define([AC_DEFINE], [_AC_DEFINE_Q([_$0], $@)])
2082 # _AC_DEFINE(STRING)
2083 # ------------------
2084 # Append the pre-expanded STRING and a newline to confdefs.h, as if by
2085 # a quoted here-doc.
2086 m4_define([_AC_DEFINE],
2087 [AS_ECHO(["AS_ESCAPE([[$1]])"]) >>confdefs.h])
2090 # AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
2091 # ----------------------------------------------------
2092 # Similar, but perform shell substitutions $ ` \ once on VALUE, as
2093 # in an unquoted here-doc.
2094 m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([_$0], $@)])
2096 # _AC_DEFINE_UNQUOTED(STRING)
2097 # ---------------------------
2098 # Append the pre-expanded STRING and a newline to confdefs.h, as if
2099 # with an unquoted here-doc, but avoiding a fork in the common case of
2100 # no backslash, no command substitution, no complex variable
2101 # substitution, and no quadrigraphs.
2102 m4_define([_AC_DEFINE_UNQUOTED],
2103 [m4_if(m4_bregexp([$1], [\\\|`\|\$(\|\${\|@]), [-1],
2104        [AS_ECHO(["AS_ESCAPE([$1], [""])"]) >>confdefs.h],
2105        [cat >>confdefs.h <<_ACEOF
2106 [$1]
2107 _ACEOF])])
2110 # _AC_DEFINE_Q(MACRO, VARIABLE, [VALUE], [DESCRIPTION])
2111 # -----------------------------------------------------
2112 # Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}.
2113 # MACRO must take one argument, which is the fully expanded string to
2114 # append to confdefs.h as if by a possibly-quoted here-doc.
2116 # m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so we use
2117 # m4_format rather than regex to grab prefix up to first ().  AC_name
2118 # is defined with over-quotation, so that we can avoid m4_defn; this
2119 # is only safe because the name should not contain $.
2121 # Guarantee a match in m4_index, so as to avoid a bug with precision
2122 # -1 in m4_format in older m4.
2123 m4_define([_AC_DEFINE_Q],
2124 [m4_pushdef([AC_name], m4_format([[[%.*s]]], m4_index([$2(], [(]), [$2]))]dnl
2125 [AC_DEFINE_TRACE(AC_name)]dnl
2126 [m4_cond([m4_index([$3], [
2127 ])], [-1], [],
2128         [m4_bregexp([[$3]], [[^\\]
2129 ], [-])], [], [],
2130         [m4_warn([syntax], [AC_DEFINE]m4_if([$1], [_AC_DEFINE], [],
2131   [[_UNQUOTED]])[: `$3' is not a valid preprocessor define value])])]dnl
2132 [m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])
2133 ])_m4_popdef([AC_name])]dnl
2134 [$1(m4_expand([[@%:@define] $2 ]m4_if([$#], 2, 1,
2135   [$3], [], [/**/], [[$3]])))
2140 ## -------------------------- ##
2141 ## Setting output variables.  ##
2142 ## -------------------------- ##
2145 # AC_SUBST_TRACE(VARIABLE)
2146 # ------------------------
2147 # This macro is used with --trace to collect the list of substituted variables.
2148 m4_define([AC_SUBST_TRACE])
2151 # AC_SUBST(VARIABLE, [VALUE])
2152 # ---------------------------
2153 # Create an output variable from a shell VARIABLE.  If VALUE is given
2154 # assign it to VARIABLE.  Use `""' if you want to set VARIABLE to an
2155 # empty value, not an empty second argument.
2157 m4_define([AC_SUBST],
2158 [AS_IDENTIFIER_IF([$1], [],
2159   [m4_fatal([$0: `$1' is not a valid shell variable name])])]dnl
2160 [AC_SUBST_TRACE([$1])]dnl
2161 [m4_pattern_allow([^$1$])]dnl
2162 [m4_ifvaln([$2], [$1=$2])[]]dnl
2163 [m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST
2166 # AC_SUBST_FILE(VARIABLE)
2167 # -----------------------
2168 # Read the comments of the preceding macro.
2169 m4_define([AC_SUBST_FILE],
2170 [m4_pattern_allow([^$1$])dnl
2171 m4_append_uniq([_AC_SUBST_FILES], [$1], [
2172 ])])
2176 ## --------------------------------------- ##
2177 ## Printing messages at autoconf runtime.  ##
2178 ## --------------------------------------- ##
2180 # In fact, I think we should promote the use of m4_warn and m4_fatal
2181 # directly.  This will also avoid to some people to get it wrong
2182 # between AC_FATAL and AC_MSG_ERROR.
2185 # AC_DIAGNOSE(CATEGORY, MESSAGE)
2186 # AC_FATAL(MESSAGE, [EXIT-STATUS])
2187 # --------------------------------
2188 m4_define([AC_DIAGNOSE], [m4_warn($@)])
2189 m4_define([AC_FATAL],    [m4_fatal($@)])
2192 # AC_WARNING(MESSAGE)
2193 # -------------------
2194 # Report a MESSAGE to the user of autoconf if `-W' or `-W all' was
2195 # specified.
2196 m4_define([AC_WARNING],
2197 [AC_DIAGNOSE([syntax], [$1])])
2202 ## ---------------------------------------- ##
2203 ## Printing messages at configure runtime.  ##
2204 ## ---------------------------------------- ##
2207 # AC_MSG_CHECKING(FEATURE)
2208 # ------------------------
2209 m4_define([AC_MSG_CHECKING],
2210 [{ _AS_ECHO_LOG([checking $1])
2211 _AS_ECHO_N([checking $1... ]); }dnl
2215 # AC_MSG_RESULT(RESULT)
2216 # ---------------------
2217 m4_define([AC_MSG_RESULT],
2218 [{ _AS_ECHO_LOG([result: $1])
2219 _AS_ECHO([$1]); }dnl
2223 # AC_MSG_WARN(PROBLEM)
2224 # AC_MSG_NOTICE(STRING)
2225 # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
2226 # AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
2227 # ----------------------------------------
2228 m4_copy([AS_WARN],    [AC_MSG_WARN])
2229 m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
2230 m4_copy([AS_ERROR],   [AC_MSG_ERROR])
2231 m4_define([AC_MSG_FAILURE],
2232 [{ AS_MESSAGE([error: in `$ac_pwd':], 2)
2233 AC_MSG_ERROR([$1
2234 See `config.log' for more details], [$2]); }])
2237 # _AC_MSG_LOG_CONFTEST
2238 # --------------------
2239 m4_define([_AC_MSG_LOG_CONFTEST],
2240 [AS_ECHO(["$as_me: failed program was:"]) >&AS_MESSAGE_LOG_FD
2241 sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2245 # AU::AC_CHECKING(FEATURE)
2246 # ------------------------
2247 AU_DEFUN([AC_CHECKING],
2248 [AS_MESSAGE([checking $1...])])
2251 # AU::AC_MSG_RESULT_UNQUOTED(RESULT)
2252 # ----------------------------------
2253 # No escaping, so it performed also backtick substitution.
2254 AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
2255 [_AS_ECHO_UNQUOTED([$as_me:${as_lineno-$LINENO}: result: $1], AS_MESSAGE_LOG_FD)
2256 _AS_ECHO_UNQUOTED([$1])[]dnl
2260 # AU::AC_VERBOSE(STRING)
2261 # ----------------------
2262 AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])
2269 ## ---------------------------- ##
2270 ## Compiler-running mechanics.  ##
2271 ## ---------------------------- ##
2274 # _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
2275 # ----------------------------------
2276 # Eval COMMAND, save the exit status in ac_status, and log it.  The return
2277 # code is 0 if COMMAND succeeded, so that it can be used directly in AS_IF
2278 # constructs.
2279 AC_DEFUN([_AC_RUN_LOG],
2280 [{ { $2; } >&AS_MESSAGE_LOG_FD
2281   ($1) 2>&AS_MESSAGE_LOG_FD
2282   ac_status=$?
2283   _AS_ECHO_LOG([\$? = $ac_status])
2284   test $ac_status = 0; }])
2287 # _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
2288 # -----------------------------------------
2289 # Run COMMAND, save its stderr into conftest.err, save the exit status
2290 # in ac_status, and log it.  Don't forget to clean up conftest.err after
2291 # use.
2292 # Note that when tracing, most shells will leave the traces in stderr
2293 # starting with "+": that's what this macro tries to address.
2294 # The return code is 0 if COMMAND succeeded, so that it can be used directly
2295 # in AS_IF constructs.
2296 AC_DEFUN([_AC_RUN_LOG_STDERR],
2297 [{ { $2; } >&AS_MESSAGE_LOG_FD
2298   ($1) 2>conftest.err
2299   ac_status=$?
2300   if test -s conftest.err; then
2301     grep -v '^ *+' conftest.err >conftest.er1
2302     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2303     mv -f conftest.er1 conftest.err
2304   fi
2305   _AS_ECHO_LOG([\$? = $ac_status])
2306   test $ac_status = 0; }])
2309 # _AC_RUN_LOG_LIMIT(COMMAND, LOG-COMMANDS, [LINES])
2310 # -------------------------------------------------
2311 # Like _AC_RUN_LOG, but only log LINES lines from stderr,
2312 # defaulting to 10 lines.
2313 AC_DEFUN([_AC_RUN_LOG_LIMIT],
2314 [{ { $2; } >&AS_MESSAGE_LOG_FD
2315   ($1) 2>conftest.err
2316   ac_status=$?
2317   if test -s conftest.err; then
2318     sed 'm4_default([$3], [10])a\
2319 ... rest of stderr output deleted ...
2320          m4_default([$3], [10])q' conftest.err >conftest.er1
2321     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2322   fi
2323   rm -f conftest.er1 conftest.err
2324   _AS_ECHO_LOG([\$? = $ac_status])
2325   test $ac_status = 0; }])
2328 # _AC_DO_ECHO(COMMAND)
2329 # --------------------
2330 # Echo COMMAND.  This is designed to be used just before evaluating COMMAND.
2331 AC_DEFUN([_AC_DO_ECHO],
2332 [m4_if([$1], [$ac_try], [], [ac_try="$1"
2333 ])]dnl
2334 dnl If the string contains '\"', '`', or '\\', then just echo it rather
2335 dnl than expanding it.  This is a hack, but it is safer, while also
2336 dnl typically expanding simple substrings like '$CC', which is what we want.
2338 dnl Much of this macro body is quoted, to work around misuses like
2339 dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
2340 dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
2341 dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse
2342 dnl underquoting misuses, such as
2343 dnl `AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'.
2344 dnl We normally wouldn't bother with this kind of workaround for invalid code
2345 dnl but this change was put in just before Autoconf 2.60 and we wanted to
2346 dnl minimize the integration hassle.
2347 [[case "(($ac_try" in
2348   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2349   *) ac_try_echo=$ac_try;;
2350 esac
2351 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""]
2352 AS_ECHO(["$ac_try_echo"])])
2354 # _AC_DO(COMMAND)
2355 # ---------------
2356 # Eval COMMAND, save the exit status in ac_status, and log it.
2357 # For internal use only.
2358 AC_DEFUN([_AC_DO],
2359 [_AC_RUN_LOG([eval "$1"],
2360              [_AC_DO_ECHO([$1])])])
2363 # _AC_DO_STDERR(COMMAND)
2364 # ----------------------
2365 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2366 AC_DEFUN([_AC_DO_STDERR],
2367 [_AC_RUN_LOG_STDERR([eval "$1"],
2368                     [_AC_DO_ECHO([$1])])])
2371 # _AC_DO_VAR(VARIABLE)
2372 # --------------------
2373 # Evaluate "$VARIABLE", which should be a valid shell command.
2374 # The purpose of this macro is to write "configure:123: command line"
2375 # into config.log for every test run.
2376 AC_DEFUN([_AC_DO_VAR],
2377 [_AC_DO([$$1])])
2380 # _AC_DO_TOKENS(COMMAND)
2381 # ----------------------
2382 # Like _AC_DO_VAR, but execute COMMAND instead, where COMMAND is a series of
2383 # tokens of the shell command language.
2384 AC_DEFUN([_AC_DO_TOKENS],
2385 [{ ac_try='$1'
2386   _AC_DO([$ac_try]); }])
2389 # _AC_DO_LIMIT(COMMAND, [LINES])
2390 # ------------------------------
2391 # Like _AC_DO, but limit the amount of stderr lines logged to LINES.
2392 # For internal use only.
2393 AC_DEFUN([_AC_DO_LIMIT],
2394 [_AC_RUN_LOG_LIMIT([eval "$1"],
2395                    [_AC_DO_ECHO([$1])], [$2])])
2398 # _AC_EVAL(COMMAND)
2399 # -----------------
2400 # Eval COMMAND, save the exit status in ac_status, and log it.
2401 # Unlike _AC_DO, this macro mishandles quoted arguments in some cases.
2402 # It is present only for backward compatibility with previous Autoconf versions.
2403 AC_DEFUN([_AC_EVAL],
2404 [_AC_RUN_LOG([eval $1],
2405              [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2408 # _AC_EVAL_STDERR(COMMAND)
2409 # ------------------------
2410 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2411 # Unlike _AC_DO_STDERR, this macro mishandles quoted arguments in some cases.
2412 # It is present only for backward compatibility with previous Autoconf versions.
2413 AC_DEFUN([_AC_EVAL_STDERR],
2414 [_AC_RUN_LOG_STDERR([eval $1],
2415                     [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2418 # AC_TRY_EVAL(VARIABLE)
2419 # ---------------------
2420 # Evaluate $VARIABLE, which should be a valid shell command.
2421 # The purpose of this macro is to write "configure:123: command line"
2422 # into config.log for every test run.
2424 # The AC_TRY_EVAL and AC_TRY_COMMAND macros are dangerous and
2425 # undocumented, and should not be used.
2426 # They may be removed or their API changed in a future release.
2427 # Autoconf itself no longer uses these two macros; they are present
2428 # only for backward compatibility with previous versions of Autoconf.
2429 # Not every shell command will work due to problems with eval
2430 # and quoting, and the rules for exactly what does work are tricky.
2431 # Worse, due to double-expansion during evaluation, arbitrary unintended
2432 # shell commands could be executed in some situations.
2433 AC_DEFUN([AC_TRY_EVAL],
2434 [_AC_EVAL([$$1])])
2437 # AC_TRY_COMMAND(COMMAND)
2438 # -----------------------
2439 # Like AC_TRY_EVAL, but execute COMMAND instead, where COMMAND is a series of
2440 # tokens of the shell command language.
2441 # This macro should not be used; see the comments under AC_TRY_EVAL for why.
2442 AC_DEFUN([AC_TRY_COMMAND],
2443 [{ ac_try='$1'
2444   _AC_EVAL([$ac_try]); }])
2447 # AC_RUN_LOG(COMMAND)
2448 # -------------------
2449 AC_DEFUN([AC_RUN_LOG],
2450 [_AC_RUN_LOG([$1],
2451              [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"])])])
2456 ## ------------------------ ##
2457 ## Examining declarations.  ##
2458 ## ------------------------ ##
2461 # _AC_PREPROC_IFELSE_BODY
2462 # -----------------------
2463 # Shell function body for _AC_PREPROC_IFELSE.
2464 m4_define([_AC_PREPROC_IFELSE_BODY],
2465 [  AS_LINENO_PUSH([$[]1])
2466   AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) > conftest.i && {
2467          test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2468          test ! -s conftest.err
2469        }],
2470     [ac_retval=0],
2471     [_AC_MSG_LOG_CONFTEST
2472     ac_retval=1])
2473   AS_LINENO_POP
2474   AS_SET_STATUS([$ac_retval])
2475 ])# _AC_PREPROC_IFELSE_BODY
2478 # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2479 # ----------------------------------------------------------------
2480 # Try to preprocess PROGRAM.
2482 # This macro can be used during the selection of a preprocessor.
2483 # eval is necessary to expand ac_cpp.
2484 AC_DEFUN([_AC_PREPROC_IFELSE],
2485 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_cpp],
2486   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
2487     [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
2488   [$0_BODY])]dnl
2489 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2490 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
2491 rm -f conftest.err conftest.i[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2492 ])# _AC_PREPROC_IFELSE
2494 # AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2495 # ---------------------------------------------------------------
2496 # Try to preprocess PROGRAM.  Requires that the preprocessor for the
2497 # current language was checked for, hence do not use this macro in macros
2498 # looking for a preprocessor.
2499 AC_DEFUN([AC_PREPROC_IFELSE],
2500 [AC_LANG_PREPROC_REQUIRE()dnl
2501 _AC_PREPROC_IFELSE($@)])
2504 # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2505 # ---------------------------------------------------------
2506 # AC_TRY_CPP is used to check whether particular header files exist.
2507 # (But it actually tests whether INCLUDES produces no CPP errors.)
2509 # INCLUDES are not defaulted and are double quoted.
2510 AU_DEFUN([AC_TRY_CPP],
2511 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
2514 # AC_EGREP_CPP(PATTERN, PROGRAM,
2515 #              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2516 # ------------------------------------------------------
2517 # Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
2518 # come early, it is not included in AC_BEFORE checks.
2519 AC_DEFUN([AC_EGREP_CPP],
2520 [AC_LANG_PREPROC_REQUIRE()dnl
2521 AC_REQUIRE([AC_PROG_EGREP])dnl
2522 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
2523 AS_IF([dnl eval is necessary to expand ac_cpp.
2524 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
2525 (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
2526 dnl Quote $1 to prevent m4 from eating character classes
2527   $EGREP "[$1]" >/dev/null 2>&1],
2528   [$3],
2529   [$4])
2530 rm -f conftest*
2531 ])# AC_EGREP_CPP
2534 # AC_EGREP_HEADER(PATTERN, HEADER-FILE,
2535 #                 [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2536 # ---------------------------------------------------------
2537 AC_DEFUN([AC_EGREP_HEADER],
2538 [AC_EGREP_CPP([$1],
2539 [#include <$2>
2540 ], [$3], [$4])])
2545 ## ------------------ ##
2546 ## Examining syntax.  ##
2547 ## ------------------ ##
2549 # _AC_COMPILE_IFELSE_BODY
2550 # -----------------------
2551 # Shell function body for _AC_COMPILE_IFELSE.
2552 m4_define([_AC_COMPILE_IFELSE_BODY],
2553 [  AS_LINENO_PUSH([$[]1])
2554   rm -f conftest.$ac_objext
2555   AS_IF([_AC_DO_STDERR($ac_compile) && {
2556          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2557          test ! -s conftest.err
2558        } && test -s conftest.$ac_objext],
2559       [ac_retval=0],
2560       [_AC_MSG_LOG_CONFTEST
2561         ac_retval=1])
2562   AS_LINENO_POP
2563   AS_SET_STATUS([$ac_retval])
2564 ])# _AC_COMPILE_IFELSE_BODY
2567 # _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2568 # ----------------------------------------------------------------
2569 # Try to compile PROGRAM.
2570 # This macro can be used during the selection of a compiler.
2571 AC_DEFUN([_AC_COMPILE_IFELSE],
2572 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_compile],
2573   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_compile], [LINENO],
2574     [Try to compile conftest.$ac_ext, and return whether this succeeded.])],
2575   [$0_BODY])]dnl
2576 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2577 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
2578 rm -f core conftest.err conftest.$ac_objext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2579 ])# _AC_COMPILE_IFELSE
2582 # AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2583 # ---------------------------------------------------------------
2584 # Try to compile PROGRAM.  Requires that the compiler for the current
2585 # language was checked for, hence do not use this macro in macros looking
2586 # for a compiler.
2587 AC_DEFUN([AC_COMPILE_IFELSE],
2588 [AC_LANG_COMPILER_REQUIRE()dnl
2589 _AC_COMPILE_IFELSE($@)])
2592 # AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
2593 #                [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2594 # ---------------------------------------------------
2595 AU_DEFUN([AC_TRY_COMPILE],
2596 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2600 ## --------------------- ##
2601 ## Examining libraries.  ##
2602 ## --------------------- ##
2605 # _AC_LINK_IFELSE_BODY
2606 # --------------------
2607 # Shell function body for _AC_LINK_IFELSE.
2608 m4_define([_AC_LINK_IFELSE_BODY],
2609 [  AS_LINENO_PUSH([$[]1])
2610   rm -f conftest.$ac_objext conftest$ac_exeext
2611   AS_IF([_AC_DO_STDERR($ac_link) && {
2612          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2613          test ! -s conftest.err
2614        } && test -s conftest$ac_exeext && {
2615          test "$cross_compiling" = yes ||
2616          AS_TEST_X([conftest$ac_exeext])
2617        }],
2618       [ac_retval=0],
2619       [_AC_MSG_LOG_CONFTEST
2620         ac_retval=1])
2621   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2622   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2623   # interfere with the next link command; also delete a directory that is
2624   # left behind by Apple's compiler.  We do this before executing the actions.
2625   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2626   AS_LINENO_POP
2627   AS_SET_STATUS([$ac_retval])
2628 ])# _AC_LINK_IFELSE_BODY
2631 # _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2632 # -------------------------------------------------------------
2633 # Try to link PROGRAM.
2634 # This macro can be used during the selection of a compiler.
2636 # Test that resulting file is executable; see the problem reported by mwoehlke
2637 # in <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00048.html>.
2638 # But skip the test when cross-compiling, to prevent problems like the one
2639 # reported by Chris Johns in
2640 # <http://lists.gnu.org/archive/html/autoconf/2007-03/msg00085.html>.
2642 AC_DEFUN([_AC_LINK_IFELSE],
2643 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_link],
2644   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_link], [LINENO],
2645     [Try to link conftest.$ac_ext, and return whether this succeeded.])],
2646   [$0_BODY])]dnl
2647 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2648 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_link "$LINENO"], [$2], [$3])
2649 rm -f core conftest.err conftest.$ac_objext \
2650     conftest$ac_exeext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2651 ])# _AC_LINK_IFELSE
2654 # AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2655 # ------------------------------------------------------------
2656 # Try to link PROGRAM.  Requires that the compiler for the current
2657 # language was checked for, hence do not use this macro in macros looking
2658 # for a compiler.
2659 AC_DEFUN([AC_LINK_IFELSE],
2660 [AC_LANG_COMPILER_REQUIRE()dnl
2661 _AC_LINK_IFELSE($@)])
2664 # AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
2665 #             [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2666 # ------------------------------------------------
2667 # Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
2668 AU_DEFUN([AC_TRY_LINK],
2669 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2672 # AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
2673 #                  ACTION-IF-TRUE, [ACTION-IF-FALSE])
2674 # ---------------------------------------------------
2675 AU_DEFUN([AC_COMPILE_CHECK],
2676 [m4_ifvaln([$1], [AC_MSG_CHECKING([for $1])])dnl
2677 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])])
2682 ## ------------------------------- ##
2683 ## Checking for runtime features.  ##
2684 ## ------------------------------- ##
2687 # _AC_RUN_IFELSE_BODY
2688 # -------------------
2689 # Shell function body for _AC_RUN_IFELSE.
2690 m4_define([_AC_RUN_IFELSE_BODY],
2691 [  AS_LINENO_PUSH([$[]1])
2692   AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
2693       [ac_retval=0],
2694       [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
2695        _AC_MSG_LOG_CONFTEST
2696        ac_retval=$ac_status])
2697   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2698   AS_LINENO_POP
2699   AS_SET_STATUS([$ac_retval])
2700 ])# _AC_RUN_IFELSE_BODY
2703 # _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2704 # ------------------------------------------------------------
2705 # Compile, link, and run.
2706 # This macro can be used during the selection of a compiler.
2707 # We also remove conftest.o as if the compilation fails, some compilers
2708 # don't remove it.  We remove gmon.out and bb.out, which may be
2709 # created during the run if the program is built with profiling support.
2710 AC_DEFUN([_AC_RUN_IFELSE],
2711 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run],
2712   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run], [LINENO],
2713     [Try to link conftest.$ac_ext, and return whether this succeeded.
2714      Assumes that executables *can* be run.])],
2715   [$0_BODY])]dnl
2716 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2717 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run "$LINENO"], [$2], [$3])
2718 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2719   conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2720 ])# _AC_RUN_IFELSE
2722 # AC_RUN_IFELSE(PROGRAM,
2723 #               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2724 #               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2725 # ----------------------------------------------------------
2726 # Compile, link, and run. Requires that the compiler for the current
2727 # language was checked for, hence do not use this macro in macros looking
2728 # for a compiler.
2729 AC_DEFUN([AC_RUN_IFELSE],
2730 [AC_LANG_COMPILER_REQUIRE()dnl
2731 m4_ifval([$4], [],
2732          [AC_DIAGNOSE([cross],
2733                      [$0 called without default to allow cross compiling])])dnl
2734 AS_IF([test "$cross_compiling" = yes],
2735   [m4_default([$4],
2736            [AC_MSG_FAILURE([cannot run test program while cross compiling])])],
2737   [_AC_RUN_IFELSE($@)])
2741 # AC_TRY_RUN(PROGRAM,
2742 #            [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2743 #            [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2744 # -------------------------------------------------------
2745 AU_DEFUN([AC_TRY_RUN],
2746 [AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])
2750 ## ------------------------------------- ##
2751 ## Checking for the existence of files.  ##
2752 ## ------------------------------------- ##
2754 # AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2755 # -------------------------------------------------------------
2757 # Check for the existence of FILE.
2758 AC_DEFUN([AC_CHECK_FILE],
2759 [AC_DIAGNOSE([cross],
2760              [cannot check for file existence when cross compiling])dnl
2761 AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
2762 AC_CACHE_CHECK([for $1], [ac_File],
2763 [test "$cross_compiling" = yes &&
2764   AC_MSG_ERROR([cannot check for file existence when cross compiling])
2765 if test -r "$1"; then
2766   AS_VAR_SET([ac_File], [yes])
2767 else
2768   AS_VAR_SET([ac_File], [no])
2769 fi])
2770 AS_VAR_IF([ac_File], [yes], [$2], [$3])
2771 AS_VAR_POPDEF([ac_File])dnl
2772 ])# AC_CHECK_FILE
2775 # _AC_CHECK_FILES(FILE)
2776 # ---------------------
2777 # Helper to AC_CHECK_FILES, which generates two of the three arguments
2778 # to AC_CHECK_FILE based on FILE.
2779 m4_define([_AC_CHECK_FILES],
2780 [[$1], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
2781   [Define to 1 if you have the file `$1'.])]])
2784 # AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2785 # -----------------------------------------------------------------
2786 # For each word in the whitespace-separated FILE list, perform either
2787 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.  For files that exist, also
2788 # provide the preprocessor variable HAVE_FILE.
2789 AC_DEFUN([AC_CHECK_FILES],
2790 [m4_map_args_w([$1], [AC_CHECK_FILE(_$0(], [)[$2], [$3])])])
2793 ## ------------------------------- ##
2794 ## Checking for declared symbols.  ##
2795 ## ------------------------------- ##
2798 # _AC_CHECK_DECL_BODY
2799 # -------------------
2800 # Shell function body for AC_CHECK_DECL.
2801 m4_define([_AC_CHECK_DECL_BODY],
2802 [  AS_LINENO_PUSH([$[]1])
2803   [as_decl_name=`echo $][2|sed 's/ *(.*//'`]
2804   [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
2805   AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
2806   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
2807 [@%:@ifndef $[]as_decl_name
2808 @%:@ifdef __cplusplus
2809   (void) $[]as_decl_use;
2810 @%:@else
2811   (void) $[]as_decl_name;
2812 @%:@endif
2813 @%:@endif
2814 ])],
2815                    [AS_VAR_SET([$[]3], [yes])],
2816                    [AS_VAR_SET([$[]3], [no])])])
2817   AS_LINENO_POP
2818 ])# _AC_CHECK_DECL_BODY
2820 # AC_CHECK_DECL(SYMBOL,
2821 #               [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2822 #               [INCLUDES = DEFAULT-INCLUDES])
2823 # -------------------------------------------------------
2824 # Check whether SYMBOL (a function, variable, or constant) is declared.
2825 AC_DEFUN([AC_CHECK_DECL],
2826 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_decl],
2827   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_decl],
2828     [LINENO SYMBOL VAR INCLUDES],
2829     [Tests whether SYMBOL is declared in INCLUDES, setting cache variable
2830      VAR accordingly.])],
2831   [_$0_BODY])]dnl
2832 [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl
2833 [ac_fn_[]_AC_LANG_ABBREV[]_check_decl ]dnl
2834 ["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])"
2835 AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])
2836 AS_VAR_POPDEF([ac_Symbol])dnl
2837 ])# AC_CHECK_DECL
2840 # _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
2841 #                 INCLUDES)
2842 # -------------------------------------------------------------
2843 # Helper to AC_CHECK_DECLS, which generates the check for a single
2844 # SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
2845 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
2846 m4_define([_AC_CHECK_DECLS],
2847 [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
2848 [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])),
2849   [$ac_have_decl],
2850   [Define to 1 if you have the declaration of `$1',
2851    and to 0 if you don't.])]dnl
2852 [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
2854 # AC_CHECK_DECLS(SYMBOLS,
2855 #                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2856 #                [INCLUDES = DEFAULT-INCLUDES])
2857 # --------------------------------------------------------
2858 # Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise.  See the
2859 # documentation for a detailed explanation of this difference with
2860 # other AC_CHECK_*S macros.  SYMBOLS is an m4 list.
2861 AC_DEFUN([AC_CHECK_DECLS],
2862 [m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)])
2865 # _AC_CHECK_DECL_ONCE(SYMBOL)
2866 # ---------------------------
2867 # Check for a single SYMBOL once.
2868 m4_define([_AC_CHECK_DECL_ONCE],
2869 [AC_DEFUN([_AC_Check_Decl_$1], [_AC_CHECK_DECLS([$1])])]dnl
2870 [AC_REQUIRE([_AC_Check_Decl_$1])])
2872 # AC_CHECK_DECLS_ONCE(SYMBOLS)
2873 # ----------------------------
2874 # Like AC_CHECK_DECLS(SYMBOLS), but do it at most once.
2875 AC_DEFUN([AC_CHECK_DECLS_ONCE],
2876 [m4_map_args_sep([_AC_CHECK_DECL_ONCE(], [)], [], $1)])
2880 ## ---------------------------------- ##
2881 ## Replacement of library functions.  ##
2882 ## ---------------------------------- ##
2885 # AC_CONFIG_LIBOBJ_DIR(DIRNAME)
2886 # -----------------------------
2887 # Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME.
2888 AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR],
2889 [m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])])
2892 # AC_LIBSOURCE(FILE-NAME)
2893 # -----------------------
2894 # Announce we might need the file `FILE-NAME'.
2895 m4_define([AC_LIBSOURCE], [])
2898 # AC_LIBSOURCES([FILE-NAME1, ...])
2899 # --------------------------------
2900 # Announce we might need these files.
2901 AC_DEFUN([AC_LIBSOURCES],
2902 [m4_map_args([AC_LIBSOURCE], $1)])
2905 # _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR)
2906 # --------------------------------------------
2907 # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
2908 m4_define([_AC_LIBOBJ],
2909 [AS_LITERAL_WORD_IF([$1],
2910                [AC_LIBSOURCE([$1.c])],
2911                [$2])dnl
2912 case " $LIB@&t@OBJS " in
2913   *" $1.$ac_objext "* ) ;;
2914   *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;;
2915 esac
2919 # AC_LIBOBJ(FILE-NAME-NOEXT)
2920 # --------------------------
2921 # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
2922 AC_DEFUN([AC_LIBOBJ],
2923 [_AC_LIBOBJ([$1],
2924             [AC_DIAGNOSE(syntax,
2925                          [$0($1): you should use literals])])dnl
2929 # _AC_LIBOBJS_NORMALIZE
2930 # ---------------------
2931 # Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext,
2932 # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
2933 # Used with AC_CONFIG_COMMANDS_PRE.
2934 AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
2935 [ac_libobjs=
2936 ac_ltlibobjs=
2937 m4_ifndef([AM_C_PROTOTYPES], [U=
2938 ])dnl
2939 for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
2940   # 1. Remove the extension, and $U if already installed.
2941   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
2942   ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
2943   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
2944   #    will be set to the directory where LIBOBJS objects are built.
2945   AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
2946   AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
2947 done
2948 AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
2949 AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
2953 ## ----------------------------------- ##
2954 ## Checking compiler characteristics.  ##
2955 ## ----------------------------------- ##
2958 # _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
2959 #                         [IF-FAILURE])
2960 # ---------------------------------------------------------------------
2961 # Compute the integer EXPRESSION and store the result in the VARIABLE.
2962 # Works OK if cross compiling, but assumes twos-complement arithmetic.
2963 m4_define([_AC_COMPUTE_INT_COMPILE],
2964 [# Depending upon the size, compute the lo and hi bounds.
2965 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
2966  [ac_lo=0 ac_mid=0
2967   while :; do
2968     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2969                        [ac_hi=$ac_mid; break],
2970                        [AS_VAR_ARITH([ac_lo], [$ac_mid + 1])
2971                         if test $ac_lo -le $ac_mid; then
2972                           ac_lo= ac_hi=
2973                           break
2974                         fi
2975                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid + 1])])
2976   done],
2977 [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
2978  [ac_hi=-1 ac_mid=-1
2979   while :; do
2980     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
2981                        [ac_lo=$ac_mid; break],
2982                        [AS_VAR_ARITH([ac_hi], ['(' $ac_mid ')' - 1])
2983                         if test $ac_mid -le $ac_hi; then
2984                           ac_lo= ac_hi=
2985                           break
2986                         fi
2987                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid])])
2988   done],
2989  [ac_lo= ac_hi=])])
2990 # Binary search between lo and hi bounds.
2991 while test "x$ac_lo" != "x$ac_hi"; do
2992   AS_VAR_ARITH([ac_mid], ['(' $ac_hi - $ac_lo ')' / 2 + $ac_lo])
2993   _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2994                      [ac_hi=$ac_mid],
2995                      [AS_VAR_ARITH([ac_lo], ['(' $ac_mid ')' + 1])])
2996 done
2997 case $ac_lo in @%:@((
2998 ?*) AS_VAR_SET([$2], [$ac_lo]); $4 ;;
2999 '') $5 ;;
3000 esac[]dnl
3001 ])# _AC_COMPUTE_INT_COMPILE
3004 # _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
3005 #                     [IF-FAILURE])
3006 # -----------------------------------------------------------------
3007 # Store the evaluation of the integer EXPRESSION in VARIABLE.
3009 # AC_LANG_INT_SAVE intentionally does not end the file in a newline, so
3010 # we must add one to make it a text file before passing it to read.
3011 m4_define([_AC_COMPUTE_INT_RUN],
3012 [_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
3013                 [echo >>conftest.val; read $2 <conftest.val; $4], [$5])
3014 rm -f conftest.val
3015 ])# _AC_COMPUTE_INT_RUN
3018 # _AC_COMPUTE_INT_BODY
3019 # --------------------
3020 # Shell function body for AC_COMPUTE_INT.
3021 m4_define([_AC_COMPUTE_INT_BODY],
3022 [  AS_LINENO_PUSH([$[]1])
3023   if test "$cross_compiling" = yes; then
3024     _AC_COMPUTE_INT_COMPILE([$[]2], [$[]3], [$[]4],
3025                             [ac_retval=0], [ac_retval=1])
3026   else
3027     _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4],
3028                         [ac_retval=0], [ac_retval=1])
3029   fi
3030   AS_LINENO_POP
3031   AS_SET_STATUS([$ac_retval])
3032 ])# _AC_COMPUTE_INT_BODY
3034 # AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
3035 # ----------------------------------------------------------
3036 # Store into the shell variable VARIABLE the value of the integer C expression
3037 # EXPRESSION.  The value should fit in an initializer in a C variable of type
3038 # `signed long'.  If no PROLOGUE are specified, the default includes are used.
3039 # IF-FAILS is evaluated if the value cannot be found (which includes the
3040 # case of cross-compilation, if EXPRESSION is not computable at compile-time.
3041 AC_DEFUN([AC_COMPUTE_INT],
3042 [AC_LANG_COMPILER_REQUIRE()]dnl
3043 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3044   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3045     [LINENO EXPR VAR INCLUDES],
3046     [Tries to find the compile-time value of EXPR in a program that includes
3047      INCLUDES, setting VAR accordingly.  Returns whether the value could
3048      be computed])],
3049     [_$0_BODY])]dnl
3050 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_compute_int "$LINENO" "$2" "$1" ]dnl
3051        ["AS_ESCAPE([$3], [""])"],
3052        [], [$4])
3053 ])# AC_COMPUTE_INT
3055 # _AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
3056 # -----------------------------------------------------------
3057 # FIXME: this private interface was used by several packages.
3058 # Give them time to transition to AC_COMPUTE_INT and then delete this one.
3059 AC_DEFUN([_AC_COMPUTE_INT],
3060 [AC_COMPUTE_INT([$2], [$1], [$3], [$4])
3061 AC_DIAGNOSE([obsolete],
3062 [The macro `_AC_COMPUTE_INT' is obsolete and will be deleted in a
3063 future version or Autoconf.  Hence, it is suggested that you use
3064 instead the public AC_COMPUTE_INT macro.  Note that the arguments are
3065 slightly different between the two.])dnl
3066 ])# _AC_COMPUTE_INT