Mention autogen.sh sooner in doc
[autoconf.git] / lib / autoconf / general.m4
blob8f40fca3acdd8d6b6aabe3c73eac0beeb7d6247c
1 # This file is part of Autoconf.                       -*- Autoconf -*-
2 # Parameterized macros.
3 m4_define([_AC_COPYRIGHT_YEARS], [
4 Copyright (C) 1992-1996, 1998-2017, 2020-2024 Free Software Foundation,
5 Inc.
6 ])
8 # This file is part of Autoconf.  This program is free
9 # software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the
11 # Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
19 # Under Section 7 of GPL version 3, you are granted additional
20 # permissions described in the Autoconf Configure Script Exception,
21 # version 3.0, as published by the Free Software Foundation.
23 # You should have received a copy of the GNU General Public License
24 # and a copy of the Autoconf Configure Script Exception along with
25 # this program; see the files COPYINGv3 and COPYING.EXCEPTION
26 # respectively.  If not, see <https://www.gnu.org/licenses/> and
27 # <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;f=COPYING.EXCEPTION>.
29 # Written by David MacKenzie, with help from
30 # Franç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 ## ----------------------------- ##
168 ## Implementing shell functions. ##
169 ## ----------------------------- ##
172 # AC_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY, [DIVERSION = SHELL_FN]
173 # ------------------------------------------------------------------------
174 # Same as AS_REQUIRE_SHELL_FN except that the default diversion comes
175 # later in the script (speeding up configure --help and --version).
176 AC_DEFUN([AC_REQUIRE_SHELL_FN],
177 [AS_REQUIRE_SHELL_FN([$1], [$2], [$3], m4_default_quoted([$4], [SHELL_FN]))])
181 ## ----------------------------- ##
182 ## Implementing Autoconf loops.  ##
183 ## ----------------------------- ##
186 # AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION)
187 # ------------------------------------------
188 # The double definition is necessary because autoupdate expands m4_
189 # macros, so we have to double-quote the replacement, but then it
190 # won't work in a normal autoconf run.
191 AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]])
192 AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnl
193 m4_warn([obsolete], [The macro 'AC_FOREACH' is obsolete.
194 You should run autoupdate.])])
198 ## ----------------------------------- ##
199 ## Helping macros to display strings.  ##
200 ## ----------------------------------- ##
203 # AU::AC_HELP_STRING(LHS, RHS, [COLUMN])
204 # --------------------------------------
205 AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])
209 ## ---------------------------------------------- ##
210 ## Information on the package being Autoconf'ed.  ##
211 ## ---------------------------------------------- ##
214 # It is suggested that the macros in this section appear before
215 # AC_INIT in 'configure.ac'.  Nevertheless, this is just stylistic,
216 # and from the implementation point of view, AC_INIT *must* be expanded
217 # beforehand: it puts data in diversions which must appear before the
218 # data provided by the macros of this section.
220 # The solution is to require AC_INIT in each of these macros.  AC_INIT
221 # has the needed magic so that it can't be expanded twice.
223 # _AC_INIT_LITERAL(STRING)
224 # ------------------------
225 # Reject STRING if it cannot be used as-is in single-quoted strings,
226 # double-quoted strings, and quoted and unquoted here-docs.
227 m4_define([_AC_INIT_LITERAL],
228 [m4_if(m4_index(m4_translit([[$1]], [""], ['']),
229                 ['])AS_LITERAL_HEREDOC_IF([$1], [-]),
230        [-1-], [],
231   [m4_warn([syntax], [AC_INIT: not a literal: "$1"])])])
233 # _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
234 # ---------------------------------------------------------------------
235 # Set the values of AC_PACKAGE_{NAME,VERSION,STRING,BUGREPORT,TARNAME,URL}
236 # from the arguments.
237 m4_define([_AC_INIT_PACKAGE],
238 [_AC_INIT_PACKAGE_N(m4_normalize([$1]), m4_normalize([$2]), m4_normalize([$3]),
239                     m4_normalize([$4]), m4_normalize([$5]))])
241 # _AC_INIT_PACKAGE_N(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
242 # -----------------------------------------------------------------------
243 # Subroutine of _AC_INIT_PACKAGE.
244 m4_define([_AC_INIT_PACKAGE_N],
245 [# PACKAGE-NAME, VERSION, BUGREPORT, and URL should all be safe for use
246 # in shell strings of all kinds.
247 _AC_INIT_LITERAL([$1])
248 _AC_INIT_LITERAL([$2])
249 _AC_INIT_LITERAL([$3])
250 _AC_INIT_LITERAL([$5])
252 # TARNAME is even more constrained: it should not contain any shell
253 # metacharacters or whitespace, because it is used to construct
254 # filenames.
255 AS_LITERAL_WORD_IF([$4], [],
256   [m4_warn([syntax],
257            [AC_INIT: unsafe as a filename: "$4"])])
259 m4_define_default([AC_PACKAGE_NAME],      [$1])
260 m4_define_default([AC_PACKAGE_VERSION],   [$2])
262 # The m4_strip makes AC_PACKAGE_STRING be [], not [ ], when
263 # both $1 and $2 are empty.
264 m4_define_default([AC_PACKAGE_STRING],    m4_strip([$1 $2]))
265 m4_define_default([AC_PACKAGE_BUGREPORT], [$3])
267 # N.B. m4_ifnblank strips one layer of quotation from whichever of its
268 # second and third argument it evaluates to.
269 m4_define_default([AC_PACKAGE_TARNAME],
270   m4_ifnblank([$4], [[$4]],
271     [m4_quote(m4_bpatsubst(m4_tolower(m4_bpatsubst([$1], [^GNU ], [])),
272       [[^_abcdefghijklmnopqrstuvwxyz0123456789]], [-]))]))
273 m4_define_default([AC_PACKAGE_URL],
274   m4_ifnblank([$5], [[$5]],
275     [m4_if(m4_index([$1], [GNU ]), [0],
276       [[https://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]],
277       [])]))
281 # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER],
282 #              [FILTER = m4_newline])
283 # ------------------------------------------------------
284 # Emit TEXT, a copyright notice, in the top of 'configure' and in
285 # --version output.  Macros in TEXT are evaluated once.  Process
286 # the --version output through FILTER (m4_newline, m4_do, and
287 # m4_copyright_condense are common filters).
288 m4_define([AC_COPYRIGHT],
289 [AS_COPYRIGHT([$1])[]]dnl
290 [m4_divert_text(m4_default_quoted([$2], [VERSION_USER]),
291 [m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT
294 # AC_REVISION(REVISION-INFO)
295 # --------------------------
296 # The second quote in the translit is just to cope with font-lock-mode
297 # which sees the opening of a string.
298 m4_define([AC_REVISION],
299 [m4_divert_text([HEADER-REVISION],
300                 [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
306 ## ---------------------------------------- ##
307 ## Requirements over the Autoconf version.  ##
308 ## ---------------------------------------- ##
311 # AU::AC_PREREQ(VERSION)
312 # ----------------------
313 # Update this 'AC_PREREQ' statement to require the current version of
314 # Autoconf.  But fail if ever this autoupdate is too old.
316 # Note that 'm4_defn([m4_PACKAGE_VERSION])' below are expanded before
317 # calling 'AU_DEFUN', i.e., it is hard coded.  Otherwise it would be
318 # quite complex for autoupdate to import the value of
319 # 'm4_PACKAGE_VERSION'.  We could 'AU_DEFUN' 'm4_PACKAGE_VERSION', but
320 # this would replace all its occurrences with the current version of
321 # Autoconf, which is certainly not what the user intended.
322 AU_DEFUN([AC_PREREQ],
323 [m4_version_prereq([$1])[]dnl
324 [AC_PREREQ(]]m4_dquote(m4_dquote(m4_defn([m4_PACKAGE_VERSION])))[[)]])
327 # AC_PREREQ(VERSION)
328 # ------------------
329 # Complain and exit if the Autoconf version is less than VERSION.
330 m4_undefine([AC_PREREQ])
331 m4_copy([m4_version_prereq], [AC_PREREQ])
334 # AC_AUTOCONF_VERSION
335 # -------------------
336 # The current version of Autoconf parsing this file.
337 m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])
343 ## ---------------- ##
344 ## Initialization.  ##
345 ## ---------------- ##
348 # All the following macros are used by AC_INIT.  Ideally, they should
349 # be presented in the order in which they are output.  Please, help us
350 # sorting it, or at least, don't augment the entropy.
353 # _AC_INIT_NOTICE
354 # ---------------
355 # Provide useful headers; override the HEADER-COMMENT created by M4sh.
356 m4_define([_AC_INIT_NOTICE],
357 [m4_cleardivert([HEADER-COMMENT])]dnl
358 [m4_divert_text([HEADER-COMMENT],
359 [@%:@ Guess values for system-dependent variables and create Makefiles.
360 @%:@ Generated by m4_PACKAGE_STRING[]dnl
361 m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
363 m4_ifset([AC_PACKAGE_BUGREPORT],
364          [m4_divert_text([HEADER-COMMENT],
365                          [@%:@
366 @%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
370 # _AC_INIT_COPYRIGHT
371 # ------------------
372 # We dump to VERSION_FSF to make sure we are inserted before the
373 # user copyrights, and after the setup of the --version handling.
374 m4_define([_AC_INIT_COPYRIGHT],
375 [AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [
376 m4_copyright_condense])dnl
377 AC_COPYRIGHT(
378 [This configure script is free software; the Free Software Foundation
379 gives unlimited permission to copy, distribute and modify it.],
380              [VERSION_FSF], [m4_echo])])
383 # File Descriptors
384 # ----------------
385 # Set up the file descriptors used by 'configure'.
386 # File descriptor usage:
387 # 0 standard input (/dev/null)
388 # 1 file creation
389 # 2 errors and warnings
390 # AS_MESSAGE_LOG_FD compiler messages saved in config.log
391 # AS_MESSAGE_FD checking for... messages and results
392 # AS_ORIGINAL_STDIN_FD original standard input (still open)
394 # stdin is /dev/null because checks that run programs may
395 # inadvertently run interactive ones, which would stop configuration
396 # until someone typed an EOF.
397 m4_define([AS_MESSAGE_FD], 6)
398 m4_define([AS_ORIGINAL_STDIN_FD], 7)
399 # That's how they used to be named.
400 AU_ALIAS([AC_FD_CC],  [AS_MESSAGE_LOG_FD])
401 AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
404 # _AC_INIT_DEFAULTS
405 # -----------------
406 # Values which defaults can be set from 'configure.ac'.
407 # '/bin/machine' is used in 'glibcbug'.  The others are used in config.*
408 m4_define([_AC_INIT_DEFAULTS],
409 [m4_divert_push([DEFAULTS])dnl
411 test -n "$DJDIR" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null
412 exec AS_MESSAGE_FD>&1
414 # Name of the host.
415 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
416 # so uname gets run too.
417 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
420 # Initializations.
422 ac_default_prefix=/usr/local
423 ac_clean_CONFIG_STATUS=
424 ac_clean_files=
425 ac_config_libobj_dir=.
426 LIB@&t@OBJS=
427 cross_compiling=no
428 subdirs=
429 MFLAGS=
430 MAKEFLAGS=
431 AC_SUBST([SHELL])dnl
432 AC_SUBST([PATH_SEPARATOR])dnl
434 # Identity of this package.
435 AC_SUBST([PACKAGE_NAME],
436          [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])dnl
437 AC_SUBST([PACKAGE_TARNAME],
438          [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
439 AC_SUBST([PACKAGE_VERSION],
440          [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
441 AC_SUBST([PACKAGE_STRING],
442          [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
443 AC_SUBST([PACKAGE_BUGREPORT],
444          [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
445 AC_SUBST([PACKAGE_URL],
446          [m4_ifdef([AC_PACKAGE_URL],       ['AC_PACKAGE_URL'])])dnl
448 m4_divert_pop([DEFAULTS])dnl
449 m4_wrap_lifo([m4_divert_text([DEFAULTS],
450 [ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)'
451 ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
452 ac_user_opts='
453 enable_option_checking
454 m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS])
456 m4_ifdef([_AC_PRECIOUS_VARS],
457   [_AC_ARG_VAR_STORE[]dnl
458    _AC_ARG_VAR_VALIDATE[]dnl
459    ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])'])
460 m4_ifdef([_AC_LIST_SUBDIRS],
461   [ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl
462 ])])dnl
463 ])# _AC_INIT_DEFAULTS
466 # AC_PREFIX_DEFAULT(PREFIX)
467 # -------------------------
468 AC_DEFUN([AC_PREFIX_DEFAULT],
469 [m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
472 # AC_PREFIX_PROGRAM(PROGRAM)
473 # --------------------------
474 # Guess the value for the 'prefix' variable by looking for
475 # the argument program along PATH and taking its parent.
476 # Example: if the argument is 'gcc' and we find /usr/local/gnu/bin/gcc,
477 # set 'prefix' to /usr/local/gnu.
478 # This comes too late to find a site file based on the prefix,
479 # and it might use a cached value for the path.
480 # No big loss, I think, since most configures don't use this macro anyway.
481 AC_DEFUN([AC_PREFIX_PROGRAM],
482 [if test "x$prefix" = xNONE; then
483 dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
484   _AS_ECHO_N([checking for prefix by ])
485   AC_PATH_PROG(ac_prefix_program, [$1])
486   if test -n "$ac_prefix_program"; then
487     prefix=`AS_DIRNAME(["$ac_prefix_program"])`
488     prefix=`AS_DIRNAME(["$prefix"])`
489   fi
491 ])# AC_PREFIX_PROGRAM
494 # AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
495 # ---------------------------------------------
496 # UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package,
497 # relative to the directory that configure is in, which we can look
498 # for to find out if srcdir is correct.
499 AC_DEFUN([AC_CONFIG_SRCDIR],
500 [m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
503 # _AC_INIT_DIRCHECK
504 # -----------------
505 # Set ac_pwd, and sanity-check it and the source and installation directories.
507 # (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
509 AC_DEFUN([_AC_INIT_DIRCHECK],
510 [m4_divert_push([PARSE_ARGS])dnl
512 ac_pwd=`pwd` && test -n "$ac_pwd" &&
513 ac_ls_di=`ls -di .` &&
514 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
515   AC_MSG_ERROR([working directory cannot be determined])
516 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
517   AC_MSG_ERROR([pwd does not report name of working directory])
519 m4_divert_pop([PARSE_ARGS])dnl
520 ])# _AC_INIT_DIRCHECK
522 # _AC_INIT_SRCDIR
523 # ---------------
524 # Compute 'srcdir' based on '$ac_unique_file'.
526 # (We have to AC_DEFUN it, since we use AC_REQUIRE.)
528 AC_DEFUN([_AC_INIT_SRCDIR],
529 [AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
530 m4_divert_push([PARSE_ARGS])dnl
532 # Find the source files, if location was not specified.
533 if test -z "$srcdir"; then
534   ac_srcdir_defaulted=yes
535   # Try the directory containing this script, then the parent directory.
536   ac_confdir=`AS_DIRNAME(["$as_myself"])`
537   srcdir=$ac_confdir
538   if test ! -r "$srcdir/$ac_unique_file"; then
539     srcdir=..
540   fi
541 else
542   ac_srcdir_defaulted=no
544 if test ! -r "$srcdir/$ac_unique_file"; then
545   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
546   AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
548 ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work"
549 ac_abs_confdir=`(
550         cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
551         pwd)`
552 # When building in place, set srcdir=.
553 if test "$ac_abs_confdir" = "$ac_pwd"; then
554   srcdir=.
556 # Remove unnecessary trailing slashes from srcdir.
557 # Double slashes in file names in object file debugging info
558 # mess up M-x gdb in Emacs.
559 case $srcdir in
560 */) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
561 esac
562 m4_divert_pop([PARSE_ARGS])dnl
563 ])# _AC_INIT_SRCDIR
566 # _AC_INIT_PARSE_ARGS
567 # -------------------
568 m4_define([_AC_INIT_PARSE_ARGS],
569 [m4_divert_push([PARSE_ARGS])dnl
571 # Initialize some variables set by options.
572 ac_init_help=
573 ac_init_version=false
574 ac_unrecognized_opts=
575 ac_unrecognized_sep=
576 # The variables have the same names as the options, with
577 # dashes changed to underlines.
578 cache_file=/dev/null
579 AC_SUBST(exec_prefix, NONE)dnl
580 no_create=
581 no_recursion=
582 AC_SUBST(prefix, NONE)dnl
583 program_prefix=NONE
584 program_suffix=NONE
585 AC_SUBST(program_transform_name, [s,x,x,])dnl
586 silent=
587 site=
588 srcdir=
589 verbose=
590 x_includes=NONE
591 x_libraries=NONE
593 # Installation directory options.
594 # These are left unexpanded so users can "make install exec_prefix=/foo"
595 # and all the variables that are supposed to be based on exec_prefix
596 # by default will actually change.
597 # Use braces instead of parens because sh, perl, etc. also accept them.
598 # (The list follows the same order as the GNU Coding Standards.)
599 AC_SUBST([bindir],         ['${exec_prefix}/bin'])dnl
600 AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
601 AC_SUBST([libexecdir],     ['${exec_prefix}/libexec'])dnl
602 AC_SUBST([datarootdir],    ['${prefix}/share'])dnl
603 AC_SUBST([datadir],        ['${datarootdir}'])dnl
604 AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
605 AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
606 AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
607 AC_SUBST([runstatedir],    ['${localstatedir}/run'])dnl
608 AC_SUBST([includedir],     ['${prefix}/include'])dnl
609 AC_SUBST([oldincludedir],  ['/usr/include'])dnl
610 AC_SUBST([docdir],         [m4_ifset([AC_PACKAGE_TARNAME],
611                                      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
612                                      ['${datarootdir}/doc/${PACKAGE}'])])dnl
613 AC_SUBST([infodir],        ['${datarootdir}/info'])dnl
614 AC_SUBST([htmldir],        ['${docdir}'])dnl
615 AC_SUBST([dvidir],         ['${docdir}'])dnl
616 AC_SUBST([pdfdir],         ['${docdir}'])dnl
617 AC_SUBST([psdir],          ['${docdir}'])dnl
618 AC_SUBST([libdir],         ['${exec_prefix}/lib'])dnl
619 AC_SUBST([localedir],      ['${datarootdir}/locale'])dnl
620 AC_SUBST([mandir],         ['${datarootdir}/man'])dnl
622 ac_prev=
623 ac_dashdash=
624 for ac_option
626   # If the previous option needs an argument, assign it.
627   if test -n "$ac_prev"; then
628     eval $ac_prev=\$ac_option
629     ac_prev=
630     continue
631   fi
633   case $ac_option in
634   *=?*) ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;;
635   *=)   ac_optarg= ;;
636   *)    ac_optarg=yes ;;
637   esac
639   case $ac_dashdash$ac_option in
640   --)
641     ac_dashdash=yes ;;
643   -bindir | --bindir | --bindi | --bind | --bin | --bi)
644     ac_prev=bindir ;;
645   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
646     bindir=$ac_optarg ;;
648   -build | --build | --buil | --bui | --bu)
649     ac_prev=build_alias ;;
650   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
651     build_alias=$ac_optarg ;;
653   -cache-file | --cache-file | --cache-fil | --cache-fi \
654   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
655     ac_prev=cache_file ;;
656   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
657   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
658     cache_file=$ac_optarg ;;
660   --config-cache | -C)
661     cache_file=config.cache ;;
663   -datadir | --datadir | --datadi | --datad)
664     ac_prev=datadir ;;
665   -datadir=* | --datadir=* | --datadi=* | --datad=*)
666     datadir=$ac_optarg ;;
668   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
669   | --dataroo | --dataro | --datar)
670     ac_prev=datarootdir ;;
671   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
672   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
673     datarootdir=$ac_optarg ;;
675   _AC_INIT_PARSE_ENABLE([disable])
677   -docdir | --docdir | --docdi | --doc | --do)
678     ac_prev=docdir ;;
679   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
680     docdir=$ac_optarg ;;
682   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
683     ac_prev=dvidir ;;
684   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
685     dvidir=$ac_optarg ;;
687   _AC_INIT_PARSE_ENABLE([enable])
689   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
690   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
691   | --exec | --exe | --ex)
692     ac_prev=exec_prefix ;;
693   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
694   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
695   | --exec=* | --exe=* | --ex=*)
696     exec_prefix=$ac_optarg ;;
698   -gas | --gas | --ga | --g)
699     # Obsolete; use --with-gas.
700     with_gas=yes ;;
702   -help | --help | --hel | --he | -h)
703     ac_init_help=long ;;
704   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
705     ac_init_help=recursive ;;
706   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
707     ac_init_help=short ;;
709   -host | --host | --hos | --ho)
710     ac_prev=host_alias ;;
711   -host=* | --host=* | --hos=* | --ho=*)
712     host_alias=$ac_optarg ;;
714   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
715     ac_prev=htmldir ;;
716   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
717   | --ht=*)
718     htmldir=$ac_optarg ;;
720   -includedir | --includedir | --includedi | --included | --include \
721   | --includ | --inclu | --incl | --inc)
722     ac_prev=includedir ;;
723   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
724   | --includ=* | --inclu=* | --incl=* | --inc=*)
725     includedir=$ac_optarg ;;
727   -infodir | --infodir | --infodi | --infod | --info | --inf)
728     ac_prev=infodir ;;
729   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
730     infodir=$ac_optarg ;;
732   -libdir | --libdir | --libdi | --libd)
733     ac_prev=libdir ;;
734   -libdir=* | --libdir=* | --libdi=* | --libd=*)
735     libdir=$ac_optarg ;;
737   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
738   | --libexe | --libex | --libe)
739     ac_prev=libexecdir ;;
740   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
741   | --libexe=* | --libex=* | --libe=*)
742     libexecdir=$ac_optarg ;;
744   -localedir | --localedir | --localedi | --localed | --locale)
745     ac_prev=localedir ;;
746   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
747     localedir=$ac_optarg ;;
749   -localstatedir | --localstatedir | --localstatedi | --localstated \
750   | --localstate | --localstat | --localsta | --localst | --locals)
751     ac_prev=localstatedir ;;
752   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
753   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
754     localstatedir=$ac_optarg ;;
756   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
757     ac_prev=mandir ;;
758   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
759     mandir=$ac_optarg ;;
761   -nfp | --nfp | --nf)
762     # Obsolete; use --without-fp.
763     with_fp=no ;;
765   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
766   | --no-cr | --no-c | -n)
767     no_create=yes ;;
769   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
770   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
771     no_recursion=yes ;;
773   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
774   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
775   | --oldin | --oldi | --old | --ol | --o)
776     ac_prev=oldincludedir ;;
777   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
778   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
779   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
780     oldincludedir=$ac_optarg ;;
782   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
783     ac_prev=prefix ;;
784   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
785     prefix=$ac_optarg ;;
787   -program-prefix | --program-prefix | --program-prefi | --program-pref \
788   | --program-pre | --program-pr | --program-p)
789     ac_prev=program_prefix ;;
790   -program-prefix=* | --program-prefix=* | --program-prefi=* \
791   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
792     program_prefix=$ac_optarg ;;
794   -program-suffix | --program-suffix | --program-suffi | --program-suff \
795   | --program-suf | --program-su | --program-s)
796     ac_prev=program_suffix ;;
797   -program-suffix=* | --program-suffix=* | --program-suffi=* \
798   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
799     program_suffix=$ac_optarg ;;
801   -program-transform-name | --program-transform-name \
802   | --program-transform-nam | --program-transform-na \
803   | --program-transform-n | --program-transform- \
804   | --program-transform | --program-transfor \
805   | --program-transfo | --program-transf \
806   | --program-trans | --program-tran \
807   | --progr-tra | --program-tr | --program-t)
808     ac_prev=program_transform_name ;;
809   -program-transform-name=* | --program-transform-name=* \
810   | --program-transform-nam=* | --program-transform-na=* \
811   | --program-transform-n=* | --program-transform-=* \
812   | --program-transform=* | --program-transfor=* \
813   | --program-transfo=* | --program-transf=* \
814   | --program-trans=* | --program-tran=* \
815   | --progr-tra=* | --program-tr=* | --program-t=*)
816     program_transform_name=$ac_optarg ;;
818   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
819     ac_prev=pdfdir ;;
820   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
821     pdfdir=$ac_optarg ;;
823   -psdir | --psdir | --psdi | --psd | --ps)
824     ac_prev=psdir ;;
825   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
826     psdir=$ac_optarg ;;
828   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
829   | -silent | --silent | --silen | --sile | --sil)
830     silent=yes ;;
832   -runstatedir | --runstatedir | --runstatedi | --runstated \
833   | --runstate | --runstat | --runsta | --runst | --runs \
834   | --run | --ru | --r)
835     ac_prev=runstatedir ;;
836   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
837   | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
838   | --run=* | --ru=* | --r=*)
839     runstatedir=$ac_optarg ;;
841   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
842     ac_prev=sbindir ;;
843   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
844   | --sbi=* | --sb=*)
845     sbindir=$ac_optarg ;;
847   -sharedstatedir | --sharedstatedir | --sharedstatedi \
848   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
849   | --sharedst | --shareds | --shared | --share | --shar \
850   | --sha | --sh)
851     ac_prev=sharedstatedir ;;
852   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
853   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
854   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
855   | --sha=* | --sh=*)
856     sharedstatedir=$ac_optarg ;;
858   -site | --site | --sit)
859     ac_prev=site ;;
860   -site=* | --site=* | --sit=*)
861     site=$ac_optarg ;;
863   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
864     ac_prev=srcdir ;;
865   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
866     srcdir=$ac_optarg ;;
868   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
869   | --syscon | --sysco | --sysc | --sys | --sy)
870     ac_prev=sysconfdir ;;
871   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
872   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
873     sysconfdir=$ac_optarg ;;
875   -target | --target | --targe | --targ | --tar | --ta | --t)
876     ac_prev=target_alias ;;
877   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
878     target_alias=$ac_optarg ;;
880   -v | -verbose | --verbose | --verbos | --verbo | --verb)
881     verbose=yes ;;
883   -version | --version | --versio | --versi | --vers | -V)
884     ac_init_version=: ;;
886   _AC_INIT_PARSE_ENABLE([with])
888   _AC_INIT_PARSE_ENABLE([without])
890   --x)
891     # Obsolete; use --with-x.
892     with_x=yes ;;
894   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
895   | --x-incl | --x-inc | --x-in | --x-i)
896     ac_prev=x_includes ;;
897   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
898   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
899     x_includes=$ac_optarg ;;
901   -x-libraries | --x-libraries | --x-librarie | --x-librari \
902   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
903     ac_prev=x_libraries ;;
904   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
905   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
906     x_libraries=$ac_optarg ;;
908   -*) AC_MSG_ERROR([unrecognized option: '$ac_option'
909 Try '$[0] --help' for more information])
910     ;;
912   *=*)
913     ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
914     # Reject names that are not valid shell variable names.
915     case $ac_envvar in #(
916       '' | [[0-9]]* | *[[!_$as_cr_alnum]]* )
917       AC_MSG_ERROR([invalid variable name: '$ac_envvar']) ;;
918     esac
919     eval $ac_envvar=\$ac_optarg
920     export $ac_envvar ;;
922   *)
923     # FIXME: should be removed in autoconf 3.0.
924     AC_MSG_WARN([you should use --build, --host, --target])
925     expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
926       AC_MSG_WARN([invalid host type: $ac_option])
927     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
928     ;;
930   esac
931 done
933 if test -n "$ac_prev"; then
934   ac_option=--`printf '%s\n' $ac_prev | sed 's/_/-/g'`
935   AC_MSG_ERROR([missing argument to $ac_option])
938 if test -n "$ac_unrecognized_opts"; then
939   case $enable_option_checking in
940     no) ;;
941     fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
942     *)     AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;
943   esac
946 # Check all directory arguments for consistency.
947 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
948                 datadir sysconfdir sharedstatedir localstatedir includedir \
949                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
950                 libdir localedir mandir runstatedir
952   eval ac_val=\$$ac_var
953   # Remove trailing slashes.
954   case $ac_val in
955     */ )
956       ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'`
957       eval $ac_var=\$ac_val;;
958   esac
959   # Be sure to have absolute directory names.
960   case $ac_val in
961     [[\\/$]]* | ?:[[\\/]]* )  continue;;
962     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
963   esac
964   AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val])
965 done
967 # There might be people who depend on the old broken behavior: '$host'
968 # used to hold the argument of --host etc.
969 # FIXME: To remove some day.
970 build=$build_alias
971 host=$host_alias
972 target=$target_alias
974 # FIXME: To remove some day.
975 if test "x$host_alias" != x; then
976   if test "x$build_alias" = x; then
977     cross_compiling=maybe
978   elif test "x$build_alias" != "x$host_alias"; then
979     cross_compiling=yes
980   fi
983 ac_tool_prefix=
984 test -n "$host_alias" && ac_tool_prefix=$host_alias-
986 test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
988 m4_divert_pop([PARSE_ARGS])dnl
989 ])# _AC_INIT_PARSE_ARGS
992 # _AC_INIT_PARSE_ENABLE(OPTION-NAME)
993 # ----------------------------------
994 # A trivial front-end for _AC_INIT_PARSE_ENABLE2.
996 m4_define([_AC_INIT_PARSE_ENABLE],
997 [m4_bmatch([$1], [^with],
998            [_AC_INIT_PARSE_ENABLE2([$1], [with])],
999            [_AC_INIT_PARSE_ENABLE2([$1], [enable])])])
1002 # _AC_INIT_PARSE_ENABLE2(OPTION-NAME, POSITIVE-NAME)
1003 # --------------------------------------------------
1004 # Handle an '--enable' or a '--with' option.
1006 # OPTION-NAME is 'enable', 'disable', 'with', or 'without'.
1007 # POSITIVE-NAME is the corresponding positive variant, i.e. 'enable' or 'with'.
1009 # Positive variant of the option is recognized by the condition
1010 #       OPTION-NAME == POSITIVE-NAME .
1012 m4_define([_AC_INIT_PARSE_ENABLE2],
1013 [-$1-* | --$1-*)
1014     ac_useropt=`expr "x$ac_option" : 'x-*$1-\(m4_if([$1], [$2], [[[^=]]], [.])*\)'`
1015     # Reject names that are not valid shell variable names.
1016     expr "x$ac_useropt" : "[.*[^-+._$as_cr_alnum]]" >/dev/null &&
1017       AC_MSG_ERROR([invalid ]m4_if([$2], [with],
1018         [package], [feature])[ name: '$ac_useropt'])
1019     ac_useropt_orig=$ac_useropt
1020     ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-+.]]/_/g'`
1021     case $ac_user_opts in
1022       *"
1023 "$2_$ac_useropt"
1024 "*) ;;
1025       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt_orig"
1026          ac_unrecognized_sep=', ';;
1027     esac
1028     eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl
1032 # _AC_INIT_HELP
1033 # -------------
1034 # Handle the 'configure --help' message.
1035 m4_define([_AC_INIT_HELP],
1036 [m4_divert_push([HELP_BEGIN])dnl
1039 # Report the --help message.
1041 if test "$ac_init_help" = "long"; then
1042   # Omit some internal or obsolete options to make the list less imposing.
1043   # This message is too long to be a string in the A/UX 3.1 sh.
1044   cat <<_ACEOF
1045 'configure' configures m4_ifset([AC_PACKAGE_STRING],
1046                         [AC_PACKAGE_STRING],
1047                         [this package]) to adapt to many kinds of systems.
1049 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
1051 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
1052 VAR=VALUE.  See below for descriptions of some of the useful variables.
1054 Defaults for the options are specified in brackets.
1056 Configuration:
1057   -h, --help              display this help and exit
1058       --help=short        display options specific to this package
1059       --help=recursive    display the short help of all the included packages
1060   -V, --version           display version information and exit
1061   -q, --quiet, --silent   do not print 'checking ...' messages
1062       --cache-file=FILE   cache test results in FILE [disabled]
1063   -C, --config-cache      alias for '--cache-file=config.cache'
1064   -n, --no-create         do not create output files
1065       --srcdir=DIR        find the sources in DIR [configure dir or '..']
1067 Installation directories:
1068 ]AS_HELP_STRING([--prefix=PREFIX],
1069   [install architecture-independent files in PREFIX [$ac_default_prefix]])
1070 AS_HELP_STRING([--exec-prefix=EPREFIX],
1071   [install architecture-dependent files in EPREFIX [PREFIX]])[
1073 By default, 'make install' will install all the files in
1074 '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc.  You can specify
1075 an installation prefix other than '$ac_default_prefix' using '--prefix',
1076 for instance '--prefix=\$HOME'.
1078 For better control, use the options below.
1080 Fine tuning of the installation directories:
1081   --bindir=DIR            user executables [EPREFIX/bin]
1082   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1083   --libexecdir=DIR        program executables [EPREFIX/libexec]
1084   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1085   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1086   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1087   --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
1088   --libdir=DIR            object code libraries [EPREFIX/lib]
1089   --includedir=DIR        C header files [PREFIX/include]
1090   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1091   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1092   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1093   --infodir=DIR           info documentation [DATAROOTDIR/info]
1094   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1095   --mandir=DIR            man documentation [DATAROOTDIR/man]
1096 ]AS_HELP_STRING([--docdir=DIR],
1097   [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME],
1098     [AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[
1099   --htmldir=DIR           html documentation [DOCDIR]
1100   --dvidir=DIR            dvi documentation [DOCDIR]
1101   --pdfdir=DIR            pdf documentation [DOCDIR]
1102   --psdir=DIR             ps documentation [DOCDIR]
1103 _ACEOF
1105   cat <<\_ACEOF]
1106 m4_divert_pop([HELP_BEGIN])dnl
1107 dnl The order of the diversions here is
1108 dnl - HELP_BEGIN
1109 dnl   which may be extended by extra generic options such as with X or
1110 dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
1112 dnl - HELP_CANON
1113 dnl   Support for cross compilation (--build, --host and --target).
1114 dnl   Display only in long --help.
1116 dnl - HELP_ENABLE
1117 dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
1118 dnl   then implements the header of the non generic options.
1120 dnl - HELP_WITH
1122 dnl - HELP_VAR
1124 dnl - HELP_VAR_END
1126 dnl - HELP_END
1127 dnl   initialized below, in which we dump the trailer (handling of the
1128 dnl   recursion for instance).
1129 m4_divert_push([HELP_ENABLE])dnl
1130 _ACEOF
1133 if test -n "$ac_init_help"; then
1134 m4_ifset([AC_PACKAGE_STRING],
1135 [  case $ac_init_help in
1136      short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
1137    esac])
1138   cat <<\_ACEOF
1139 m4_divert_pop([HELP_ENABLE])dnl
1140 m4_divert_push([HELP_END])dnl
1142 Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
1143   [the package provider]).dnl
1144 m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
1145 AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
1146 m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
1147 General help using GNU software: <https://www.gnu.org/gethelp/>.])])
1148 _ACEOF
1149 ac_status=$?
1152 if test "$ac_init_help" = "recursive"; then
1153   # If there are subdirs, report their specific --help.
1154   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1155     test -d "$ac_dir" ||
1156       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1157       continue
1158     _AC_SRCDIRS(["$ac_dir"])
1159     cd "$ac_dir" || { ac_status=$?; continue; }
1160     # Check for configure.gnu first; this name is used for a wrapper for
1161     # Metaconfig's "Configure" on case-insensitive file systems.
1162     if test -f "$ac_srcdir/configure.gnu"; then
1163       echo &&
1164       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1165     elif test -f "$ac_srcdir/configure"; then
1166       echo &&
1167       $SHELL "$ac_srcdir/configure" --help=recursive
1168     else
1169       AC_MSG_WARN([no configuration information is in $ac_dir])
1170     fi || ac_status=$?
1171     cd "$ac_pwd" || { ac_status=$?; break; }
1172   done
1175 test -n "$ac_init_help" && exit $ac_status
1176 m4_divert_pop([HELP_END])dnl
1177 ])# _AC_INIT_HELP
1180 # _AC_INIT_VERSION
1181 # ----------------
1182 # Handle the 'configure --version' message.
1183 m4_define([_AC_INIT_VERSION],
1184 [m4_divert_text([VERSION_BEGIN],
1185 [if $ac_init_version; then
1186   cat <<\_ACEOF
1187 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
1188 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1189 generated by m4_PACKAGE_STRING])
1190 m4_divert_text([VERSION_END],
1191 [_ACEOF
1192   exit
1193 fi])dnl
1194 ])# _AC_INIT_VERSION
1197 # _AC_INIT_CONFIG_LOG
1198 # -------------------
1199 # Initialize the config.log file descriptor and write header to it.
1200 m4_define([_AC_INIT_CONFIG_LOG],
1201 [m4_divert_text([INIT_PREPARE],
1202 [m4_define([AS_MESSAGE_LOG_FD], 5)dnl
1203 ac_configure_args_raw=
1204 for ac_arg
1206   case $ac_arg in
1207   *\'*)
1208     ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1209   esac
1210   AS_VAR_APPEND([ac_configure_args_raw], [" '$ac_arg'"])
1211 done
1213 case $ac_configure_args_raw in
1214   *$as_nl*)
1215     ac_safe_unquote= ;;
1216   *)
1217     ac_unsafe_z='|&;<>()$`\\"*?@<:@ ''  ' # This string ends in space, tab.
1218     ac_unsafe_a="$ac_unsafe_z#~"
1219     ac_safe_unquote="s/ '\\([[^$ac_unsafe_a]][[^$ac_unsafe_z]]*\\)'/ \\1/g"
1220     ac_configure_args_raw=`dnl
1221       AS_ECHO(["$ac_configure_args_raw"]) | sed "$ac_safe_unquote"`;;
1222 esac
1224 cat >config.log <<_ACEOF
1225 This file contains any messages produced by compilers while
1226 running configure, to aid debugging if configure makes a mistake.
1228 It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1229 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1230 generated by m4_PACKAGE_STRING.  Invocation command line was
1232   $ $[0]$ac_configure_args_raw
1234 _ACEOF
1235 exec AS_MESSAGE_LOG_FD>>config.log
1236 AS_UNAME >&AS_MESSAGE_LOG_FD
1238 cat >&AS_MESSAGE_LOG_FD <<_ACEOF
1241 m4_text_box([Core tests.])
1243 _ACEOF
1244 ])])# _AC_INIT_CONFIG_LOG
1247 # _AC_INIT_PREPARE
1248 # ----------------
1249 # Called by AC_INIT to build the preamble of the 'configure' scripts.
1250 # 1. Trap and clean up various tmp files.
1251 # 2. Set up the fd and output files
1252 # 3. Remember the options given to 'configure' for 'config.status --recheck'.
1253 # 4. Initiates confdefs.h
1254 # 5. Loads site and cache files
1255 m4_define([_AC_INIT_PREPARE],
1256 [m4_divert_push([INIT_PREPARE])dnl
1258 # Keep a trace of the command line.
1259 # Strip out --no-create and --no-recursion so they do not pile up.
1260 # Strip out --silent because we don't want to record it for future runs.
1261 # Also quote any args containing shell meta-characters.
1262 # Make two passes to allow for proper duplicate-argument suppression.
1263 ac_configure_args=
1264 ac_configure_args0=
1265 ac_configure_args1=
1266 ac_must_keep_next=false
1267 for ac_pass in 1 2
1269   for ac_arg
1270   do
1271     case $ac_arg in
1272     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1273     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1274     | -silent | --silent | --silen | --sile | --sil)
1275       continue ;;
1276     *\'*)
1277       ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1278     esac
1279     case $ac_pass in
1280     1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
1281     2)
1282       AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
1283 dnl If trying to remove duplicates, be sure to (i) keep the *last*
1284 dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
1285 dnl and (ii) not to strip long options (--prefix foo --prefix bar might
1286 dnl give --prefix foo bar).
1287       if test $ac_must_keep_next = true; then
1288         ac_must_keep_next=false # Got value, back to normal.
1289       else
1290         case $ac_arg in
1291 dnl Use broad patterns, as arguments that would have already made configure
1292 dnl exit don't matter.
1293           *=* | --config-cache | -C | -disable-* | --disable-* \
1294           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1295           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1296           | -with-* | --with-* | -without-* | --without-* | --x)
1297             case "$ac_configure_args0 " in
1298               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1299             esac
1300             ;;
1301           -* ) ac_must_keep_next=true ;;
1302         esac
1303       fi
1304       AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
1305       ;;
1306     esac
1307   done
1308 done
1309 AS_UNSET(ac_configure_args0)
1310 AS_UNSET(ac_configure_args1)
1312 # When interrupted or exit'd, cleanup temporary files, and complete
1313 # config.log.  We remove comments because anyway the quotes in there
1314 # would cause problems or look ugly.
1315 # WARNING: Use '\'' to represent an apostrophe within the trap.
1316 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1317 trap 'exit_status=$?
1318   # Sanitize IFS.
1319   IFS=" ""      $as_nl"
1320   # Save into config.log some information that might help in debugging.
1321   {
1322     echo
1324     AS_BOX([Cache variables.])
1325     echo
1326     m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]),
1327                   [^ *\(#.*\)?
1328 ],                [],
1329                   ['], ['\\''])
1330     echo
1332     AS_BOX([Output variables.])
1333     echo
1334     for ac_var in $ac_subst_vars
1335     do
1336       eval ac_val=\$$ac_var
1337       case $ac_val in
1338       *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1339       esac
1340       AS_ECHO(["$ac_var='\''$ac_val'\''"])
1341     done | sort
1342     echo
1344     if test -n "$ac_subst_files"; then
1345       AS_BOX([File substitutions.])
1346       echo
1347       for ac_var in $ac_subst_files
1348       do
1349         eval ac_val=\$$ac_var
1350         case $ac_val in
1351         *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1352         esac
1353         AS_ECHO(["$ac_var='\''$ac_val'\''"])
1354       done | sort
1355       echo
1356     fi
1358     if test -s confdefs.h; then
1359       AS_BOX([confdefs.h.])
1360       echo
1361       cat confdefs.h
1362       echo
1363     fi
1364     test "$ac_signal" != 0 &&
1365       AS_ECHO(["$as_me: caught signal $ac_signal"])
1366     AS_ECHO(["$as_me: exit $exit_status"])
1367   } >&AS_MESSAGE_LOG_FD
1368   eval "rm -f $ac_clean_CONFIG_STATUS core *.core core.conftest.*" &&
1369     rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
1370     exit $exit_status
1371 ' 0
1372 for ac_signal in 1 2 13 15; do
1373   trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
1374 done
1375 ac_signal=0
1377 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1378 rm -f -r conftest* confdefs.h
1380 dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
1381 dnl containing less than 14 bytes (including the newline).
1382 AS_ECHO(["/* confdefs.h */"]) > confdefs.h
1384 # Predefined preprocessor variables.
1385 AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
1386                    [Define to the full name of this package.])dnl
1387 AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
1388                    [Define to the one symbol short name of this package.])dnl
1389 AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
1390                    [Define to the version of this package.])dnl
1391 AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
1392                    [Define to the full name and version of this package.])dnl
1393 AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
1394                    [Define to the address where bug reports for this package
1395                     should be sent.])dnl
1396 AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"],
1397                    [Define to the home page for this package.])
1399 # Let the site file select an alternate cache file if it wants to.
1400 AC_SITE_LOAD
1401 AC_CACHE_LOAD
1402 m4_divert_pop([INIT_PREPARE])dnl
1403 ])# _AC_INIT_PREPARE
1406 # _AC_INIT_ECHO_N
1407 # ---------------
1408 # Emit code for backward compatibility with Makefiles that use the
1409 # ECHO_C, ECHO_N, and ECHO_T substitution variables.  From Autoconf's
1410 # perspective, these were undocumented internals of the old definition
1411 # of AS_ECHO_N, before that was changed to use 'printf' instead of
1412 # 'echo', but they were AC_SUBSTed and Makefiles were written to use
1413 # them.  We don't have any way to know whether substitution variables
1414 # are actually used in the project being configured, and the cost of
1415 # this test is minimal.
1417 # Test logic borrowed from dist 3.0.  Use '*c*,', not '*c,' because if '\c'
1418 # failed there is also a newline to match.  Use 'xy' because '\c' echoed
1419 # in a command substitution prints only the first character of the output
1420 # with ksh version M-11/16/88f on AIX 6.1; it needs to be reset by another
1421 # backquoted echo.
1422 m4_define([_AC_INIT_ECHO_N], [
1423 # Determine whether it's possible to make 'echo' print without a newline.
1424 # These variables are no longer used directly by Autoconf, but are AC_SUBSTed
1425 # for compatibility with existing Makefiles.
1426 ECHO_C= ECHO_N= ECHO_T=
1427 case `echo -n x` in @%:@(((((
1428 -n*)
1429   case `echo 'xy\c'` in
1430   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
1431   xy)  ECHO_C='\c';;
1432   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
1433        ECHO_T=' ';;
1434   esac;;
1436   ECHO_N='-n';;
1437 esac
1438 AC_SUBST([ECHO_C])dnl
1439 AC_SUBST([ECHO_N])dnl
1440 AC_SUBST([ECHO_T])dnl
1444 # AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
1445 # ----------------------------------------
1446 # This macro is used only for Autoupdate.
1447 AU_DEFUN([AC_INIT],
1448 [m4_ifval([$2], [[AC_INIT($@)]],
1449           [m4_ifval([$1],
1450 [[AC_INIT]
1451 AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
1455 # AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
1456 # ----------------------------------------------------------
1457 # Include the user macro files, prepare the diversions, and output the
1458 # preamble of the 'configure' script.
1460 # If BUG-REPORT is omitted, do without (unless the user previously
1461 # defined the m4 macro AC_PACKAGE_BUGREPORT).  If TARNAME is omitted,
1462 # use PACKAGE to seed it.  If URL is omitted, use
1463 # 'https://www.gnu.org/software/TARNAME/' if PACKAGE begins with 'GNU',
1464 # otherwise, do without.
1466 # Note that the order is important: first initialize, then set the
1467 # AC_CONFIG_SRCDIR.
1468 m4_define([AC_INIT],
1469 [# Forbidden tokens and exceptions.
1470 m4_pattern_forbid([^_?A[CHUM]_])
1471 m4_pattern_forbid([_AC_])
1472 m4_pattern_forbid([^LIBOBJS$],
1473                   [do not use LIBOBJS directly, use AC_LIBOBJ (see section 'AC_LIBOBJ vs LIBOBJS'])
1474 # Actually reserved by M4sh.
1475 m4_pattern_allow([^AS_FLAGS$])
1476 # So that the autoconf-generated scripts will always re-execute
1477 # themselves with $CONFIG_SHELL, if that's set in the environment.
1478 m4_define([_AS_FORCE_REEXEC_WITH_CONFIG_SHELL], [yes])
1479 AS_INIT[]dnl
1480 AS_PREPARE[]dnl
1481 m4_divert_push([KILL])
1482 m4_ifval([$2], [_AC_INIT_PACKAGE($@)], [_AC_INIT_PACKAGE()])
1483 _AC_INIT_DEFAULTS
1484 _AC_INIT_PARSE_ARGS
1485 _AC_INIT_DIRCHECK
1486 _AC_INIT_SRCDIR
1487 _AC_INIT_HELP
1488 _AC_INIT_VERSION
1489 _AC_INIT_CONFIG_LOG
1490 _AC_INIT_PREPARE
1491 _AC_INIT_NOTICE
1492 _AC_INIT_COPYRIGHT
1493 m4_divert_text([SHELL_FN], [
1494 m4_text_box([Autoconf initialization.])])
1495 m4_divert_pop
1496 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1498 dnl Substitute for predefined variables.
1499 AC_SUBST([DEFS])dnl
1500 AC_SUBST([LIBS])dnl
1501 _AC_ARG_VAR_PRECIOUS([build_alias])AC_SUBST([build_alias])dnl
1502 _AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl
1503 _AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl
1505 dnl Backward compatibility with old Makefiles and old macros.
1506 _AC_INIT_ECHO_N
1508 AC_LANG_PUSH(C)
1510 dnl Record that AC_INIT has been called.  It doesn't make sense to
1511 dnl AC_REQUIRE AC_INIT, but it _does_ make sense for macros to say
1512 dnl AC_BEFORE([self], [AC_INIT]) sometimes.  Also, _AC_FINALIZE checks
1513 dnl for AC_INIT having been called.
1514 m4_provide([AC_INIT])dnl
1518 # _AC_FINALIZE
1519 # ------------
1520 # Code to be run after the entire configure.ac is processed, but only
1521 # when generating configure.  This macro should only be called from
1522 # trailer.m4, which is fed to m4 after configure.ac by autoconf (the
1523 # program).  We don't just call m4_wrap([_AC_FINALIZE]), because then
1524 # it would run at freeze time and when tracing configure.ac for
1525 # autoheader etc.
1527 # Currently this doesn't emit anything; it just checks that AC_INIT
1528 # and AC_OUTPUT were expanded at some point.  Leaving either of these
1529 # out of a configure script is likely to be a bug.
1530 m4_define([_AC_FINALIZE],
1531   [m4_provide_if([AC_INIT], [],
1532     [m4_warn([syntax], [AC_INIT was never used])])dnl
1533    m4_provide_if([AC_OUTPUT], [],
1534     [m4_warn([syntax], [AC_OUTPUT was never used])])])
1537 ## ------------------------------------------------------------- ##
1538 ## Selecting optional features, working with optional software.  ##
1539 ## ------------------------------------------------------------- ##
1541 # AC_PRESERVE_HELP_ORDER
1542 # ----------------------
1543 # Emit help strings in the order given, rather than grouping all --enable-FOO
1544 # and all --with-BAR.
1545 AC_DEFUN([AC_PRESERVE_HELP_ORDER],
1546 [m4_divert_once([HELP_ENABLE], [[
1547 Optional Features and Packages:
1548   --disable-option-checking  ignore unrecognized --enable/--with options
1549   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1550   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1551   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1552   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
1553 m4_define([_m4_divert(HELP_ENABLE)],    _m4_divert(HELP_WITH))
1554 ])# AC_PRESERVE_HELP_ORDER
1556 # _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1557 # -------------------------------------------------------------------
1558 # Common code for AC_ARG_ENABLE and AC_ARG_WITH.
1559 # OPTION is either "enable" or "with".
1561 m4_define([_AC_ENABLE_IF],
1562 [@%:@ Check whether --$1-$2 was given.
1563 _AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-+.], [___]), [$3], [$4])
1566 m4_define([_AC_ENABLE_IF_ACTION],
1567 [m4_append_uniq([_AC_USER_OPTS], [$1_$2], [
1568 ])dnl
1569 AS_IF([test ${$1_$2+y}], [$1val=$$1_$2; $3], [$4])dnl
1572 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1573 # ------------------------------------------------------------------------
1574 AC_DEFUN([AC_ARG_ENABLE],
1575 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1577 [m4_divert_once([HELP_ENABLE], [[
1578 Optional Features:
1579   --disable-option-checking  ignore unrecognized --enable/--with options
1580   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1581   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])])dnl
1582 m4_divert_once([HELP_ENABLE], [$2])dnl
1583 _AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl
1584 ])# AC_ARG_ENABLE
1587 AU_DEFUN([AC_ENABLE],
1588 [AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])])
1591 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
1592 # --------------------------------------------------------------------
1593 AC_DEFUN([AC_ARG_WITH],
1594 [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
1596 [m4_divert_once([HELP_WITH], [[
1597 Optional Packages:
1598   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1599   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])])
1600 m4_divert_once([HELP_WITH], [$2])dnl
1601 _AC_ENABLE_IF([with], [$1], [$3], [$4])dnl
1602 ])# AC_ARG_WITH
1604 AU_DEFUN([AC_WITH],
1605 [AC_ARG_WITH([$1], [  --with-$1], [$2], [$3])])
1607 # AC_DISABLE_OPTION_CHECKING
1608 # --------------------------
1609 AC_DEFUN([AC_DISABLE_OPTION_CHECKING],
1610 [m4_divert_once([DEFAULTS], [enable_option_checking=no])
1611 ])# AC_DISABLE_OPTION_CHECKING
1614 ## ----------------------------------------- ##
1615 ## Remembering variables for reconfiguring.  ##
1616 ## ----------------------------------------- ##
1619 # AC_ARG_VAR(VARNAME, DOCUMENTATION)
1620 # ----------------------------------
1621 # Register VARNAME as a precious variable, and document it in
1622 # 'configure --help' (but only once).
1623 AC_DEFUN([AC_ARG_VAR],
1624 [m4_divert_once([HELP_VAR], [[
1625 Some influential environment variables:]])dnl
1626 m4_divert_once([HELP_VAR_END], [[
1627 Use these variables to override the choices made by 'configure' or to help
1628 it to find libraries and programs with nonstandard names/locations.]])dnl
1629 m4_expand_once([m4_divert_text([HELP_VAR],
1630                                [AS_HELP_STRING([$1], [$2], [              ])])],
1631                [$0($1)])dnl
1632 AC_SUBST([$1])dnl
1633 _AC_ARG_VAR_PRECIOUS([$1])dnl
1634 ])# AC_ARG_VAR
1637 # _AC_ARG_VAR_PRECIOUS(VARNAME)
1638 # -----------------------------
1639 # Declare VARNAME is precious.
1640 m4_define([_AC_ARG_VAR_PRECIOUS],
1641 [m4_append_uniq([_AC_PRECIOUS_VARS], [$1], [
1642 ])dnl
1646 # _AC_ARG_VAR_STORE
1647 # -----------------
1648 # We try to diagnose when precious variables have changed.  To do this,
1649 # make two early snapshots (after the option processing to take
1650 # explicit variables into account) of those variables: one (ac_env_)
1651 # which represents the current run, and a second (ac_cv_env_) which,
1652 # at the first run, will be saved in the cache.  As an exception to
1653 # the cache mechanism, its loading will override these variables (non
1654 # 'ac_cv_env_' cache value are only set when unset).
1656 # In subsequent runs, after having loaded the cache, compare
1657 # ac_cv_env_foo against ac_env_foo.  See _AC_ARG_VAR_VALIDATE.
1658 m4_define([_AC_ARG_VAR_STORE],
1659 [m4_divert_text([PARSE_ARGS],
1660 [for ac_var in $ac_precious_vars; do
1661   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1662   eval ac_env_${ac_var}_value=\$${ac_var}
1663   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1664   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1665 done])dnl
1669 # _AC_ARG_VAR_VALIDATE
1670 # --------------------
1671 # The precious variables are saved twice at the beginning of
1672 # configure.  E.g., PRECIOUS is saved as 'ac_env_PRECIOUS_set' and
1673 # 'ac_env_PRECIOUS_value' on the one hand and 'ac_cv_env_PRECIOUS_set'
1674 # and 'ac_cv_env_PRECIOUS_value' on the other hand.
1676 # Now the cache has just been loaded, so 'ac_cv_env_' represents the
1677 # content of the cached values, while 'ac_env_' represents that of the
1678 # current values.
1680 # So we check that 'ac_env_' and 'ac_cv_env_' are consistent.  If
1681 # they aren't, die.
1682 m4_define([_AC_ARG_VAR_VALIDATE],
1683 [m4_divert_text([INIT_PREPARE],
1684 [# Check that the precious variables saved in the cache have kept the same
1685 # value.
1686 ac_cache_corrupted=false
1687 for ac_var in $ac_precious_vars; do
1688   eval ac_old_set=\$ac_cv_env_${ac_var}_set
1689   eval ac_new_set=\$ac_env_${ac_var}_set
1690   eval ac_old_val=\$ac_cv_env_${ac_var}_value
1691   eval ac_new_val=\$ac_env_${ac_var}_value
1692   case $ac_old_set,$ac_new_set in
1693     set,)
1694       AS_MESSAGE([error: '$ac_var' was set to '$ac_old_val' in the previous run], 2)
1695       ac_cache_corrupted=: ;;
1696     ,set)
1697       AS_MESSAGE([error: '$ac_var' was not set in the previous run], 2)
1698       ac_cache_corrupted=: ;;
1699     ,);;
1700     *)
1701       if test "x$ac_old_val" != "x$ac_new_val"; then
1702         # differences in whitespace do not lead to failure.
1703         ac_old_val_w=
1704         for ac_val in x $ac_old_val; do
1705           ac_old_val_w="$ac_old_val_w $ac_val"
1706         done
1707         ac_new_val_w=
1708         for ac_val in x $ac_new_val; do
1709           ac_new_val_w="$ac_new_val_w $ac_val"
1710         done
1711         if test "$ac_old_val_w" != "$ac_new_val_w"; then
1712           AS_MESSAGE([error: '$ac_var' has changed since the previous run:], 2)
1713           ac_cache_corrupted=:
1714         else
1715           AS_MESSAGE([warning: ignoring whitespace changes in '$ac_var' since the previous run:], 2)
1716           eval $ac_var=\$ac_old_val
1717         fi
1718         AS_MESSAGE([  former value:  '$ac_old_val'], 2)
1719         AS_MESSAGE([  current value: '$ac_new_val'], 2)
1720       fi;;
1721   esac
1722   # Pass precious variables to config.status.
1723   if test "$ac_new_set" = set; then
1724     case $ac_new_val in
1725     *\'*) ac_arg=$ac_var=`AS_ECHO(["$ac_new_val"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1726     *) ac_arg=$ac_var=$ac_new_val ;;
1727     esac
1728     case " $ac_configure_args " in
1729       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1730       *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
1731     esac
1732   fi
1733 done
1734 if $ac_cache_corrupted; then
1735   AS_MESSAGE([error: in '$ac_pwd':], 2)
1736   AS_MESSAGE([error: changes in the environment can compromise the build], 2)
1737   AS_ERROR([run '${MAKE-make} distclean' and/or 'rm $cache_file'
1738             and start over])
1739 fi])dnl
1740 ])# _AC_ARG_VAR_VALIDATE
1746 ## ---------------------------- ##
1747 ## Transforming program names.  ##
1748 ## ---------------------------- ##
1751 # AC_ARG_PROGRAM
1752 # --------------
1753 # This macro is expanded only once, to avoid that 'foo' ends up being
1754 # installed as 'ggfoo'.
1755 AC_DEFUN_ONCE([AC_ARG_PROGRAM],
1756 [dnl Document the options.
1757 m4_divert_push([HELP_BEGIN])dnl
1759 Program names:
1760   --program-prefix=PREFIX            prepend PREFIX to installed program names
1761   --program-suffix=SUFFIX            append SUFFIX to installed program names
1762   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
1763 m4_divert_pop([HELP_BEGIN])dnl
1764 test "$program_prefix" != NONE &&
1765   program_transform_name="s&^&$program_prefix&;$program_transform_name"
1766 # Use a double $ so make ignores it.
1767 test "$program_suffix" != NONE &&
1768   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
1769 # Double any \ or $.
1770 # By default was 's,x,x', remove it if useless.
1771 [ac_script='s/[\\$]/&&/g;s/;s,x,x,$//']
1772 program_transform_name=`AS_ECHO(["$program_transform_name"]) | sed "$ac_script"`
1773 ])# AC_ARG_PROGRAM
1779 ## ------------------------- ##
1780 ## Finding auxiliary files.  ##
1781 ## ------------------------- ##
1784 # AC_CONFIG_AUX_DIR(DIR)
1785 # ----------------------
1786 # Find auxiliary scripts (e.g. install-sh, config.sub, config.guess)
1787 # in DIR.  If DIR is a literal shell word and not an absolute path,
1788 # it is interpreted relative to $srcdir; otherwise it is assumed to be
1789 # usable as-is.  If this macro is used more than once, it builds up a
1790 # list of directories to search, first to last.  If this macro is not
1791 # used at all, the default is to look in $srcdir and two levels of
1792 # parent directories above $srcdir; see _AC_INIT_SRCDIR.
1794 # This macro may be used as a trace hook by tools that wish to know
1795 # where the auxiliary files should be.
1797 # Note: paths starting with a DOS drive letter count as absolute, but
1798 # we do *not* check for backslash as a directory separator, because
1799 # anything with a backslash in it will be considered non-literal by
1800 # AS_LITERAL_WORD_IF and won't reach the m4_bmatch.  This is correct
1801 # behavior, because DIR will wind up inside a double-quoted shell string.
1802 AC_DEFUN([AC_CONFIG_AUX_DIR],
1803   [m4_append_uniq([_AC_AUX_DIR_CANDIDATES],
1804     AS_LITERAL_WORD_IF([$1],
1805       [m4_bmatch([$1],
1806                  [^/],       [$1],
1807                  [^[a-z]:/], [$1],
1808                             [${srcdir}/$1])],
1809       [$1]),
1810     [${PATH_SEPARATOR}])])
1813 # AC_CONFIG_AUX_DIRS(DIRS)
1814 # ------------------------
1815 # Find auxiliary scripts (e.g. install-sh, config.sub, config.guess)
1816 # in any of the whitespace-separated directories named DIRS.
1817 # This macro is not documented; it used to be an internal subroutine,
1818 # but its name didn't begin with an underscore, so we're preserving it
1819 # for the small number of configure scripts that used it themselves.
1820 # It might be promoted to an official interface in the future.
1821 AC_DEFUN([AC_CONFIG_AUX_DIRS],
1822 [m4_map_args_w(m4_validate_w([$1]), [AC_CONFIG_AUX_DIR(], [)])])
1825 # AC_REQUIRE_AUX_FILE(FILE)
1826 # -------------------------
1827 # Declare that FILE is a required auxiliary file.  FILE must be literal.
1828 # At configure time, if we cannot locate a directory containing all of the
1829 # required auxiliary files, the script will bomb out.  This macro may also
1830 # be used as a trace hook by tools that wish to identify all of the required
1831 # auxiliary files.
1832 AC_DEFUN([AC_REQUIRE_AUX_FILE],
1833 [AS_LITERAL_WORD_IF([$1],
1834   [m4_do(
1835     [AC_REQUIRE([_AC_INIT_AUX_DIR])],
1836     [m4_set_add([_AC_AUX_FILES], [$1])]
1837   )],
1838   [m4_fatal([$0: requires a literal argument])])])
1841 # AC_CONFIG_AUX_DIR_DEFAULT
1842 # -------------------------
1843 # No longer needed (AC_REQUIRE_AUX_FILE now does the whole job) but
1844 # preserved for backward compatibility with third-party macros.
1845 # Not yet being removed by autoupdate, because we don't know if any
1846 # third-party macros used this without also using AC_REQUIRE_AUX_FILE.
1847 # That usage is now considered incorrect, but removing it would break
1848 # those macros.
1849 AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
1850 [AC_REQUIRE([_AC_INIT_AUX_DIR])])
1853 # _AC_INIT_AUX_DIR
1854 # ----------------
1855 # Internal subroutine: AC_REQUIREd by AC_REQUIRE_AUX_FILE and
1856 # AC_CONFIG_AUX_DIR_DEFAULT.  Emits the shell code that actually
1857 # searches for the aux directory.  If AC_REQUIRE_AUX_FILE has
1858 # been used at least once, the aux directory must contain all
1859 # of the files that were AC_REQUIRE_AUX_FILE'd.  If it was never
1860 # used, fall back to the old behavior of looking only for install-sh.
1861 # (This fallback can be removed once we drop AC_CONFIG_AUX_DIR_DEFAULT.)
1862 AC_DEFUN([_AC_INIT_AUX_DIR],
1863 [m4_wrap_lifo(
1864   [m4_do(
1865     [m4_set_empty([_AC_AUX_FILES],
1866       [m4_do(
1867         [m4_warn([syntax],
1868           [AC_CONFIG_AUX_DIR_DEFAULT used without AC_REQUIRE_AUX_FILE])],
1869         [m4_set_add([_AC_AUX_FILES], [install-sh])])])],
1870   [m4_divert_text([INIT_PREPARE],
1872 # Auxiliary files required by this configure script.
1873 ac_aux_files="m4_set_dump([_AC_AUX_FILES], [ ])"
1875 # Locations in which to look for auxiliary files.
1876 ac_aux_dir_candidates="m4_ifset([_AC_AUX_DIR_CANDIDATES],
1877   [m4_defn([_AC_AUX_DIR_CANDIDATES])],
1878   [${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../..])"
1880 # Search for a directory containing all of the required auxiliary files,
1881 # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
1882 # If we don't find one directory that contains all the files we need,
1883 # we report the set of missing files from the *first* directory in
1884 # $ac_aux_dir_candidates and give up.
1885 ac_missing_aux_files=""
1886 ac_first_candidate=:
1887 _AS_ECHO_LOG([looking for aux files: $ac_aux_files])
1888 _AS_PATH_WALK([$ac_aux_dir_candidates], [
1889   _AS_ECHO_LOG([ trying $as_dir])
1890   ac_aux_dir_found=yes
1891   ac_install_sh=
1892   for ac_aux in $ac_aux_files
1893   do
1894     # As a special case, if "install-sh" is required, that requirement
1895     # can be satisfied by any of "install-sh", "install.sh", or "shtool",
1896     # and $ac_install_sh is set appropriately for whichever one is found.
1897     if test x"$ac_aux" = x"install-sh"
1898     then
1899       if test -f "${as_dir}install-sh"; then
1900         _AS_ECHO_LOG([  ${as_dir}install-sh found])
1901         ac_install_sh="${as_dir}install-sh -c"
1902       elif test -f "${as_dir}install.sh"; then
1903         _AS_ECHO_LOG([  ${as_dir}install.sh found])
1904         ac_install_sh="${as_dir}install.sh -c"
1905       elif test -f "${as_dir}shtool"; then
1906         _AS_ECHO_LOG([  ${as_dir}shtool found])
1907         ac_install_sh="${as_dir}shtool install -c"
1908       else
1909         ac_aux_dir_found=no
1910         if $ac_first_candidate; then
1911           ac_missing_aux_files="${ac_missing_aux_files} install-sh"
1912         else
1913           break
1914         fi
1915       fi
1916     else
1917       if test -f "${as_dir}${ac_aux}"; then
1918         _AS_ECHO_LOG([  ${as_dir}${ac_aux} found])
1919       else
1920         ac_aux_dir_found=no
1921         if $ac_first_candidate; then
1922           ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
1923         else
1924           break
1925         fi
1926       fi
1927     fi
1928   done
1929   if test "$ac_aux_dir_found" = yes; then
1930     ac_aux_dir="$as_dir"
1931     break
1932   fi
1933   ac_first_candidate=false
1935   [AC_MSG_ERROR([cannot find required auxiliary files:$ac_missing_aux_files])])
1937 # These three variables are undocumented and unsupported,
1938 # and are intended to be withdrawn in a future Autoconf release.
1939 # They can cause serious problems if a builder's source tree is in a directory
1940 # whose full name contains unusual characters.
1941 dnl The quadrigraphs prevent spurious deprecation warnings.
1942 if test -f "${ac_aux_dir}config.guess"; then
1943   ac_@&t@config_guess="$SHELL ${ac_aux_dir}config.guess"
1945 if test -f "${ac_aux_dir}config.sub"; then
1946   ac_@&t@config_sub="$SHELL ${ac_aux_dir}config.sub"
1948 if test -f "$ac_aux_dir/configure"; then
1949   ac_@&t@configure="$SHELL ${ac_aux_dir}configure"
1951 ])])])])
1953 # Deprecation warnings for the unsupported variables above.
1954 m4_define([ac_config_guess],
1955 [m4_warn([obsolete],
1956  [$ac_config_guess is obsolete and unsafe.  Please stop using it.
1957 Contact autoconf@gnu.org if you really need it.])ac_@&t@config_guess])
1959 m4_define([ac_config_sub],
1960 [m4_warn([obsolete],
1961  [$ac_config_sub is obsolete and unsafe.  Please stop using it.
1962 Contact autoconf@gnu.org if you really need it.])ac_@&t@config_sub])
1964 m4_define([ac_configure],
1965 [m4_warn([obsolete],
1966  [$ac_configure is obsolete and unsafe.  Please stop using it.
1967 Contact autoconf@gnu.org if you really need it.])ac_@&t@config_sub])
1971 ## ------------------------ ##
1972 ## Finding aclocal macros.  ##
1973 ## ------------------------ ##
1976 # AC_CONFIG_MACRO_DIR_TRACE(DIR)
1977 # ------------------------------
1978 # This macro exists solely for tracing - never invoke it directly.
1979 # It will be called once per directory listed in either form of
1980 # AC_CONFIG_MACRO_DIR[S].
1981 m4_define([AC_CONFIG_MACRO_DIR_TRACE],
1982 [m4_fatal([Do not invoke $0 directly])])
1984 # _AC_CONFIG_MACRO_DIRS_USED
1985 # --------------------------
1986 # Internal witness macro, redefined to empty after first directory is traced.
1987 m4_define([_AC_CONFIG_MACRO_DIRS_USED], [-])
1989 # _AC_CONFIG_MACRO_DIRS(CALLER, DIR)
1990 # ----------------------------------
1991 # Internal workhorse macro to ensure a sane calling pattern of CALLER, and
1992 # eventually trace DIR through the documented public trace point.
1993 m4_define([_AC_CONFIG_MACRO_DIRS],
1994 [m4_if([$1], [-AC_CONFIG_MACRO_DIRS], [AC_CONFIG_MACRO_DIR([$2])],
1995        [$1], [AC_CONFIG_MACRO_DIR], [m4_fatal([$1 can only be used once])],
1996   [m4_define([$0_USED])m4_pushdef([AC_CONFIG_MACRO_DIR_TRACE])]]dnl
1997 [[AC_CONFIG_MACRO_DIR_TRACE([$2])m4_popdef([AC_CONFIG_MACRO_DIR_TRACE])])])
1999 # AC_CONFIG_MACRO_DIRS(DIR-1 [DIR-2 ... DIR-n])
2000 # --------------------------------------------
2001 # Declare directories containing additional macros for aclocal.
2002 # This macro can be called multiple times, and with multiple arguments.
2003 # Do not trace this macro; instead trace AC_CONFIG_MACRO_DIR_TRACE.
2004 # If no directory has been traced yet, then this macro also triggers
2005 # a trace of AC_CONFIG_MACRO_DIR on the first directory.
2006 AC_DEFUN([AC_CONFIG_MACRO_DIRS],
2007 [m4_map_args_w(m4_validate_w([$1]),
2008   [_$0(_$0_USED()[$0], ], [)])])
2010 # AC_CONFIG_MACRO_DIR(DIR)
2011 # ------------------------
2012 # Declare directory containing additional macros for aclocal.
2013 # This macro exists for backward compatibility; while tools can trace this,
2014 # we recommend tracing AC_CONFIG_MACRO_DIR_TRACE instead.  This macro can
2015 # only be used once, and must not be used after AC_CONFIG_MACRO_DIRS.
2016 AC_DEFUN([AC_CONFIG_MACRO_DIR],
2017 [_$0S(_$0S_USED()[$0], [$1])])
2020 ## ----------------------------------- ##
2021 ## Getting the canonical system type.  ##
2022 ## ----------------------------------- ##
2024 # The inputs are:
2025 #    configure --host=HOST --target=TARGET --build=BUILD
2027 # The rules are:
2028 # 1. Build defaults to the current platform, as determined by config.guess.
2029 # 2. Host defaults to build.
2030 # 3. Target defaults to host.
2033 # _AC_CANONICAL_SPLIT(THING)
2034 # --------------------------
2035 # Generate the variables THING, THING_{alias cpu vendor os}.
2036 m4_define([_AC_CANONICAL_SPLIT],
2037 [case $ac_cv_$1 in
2038 *-*-*) ;;
2039 *) AC_MSG_ERROR([invalid value of canonical $1]);;
2040 esac
2041 AC_SUBST([$1], [$ac_cv_$1])dnl
2042 ac_save_IFS=$IFS; IFS='-'
2043 set x $ac_cv_$1
2044 shift
2045 AC_SUBST([$1_cpu], [$[1]])dnl
2046 AC_SUBST([$1_vendor], [$[2]])dnl
2047 shift; shift
2048 [# Remember, the first character of IFS is used to create $]*,
2049 # except with old shells:
2050 $1_os=$[*]
2051 IFS=$ac_save_IFS
2052 case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac
2053 AC_SUBST([$1_os])dnl
2054 ])# _AC_CANONICAL_SPLIT
2057 # AC_CANONICAL_BUILD
2058 # ------------------
2059 AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
2060 [AC_REQUIRE_AUX_FILE([config.sub])dnl
2061 AC_REQUIRE_AUX_FILE([config.guess])dnl
2062 m4_divert_once([HELP_CANON],
2064 System types:
2065   --build=BUILD     configure for building on BUILD [guessed]]])dnl
2066 # Make sure we can run config.sub.
2067 $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
2068   AC_MSG_ERROR([cannot run $SHELL ${ac_aux_dir}config.sub])
2070 AC_CACHE_CHECK([build system type], [ac_cv_build],
2071 [ac_build_alias=$build_alias
2072 test "x$ac_build_alias" = x &&
2073   ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
2074 test "x$ac_build_alias" = x &&
2075   AC_MSG_ERROR([cannot guess build type; you must specify one])
2076 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
2077   AC_MSG_ERROR([$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed])
2079 _AC_CANONICAL_SPLIT(build)
2080 ])# AC_CANONICAL_BUILD
2083 # AC_CANONICAL_HOST
2084 # -----------------
2085 AC_DEFUN_ONCE([AC_CANONICAL_HOST],
2086 [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2087 m4_divert_once([HELP_CANON],
2088 [[  --host=HOST       cross-compile to build programs to run on HOST [BUILD]]])dnl
2089 AC_CACHE_CHECK([host system type], [ac_cv_host],
2090 [if test "x$host_alias" = x; then
2091   ac_cv_host=$ac_cv_build
2092 else
2093   ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
2094     AC_MSG_ERROR([$SHELL ${ac_aux_dir}config.sub $host_alias failed])
2097 _AC_CANONICAL_SPLIT([host])
2098 ])# AC_CANONICAL_HOST
2101 # AC_CANONICAL_TARGET
2102 # -------------------
2103 AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
2104 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2105 AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
2106 m4_divert_once([HELP_CANON],
2107 [[  --target=TARGET   configure for building compilers for TARGET [HOST]]])dnl
2108 AC_CACHE_CHECK([target system type], [ac_cv_target],
2109 [if test "x$target_alias" = x; then
2110   ac_cv_target=$ac_cv_host
2111 else
2112   ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` ||
2113     AC_MSG_ERROR([$SHELL ${ac_aux_dir}config.sub $target_alias failed])
2116 _AC_CANONICAL_SPLIT([target])
2118 # The aliases save the names the user supplied, while $host etc.
2119 # will get canonicalized.
2120 test -n "$target_alias" &&
2121   test "$program_prefix$program_suffix$program_transform_name" = \
2122     NONENONEs,x,x, &&
2123   program_prefix=${target_alias}-[]dnl
2124 ])# AC_CANONICAL_TARGET
2127 AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
2130 # AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
2131 # ------------------------------------------
2132 # If the cache file is inconsistent with the current host,
2133 # target and build system types, execute CMD or print a default
2134 # error message.  Now handled via _AC_ARG_VAR_PRECIOUS.
2135 AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])
2138 ## ---------------------- ##
2139 ## Caching test results.  ##
2140 ## ---------------------- ##
2143 # AC_SITE_LOAD
2144 # ------------
2145 # Look for site- or system-specific initialization scripts.
2146 m4_define([AC_SITE_LOAD],
2147 [# Prefer an explicitly selected file to automatically selected ones.
2148 if test -n "$CONFIG_SITE"; then
2149   ac_site_files="$CONFIG_SITE"
2150 elif test "x$prefix" != xNONE; then
2151   ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
2152 else
2153   ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
2156 for ac_site_file in $ac_site_files
2158   AS_CASE([$ac_site_file],
2159     [*/*], [],
2160     [ac_site_file=./$ac_site_file])
2161   if test -f "$ac_site_file" && test -r "$ac_site_file"; then
2162     AC_MSG_NOTICE([loading site script $ac_site_file])
2163     sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
2164     . "$ac_site_file" \
2165       || AC_MSG_FAILURE([failed to load site script $ac_site_file])
2166   fi
2167 done
2171 # AC_CACHE_LOAD
2172 # -------------
2173 m4_define([AC_CACHE_LOAD],
2174 [if test -r "$cache_file"; then
2175   # Some versions of bash will fail to source /dev/null (special files
2176   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2177   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2178     AC_MSG_NOTICE([loading cache $cache_file])
2179     case $cache_file in
2180       [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";;
2181       *)                      . "./$cache_file";;
2182     esac
2183   fi
2184 else
2185   AC_MSG_NOTICE([creating cache $cache_file])
2186   >$cache_file
2188 ])# AC_CACHE_LOAD
2191 # _AC_CACHE_DUMP
2192 # --------------
2193 # Dump the cache to stdout.  It can be in a pipe (this is a requirement).
2194 m4_define([_AC_CACHE_DUMP],
2195 [# The following way of writing the cache mishandles newlines in values,
2196 # but we know of no workaround that is simple, portable, and efficient.
2197 # So, we kill variables containing newlines.
2198 # Ultrix sh set writes to stderr and can't be redirected directly,
2199 # and sets the high bit in the cache file unless we assign to the vars.
2201   for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do
2202     eval ac_val=\$$ac_var
2203     case $ac_val in #(
2204     *${as_nl}*)
2205       case $ac_var in #(
2206       *_cv_*) AC_MSG_WARN([cache variable $ac_var contains a newline]) ;;
2207       esac
2208       case $ac_var in #(
2209       _ | IFS | as_nl) ;; #(
2210       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2211       *) AS_UNSET([$ac_var]) ;;
2212       esac ;;
2213     esac
2214   done
2216   (set) 2>&1 |
2217     case $as_nl`(ac_space=' '; set) 2>&1` in #(
2218     *${as_nl}ac_space=\ *)
2219       # 'set' does not quote correctly, so add quotes: double-quote
2220       # substitution turns \\\\ into \\, and sed turns \\ into \.
2221       sed -n \
2222         ["s/'/'\\\\''/g;
2223           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
2224       ;; #(
2225     *)
2226       # 'set' quotes correctly as required by POSIX, so do not add quotes.
2227       sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"]
2228       ;;
2229     esac |
2230     sort
2231 )dnl
2232 ])# _AC_CACHE_DUMP
2235 # AC_CACHE_SAVE
2236 # -------------
2237 # Save the cache.
2238 # Allow a site initialization script to override cache values.
2239 m4_define([AC_CACHE_SAVE],
2240 [cat >confcache <<\_ACEOF
2241 # This file is a shell script that caches the results of configure
2242 # tests run on this system so they can be shared between configure
2243 # scripts and configure runs, see configure's option --config-cache.
2244 # It is not useful on other systems.  If it contains results you don't
2245 # want to keep, you may remove or edit it.
2247 # config.status only pays attention to the cache file if you give it
2248 # the --recheck option to rerun configure.
2250 # 'ac_cv_env_foo' variables (set or unset) will be overridden when
2251 # loading this file, other *unset* 'ac_cv_foo' will be assigned the
2252 # following values.
2254 _ACEOF
2256 _AC_CACHE_DUMP() |
2257   sed ['
2258      /^ac_cv_env_/b end
2259      t clear
2260      :clear
2261      s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
2262      t end
2263      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
2264      :end'] >>confcache
2265 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
2266   if test -w "$cache_file"; then
2267     if test "x$cache_file" != "x/dev/null"; then
2268       AC_MSG_NOTICE([updating cache $cache_file])
2269       if test ! -f "$cache_file" || test -h "$cache_file"; then
2270         cat confcache >"$cache_file"
2271       else
2272 dnl Try to update the cache file atomically even on different mount points;
2273 dnl at the same time, avoid filename limitation issues in the common case.
2274         case $cache_file in #(
2275         */* | ?:*)
2276           mv -f confcache "$cache_file"$$ &&
2277           mv -f "$cache_file"$$ "$cache_file" ;; #(
2278         *)
2279           mv -f confcache "$cache_file" ;;
2280         esac
2281       fi
2282     fi
2283   else
2284     AC_MSG_NOTICE([not updating unwritable cache $cache_file])
2285   fi
2287 rm -f confcache[]dnl
2288 ])# AC_CACHE_SAVE
2291 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
2292 # ------------------------------------------
2293 # The name of shell var CACHE-ID must contain '_cv_' in order to get saved.
2294 # Should be dnl'ed.  Try to catch common mistakes.
2295 m4_defun([AC_CACHE_VAL],
2296 [AS_LITERAL_WORD_IF([$1], [m4_if(m4_index(m4_quote($1), [_cv_]), [-1],
2297                             [m4_warn([syntax],
2298 [$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])])dnl
2299 m4_if(m4_index([$2], [AC_DEFINE]), [-1], [],
2300       [m4_warn([syntax],
2301 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
2302 [where no actions should be taken])])dnl
2303 m4_if(m4_index([$2], [AC_SUBST]), [-1], [],
2304       [m4_warn([syntax],
2305 [$0($1, ...): suspicious presence of an AC_SUBST in the second argument, ]dnl
2306 [where no actions should be taken])])dnl
2307 AS_VAR_SET_IF([$1],
2308               [_AS_ECHO_N([(cached) ])],
2309               [$2])
2313 # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
2314 # -------------------------------------------
2315 # Do not call this macro with a dnl right behind.
2316 m4_defun([AC_CACHE_CHECK],
2317 [AC_MSG_CHECKING([$1])
2318 AC_CACHE_VAL([$2], [$3])dnl
2319 AS_LITERAL_WORD_IF([$2],
2320               [AC_MSG_RESULT([$$2])],
2321               [AS_VAR_COPY([ac_res], [$2])
2322                AC_MSG_RESULT([$ac_res])])dnl
2325 # _AC_CACHE_CHECK_INT(MESSAGE, CACHE-ID, EXPRESSION,
2326 #                     [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS])
2327 # --------------------------------------------------------------
2328 AC_DEFUN([_AC_CACHE_CHECK_INT],
2329 [AC_CACHE_CHECK([$1], [$2],
2330    [AC_COMPUTE_INT([$2], [$3], [$4], [$5])])
2331 ])# _AC_CACHE_CHECK_INT
2335 ## ---------------------- ##
2336 ## Defining CPP symbols.  ##
2337 ## ---------------------- ##
2340 # AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
2341 # -------------------------------------------
2342 # Used by --trace to collect the list of AC_DEFINEd macros.
2343 m4_define([AC_DEFINE_TRACE_LITERAL],
2344 [m4_pattern_allow([^$1$])dnl
2345 AS_IDENTIFIER_IF([$1], [],
2346   [m4_warn([syntax], [AC_DEFINE: not an identifier: $1])])dnl
2347 ])# AC_DEFINE_TRACE_LITERAL
2350 # AC_DEFINE_TRACE(CPP-SYMBOL)
2351 # ---------------------------
2352 # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
2353 # out non literal symbols.  CPP-SYMBOL must not include any parameters.
2354 m4_define([AC_DEFINE_TRACE],
2355 [AS_LITERAL_WORD_IF([$1], [AC_DEFINE_TRACE_LITERAL(_m4_expand([$1]))])])
2358 # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
2359 # -------------------------------------------
2360 # Set VARIABLE to VALUE, verbatim, or 1.  Remember the value
2361 # and if VARIABLE is affected the same VALUE, do nothing, else
2362 # die.  The third argument is used by autoheader.
2363 m4_define([AC_DEFINE], [_AC_DEFINE_Q([_$0], $@)])
2365 # _AC_DEFINE(STRING)
2366 # ------------------
2367 # Append the pre-expanded STRING and a newline to confdefs.h, as if by
2368 # a quoted here-doc.
2369 m4_define([_AC_DEFINE],
2370 [AS_ECHO(["AS_ESCAPE([[$1]])"]) >>confdefs.h])
2373 # AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
2374 # ----------------------------------------------------
2375 # Similar, but perform shell substitutions $ ` \ once on VALUE, as
2376 # in an unquoted here-doc.
2377 m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([_$0], $@)])
2379 # _AC_DEFINE_UNQUOTED(STRING)
2380 # ---------------------------
2381 # Append the pre-expanded STRING and a newline to confdefs.h, as if
2382 # with an unquoted here-doc, but avoiding a fork in the common case of
2383 # no backslash, no command substitution, no complex variable
2384 # substitution (taking into account quadrigraphs as well).  Also
2385 # avoid AS_ECHO if "#" is present to avoid confusing m4 with comments,
2386 # but quadrigraphs are fine in that case.
2387 m4_define([_AC_DEFINE_UNQUOTED],
2388 [m4_if(m4_bregexp([$1], [#\|\\\|`\|\(\$\|@S|@\)\((|{|@{:@\)]), [-1],
2389        [AS_ECHO(["AS_ESCAPE([$1], [""])"]) >>confdefs.h],
2390        [cat >>confdefs.h <<_ACEOF
2391 [$1]
2392 _ACEOF])])
2395 # _AC_DEFINE_Q(MACRO, VARIABLE, [VALUE], [DESCRIPTION])
2396 # -----------------------------------------------------
2397 # Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}.
2398 # MACRO must take one argument, which is the fully expanded string to
2399 # append to confdefs.h as if by a possibly-quoted here-doc.
2401 # m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so we use
2402 # m4_format rather than regex to grab prefix up to first ().  AC_name
2403 # is defined with over-quotation, so that we can avoid m4_defn; this
2404 # is only safe because the name should not contain $.
2406 # Guarantee a match in m4_index, so as to avoid a bug with precision
2407 # -1 in m4_format in older m4.
2408 m4_define([_AC_DEFINE_Q],
2409 [m4_pushdef([AC_name], m4_format([[[%.*s]]], m4_index([$2(], [(]), [$2]))]dnl
2410 [AC_DEFINE_TRACE(AC_name)]dnl
2411 [m4_cond([m4_index([$3], [
2412 ])], [-1], [],
2413         [m4_bregexp([[$3]], [[^\\]
2414 ], [-])], [], [],
2415         [m4_warn([syntax], [AC_DEFINE]m4_if([$1], [_AC_DEFINE], [],
2416   [[_UNQUOTED]])[: '$3' is not a valid preprocessor define value])])]dnl
2417 [m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])
2418 ])_m4_popdef([AC_name])]dnl
2419 [$1(m4_expand([[@%:@define] $2 ]m4_if([$#], 2, 1,
2420   [$3], [], [/**/], [[$3]])))
2425 ## -------------------------- ##
2426 ## Setting output variables.  ##
2427 ## -------------------------- ##
2430 # AC_SUBST_TRACE(VARIABLE)
2431 # ------------------------
2432 # This macro is used with --trace to collect the list of substituted variables.
2433 m4_define([AC_SUBST_TRACE])
2436 # AC_SUBST(VARIABLE, [VALUE])
2437 # ---------------------------
2438 # Create an output variable from a shell VARIABLE.  If VALUE is given
2439 # assign it to VARIABLE.  Use '""' if you want to set VARIABLE to an
2440 # empty value, not an empty second argument.
2442 m4_define([AC_SUBST],
2443 [AS_IDENTIFIER_IF([$1], [],
2444   [m4_fatal([$0: '$1' is not a valid shell variable name])])]dnl
2445 [AC_SUBST_TRACE([$1])]dnl
2446 [m4_pattern_allow([^$1$])]dnl
2447 [m4_ifvaln([$2], [[$1]=$2])[]]dnl
2448 [m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST
2451 # AC_SUBST_FILE(VARIABLE)
2452 # -----------------------
2453 # Read the comments of the preceding macro.
2454 m4_define([AC_SUBST_FILE],
2455 [m4_pattern_allow([^$1$])dnl
2456 m4_append_uniq([_AC_SUBST_FILES], [$1], [
2457 ])])
2461 ## --------------------------------------- ##
2462 ## Printing messages at autoconf runtime.  ##
2463 ## --------------------------------------- ##
2465 # AU::AC_DIAGNOSE(CATEGORY, MESSAGE)
2466 # AU::AC_FATAL(MESSAGE, [EXIT-STATUS])
2467 # AU::AC_WARNING(MESSAGE)
2468 # AU::AC_OBSOLETE(THIS-MACRO, [SUGGESTION])
2469 # --------------------------------
2470 # The double definitions are necessary because autoupdate expands m4_
2471 # macros, so we have to double-quote the replacements, but then they
2472 # won't work in a normal autoconf run.
2474 # 2020-10-06 / autoconf 2.70: Widely used third-party macros
2475 # (among others, from automake, libtool, and gettext) use AC_DIAGNOSE,
2476 # so we temporarily don't issue an obsolescence warning for it.
2477 # Revisit after third parties have had a chance to update their macros
2478 # and make releases.
2479 AU_DEFUN([AC_DIAGNOSE], [[m4_warn($@)]], [], [silent])
2480 AC_DEFUN([AC_DIAGNOSE], [m4_warn($@)])
2482 AU_DEFUN([AC_FATAL], [[m4_fatal($@)]])
2483 AC_DEFUN([AC_FATAL], [m4_fatal($@)dnl
2484 m4_warn([obsolete], [The macro '$0' is obsolete.
2485 You should run autoupdate.])])
2487 AU_DEFUN([AC_WARNING],  [[m4_warn([syntax], [$1])]])
2488 AC_DEFUN([AC_WARNING], [m4_warn([syntax], [$1])dnl
2489 m4_warn([obsolete], [The macro '$0' is obsolete.
2490 You should run autoupdate.])])
2492 AU_DEFUN([AC_OBSOLETE], [[m4_warn([obsolete], [$1 is obsolete$2])]],
2493 [if possible, define this macro using AU_DEFUN.])
2494 AC_DEFUN([AC_OBSOLETE], [m4_warn([obsolete], [$1 is obsolete$2])dnl
2495 m4_warn([obsolete], [The macro '$0' is obsolete.
2496 You should run autoupdate.])])
2500 ## ---------------------------------------- ##
2501 ## Printing messages at configure runtime.  ##
2502 ## ---------------------------------------- ##
2505 # AC_MSG_CHECKING(FEATURE)
2506 # ------------------------
2507 m4_define([AC_MSG_CHECKING],
2508 [{ _AS_ECHO_LOG([checking $1])
2509 _AS_ECHO_N([checking $1... ]); }dnl
2513 # AC_MSG_RESULT(RESULT)
2514 # ---------------------
2515 m4_define([AC_MSG_RESULT],
2516 [{ _AS_ECHO_LOG([result: $1])
2517 _AS_ECHO([$1]); }dnl
2521 # AC_MSG_WARN(PROBLEM)
2522 # AC_MSG_NOTICE(STRING)
2523 # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
2524 # AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
2525 # ----------------------------------------
2526 m4_copy([AS_WARN],    [AC_MSG_WARN])
2527 m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
2528 m4_copy([AS_ERROR],   [AC_MSG_ERROR])
2529 m4_define([AC_MSG_FAILURE],
2530 [{ AS_MESSAGE([error: in '$ac_pwd':], 2)
2531 AC_MSG_ERROR([$1
2532 See 'config.log' for more details], [$2]); }])
2535 # _AC_MSG_LOG_CONFTEST
2536 # --------------------
2537 m4_define([_AC_MSG_LOG_CONFTEST],
2538 [AS_ECHO(["$as_me: failed program was:"]) >&AS_MESSAGE_LOG_FD
2539 sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2543 # AU::AC_CHECKING(FEATURE)
2544 # ------------------------
2545 AU_DEFUN([AC_CHECKING],
2546 [AS_MESSAGE([checking $1...])])
2549 # AU::AC_MSG_RESULT_UNQUOTED(RESULT)
2550 # ----------------------------------
2551 # No escaping, so it performed also backtick substitution.
2552 AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
2553 [_AS_ECHO_UNQUOTED([$as_me:${as_lineno-$LINENO}: result: $1], AS_MESSAGE_LOG_FD)
2554 _AS_ECHO_UNQUOTED([$1])[]dnl
2558 # AU::AC_VERBOSE(STRING)
2559 # ----------------------
2560 AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])
2567 ## ---------------------------- ##
2568 ## Compiler-running mechanics.  ##
2569 ## ---------------------------- ##
2572 # _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
2573 # ----------------------------------
2574 # Eval COMMAND, save the exit status in ac_status, and log it.  The return
2575 # code is 0 if COMMAND succeeded, so that it can be used directly in AS_IF
2576 # constructs.
2577 AC_DEFUN([_AC_RUN_LOG],
2578 [{ { $2; } >&AS_MESSAGE_LOG_FD
2579   ($1) 2>&AS_MESSAGE_LOG_FD
2580   ac_status=$?
2581   _AS_ECHO_LOG([\$? = $ac_status])
2582   test $ac_status = 0; }])
2585 # _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
2586 # -----------------------------------------
2587 # Run COMMAND, save its stderr into conftest.err, save the exit status
2588 # in ac_status, and log it.  Don't forget to clean up conftest.err after
2589 # use.
2590 # Note that when tracing, most shells will leave the traces in stderr
2591 # starting with "+": that's what this macro tries to address.
2592 # The return code is 0 if COMMAND succeeded, so that it can be used directly
2593 # in AS_IF constructs.
2594 AC_DEFUN([_AC_RUN_LOG_STDERR],
2595 [{ { $2; } >&AS_MESSAGE_LOG_FD
2596   ($1) 2>conftest.err
2597   ac_status=$?
2598   if test -s conftest.err; then
2599     grep -v '^ *+' conftest.err >conftest.er1
2600     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2601     mv -f conftest.er1 conftest.err
2602   fi
2603   _AS_ECHO_LOG([\$? = $ac_status])
2604   test $ac_status = 0; }])
2607 # _AC_RUN_LOG_LIMIT(COMMAND, LOG-COMMANDS, [LINES])
2608 # -------------------------------------------------
2609 # Like _AC_RUN_LOG, but only log LINES lines from stderr,
2610 # defaulting to 10 lines.
2611 AC_DEFUN([_AC_RUN_LOG_LIMIT],
2612 [{ { $2; } >&AS_MESSAGE_LOG_FD
2613   ($1) 2>conftest.err
2614   ac_status=$?
2615   if test -s conftest.err; then
2616     sed 'm4_default([$3], [10])a\
2617 ... rest of stderr output deleted ...
2618          m4_default([$3], [10])q' conftest.err >conftest.er1
2619     cat conftest.er1 >&AS_MESSAGE_LOG_FD
2620   fi
2621   rm -f conftest.er1 conftest.err
2622   _AS_ECHO_LOG([\$? = $ac_status])
2623   test $ac_status = 0; }])
2626 # _AC_DO_ECHO(COMMAND)
2627 # --------------------
2628 # Echo COMMAND.  This is designed to be used just before evaluating COMMAND.
2629 AC_DEFUN([_AC_DO_ECHO],
2630 [m4_if([$1], [$ac_try], [], [ac_try="$1"
2631 ])]dnl
2632 dnl If the string contains '\"', '`', or '\\', then just echo it rather
2633 dnl than expanding it.  This is a hack, but it is safer, while also
2634 dnl typically expanding simple substrings like '$CC', which is what we want.
2636 dnl Much of this macro body is quoted, to work around misuses like
2637 dnl 'AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
2638 dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
2639 dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse
2640 dnl underquoting misuses, such as
2641 dnl 'AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'.
2642 dnl We normally wouldn't bother with this kind of workaround for invalid code
2643 dnl but this change was put in just before Autoconf 2.60 and we wanted to
2644 dnl minimize the integration hassle.
2645 [[case "(($ac_try" in
2646   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2647   *) ac_try_echo=$ac_try;;
2648 esac
2649 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""]
2650 AS_ECHO(["$ac_try_echo"])])
2652 # _AC_DO(COMMAND)
2653 # ---------------
2654 # Eval COMMAND, save the exit status in ac_status, and log it.
2655 # For internal use only.
2656 AC_DEFUN([_AC_DO],
2657 [_AC_RUN_LOG([eval "$1"],
2658              [_AC_DO_ECHO([$1])])])
2661 # _AC_DO_STDERR(COMMAND)
2662 # ----------------------
2663 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2664 AC_DEFUN([_AC_DO_STDERR],
2665 [_AC_RUN_LOG_STDERR([eval "$1"],
2666                     [_AC_DO_ECHO([$1])])])
2669 # _AC_DO_VAR(VARIABLE)
2670 # --------------------
2671 # Evaluate "$VARIABLE", which should be a valid shell command.
2672 # The purpose of this macro is to write "configure:123: command line"
2673 # into config.log for every test run.
2674 AC_DEFUN([_AC_DO_VAR],
2675 [_AC_DO([$$1])])
2678 # _AC_DO_TOKENS(COMMAND)
2679 # ----------------------
2680 # Like _AC_DO_VAR, but execute COMMAND instead, where COMMAND is a series of
2681 # tokens of the shell command language.
2682 AC_DEFUN([_AC_DO_TOKENS],
2683 [{ ac_try='$1'
2684   _AC_DO([$ac_try]); }])
2687 # _AC_DO_LIMIT(COMMAND, [LINES])
2688 # ------------------------------
2689 # Like _AC_DO, but limit the amount of stderr lines logged to LINES.
2690 # For internal use only.
2691 AC_DEFUN([_AC_DO_LIMIT],
2692 [_AC_RUN_LOG_LIMIT([eval "$1"],
2693                    [_AC_DO_ECHO([$1])], [$2])])
2696 # _AC_EVAL(COMMAND)
2697 # -----------------
2698 # Eval COMMAND, save the exit status in ac_status, and log it.
2699 # Unlike _AC_DO, this macro mishandles quoted arguments
2700 # and backslashes in some cases.
2701 # It is present only for backward compatibility with previous Autoconf versions.
2702 AC_DEFUN([_AC_EVAL],
2703 [_AC_RUN_LOG([eval $1],
2704              [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2707 # _AC_EVAL_STDERR(COMMAND)
2708 # ------------------------
2709 # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
2710 # Unlike _AC_DO_STDERR, this macro mishandles quoted arguments
2711 # and backslashes in some cases.
2712 # It is present only for backward compatibility with previous Autoconf versions.
2713 AC_DEFUN([_AC_EVAL_STDERR],
2714 [_AC_RUN_LOG_STDERR([eval $1],
2715                     [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2718 # AC_TRY_EVAL(VARIABLE)
2719 # ---------------------
2720 # Evaluate $VARIABLE, which should be a valid shell command.
2721 # The purpose of this macro is to write "configure:123: command line"
2722 # into config.log for every test run.
2724 # The AC_TRY_EVAL and AC_TRY_COMMAND macros are dangerous and
2725 # undocumented, and should not be used.
2726 # They may be removed or their API changed in a future release.
2727 # Autoconf itself no longer uses these two macros; they are present
2728 # only for backward compatibility with previous versions of Autoconf.
2729 # Not every shell command will work due to problems with eval
2730 # and quoting, and the rules for exactly what does work are tricky.
2731 # Worse, due to double-expansion during evaluation, arbitrary unintended
2732 # shell commands could be executed in some situations.
2733 AC_DEFUN([AC_TRY_EVAL],
2734 [_AC_EVAL([$$1])])
2737 # AC_TRY_COMMAND(COMMAND)
2738 # -----------------------
2739 # Like AC_TRY_EVAL, but execute COMMAND instead, where COMMAND is a series of
2740 # tokens of the shell command language.
2741 # This macro should not be used; see the comments under AC_TRY_EVAL for why.
2742 AC_DEFUN([AC_TRY_COMMAND],
2743 [{ ac_try='$1'
2744   _AC_EVAL([$ac_try]); }])
2747 # AC_RUN_LOG(COMMAND)
2748 # -------------------
2749 AC_DEFUN([AC_RUN_LOG],
2750 [_AC_RUN_LOG([$1],
2751              [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"])])])
2756 ## ------------------------ ##
2757 ## Examining declarations.  ##
2758 ## ------------------------ ##
2761 # _AC_PREPROC_IFELSE_BODY
2762 # -----------------------
2763 # Shell function body for _AC_PREPROC_IFELSE.
2764 m4_define([_AC_PREPROC_IFELSE_BODY],
2765 [  AS_LINENO_PUSH([$[]1])
2766   AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) > conftest.i && {
2767          test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2768          test ! -s conftest.err
2769        }],
2770     [ac_retval=0],
2771     [_AC_MSG_LOG_CONFTEST
2772     ac_retval=1])
2773   AS_LINENO_POP
2774   AS_SET_STATUS([$ac_retval])
2775 ])# _AC_PREPROC_IFELSE_BODY
2778 # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2779 # ----------------------------------------------------------------
2780 # Try to preprocess PROGRAM.
2782 # This macro can be used during the selection of a preprocessor.
2783 # eval is necessary to expand ac_cpp.
2784 AC_DEFUN([_AC_PREPROC_IFELSE],
2785 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_cpp],
2786   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
2787     [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
2788   [$0_BODY])]dnl
2789 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2790 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
2791 rm -f conftest.err conftest.i[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2792 ])# _AC_PREPROC_IFELSE
2794 # AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2795 # ---------------------------------------------------------------
2796 # Try to preprocess PROGRAM.  Requires that the preprocessor for the
2797 # current language was checked for, hence do not use this macro in macros
2798 # looking for a preprocessor.
2799 AC_DEFUN([AC_PREPROC_IFELSE],
2800 [AC_LANG_PREPROC_REQUIRE()dnl
2801 _AC_PREPROC_IFELSE($@)])
2804 # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2805 # ---------------------------------------------------------
2806 # AC_TRY_CPP is used to check whether particular header files exist.
2807 # (But it actually tests whether INCLUDES produces no CPP errors.)
2809 # INCLUDES are not defaulted and are double quoted.
2810 AU_DEFUN([AC_TRY_CPP],
2811 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
2814 # AC_EGREP_CPP(PATTERN, PROGRAM,
2815 #              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2816 # ------------------------------------------------------
2817 AC_DEFUN([AC_EGREP_CPP],
2818 [AC_LANG_PREPROC_REQUIRE()dnl
2819 AC_REQUIRE([_AC_PROG_EGREP_TRADITIONAL])dnl
2820 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
2821 AS_IF([dnl eval is necessary to expand ac_cpp.
2822 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
2823 (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
2824 dnl Quote $1 to prevent m4 from eating character classes
2825   $EGREP_TRADITIONAL "m4_bregexp([$1],[^[$-]],[.?])[$1]" >/dev/null 2>&1],
2826   [$3],
2827   [$4])
2828 rm -rf conftest*
2829 ])# AC_EGREP_CPP
2832 # AC_EGREP_HEADER(PATTERN, HEADER-FILE,
2833 #                 [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2834 # ---------------------------------------------------------
2835 AC_DEFUN([AC_EGREP_HEADER],
2836 [AC_EGREP_CPP([$1],
2837 [#include <$2>
2838 ], [$3], [$4])])
2843 ## ------------------ ##
2844 ## Examining syntax.  ##
2845 ## ------------------ ##
2847 # _AC_COMPILE_IFELSE_BODY
2848 # -----------------------
2849 # Shell function body for _AC_COMPILE_IFELSE.
2850 m4_define([_AC_COMPILE_IFELSE_BODY],
2851 [  AS_LINENO_PUSH([$[]1])
2852   rm -f conftest.$ac_objext conftest.beam
2853   AS_IF([_AC_DO_STDERR($ac_compile) && {
2854          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2855          test ! -s conftest.err
2856        } && test -s conftest.$ac_objext],
2857       [ac_retval=0],
2858       [_AC_MSG_LOG_CONFTEST
2859         ac_retval=1])
2860   AS_LINENO_POP
2861   AS_SET_STATUS([$ac_retval])
2862 ])# _AC_COMPILE_IFELSE_BODY
2865 # _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2866 # ----------------------------------------------------------------
2867 # Try to compile PROGRAM.
2868 # This macro can be used during the selection of a compiler.
2869 AC_DEFUN([_AC_COMPILE_IFELSE],
2870 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_compile],
2871   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_compile], [LINENO],
2872     [Try to compile conftest.$ac_ext, and return whether this succeeded.])],
2873   [$0_BODY])]dnl
2874 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2875 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
2876 rm -f core conftest.err conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2877 ])# _AC_COMPILE_IFELSE
2880 # AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2881 # ---------------------------------------------------------------
2882 # Try to compile PROGRAM.  Requires that the compiler for the current
2883 # language was checked for, hence do not use this macro in macros looking
2884 # for a compiler.
2885 AC_DEFUN([AC_COMPILE_IFELSE],
2886 [AC_LANG_COMPILER_REQUIRE()dnl
2887 _AC_COMPILE_IFELSE($@)])
2890 # AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
2891 #                [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2892 # ---------------------------------------------------
2893 AU_DEFUN([AC_TRY_COMPILE],
2894 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2898 ## --------------------- ##
2899 ## Examining libraries.  ##
2900 ## --------------------- ##
2903 # _AC_LINK_IFELSE_BODY
2904 # --------------------
2905 # Shell function body for _AC_LINK_IFELSE.
2906 m4_define([_AC_LINK_IFELSE_BODY],
2907 [  AS_LINENO_PUSH([$[]1])
2908   rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
2909   AS_IF([_AC_DO_STDERR($ac_link) && {
2910          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2911          test ! -s conftest.err
2912        } && test -s conftest$ac_exeext && {
2913          test "$cross_compiling" = yes ||
2914          AS_TEST_X([conftest$ac_exeext])
2915        }],
2916       [ac_retval=0],
2917       [_AC_MSG_LOG_CONFTEST
2918         ac_retval=1])
2919   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2920   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2921   # interfere with the next link command; also delete a directory that is
2922   # left behind by Apple's compiler.  We do this before executing the actions.
2923   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2924   AS_LINENO_POP
2925   AS_SET_STATUS([$ac_retval])
2926 ])# _AC_LINK_IFELSE_BODY
2929 # _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2930 # -------------------------------------------------------------
2931 # Try to link PROGRAM.
2932 # This macro can be used during the selection of a compiler.
2934 # Test that resulting file is executable; see the problem reported by mwoehlke
2935 # in <https://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00048.html>.
2936 # But skip the test when cross-compiling, to prevent problems like the one
2937 # reported by Chris Johns in
2938 # <https://lists.gnu.org/archive/html/autoconf/2007-03/msg00085.html>.
2940 AC_DEFUN([_AC_LINK_IFELSE],
2941 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_link],
2942   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_link], [LINENO],
2943     [Try to link conftest.$ac_ext, and return whether this succeeded.])],
2944   [$0_BODY])]dnl
2945 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
2946 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_link "$LINENO"], [$2], [$3])
2947 rm -f core conftest.err conftest.$ac_objext conftest.beam \
2948     conftest$ac_exeext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2949 ])# _AC_LINK_IFELSE
2952 # AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2953 # ------------------------------------------------------------
2954 # Try to link PROGRAM.  Requires that the compiler for the current
2955 # language was checked for, hence do not use this macro in macros looking
2956 # for a compiler.
2957 AC_DEFUN([AC_LINK_IFELSE],
2958 [AC_LANG_COMPILER_REQUIRE()dnl
2959 _AC_LINK_IFELSE($@)])
2962 # AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
2963 #             [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2964 # ------------------------------------------------
2965 # Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
2966 AU_DEFUN([AC_TRY_LINK],
2967 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2970 # AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
2971 #                  ACTION-IF-TRUE, [ACTION-IF-FALSE])
2972 # ---------------------------------------------------
2973 AU_DEFUN([AC_COMPILE_CHECK],
2974 [m4_ifvaln([$1], [AC_MSG_CHECKING([for $1])])dnl
2975 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])])
2980 ## ------------------------------- ##
2981 ## Checking for runtime features.  ##
2982 ## ------------------------------- ##
2985 # _AC_RUN_IFELSE_BODY
2986 # -------------------
2987 # Shell function body for _AC_RUN_IFELSE.
2988 m4_define([_AC_RUN_IFELSE_BODY],
2989 [  AS_LINENO_PUSH([$[]1])
2990   AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
2991       [ac_retval=0],
2992       [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
2993        _AC_MSG_LOG_CONFTEST
2994        ac_retval=$ac_status])
2995   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2996   AS_LINENO_POP
2997   AS_SET_STATUS([$ac_retval])
2998 ])# _AC_RUN_IFELSE_BODY
3001 # _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
3002 # ------------------------------------------------------------
3003 # Compile, link, and run.
3004 # This macro can be used during the selection of a compiler.
3005 # We also remove conftest.o as if the compilation fails, some compilers
3006 # don't remove it.  We remove gmon.out and bb.out, which may be
3007 # created during the run if the program is built with profiling support.
3008 AC_DEFUN([_AC_RUN_IFELSE],
3009 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run],
3010   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run], [LINENO],
3011     [Try to run conftest.$ac_ext, and return whether this succeeded.
3012      Assumes that executables *can* be run.])],
3013   [$0_BODY])]dnl
3014 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
3015 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run "$LINENO"], [$2], [$3])
3016 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3017   conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
3018 ])# _AC_RUN_IFELSE
3020 # AC_RUN_IFELSE(PROGRAM,
3021 #               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
3022 #               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
3023 # ----------------------------------------------------------
3024 # Compile, link, and run. Requires that the compiler for the current
3025 # language was checked for, hence do not use this macro in macros looking
3026 # for a compiler.
3027 AC_DEFUN([AC_RUN_IFELSE],
3028 [AC_LANG_COMPILER_REQUIRE()dnl
3029 m4_ifval([$4], [],
3030          [m4_warn([cross],
3031                   [$0 called without default to allow cross compiling])])dnl
3032 AS_IF([test "$cross_compiling" = yes],
3033   [m4_default([$4],
3034            [AC_MSG_FAILURE([cannot run test program while cross compiling])])],
3035   [_AC_RUN_IFELSE($@)])
3039 # AC_TRY_RUN(PROGRAM,
3040 #            [ACTION-IF-TRUE], [ACTION-IF-FALSE],
3041 #            [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
3042 # -------------------------------------------------------
3043 AU_DEFUN([AC_TRY_RUN],
3044 [AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])
3048 ## ------------------------------------- ##
3049 ## Checking for the existence of files.  ##
3050 ## ------------------------------------- ##
3052 # AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3053 # -------------------------------------------------------------
3055 # Check for the existence of FILE.
3056 AC_DEFUN([AC_CHECK_FILE],
3057 [m4_warn([cross],
3058          [cannot check for file existence when cross compiling])dnl
3059 AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
3060 AC_CACHE_CHECK([for $1], [ac_File],
3061 [test "$cross_compiling" = yes &&
3062   AC_MSG_ERROR([cannot check for file existence when cross compiling])
3063 if test -r "$1"; then
3064   AS_VAR_SET([ac_File], [yes])
3065 else
3066   AS_VAR_SET([ac_File], [no])
3067 fi])
3068 AS_VAR_IF([ac_File], [yes], [$2], [$3])
3069 AS_VAR_POPDEF([ac_File])dnl
3070 ])# AC_CHECK_FILE
3073 # _AC_CHECK_FILES(FILE)
3074 # ---------------------
3075 # Helper to AC_CHECK_FILES, which generates two of the three arguments
3076 # to AC_CHECK_FILE based on FILE.
3077 m4_define([_AC_CHECK_FILES],
3078 [[$1], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
3079   [Define to 1 if you have the file '$1'.])]])
3082 # AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3083 # -----------------------------------------------------------------
3084 # For each word in the whitespace-separated FILE list, perform either
3085 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.  For files that exist, also
3086 # provide the preprocessor variable HAVE_FILE.
3087 AC_DEFUN([AC_CHECK_FILES],
3088 [m4_map_args_w(m4_validate_w([$1]),
3089   [AC_CHECK_FILE(_$0(], [)[$2], [$3])])])
3092 ## ------------------------------- ##
3093 ## Checking for declared symbols.  ##
3094 ## ------------------------------- ##
3096 # _AC_UNDECLARED_BUILTIN
3097 # ----------------------
3098 # Set ac_[]_AC_LANG_ABBREV[]_undeclared_builtin_options to any options
3099 # needed to make the compiler issue a hard error, not a warning, when
3100 # an undeclared function is used whose declaration happens to be
3101 # built into the compiler (e.g. 'strchr' is often known in advance to
3102 # the C compiler).  These options should not cause any other unrelated
3103 # warnings to become errors.  If no such options can be found, or if
3104 # they make the compiler error out on a correct program of the form
3105 # used by AC_CHECK_DECL, report failure.
3106 AC_DEFUN([_AC_UNDECLARED_BUILTIN],
3107 [AC_CACHE_CHECK(
3108   [for $[]_AC_CC options needed to detect all undeclared functions],
3109   [ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options],
3110   [ac_save_CFLAGS=$CFLAGS
3111    ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options='cannot detect'
3112    for ac_arg in '' -fno-builtin; do
3113      CFLAGS="$ac_save_CFLAGS $ac_arg"
3114      # This test program should *not* compile successfully.
3115      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [(void) strchr;])],
3116        [],
3117        [# This test program should compile successfully.
3118         # No library function is consistently available on
3119         # freestanding implementations, so test against a dummy
3120         # declaration.  Include always-available headers on the
3121         # off chance that they somehow elicit warnings.
3122         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3123 [[#include <float.h>
3124 #include <limits.h>
3125 #include <stdarg.h>
3126 #include <stddef.h>
3127 extern void ac_decl (int, char *);
3129 [[(void) ac_decl (0, (char *) 0);
3130   (void) ac_decl;
3131 ]])],
3132          [AS_IF([test x"$ac_arg" = x],
3133            [ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options='none needed'],
3134            [ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options=$ac_arg])
3135           break],
3136          [])])
3137     done
3138     CFLAGS=$ac_save_CFLAGS
3139   ])
3140   AS_CASE([$ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options],
3141     ['cannot detect'],
3142       [AC_MSG_FAILURE([cannot make $[]_AC_CC report undeclared builtins])],
3143     ['none needed'],
3144       [ac_[]_AC_LANG_ABBREV[]_undeclared_builtin_options=''],
3145       [ac_[]_AC_LANG_ABBREV[]_undeclared_builtin_options=$ac_cv_[]_AC_LANG_ABBREV[]_undeclared_builtin_options])
3148 # _AC_CHECK_DECL_BODY
3149 # -------------------
3150 # Shell function body for AC_CHECK_DECL.
3151 # If we are compiling C, just refer to the name of the function, so we
3152 # don't implicitly declare it.  However, if we are compiling C++,
3153 # '(void) function_name;' won't work when function_name has more than one
3154 # overload, we need to fabricate a function call.  Fortunately, there is
3155 # no such thing as an implicit function declaration in C++.
3156 # If the function is defined as a macro, we cannot verify its signature
3157 # without calling it, and it might not expand to a construct that's valid
3158 # as the only statement in a function body; just report it as available.
3159 m4_define([_AC_CHECK_DECL_BODY],
3160 [  AS_LINENO_PUSH([$[]1])
3161   as_decl_name=`echo $[]2|sed 's/ *(.*//'`
3162   AC_CACHE_CHECK([whether $][as_decl_name is declared], [$[]3],
3163   [as_decl_use=`echo $[]2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3164   AS_VAR_COPY([ac_save_FLAGS], [$[]6])
3165   AS_VAR_APPEND([$[]6], [" $[]5"])
3166   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$][4]],
3167 [[#ifndef $][as_decl_name
3168 #ifdef __cplusplus
3169   (void) $][as_decl_use;
3170 #else
3171   (void) $][as_decl_name;
3172 #endif
3173 #endif
3174 ]])],
3175                    [AS_VAR_SET([$[]3], [yes])],
3176                    [AS_VAR_SET([$[]3], [no])])
3177   AS_VAR_COPY([$[]6], [ac_save_FLAGS])
3179   AS_LINENO_POP
3180 ])# _AC_CHECK_DECL_BODY
3182 # AC_CHECK_DECL(SYMBOL,
3183 #               [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3184 #               [INCLUDES = DEFAULT-INCLUDES])
3185 # -------------------------------------------------------
3186 # Check whether SYMBOL (a function, variable, or constant) is declared.
3187 AC_DEFUN([AC_CHECK_DECL],
3188 [AC_REQUIRE_SHELL_FN([ac_fn_check_decl],
3189   [AS_FUNCTION_DESCRIBE([ac_fn_check_decl],
3190     [LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR],
3191     [Tests whether SYMBOL is declared in INCLUDES, setting cache variable
3192      VAR accordingly.  Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.])],
3193   [_$0_BODY])]dnl
3194 dnl Initialize each $ac_[]_AC_LANG_ABBREV[]_undeclared_builtin_options once.
3195 [AC_DEFUN([_AC_UNDECLARED_BUILTIN_]_AC_LANG_ABBREV,
3196           [_AC_UNDECLARED_BUILTIN])]dnl
3197 [AC_REQUIRE([_AC_UNDECLARED_BUILTIN_]_AC_LANG_ABBREV)]dnl
3198 [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl
3199 [ac_fn_check_decl ]dnl
3200 ["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])" ]dnl
3201 ["$ac_[]_AC_LANG_ABBREV[]_undeclared_builtin_options" "_AC_LANG_PREFIX[]FLAGS"]
3202 [AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])]dnl
3203 [AS_VAR_POPDEF([ac_Symbol])]dnl
3204 )# AC_CHECK_DECL
3207 # _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
3208 #                 INCLUDES)
3209 # -------------------------------------------------------------
3210 # Helper to AC_CHECK_DECLS, which generates the check for a single
3211 # SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
3212 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
3213 m4_define([_AC_CHECK_DECLS],
3214 [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
3215 [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])),
3216   [$ac_have_decl],
3217   [Define to 1 if you have the declaration of '$1',
3218    and to 0 if you don't.])]dnl
3219 [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
3221 # AC_CHECK_DECLS(SYMBOLS,
3222 #                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3223 #                [INCLUDES = DEFAULT-INCLUDES])
3224 # --------------------------------------------------------
3225 # Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise.  See the
3226 # documentation for a detailed explanation of this difference with
3227 # other AC_CHECK_*S macros.  SYMBOLS is an m4 list.
3228 AC_DEFUN([AC_CHECK_DECLS],
3229 [m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)])
3232 # _AC_CHECK_DECL_ONCE(SYMBOL)
3233 # ---------------------------
3234 # Check for a single SYMBOL once.
3235 m4_define([_AC_CHECK_DECL_ONCE],
3236 [AC_DEFUN([_AC_Check_Decl_$1], [_AC_CHECK_DECLS([$1])])]dnl
3237 [AC_REQUIRE([_AC_Check_Decl_$1])])
3239 # AC_CHECK_DECLS_ONCE(SYMBOLS)
3240 # ----------------------------
3241 # Like AC_CHECK_DECLS(SYMBOLS), but do it at most once.
3242 AC_DEFUN([AC_CHECK_DECLS_ONCE],
3243 [m4_map_args_sep([_AC_CHECK_DECL_ONCE(], [)], [], $1)])
3247 ## ---------------------------------- ##
3248 ## Replacement of library functions.  ##
3249 ## ---------------------------------- ##
3252 # AC_CONFIG_LIBOBJ_DIR(DIRNAME)
3253 # -----------------------------
3254 # Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME.
3255 AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR],
3256 [m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])])
3259 # AC_LIBSOURCE(FILE-NAME)
3260 # -----------------------
3261 # Announce we might need the file 'FILE-NAME'.
3262 m4_define([AC_LIBSOURCE], [])
3265 # AC_LIBSOURCES([FILE-NAME1, ...])
3266 # --------------------------------
3267 # Announce we might need these files.
3268 AC_DEFUN([AC_LIBSOURCES],
3269 [m4_map_args([AC_LIBSOURCE], $1)])
3272 # _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR)
3273 # --------------------------------------------
3274 # We need 'FILE-NAME-NOEXT.o', save this into 'LIBOBJS'.
3275 m4_define([_AC_LIBOBJ],
3276 [case " $LIB@&t@OBJS " in
3277   *" $1.$ac_objext "* ) ;;
3278   *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;;
3279 esac
3283 # AC_LIBOBJ(FILE-NAME-NOEXT)
3284 # --------------------------
3285 # We need 'FILE-NAME-NOEXT.o', save this into 'LIBOBJS'.
3286 AC_DEFUN([AC_LIBOBJ],
3287 [_AC_LIBOBJ([$1])]dnl
3288 [AS_LITERAL_WORD_IF([$1], [AC_LIBSOURCE([$1.c])],
3289   [m4_warn([syntax], [$0($1): you should use literals])])])
3292 # _AC_LIBOBJS_NORMALIZE
3293 # ---------------------
3294 # Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext,
3295 # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
3296 # Used with AC_CONFIG_COMMANDS_PRE.
3297 AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
3298 [ac_libobjs=
3299 ac_ltlibobjs=
3300 m4_ifndef([AM_C_PROTOTYPES], [U=
3301 ])dnl
3302 for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
3303   # 1. Remove the extension, and $U if already installed.
3304   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
3305   ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
3306   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
3307   #    will be set to the directory where LIBOBJS objects are built.
3308   AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
3309   AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
3310 done
3311 AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
3312 AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
3316 ## ----------------------------------- ##
3317 ## Checking compiler characteristics.  ##
3318 ## ----------------------------------- ##
3321 # _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
3322 #                         [IF-FAILURE])
3323 # ---------------------------------------------------------------------
3324 # Compute the integer EXPRESSION and store the result in the VARIABLE.
3325 # Works OK if cross compiling, but assumes twos-complement arithmetic.
3326 m4_define([_AC_COMPUTE_INT_COMPILE],
3327 [# Depending upon the size, compute the lo and hi bounds.
3328 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
3329  [ac_lo=0 ac_mid=0
3330   while :; do
3331     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
3332                        [ac_hi=$ac_mid; break],
3333                        [AS_VAR_ARITH([ac_lo], [$ac_mid + 1])
3334                         if test $ac_lo -le $ac_mid; then
3335                           ac_lo= ac_hi=
3336                           break
3337                         fi
3338                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid + 1])])
3339   done],
3340 [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
3341  [ac_hi=-1 ac_mid=-1
3342   while :; do
3343     _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
3344                        [ac_lo=$ac_mid; break],
3345                        [AS_VAR_ARITH([ac_hi], ['(' $ac_mid ')' - 1])
3346                         if test $ac_mid -le $ac_hi; then
3347                           ac_lo= ac_hi=
3348                           break
3349                         fi
3350                         AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid])])
3351   done],
3352  [ac_lo= ac_hi=])])
3353 # Binary search between lo and hi bounds.
3354 while test "x$ac_lo" != "x$ac_hi"; do
3355   AS_VAR_ARITH([ac_mid], ['(' $ac_hi - $ac_lo ')' / 2 + $ac_lo])
3356   _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
3357                      [ac_hi=$ac_mid],
3358                      [AS_VAR_ARITH([ac_lo], ['(' $ac_mid ')' + 1])])
3359 done
3360 case $ac_lo in @%:@((
3361 ?*) AS_VAR_SET([$2], [$ac_lo]); $4 ;;
3362 '') $5 ;;
3363 esac[]dnl
3364 ])# _AC_COMPUTE_INT_COMPILE
3367 # _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
3368 #                     [IF-FAILURE])
3369 # -----------------------------------------------------------------
3370 # Store the evaluation of the integer EXPRESSION in VARIABLE.
3372 # AC_LANG_INT_SAVE intentionally does not end the file in a newline, so
3373 # we must add one to make it a text file before passing it to read.
3374 m4_define([_AC_COMPUTE_INT_RUN],
3375 [_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
3376                 [echo >>conftest.val; read $2 <conftest.val; $4], [$5])
3377 rm -f conftest.val
3378 ])# _AC_COMPUTE_INT_RUN
3381 # _AC_COMPUTE_INT_BODY
3382 # --------------------
3383 # Shell function body for AC_COMPUTE_INT.
3384 m4_define([_AC_COMPUTE_INT_BODY],
3385 [  AS_LINENO_PUSH([$[]1])
3386   if test "$cross_compiling" = yes; then
3387     _AC_COMPUTE_INT_COMPILE([$[]2], [$[]3], [$[]4],
3388                             [ac_retval=0], [ac_retval=1])
3389   else
3390     _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4],
3391                         [ac_retval=0], [ac_retval=1])
3392   fi
3393   AS_LINENO_POP
3394   AS_SET_STATUS([$ac_retval])
3395 ])# _AC_COMPUTE_INT_BODY
3397 # AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
3398 # ----------------------------------------------------------
3399 # Store into the shell variable VARIABLE the value of the integer C expression
3400 # EXPRESSION.  The value should fit in an initializer in a C variable of type
3401 # 'signed long'.  If no PROLOGUE are specified, the default includes are used.
3402 # IF-FAILS is evaluated if the value cannot be found (which includes the
3403 # case of cross-compilation, if EXPRESSION is not computable at compile-time.
3404 AC_DEFUN([AC_COMPUTE_INT],
3405 [AC_LANG_COMPILER_REQUIRE()]dnl
3406 [AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3407   [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_compute_int],
3408     [LINENO EXPR VAR INCLUDES],
3409     [Tries to find the compile-time value of EXPR in a program that includes
3410      INCLUDES, setting VAR accordingly.  Returns whether the value could
3411      be computed])],
3412     [_$0_BODY])]dnl
3413 [AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_compute_int "$LINENO" "$2" "$1" ]dnl
3414        ["AS_ESCAPE([$3], [""])"],
3415        [], [$4])
3416 ])# AC_COMPUTE_INT
3418 # AU::_AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
3419 # -----------------------------------------------------------
3420 # FIXME: this private interface was used by several packages.
3421 # Give them time to transition to AC_COMPUTE_INT and then delete this one.
3422 AU_DEFUN([_AC_COMPUTE_INT], [AC_COMPUTE_INT([$2], [$1], [$3], [$4])])