1 # This file is part of Autoconf. -*- Autoconf -*-
2 # Parameterized macros.
3 # Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
4 # Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 # As a special exception, the Free Software Foundation gives unlimited
22 # permission to copy, distribute and modify the configure scripts that
23 # are the output of Autoconf. You need not follow the terms of the GNU
24 # General Public License when using or distributing such scripts, even
25 # though portions of the text of Autoconf appear in them. The GNU
26 # General Public License (GPL) does govern all other use of the material
27 # that constitutes the Autoconf program.
29 # Certain portions of the Autoconf source text are designed to be copied
30 # (in certain cases, depending on the input) into the output of
31 # Autoconf. We call these the "data" portions. The rest of the Autoconf
32 # source text consists of comments plus executable code that decides which
33 # of the data portions to output in any given case. We call these
34 # comments and executable code the "non-data" portions. Autoconf never
35 # copies any of the non-data portions into its output.
37 # This special exception to the GPL applies to versions of Autoconf
38 # released by the Free Software Foundation. When you make and
39 # distribute a modified version of Autoconf, you may extend this special
40 # exception to the GPL to apply to your modified version as well, *unless*
41 # your modified version has the potential to copy into its output some
42 # of the text that was the non-data portion of the version that you started
43 # with. (In other words, unless your change moves or copies text from
44 # the non-data portions to the data portions.) If your modification has
45 # such potential, you must delete any notice of this special exception
46 # to the GPL from your modified version.
48 # Written by David MacKenzie, with help from
49 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
50 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
53 # Some people depend upon sinclude, disabled by libm4.
54 define([sinclude], [builtin([sinclude], $@)])
56 ## ---------------- ##
58 ## ---------------- ##
61 # We heavily use m4's diversions both for the initializations and for
62 # required macros (see AC_REQUIRE), because in both cases we have to
63 # issue high in `configure' something which is discovered late.
65 # KILL is only used to suppress output.
67 # The layers of `configure'. We let m4 undivert them by itself, when
68 # it reaches the end of `configure.in'.
71 # AC_REQUIRE'd #! /bin/sh line
75 # early initializations (defaults)
77 # initialization code, option handling loop.
80 # Handling `configure --help'.
82 # Help msg for AC_CANONICAL_*
84 # Help msg from AC_ARG_ENABLE.
86 # Help msg from AC_ARG_WITH.
88 # Help msg from AC_ARG_VAR.
90 # Tail of the handling of --help.
93 # Copyright notice for --version.
95 # Tail of the handling of --version.
98 # Tail of initialization code.
101 # the tests and output code
104 # This diversion is used by the AC_DEFUN/AC_REQUIRE machinery. It is
105 # important to keep room before PREPARE because for each nested
106 # AC_REQUIRE we use an additional diversion (i.e., two AC_REQUIREs
107 # will use PREPARE - 2. More than 3 levels has never seemed to be
112 # AC_REQUIRE'd code, 2 level deep
114 # AC_REQUIRE'd code, 1 level deep
116 # AC_DEFUN'd macros are elaborated here.
119 # _AC_DIVERT(DIVERSION-NAME)
120 # --------------------------
121 # Convert a diversion name into its number. Otherwise, return
122 # DIVERSION-NAME which is supposed to be an actual diversion number.
123 # Of course it would be nicer to use m4_case here, instead of zillions
124 # of little macros, but it then takes twice longer to run `autoconf'!
125 define([_AC_DIVERT(KILL)], -1)
127 define([_AC_DIVERT(BINSH)], 0)
128 define([_AC_DIVERT(NOTICE)], 1)
129 define([_AC_DIVERT(DEFAULTS)], 2)
130 define([_AC_DIVERT(INIT_PARSE_ARGS)], 3)
132 define([_AC_DIVERT(HELP_BEGIN)], 10)
133 define([_AC_DIVERT(HELP_CANON)], 11)
134 define([_AC_DIVERT(HELP_ENABLE)], 12)
135 define([_AC_DIVERT(HELP_WITH)], 13)
136 define([_AC_DIVERT(HELP_VAR)], 14)
137 define([_AC_DIVERT(HELP_END)], 15)
139 define([_AC_DIVERT(VERSION_BEGIN)], 20)
140 define([_AC_DIVERT(VERSION_END)], 21)
142 define([_AC_DIVERT(INIT_PREPARE)], 30)
144 define([_AC_DIVERT(BODY)], 40)
146 define([_AC_DIVERT(PREPARE)], 100)
149 [ifdef([_AC_DIVERT($1)],
150 [indir([_AC_DIVERT($1)])],
154 # AC_DIVERT_PUSH(DIVERSION-NAME)
155 # ------------------------------
156 # Change the diversion stream to DIVERSION-NAME, while stacking old values.
157 define([AC_DIVERT_PUSH],
158 [pushdef([_AC_DIVERT_DIVERSION], _AC_DIVERT([$1]))dnl
159 divert(_AC_DIVERT_DIVERSION)dnl
165 # Change the diversion stream to its previous value, unstacking it.
166 define([AC_DIVERT_POP],
167 [popdef([_AC_DIVERT_DIVERSION])dnl
168 ifndef([_AC_DIVERT_DIVERSION], [AC_FATAL([too many AC_DIVERT_POP])])dnl
169 divert(_AC_DIVERT_DIVERSION)dnl
173 # AC_DIVERT(DIVERSION-NAME, CONTENT)
174 # ----------------------------------
175 # Output CONTENT into DIVERSION-NAME (which may be a number actually).
176 # An end of line is appended for free to CONTENT.
178 [AC_DIVERT_PUSH([$1])dnl
184 # Initialize the diversion setup.
185 define([_AC_DIVERT_DIVERSION], _AC_DIVERT([BODY]))
186 # Throw away output until AC_INIT is called.
187 pushdef([_AC_DIVERT_DIVERSION], _AC_DIVERT([KILL]))
191 ## ------------------------------- ##
192 ## Defining macros in autoconf::. ##
193 ## ------------------------------- ##
195 # `AC_DEFUN' is basically `define' but it equips the macro with the
196 # needed machinery for `AC_REQUIRE'. A macro must be AC_DEFUN'd if
197 # either it is AC_REQUIRE'd, or it AC_REQUIRE's.
199 # Of course AC_DEFUN AC_PROVIDE's the macro, so that a macro which has
200 # been expanded is not expanded again when AC_REQUIRE'd, but the
201 # difficult part is the proper expansion of macros when they are
204 # The implementation is based on two ideas, (i) using diversions to
205 # prepare the expansion of the macro and its dependencies (by François
206 # Pinard), and (ii) expand the most recently AC_REQUIRE'd macros _after_
207 # the previous macros (by Axel Thimm).
210 # The first idea: why using diversions?
211 # -------------------------------------
213 # When a macro requires another, the other macro is expanded in new
214 # diversion, PREPARE. When the outer macro is fully expanded, we first
215 # undivert the most nested diversions (PREPARE - 1...), and finally
216 # undivert PREPARE. To understand why we need several diversions,
217 # consider the following example:
219 # | AC_DEFUN([TEST1], [Test...REQUIRE([TEST2])1])
220 # | AC_DEFUN([TEST2], [Test...REQUIRE([TEST3])2])
221 # | AC_DEFUN([TEST3], [Test...3])
223 # Because AC_REQUIRE is not required to be first in the outer macros, we
224 # must keep the expansions of the various level of AC_REQUIRE separated.
225 # Right before executing the epilogue of TEST1, we have:
227 # PREPARE - 2: Test...3
228 # PREPARE - 1: Test...2
232 # Finally the epilogue of TEST1 undiverts PREPARE - 2, PREPARE - 1, and
233 # PREPARE into the regular flow, BODY.
238 # BODY: Test...3; Test...2; Test...1
240 # (The semicolons are here for clarification, but of course are not
241 # emitted.) This is what Autoconf 2.0 (I think) to 2.13 (I'm sure)
245 # The second idea: first required first out
246 # -----------------------------------------
248 # The natural implementation of the idea above is buggy and produces
249 # very surprising results in some situations. Let's consider the
250 # following example to explain the bug:
252 # | AC_DEFUN([TEST1], [REQUIRE([TEST2a])REQUIRE([TEST2b])])
253 # | AC_DEFUN([TEST2a], [])
254 # | AC_DEFUN([TEST2b], [REQUIRE([TEST3])])
255 # | AC_DEFUN([TEST3], [REQUIRE([TEST2a])])
260 # The dependencies between the macros are:
263 # / \ is AC_REQUIRE'd by
264 # / \ left -------------------- right
267 # If you strictly apply the rules given in the previous section you get:
270 # PREPARE - 1: TEST2a; TEST2b
274 # (TEST2a, although required by TEST3 is not expanded in PREPARE - 3
275 # because is has already been expanded before in PREPARE - 1, so it has
276 # been AC_PROVIDE'd, so it is not expanded again) so when you undivert
277 # the stack of diversions, you get:
282 # BODY: TEST3; TEST2a; TEST2b; TEST1
284 # i.e., TEST2a is expanded after TEST3 although the latter required the
287 # Starting from 2.50, uses an implementation provided by Axel Thimm.
288 # The idea is simple: the order in which macros are emitted must be the
289 # same as the one in which macro are expanded. (The bug above can
290 # indeed be described as: a macro has been AC_PROVIDE'd, but it is
291 # emitted after: the lack of correlation between emission and expansion
294 # How to do that? You keeping the stack of diversions to elaborate the
295 # macros, but each time a macro is fully expanded, emit it immediately.
297 # In the example above, when TEST2a is expanded, but it's epilogue is
298 # not run yet, you have:
301 # PREPARE - 1: TEST2a
302 # PREPARE: Elaboration of TEST1
305 # The epilogue of TEST2a emits it immediately:
309 # PREPARE: Elaboration of TEST1
312 # TEST2b then requires TEST3, so right before the epilogue of TEST3, you
316 # PREPARE - 1: Elaboration of TEST2b
317 # PREPARE: Elaboration of TEST1
320 # The epilogue of TEST3 emits it:
323 # PREPARE - 1: Elaboration of TEST2b
324 # PREPARE: Elaboration of TEST1
325 # BODY: TEST2a; TEST3
327 # TEST2b is now completely expanded, and emitted:
331 # PREPARE: Elaboration of TEST1
332 # BODY: TEST2a; TEST3; TEST2b
334 # and finally, TEST1 is finished and emitted:
339 # BODY: TEST2a; TEST3; TEST2b: TEST1
341 # The idea, is simple, but the implementation is a bit evolved. If you
342 # are like me, you will want to see the actual functioning of this
343 # implementation to be convinced. The next section gives the full
347 # The Axel Thimm implementation at work
348 # -------------------------------------
350 # We consider the macros above, and this configure.in:
355 # You should keep the definitions of _AC_DEFUN_PRO, _AC_DEFUN_EPI, and
356 # AC_REQUIRE at hand to follow the steps.
358 # This implements tries not to assume that of the current diversion is
359 # BODY, so as soon as a macro (AC_DEFUN'd) is expanded, we first
360 # record the current diversion under the name _AC_DIVERT_DUMP (denoted
361 # DUMP below for short). This introduces an important difference with
362 # the previous versions of Autoconf: you cannot use AC_REQUIRE if you
363 # were not inside an AC_DEFUN'd macro, and especially, you cannot
364 # AC_REQUIRE directly from the top level.
366 # We have not tried to simulate the old behavior (better yet, we
367 # diagnose it), because it is too dangerous: a macro AC_REQUIRE'd from
368 # the top level is expanded before the body of `configure', i.e., before
369 # any other test was run. I let you imagine the result of requiring
370 # AC_STDC_HEADERS for instance, before AC_PROG_CC was actually run....
372 # After AC_INIT was run, the current diversion is BODY.
375 # diversion stack: BODY |-
377 # * TEST1 is expanded
378 # The prologue of TEST1 sets AC_DIVERSION_DUMP, which is the diversion
379 # where the current elaboration will be dumped, to the current
380 # diversion. It also AC_DIVERT_PUSH to PREPARE, where the full
381 # expansion of TEST1 and its dependencies will be elaborated.
384 # diversions: PREPARE, BODY |-
386 # * TEST1 requires TEST2a: prologue
387 # AC_REQUIRE AC_DIVERT_PUSHes another temporary diversion PREPARE - 1 (in
388 # fact, the diversion whose number is one less than the current
389 # diversion), and expands TEST2a in there.
392 # diversions: PREPARE-1, PREPARE, BODY |-
394 # * TEST2a is expanded.
395 # Its prologue pushes the current diversion again.
398 # diversions: PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
399 # It is expanded in PREPARE - 1, and PREPARE - 1 is popped by the epilogue
403 # PREPARE - 1: TEST2a
404 # diversions: PREPARE - 1, PREPARE, BODY |-
406 # * TEST1 requires TEST2a: epilogue
407 # The content of the current diversion is appended to DUMP (and removed
408 # from the current diversion). A diversion is popped.
411 # diversions: PREPARE, BODY |-
413 # * TEST1 requires TEST2b: prologue
414 # AC_REQUIRE pushes PREPARE - 1 and expands TEST2b.
417 # diversions: PREPARE - 1, PREPARE, BODY |-
419 # * TEST2b is expanded.
420 # Its prologue pushes the current diversion again.
423 # diversions: PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
424 # The body is expanded here.
426 # * TEST2b requires TEST3: prologue
427 # AC_REQUIRE pushes PREPARE - 2 and expands TEST3.
430 # diversions: PREPARE - 2, PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
432 # * TEST3 is expanded.
433 # Its prologue pushes the current diversion again.
436 # diversions: PREPARE-2, PREPARE-2, PREPARE-1, PREPARE-1, PREPARE, BODY |-
437 # TEST3 requires TEST2a, but TEST2a has already been AC_PROVIDE'd, so
438 # nothing happens. It's body is expanded here, and its epilogue pops a
443 # diversions: PREPARE - 2, PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
445 # * TEST2b requires TEST3: epilogue
446 # The current diversion is appended to DUMP, and a diversion is popped.
448 # BODY: TEST2a; TEST3
449 # diversions: PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
450 # The content of TEST2b is expanded here.
452 # BODY: TEST2a; TEST3
453 # PREPARE - 1: TEST2b,
454 # diversions: PREPARE - 1, PREPARE - 1, PREPARE, BODY |-
455 # The epilogue of TEST2b pops a diversion.
457 # BODY: TEST2a; TEST3
458 # PREPARE - 1: TEST2b,
459 # diversions: PREPARE - 1, PREPARE, BODY |-
461 # * TEST1 requires TEST2b: epilogue
462 # The current diversion is appended to DUMP, and a diversion is popped.
464 # BODY: TEST2a; TEST3; TEST2b
465 # diversions: PREPARE, BODY |-
467 # * TEST1 is expanded: epilogue
468 # TEST1's own content is in PREPARE, and it's epilogue pops a diversion.
470 # BODY: TEST2a; TEST3; TEST2b
472 # diversions: BODY |-
473 # Here, the epilogue of TEST1 notices the elaboration is done because
474 # DUMP and the current diversion are the same, it then undiverts
475 # PREPARE by hand, and undefines DUMP.
477 # BODY: TEST2a; TEST3; TEST2b; TEST1
478 # diversions: BODY |-
481 # _AC_DEFUN_PRO(MACRO-NAME)
482 # -------------------------
483 # The prologue for Autoconf macros.
484 define([_AC_DEFUN_PRO],
486 ifdef([_AC_DIVERT_DUMP],
487 [AC_DIVERT_PUSH(defn([_AC_DIVERT_DIVERSION]))],
488 [define([_AC_DIVERT_DUMP], defn([_AC_DIVERT_DIVERSION]))dnl
489 AC_DIVERT_PUSH([PREPARE])])dnl
493 # _AC_DEFUN_EPI(MACRO-NAME)
494 # -------------------------
495 # The Epilogue for Autoconf macros. MACRO-NAME only helps tracing
497 define([_AC_DEFUN_EPI],
499 ifelse(_AC_DIVERT_DUMP, _AC_DIVERT_DIVERSION,
500 [undivert(_AC_DIVERT([PREPARE]))dnl
501 undefine([_AC_DIVERT_DUMP])])dnl
505 # AC_DEFUN(NAME, EXPANSION)
506 # -------------------------
508 # Define a macro which automatically provides itself. Add machinery
509 # so the macro automatically switches expansion to the diversion
510 # stack if it is not already using it. In this case, once finished,
511 # it will bring back all the code accumulated in the diversion stack.
512 # This, combined with AC_REQUIRE, achieves the topological ordering of
513 # macros. We don't use this macro to define some frequently called
514 # macros that are not involved in ordering constraints, to save m4
517 [define([$1], [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])
520 # AC_DEFUN_ONCE(NAME, EXPANSION)
521 # ------------------------------
522 # As AC_DEFUN, but issues the EXPANSION only once, and warns if used
524 define([AC_DEFUN_ONCE],
526 [AC_PROVIDE_IFELSE([$1],
527 [AC_DIAGNOSE([syntax], [$1 invoked multiple times])],
528 [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])])
531 # AC_DEFUNCT(NAME, COMMENT)
532 # -------------------------
533 # Declare the macro NAME no longer exists, and must not be used.
535 [define([$1], [AC_FATAL([$1] is defunct[$2])])])
538 # AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION])
539 # ------------------------------------------
540 define([AC_OBSOLETE],
541 [AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
547 ## ----------------------------- ##
548 ## Dependencies between macros. ##
549 ## ----------------------------- ##
552 # AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
553 # ---------------------------------------------
555 [AC_PROVIDE_IFELSE([$2], [AC_DIAGNOSE([syntax], [$2 was called before $1])])])
558 # AC_REQUIRE(MACRO-NAME)
559 # ----------------------
560 # If MACRO-NAME has never been expanded, expand it *before* the current
561 # macro expansion. Once expanded, emit it in _AC_DIVERT_DUMP.
563 [ifndef([_AC_DIVERT_DUMP],
564 [AC_FATAL([$0: cannot be used out of an AC_DEFUN'd macro])])dnl
565 AC_PROVIDE_IFELSE([$1],
567 [AC_DIVERT_PUSH(m4_eval(_AC_DIVERT_DIVERSION - 1))dnl
569 divert(_AC_DIVERT_DUMP)undivert(_AC_DIVERT_DIVERSION)dnl
571 AC_PROVIDE_IFELSE([$1],
573 [AC_DIAGNOSE([syntax],
574 [$1 is AC_REQUIRE'd but is not AC_DEFUN'd])])dnl
578 # AC_EXPAND_ONCE(TEXT)
579 # --------------------
580 # If TEXT has never been expanded, expand it *here*.
581 define([AC_EXPAND_ONCE],
582 [AC_PROVIDE_IFELSE([$1],
584 [AC_PROVIDE([$1])[]$1])])
587 # AC_PROVIDE(MACRO-NAME)
588 # ----------------------
590 [define([AC_PROVIDE_$1])])
593 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
594 # -----------------------------------------------------------
595 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
596 # The purpose of this macro is to provide the user with a means to
597 # check macros which are provided without letting her know how the
598 # information is coded.
599 define([AC_PROVIDE_IFELSE],
600 [ifdef([AC_PROVIDE_$1],
606 ## --------------------------------- ##
607 ## Defining macros in autoupdate::. ##
608 ## --------------------------------- ##
611 # AU_DEFINE(NAME, GLUE-CODE, [MESSAGE])
612 # -------------------------------------
614 # Declare `autoupdate::NAME' to be `GLUE-CODE', with all the needed
615 # wrapping actions required by `autoupdate'.
616 # We do not define anything in `autoconf::'.
618 [AC_DEFUN([$1], [$2])])
621 # AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
622 # -----------------------------------
623 # Declare that the macro NAME is now obsoleted, and should be replaced
624 # by NEW-CODE. Tell the user she should run autoupdate, and include
625 # the additional MESSAGE.
627 # Also define NAME as a macro which code is NEW-CODE.
629 # This allows to share the same code for both supporting obsoleted macros,
630 # and to update a configure.in.
631 # See `acobsolete.m4' for a longer description.
634 [AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
635 You should run autoupdate.])dnl
642 ## ------------------------- ##
643 ## Interface to autoheader. ##
644 ## ------------------------- ##
647 # AH_OUTPUT(KEY, TEXT)
648 # --------------------
649 # Pass TEXT to autoheader.
650 # This macro is `read' only via `autoconf --trace', it outputs nothing.
651 define([AH_OUTPUT], [])
654 # AH_VERBATIM(KEY, TEMPLATE)
655 # --------------------------
656 # If KEY is direct (i.e., no indirection such as in KEY=$my_func which
657 # may occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader
658 # TEMPLATE associated to the KEY. Otherwise, do nothing. TEMPLATE is
659 # output as is, with no formating.
660 define([AH_VERBATIM],
661 [AC_VAR_IF_INDIR([$1],,
662 [AH_OUTPUT([$1], _AC_SH_QUOTE([[$2]]))])
666 # AH_TEMPLATE(KEY, DESCRIPTION)
667 # -----------------------------
668 # Issue an autoheader template for KEY, i.e., a comment composed of
669 # DESCRIPTION (properly wrapped), and then #undef KEY.
670 define([AH_TEMPLATE],
672 m4_wrap([$2 */], [ ], [/* ])[
678 # Output TEXT at the top of `config.h.in'.
680 [define([_AH_COUNTER], incr(_AH_COUNTER))dnl
681 AH_VERBATIM([0000]_AH_COUNTER, [$1])])
686 # Output TEXT at the bottom of `config.h.in'.
688 [define([_AH_COUNTER], incr(_AH_COUNTER))dnl
689 AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
692 define([_AH_COUNTER], [0])
695 ## --------------------- ##
696 ## Some /bin/sh idioms. ##
697 ## --------------------- ##
700 # AC_SHELL_IFELSE(TEST, [IF-TRUE], [IF-FALSE])
701 # --------------------------------------------
708 # with simplifications is IF-TRUE and/or IF-FALSE is empty.
709 define([AC_SHELL_IFELSE],
722 # _AC_SHELL_TMPDIR(PREFIX)
723 # ----------------------
724 # Create as safely as possible a temporary directory which name is
725 # inspired by PREFIX (should be 2-4 chars max), and set trap
726 # mechanisms to remove it.
727 define([_AC_SHELL_TMPDIR],
728 [# Create a temporary directory, and hook for its removal unless debugging.
731 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
732 trap 'exit $?' 1 2 13 15
735 # Create a (secure) tmp directory for tmp files.
738 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/$1XXXXXX") 2>/dev/null` &&
742 tmp=$TMPDIR/$1$$-$RANDOM && (umask 077 && mkdir $tmp)
745 echo "$me: cannot create a temporary directory in $TMPDIR" >&2
751 # AC_SHELL_UNSETENV(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])
752 # -----------------------------------------------------------
753 # Try to unset the env VAR, otherwise set it to
754 # VALUE-IF-UNSET-NOT-SUPPORTED. `ac_unset' must have been computed.
755 define([AC_SHELL_UNSET],
756 [$ac_unset $1 || test "${$1+set}" != set || $1=$2 && export $1])
759 ## --------------------------------------------------- ##
760 ## Common m4/sh handling of variables (indirections). ##
761 ## --------------------------------------------------- ##
764 # The purpose of this section is to provide a uniform API for
765 # reading/setting sh variables with or without indirection.
766 # Typically, one can write
767 # AC_VAR_SET(var, val)
769 # AC_VAR_SET(ac_$var, val)
770 # and expect the right thing to happen.
772 # AC_VAR_IF_INDIR(EXPRESSION, IF-INDIR, IF-NOT-INDIR)
773 # ---------------------------------------------------
774 # If EXPRESSION has shell indirections ($var or `expr`), expand
775 # IF-INDIR, else IF-NOT-INDIR.
776 define([AC_VAR_IF_INDIR],
777 [ifelse(regexp([$1], [[`$]]),
781 # AC_VAR_SET(VARIABLE, VALUE)
782 # ---------------------------
783 # Set the VALUE of the shell VARIABLE.
784 # If the variable contains indirections (e.g. `ac_cv_func_$ac_func')
785 # perform whenever possible at m4 level, otherwise sh level.
787 [AC_VAR_IF_INDIR([$1],
792 # AC_VAR_GET(VARIABLE)
793 # --------------------
794 # Get the value of the shell VARIABLE.
795 # Evaluates to $VARIABLE if there are no indirection in VARIABLE,
796 # else into the appropriate `eval' sequence.
798 [AC_VAR_IF_INDIR([$1],
799 [`eval echo '${'patsubst($1, [[\\`]], [\\\&])'}'`],
803 # AC_VAR_TEST_SET(VARIABLE)
804 # -------------------------
805 # Expands into the `test' expression which is true if VARIABLE
806 # is set. Polymorphic. Should be dnl'ed.
807 define([AC_VAR_TEST_SET],
808 [AC_VAR_IF_INDIR([$1],
809 [eval "test \"\${$1+set}\" = set"],
810 [test "${$1+set}" = set])])
814 # AC_VAR_IF_SET(VARIABLE, IF-TRUE, IF-FALSE)
815 # ------------------------------------------
816 # Implement a shell `if-then-else' depending whether VARIABLE is set
817 # or not. Polymorphic.
818 define([AC_VAR_IF_SET],
819 [AC_SHELL_IFELSE([AC_VAR_TEST_SET([$1])], [$2], [$3])])
822 # AC_VAR_PUSHDEF and AC_VAR_POPDEF
823 # --------------------------------
826 # Sometimes we may have to handle literals (e.g. `stdlib.h'), while at
827 # other moments, the same code may have to get the value from a
828 # variable (e.g., `ac_header'). To have a uniform handling of both
829 # cases, when a new value is about to be processed, declare a local
832 # AC_VAR_PUSHDEF([header], [ac_cv_header_$1])
834 # and then in the body of the macro, use `header' as is. It is of
835 # first importance to use `AC_VAR_*' to access this variable. Don't
836 # quote its name: it must be used right away by m4.
838 # If the value `$1' was a literal (e.g. `stdlib.h'), then `header' is
839 # in fact the value `ac_cv_header_stdlib_h'. If `$1' was indirect,
840 # then `header's value in m4 is in fact `$ac_header', the shell
841 # variable that holds all of the magic to get the expansion right.
843 # At the end of the block, free the variable with
845 # AC_VAR_POPDEF([header])
848 # AC_VAR_PUSHDEF(VARNAME, VALUE)
849 # ------------------------------
850 # Define the m4 macro VARNAME to an accessor to the shell variable
851 # named VALUE. VALUE does not need to be a valid shell variable name:
852 # the transliteration is handled here. To be dnl'ed.
853 define([AC_VAR_PUSHDEF],
854 [AC_VAR_IF_INDIR([$2],
856 pushdef([$1], [$ac_[$1]])],
857 [pushdef([$1], [AC_TR_SH($2)])])])
860 # AC_VAR_POPDEF(VARNAME)
861 # ----------------------
862 # Free the shell variable accessor VARNAME. To be dnl'ed.
863 define([AC_VAR_POPDEF],
868 ## ------------------------------------ ##
869 ## Common m4/sh character translation. ##
870 ## ------------------------------------ ##
872 # The point of this section is to provide high level functions
873 # comparable to m4's `translit' primitive, but m4:sh polymorphic.
874 # Transliteration of literal strings should be handled by m4, while
875 # shell variables' content will be translated at runtime (tr or sed).
877 # AC_TR_CPP(EXPRESSION)
878 # ---------------------
879 # Map EXPRESSION to an upper case string which is valid as rhs for a
880 # `#define'. sh/m4 polymorphic. Make sure to update the definition
881 # of `$ac_tr_cpp' if you change this.
883 [AC_VAR_IF_INDIR([$1],
884 [`echo "$1" | $ac_tr_cpp`],
885 [patsubst(translit([[$1]],
886 [*abcdefghijklmnopqrstuvwxyz],
887 [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
888 [[^A-Z0-9_]], [_])])])
891 # AC_TR_SH(EXPRESSION)
892 # --------------------
893 # Transform EXPRESSION into a valid shell variable name.
895 # Make sure to update the definition of `$ac_tr_sh' if you change this.
897 [AC_VAR_IF_INDIR([$1],
898 [`echo "$1" | $ac_tr_sh`],
899 [patsubst(translit([[$1]], [*+], [pp]),
900 [[^a-zA-Z0-9_]], [_])])])
904 ## ----------------------------- ##
905 ## Implementing Autoconf loops. ##
906 ## ----------------------------- ##
909 # AC_FOREACH(VARIABLE, LIST, EXPRESSION)
910 # --------------------------------------
912 # Compute EXPRESSION assigning to VARIABLE each value of the LIST.
913 # LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2
914 # ... item_n ': white spaces are separators, and leading and trailing
915 # spaces are meaningless.
917 # This macro is robust to active symbols:
918 # AC_FOREACH([Var], [ active
921 # => -active--b--active-end
923 [m4_foreach([$1], m4_split(m4_strip(m4_join([$2]))), [$3])])
928 ## ----------------------------------- ##
929 ## Helping macros to display strings. ##
930 ## ----------------------------------- ##
933 # AC_HELP_STRING(LHS, RHS, [COLUMN])
934 # ----------------------------------
936 # Format an Autoconf macro's help string so that it looks pretty when
937 # the user executes "configure --help". This macro takes three
938 # arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
939 # the COLUMN which is a string of white spaces which leads to the
940 # the RHS column (default: 26 white spaces).
942 # The resulting string is suitable for use in other macros that require
943 # a help string (e.g. AC_ARG_WITH).
945 # Here is the sample string from the Autoconf manual (Node: External
946 # Software) which shows the proper spacing for help strings.
948 # --with-readline support fancy command line editing
951 # | column 2 column 26
955 # A help string is made up of a "left hand side" (LHS) and a "right
956 # hand side" (RHS). In the example above, the LHS is
957 # "--with-readline", while the RHS is "support fancy command line
960 # If the LHS extends past column 24, then the LHS is terminated with a
961 # newline so that the RHS is on a line of its own beginning in column
964 # Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
965 # then the AC_HELP_STRING macro would expand into:
968 # --with-readline-blah-blah-blah
969 # ^ ^ support fancy command line editing
974 define([AC_HELP_STRING],
975 [pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
976 pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
977 m4_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
978 popdef([AC_Prefix_Format])dnl
979 popdef([AC_Prefix])dnl
985 ## ---------------------------------------------- ##
986 ## Information on the package being Autoconf'ed. ##
987 ## ---------------------------------------------- ##
990 # It is suggested that the macros in this section appear before
991 # AC_INIT in `configure.in'. Nevertheless, this is just stylistic,
992 # and from the implementation point of, AC_INIT *must* be expanded
993 # beforehand: it puts data in diversions which must appear before the
994 # data provided by the macros of this section.
996 # The solution is to require AC_INIT in each of these macros. AC_INIT
997 # has the needed magic so that it can't be expanded twice.
1001 # _AC_INIT_PACKAGE(PACKAGE, VERSION, [BUG-REPORT])
1002 # ------------------------------------------------
1003 define([_AC_INIT_PACKAGE],
1004 [define([AC_PACKAGE_NAME], [$1])dnl
1005 define([AC_PACKAGE_VERSION], [$2])dnl
1006 define([AC_PACKAGE_STRING], [$1 $2])dnl
1007 define([AC_PACKAGE_BUGREPORT], [$3])dnl
1011 # AC_COPYRIGHT(TEXT)
1012 # ------------------
1013 # Append Copyright information in the top of `configure'. TEXT is
1014 # evaluated once, hence TEXT can use macros. Note that we do not
1015 # prepend `# ' but `@%:@ ', since m4 does not evaluate the comments.
1016 # Had we used `# ', the Copyright sent in the beginning of `configure'
1017 # would have not been evaluated. Another solution, a bit fragile,
1018 # would have be to use m4_quote to force an evaluation:
1020 # patsubst(m4_quote($1), [^], [# ])
1021 AC_DEFUN([AC_COPYRIGHT],
1022 [AC_DIVERT([NOTICE],
1024 $1], [^], [@%:@ ])])dnl
1025 AC_DIVERT([VERSION_BEGIN],
1028 ])# _AC_INIT_COPYRIGHT
1031 # AC_REVISION(REVISION-INFO)
1032 # --------------------------
1033 # The quote in the comment below is just to cope with font-lock-mode
1034 # which sees the opening of a string.
1035 AC_DEFUN([AC_REVISION],
1036 [AC_REQUIRE([AC_INIT])dnl
1037 AC_DIVERT([BINSH], [@%:@ From configure.in translit([$1], $")])dnl "
1043 ## ---------------------------------------- ##
1044 ## Requirements over the Autoconf version. ##
1045 ## ---------------------------------------- ##
1048 # _AC_VERSION_UNLETTER(VERSION)
1049 # -----------------------------
1050 # Normalize beta version numbers with letters to numbers only for comparison.
1052 # Nl -> (N+1).-1.(l#)
1054 #i.e., 2.14a -> 2.15.-1.1, 2.14b -> 2.15.-1.2, etc.
1055 # This macro is absolutely not robust to active macro, it expects
1056 # reasonable version numbers and is valid up to `z', no double letters.
1057 define([_AC_VERSION_UNLETTER],
1058 [translit(patsubst(patsubst(patsubst([$1],
1059 [\([0-9]+\)\([abcdefghi]\)],
1060 [m4_eval(\1 + 1).-1.\2]),
1061 [\([0-9]+\)\([jklmnopqrs]\)],
1062 [m4_eval(\1 + 1).-1.1\2]),
1063 [\([0-9]+\)\([tuvwxyz]\)],
1064 [m4_eval(\1 + 1).-1.2\2]),
1065 abcdefghijklmnopqrstuvwxyz,
1066 12345678901234567890123456)])
1069 # _AC_VERSION_COMPARE(VERSION-1, VERSION-2)
1070 # -----------------------------------------
1071 # Compare the two version numbers and expand into
1072 # -1 if VERSION-1 < VERSION-2
1075 define([_AC_VERSION_COMPARE],
1076 [m4_list_cmp((m4_split(_AC_VERSION_UNLETTER([$1]), [\.])),
1077 (m4_split(_AC_VERSION_UNLETTER([$2]), [\.])))])
1080 # AC_PREREQ(VERSION)
1081 # ------------------
1082 # Complain and exit if the Autoconf version is less than VERSION.
1084 [ifelse(_AC_VERSION_COMPARE(AC_ACVERSION, [$1]), -1,
1085 [AC_FATAL([Autoconf version $1 or higher is required for this script])])])
1092 ## ---------------- ##
1093 ## Initialization. ##
1094 ## ---------------- ##
1099 # Values which defaults can be set from `configure.in'.
1100 define([_AC_INIT_DEFAULTS],
1101 [AC_DIVERT_PUSH([DEFAULTS])dnl
1106 ac_default_prefix=/usr/local
1110 AC_SUBST(SHELL, ${CONFIG_SHELL-/bin/sh})dnl
1111 # Maximum number of lines to put in a shell here document.
1112 dnl This variable seems obsolete. It should probably be removed, and
1113 dnl only ac_max_sed_lines should be used.
1114 : ${ac_max_here_lines=48}
1115 # Sed expression to map a string onto a valid sh and CPP variable names.
1116 ac_tr_sh='sed -e y%*+%pp%;s%[[^a-zA-Z0-9_]]%_%g'
1117 ac_tr_cpp='sed -e y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[[^A-Z0-9_]]%_%g'
1119 # By default always use an empty string as the executable extension.
1120 # Only change it if the script calls AC_EXEEXT.
1122 # By default assume that objects files use an extension of .o. Only
1123 # change it if the script calls AC_OBJEXT.
1125 # Factoring default headers for most tests.
1126 dnl If ever you change this variable, please keep autoconf.texi in sync.
1127 ac_includes_default="\
1129 #include <sys/types.h>
1131 # include <stdlib.h>
1132 # include <stddef.h>
1135 # include <stdlib.h>
1139 # if !STDC_HEADERS && HAVE_MEMORY_H
1140 # include <memory.h>
1142 # include <string.h>
1145 # include <strings.h>
1149 # include <inttypes.h>
1152 # include <unistd.h>
1155 ])# _AC_INIT_DEFAULTS
1158 # AC_PREFIX_DEFAULT(PREFIX)
1159 # -------------------------
1160 AC_DEFUN([AC_PREFIX_DEFAULT],
1161 [AC_DIVERT([DEFAULTS], [ac_default_prefix=$1])])
1164 # AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
1165 # ---------------------------------------------
1166 # UNIQUE-FILE-IN-SOURCE-DIR is a filename unique to this package,
1167 # relative to the directory that configure is in, which we can look
1168 # for to find out if srcdir is correct.
1169 AC_DEFUN([AC_CONFIG_SRCDIR],
1170 [AC_DIVERT([DEFAULTS], [ac_unique_file="$1"])])
1175 # Compute `srcdir' based on `$ac_unique_file'.
1176 define([_AC_INIT_SRCDIR],
1177 [AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
1179 # Find the source files, if location was not specified.
1180 if test -z "$srcdir"; then
1181 ac_srcdir_defaulted=yes
1182 # Try the directory containing this script, then its parent.
1184 ac_confdir=`echo "$ac_prog" | sed 's%/[[^/][^/]]*$%%'`
1185 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
1187 if test ! -r $srcdir/$ac_unique_file; then
1191 ac_srcdir_defaulted=no
1193 if test ! -r $srcdir/$ac_unique_file; then
1194 if test "$ac_srcdir_defaulted" = yes; then
1195 AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
1197 AC_MSG_ERROR(cannot find sources in $srcdir)
1200 dnl Double slashes in pathnames in object file debugging info
1201 dnl mess up M-x gdb in Emacs.
1202 srcdir=`echo "$srcdir" | sed 's%\([[^/]]\)/*$%\1%'`
1207 # _AC_INIT_PARSE_ARGS
1208 # -------------------
1209 define([_AC_INIT_PARSE_ARGS],
1210 [AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
1212 # Initialize some variables set by options.
1214 ac_init_version=false
1215 # The variables have the same names as the options, with
1216 # dashes changed to underlines.
1217 cache_file=/dev/null
1218 AC_SUBST(exec_prefix, NONE)dnl
1221 AC_SUBST(prefix, NONE)dnl
1224 AC_SUBST(program_transform_name, [s,x,x,])dnl
1231 dnl Installation directory options.
1232 dnl These are left unexpanded so users can "make install exec_prefix=/foo"
1233 dnl and all the variables that are supposed to be based on exec_prefix
1234 dnl by default will actually change.
1235 dnl Use braces instead of parens because sh, perl, etc. also accept them.
1236 AC_SUBST(bindir, '${exec_prefix}/bin')dnl
1237 AC_SUBST(sbindir, '${exec_prefix}/sbin')dnl
1238 AC_SUBST(libexecdir, '${exec_prefix}/libexec')dnl
1239 AC_SUBST(datadir, '${prefix}/share')dnl
1240 AC_SUBST(sysconfdir, '${prefix}/etc')dnl
1241 AC_SUBST(sharedstatedir, '${prefix}/com')dnl
1242 AC_SUBST(localstatedir, '${prefix}/var')dnl
1243 AC_SUBST(libdir, '${exec_prefix}/lib')dnl
1244 AC_SUBST(includedir, '${prefix}/include')dnl
1245 AC_SUBST(oldincludedir, '/usr/include')dnl
1246 AC_SUBST(infodir, '${prefix}/info')dnl
1247 AC_SUBST(mandir, '${prefix}/man')dnl
1252 # If the previous option needs an argument, assign it.
1253 if test -n "$ac_prev"; then
1254 eval "$ac_prev=\$ac_option"
1259 ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'`
1261 # Accept the important Cygnus configure options, so we can diagnose typos.
1265 -bindir | --bindir | --bindi | --bind | --bin | --bi)
1267 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1268 bindir=$ac_optarg ;;
1270 -build | --build | --buil | --bui | --bu)
1271 ac_prev=build_alias ;;
1272 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
1273 build_alias=$ac_optarg ;;
1275 -cache-file | --cache-file | --cache-fil | --cache-fi \
1276 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1277 ac_prev=cache_file ;;
1278 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1279 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1280 cache_file=$ac_optarg ;;
1282 --config-cache | -C)
1283 cache_file=config.cache ;;
1285 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
1287 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
1289 datadir=$ac_optarg ;;
1291 -disable-* | --disable-*)
1292 ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1293 # Reject names that are not valid shell variable names.
1294 expr "x$ac_feature" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
1295 AC_MSG_ERROR([invalid feature name: $ac_feature])
1296 ac_feature=`echo $ac_feature | sed 's/-/_/g'`
1297 eval "enable_$ac_feature=no" ;;
1299 -enable-* | --enable-*)
1300 ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
1301 # Reject names that are not valid shell variable names.
1302 expr "x$ac_feature" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
1303 AC_MSG_ERROR([invalid feature name: $ac_feature])
1304 ac_feature=`echo $ac_feature | sed 's/-/_/g'`
1306 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
1309 eval "enable_$ac_feature='$ac_optarg'" ;;
1311 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1312 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1313 | --exec | --exe | --ex)
1314 ac_prev=exec_prefix ;;
1315 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1316 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1317 | --exec=* | --exe=* | --ex=*)
1318 exec_prefix=$ac_optarg ;;
1320 -gas | --gas | --ga | --g)
1321 # Obsolete; use --with-gas.
1324 -help | --help | --hel | --he | -h)
1325 ac_init_help=long ;;
1326 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1327 ac_init_help=recursive ;;
1328 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1329 ac_init_help=short ;;
1331 -host | --host | --hos | --ho)
1333 ac_prev=host_alias ;;
1334 -host=* | --host=* | --hos=* | --ho=*)
1336 host_alias=$ac_optarg ;;
1338 -includedir | --includedir | --includedi | --included | --include \
1339 | --includ | --inclu | --incl | --inc)
1340 ac_prev=includedir ;;
1341 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1342 | --includ=* | --inclu=* | --incl=* | --inc=*)
1343 includedir=$ac_optarg ;;
1345 -infodir | --infodir | --infodi | --infod | --info | --inf)
1347 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1348 infodir=$ac_optarg ;;
1350 -libdir | --libdir | --libdi | --libd)
1352 -libdir=* | --libdir=* | --libdi=* | --libd=*)
1353 libdir=$ac_optarg ;;
1355 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1356 | --libexe | --libex | --libe)
1357 ac_prev=libexecdir ;;
1358 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1359 | --libexe=* | --libex=* | --libe=*)
1360 libexecdir=$ac_optarg ;;
1362 -localstatedir | --localstatedir | --localstatedi | --localstated \
1363 | --localstate | --localstat | --localsta | --localst \
1364 | --locals | --local | --loca | --loc | --lo)
1365 ac_prev=localstatedir ;;
1366 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1367 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
1368 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
1369 localstatedir=$ac_optarg ;;
1371 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1373 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1374 mandir=$ac_optarg ;;
1376 -nfp | --nfp | --nf)
1377 # Obsolete; use --without-fp.
1380 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1384 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1385 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1388 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1389 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1390 | --oldin | --oldi | --old | --ol | --o)
1391 ac_prev=oldincludedir ;;
1392 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1393 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1394 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1395 oldincludedir=$ac_optarg ;;
1397 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1399 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1400 prefix=$ac_optarg ;;
1402 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1403 | --program-pre | --program-pr | --program-p)
1404 ac_prev=program_prefix ;;
1405 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1406 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1407 program_prefix=$ac_optarg ;;
1409 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1410 | --program-suf | --program-su | --program-s)
1411 ac_prev=program_suffix ;;
1412 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1413 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1414 program_suffix=$ac_optarg ;;
1416 -program-transform-name | --program-transform-name \
1417 | --program-transform-nam | --program-transform-na \
1418 | --program-transform-n | --program-transform- \
1419 | --program-transform | --program-transfor \
1420 | --program-transfo | --program-transf \
1421 | --program-trans | --program-tran \
1422 | --progr-tra | --program-tr | --program-t)
1423 ac_prev=program_transform_name ;;
1424 -program-transform-name=* | --program-transform-name=* \
1425 | --program-transform-nam=* | --program-transform-na=* \
1426 | --program-transform-n=* | --program-transform-=* \
1427 | --program-transform=* | --program-transfor=* \
1428 | --program-transfo=* | --program-transf=* \
1429 | --program-trans=* | --program-tran=* \
1430 | --progr-tra=* | --program-tr=* | --program-t=*)
1431 program_transform_name=$ac_optarg ;;
1433 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1434 | -silent | --silent | --silen | --sile | --sil)
1437 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1439 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1441 sbindir=$ac_optarg ;;
1443 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1444 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1445 | --sharedst | --shareds | --shared | --share | --shar \
1447 ac_prev=sharedstatedir ;;
1448 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1449 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1450 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1452 sharedstatedir=$ac_optarg ;;
1454 -site | --site | --sit)
1456 -site=* | --site=* | --sit=*)
1459 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1461 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1462 srcdir=$ac_optarg ;;
1464 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1465 | --syscon | --sysco | --sysc | --sys | --sy)
1466 ac_prev=sysconfdir ;;
1467 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1468 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1469 sysconfdir=$ac_optarg ;;
1471 -target | --target | --targe | --targ | --tar | --ta | --t)
1472 ac_prev=target_alias ;;
1473 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1474 target_alias=$ac_optarg ;;
1476 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1479 -version | --version | --versio | --versi | --vers | -V)
1480 ac_init_version=: ;;
1483 ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
1484 # Reject names that are not valid shell variable names.
1485 expr "x$ac_package" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
1486 AC_MSG_ERROR([invalid package name: $ac_package])
1487 ac_package=`echo $ac_package| sed 's/-/_/g'`
1489 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
1492 eval "with_$ac_package='$ac_optarg'" ;;
1494 -without-* | --without-*)
1495 ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1496 # Reject names that are not valid shell variable names.
1497 expr "x$ac_package" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
1498 AC_MSG_ERROR([invalid package name: $ac_package])
1499 ac_package=`echo $ac_package | sed 's/-/_/g'`
1500 eval "with_$ac_package=no" ;;
1503 # Obsolete; use --with-x.
1506 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1507 | --x-incl | --x-inc | --x-in | --x-i)
1508 ac_prev=x_includes ;;
1509 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1510 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1511 x_includes=$ac_optarg ;;
1513 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1514 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1515 ac_prev=x_libraries ;;
1516 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1517 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1518 x_libraries=$ac_optarg ;;
1520 -*) AC_MSG_ERROR([unrecognized option: $ac_option
1521 Try `configure --help' for more information.])
1525 ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
1526 # Reject names that are not valid shell variable names.
1527 expr "x$ac_envvar" : "[.*[^a-zA-Z0-9_]]" >/dev/null &&
1528 AC_MSG_ERROR([invalid variable name: $ac_envvar])
1529 ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
1530 eval "$ac_envvar='$ac_optarg'"
1531 export $ac_envvar ;;
1534 AC_MSG_WARN([you should use --build, --host, --target])
1535 expr "x$ac_option" : "[.*[^a-zA-Z0-9.]]" >/dev/null &&
1536 AC_MSG_WARN([invalid host type: $ac_option])
1537 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1543 if test -n "$ac_prev"; then
1544 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1545 AC_MSG_ERROR(missing argument to $ac_option)
1548 # Be sure to have absolute paths.
1549 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
1550 localstatedir libdir includedir oldincludedir infodir mandir \
1553 eval ac_val=$`echo $ac_var`
1555 [[\\/$]]* | ?:[[\\/]]* ) ;;
1557 *) AC_MSG_ERROR([expected an absolute path for --$ac_var: $ac_val]);;
1561 # There might be people who depend on the old broken behavior: `$host'
1562 # used to hold the argument of --host etc.
1565 target=$target_alias
1568 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1571 ])# _AC_INIT_PARSE_ARGS
1576 # Handle the `configure --help' message.
1577 define([_AC_INIT_HELP],
1578 [AC_DIVERT_PUSH([HELP_BEGIN])dnl
1581 # Report the --help message.
1583 if test "$ac_init_help" = "long"; then
1584 # Omit some internal or obsolete options to make the list less imposing.
1585 # This message is too long to be a string in the A/UX 3.1 sh.
1587 \`configure' configures ifset([AC_PACKAGE_STRING],
1588 [AC_PACKAGE_STRING],
1589 [this package]) to adapt to many kinds of systems.
1591 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
1593 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
1596 Defaults for the options are specified in brackets.
1599 -h, --help display this help and exit
1600 --help=short display options specific to this package
1601 --help=recursive display the short help of all the included packages
1602 -V, --version display version information and exit
1603 -q, --quiet, --silent do not print \`checking...' messages
1604 --cache-file=FILE cache test results in FILE [disabled]
1605 -C, --config-cache alias for \`--cache-file=config.cache'
1606 -n, --no-create do not create output files
1607 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1612 Installation directories:
1613 --prefix=PREFIX install architecture-independent files in PREFIX
1614 [$ac_default_prefix]
1615 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1618 By default, \`make install' will install all the files in
1619 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1620 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1621 for instance \`--prefix=\$HOME'.
1623 For better control, use the options below.
1625 Fine tuning of the installation directories:
1626 --bindir=DIR user executables [EPREFIX/bin]
1627 --sbindir=DIR system admin executables [EPREFIX/sbin]
1628 --libexecdir=DIR program executables [EPREFIX/libexec]
1629 --datadir=DIR read-only architecture-independent data [PREFIX/share]
1630 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1631 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1632 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1633 --libdir=DIR object code libraries [EPREFIX/lib]
1634 --includedir=DIR C header files [PREFIX/include]
1635 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1636 --infodir=DIR info documentation [PREFIX/info]
1637 --mandir=DIR man documentation [PREFIX/man]
1642 dnl The order of the diversions here is
1644 dnl which may be prolongated by extra generic options such as with X or
1645 dnl AC_ARG_PROGRAM. Displayed only in long --help.
1648 dnl Support for cross compilation (--build, --host and --target).
1649 dnl Display only in long --help.
1652 dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
1653 dnl then implements the header of the non generic options.
1660 dnl initialized below, in which we dump the trailer (handling of the
1661 dnl recursion for instance).
1662 AC_DIVERT_PUSH([HELP_ENABLE])dnl
1666 if test -n "$ac_init_help"; then
1667 ifset([AC_PACKAGE_STRING],
1668 [ case $ac_init_help in
1669 short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
1673 AC_DIVERT_PUSH([HELP_END])dnl
1677 if test "$ac_init_help" = "recursive"; then
1678 # If there are subdirs, report their specific --help.
1680 for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
1682 # A "../" for each directory in /$ac_subdir.
1683 ac_dots=`echo $ac_subdir |
1684 sed -e 's%^\./%%;s%[[^/]]$%&/%;s%[[^/]]*/%../%g'`
1687 .) # No --srcdir option. We are building in place.
1688 ac_sub_srcdir=$srcdir ;;
1689 [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
1690 ac_sub_srcdir=$srcdir/$ac_subdir ;;
1692 ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
1695 # Check for guested configure; otherwise get Cygnus style configure.
1696 if test -f $ac_sub_srcdir/configure; then
1698 $SHELL $ac_sub_srcdir/configure --help=recursive
1699 elif test -f $ac_sub_srcdir/configure.in; then
1701 $ac_configure --help
1703 AC_MSG_WARN([no configuration information is in $ac_subdir])
1709 test -n "$ac_init_help" && exit 0
1716 # Handle the `configure --version' message.
1717 define([_AC_INIT_VERSION],
1718 [AC_DIVERT([VERSION_BEGIN],
1719 [if $ac_init_version; then
1721 ifset([AC_PACKAGE_STRING],
1722 [AC_DIVERT([VERSION_BEGIN],
1723 [configure (AC_PACKAGE_STRING) AC_ACVERSION])])
1724 AC_DIVERT([VERSION_END],
1728 ])# _AC_INIT_VERSION
1731 # _AC_INIT_PREPARE_ENVIRONMENT
1732 # ----------------------------
1733 # Tune the behavior of the shell.
1734 define([_AC_INIT_PREPARE_ENVIRONMENT],
1735 [# Be Bourne compatible
1736 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
1739 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
1743 # Support unset when possible.
1744 if (unset FOO) >/dev/null 2>&1; then
1751 AC_SHELL_UNSET([LANG], [C])
1752 AC_SHELL_UNSET([LC_ALL], [C])
1753 AC_SHELL_UNSET([LC_CTYPE], [C])
1754 AC_SHELL_UNSET([LC_MESSAGES], [C])
1757 # We need space, tab and new line, in precisely that order.
1763 AC_SHELL_UNSET([CDPATH], [:])
1769 # Called by AC_INIT to build the preamble of the `configure' scripts.
1770 # 1. Trap and clean up various tmp files.
1771 # 2. Set up the fd and output files
1772 # 3. Remember the options given to `configure' for `config.status --recheck'.
1773 # 4. Ensure a correct environment
1774 # 5. Required macros (cache, default AC_SUBST etc.)
1775 define([_AC_INIT_PREPARE],
1776 [AC_DIVERT_PUSH([INIT_PREPARE])dnl
1777 _AC_INIT_PREPARE_ENVIRONMENT
1779 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1781 # Keep a trace of the command line.
1782 # Strip out --no-create and --no-recursion so they do not pile up.
1783 # Also quote any args containing shell meta-characters.
1789 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1790 | --no-cr | --no-c) ;;
1791 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1792 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
1793 dnl If you change this globbing pattern, test it on an old shell --
1794 dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
1795 [ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
1796 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
1797 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1799 *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
1802 # Get rid of the leading space.
1805 # File descriptor usage:
1808 # 2 errors and warnings
1809 # 3 some systems may open it to /dev/tty
1810 # 4 used on the Kubota Titan
1811 define([AC_FD_MSG], 6)dnl
1812 @%:@ AC_FD_MSG checking for... messages and results
1813 define([AC_FD_LOG], 5)dnl
1814 AU_DEFUN([AC_FD_CC], [AC_FD_LOG])dnl That's how it used to be named.
1815 @%:@ AC_FD_LOG compiler messages saved in config.log
1816 if test "$silent" = yes; then
1817 exec AC_FD_MSG>/dev/null
1821 exec AC_FD_LOG>./config.log
1824 This file contains any messages produced by compilers while
1825 running configure, to aid debugging if configure makes a mistake.
1827 It was created by configure ifset([AC_PACKAGE_STRING],
1828 [(AC_PACKAGE_STRING)]) AC_ACVERSION, executed with
1829 > $[0] $ac_configure_args
1832 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1833 rm -rf conftest* confdefs.h
1834 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
1837 dnl Let the site file select an alternate cache file if it wants to.
1843 dnl Substitute for predefined variables.
1845 AC_SUBST(CPPFLAGS)dnl
1846 AC_SUBST(CXXFLAGS)dnl
1849 AC_SUBST(LDFLAGS)dnl
1852 ])# _AC_INIT_PREPARE
1857 # Include the user macro files, prepare the diversions, and output the
1858 # preamble of the `configure' script.
1860 [AC_DIVERT([BINSH], [@%:@! /bin/sh])
1861 _AC_INIT_DEFAULTS()dnl
1862 AC_DIVERT_POP()dnl to BODY
1868 dnl AC_COPYRIGHT must be called after _AC_INIT_VERSION, since it dumps
1869 dnl into a diversion prepared by _AC_INIT_VERSION.
1871 [# Guess values for system-dependent variables and create Makefiles.
1872 @%:@ Generated by Autoconf AC_ACVERSION.])dnl
1874 [Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
1875 Free Software Foundation, Inc.
1876 This configure script is free software; the Free Software Foundation
1877 gives unlimited permission to copy, distribute and modify it.])dnl
1881 # AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
1882 # ----------------------------------------
1883 # This macro is used only for Autoupdate.
1885 [ifval([$2], [[AC_INIT($@)]],
1888 AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
1892 # AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
1893 # ----------------------------------------
1894 # Wrapper around _AC_INIT which guarantees _AC_INIT is expanded only
1896 # Note that the order is important: first initialize, then set the
1899 [ifval([$2], [_AC_INIT_PACKAGE($@)])dnl
1900 AC_EXPAND_ONCE([_AC_INIT()])dnl
1901 ifval([$2], , [ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1905 ## ----------------------------- ##
1906 ## Selecting optional features. ##
1907 ## ----------------------------- ##
1910 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1911 # ------------------------------------------------------------------------
1912 AC_DEFUN([AC_ARG_ENABLE],
1913 [AC_DIVERT_PUSH([HELP_ENABLE])dnl
1916 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1917 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1921 # Check whether --enable-$1 or --disable-$1 was given.
1922 if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
1923 enableval="[$enable_]patsubst([$1], -, _)"
1932 AU_DEFUN([AC_ENABLE],
1933 [AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])])
1936 ## ------------------------------ ##
1937 ## Working with optional software ##
1938 ## ------------------------------ ##
1942 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
1943 # --------------------------------------------------------------------
1944 AC_DEFUN([AC_ARG_WITH],
1945 [AC_DIVERT_PUSH([HELP_WITH])dnl
1948 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1949 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1953 # Check whether --with-$1 or --without-$1 was given.
1954 if test "[${with_]patsubst([$1], -, _)+set}" = set; then
1955 withval="[$with_]patsubst([$1], -, _)"
1964 [AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])])
1968 ## ----------------------------------------- ##
1969 ## Remembering variables for reconfiguring. ##
1970 ## ----------------------------------------- ##
1974 # AC_ARG_VAR(VARNAME, DOCUMENTATION)
1975 # ----------------------------------
1976 # Register VARNAME as a variable configure should remember, and
1977 # document it in `configure --help'.
1978 AC_DEFUN([AC_ARG_VAR],
1979 [AC_DIVERT_PUSH([HELP_VAR])dnl
1981 Some influent environment variables:
1983 AC_HELP_STRING([$1], [$2], [ ])
1985 dnl Register if set and not yet registered.
1986 dnl If there are envvars given as arguments, they are already set,
1987 dnl therefore they won't be set again, which is the right thing.
1988 case "${$1+set} $ac_configure_args" in
1990 "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";;
1996 ## ---------------------------- ##
1997 ## Transforming program names. ##
1998 ## ---------------------------- ##
2003 # This macro is expanded only once, to avoid that `foo' ends up being
2004 # installed as `ggfoo'.
2005 AC_DEFUN_ONCE([AC_ARG_PROGRAM],
2006 [dnl Document the options.
2007 AC_DIVERT_PUSH([HELP_BEGIN])dnl
2010 --program-prefix=PREFIX prepend PREFIX to installed program names
2011 --program-suffix=SUFFIX append SUFFIX to installed program names
2012 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2014 if test "$program_transform_name" = s,x,x,; then
2015 program_transform_name=
2017 # Double any \ or $. echo might interpret backslashes.
2018 cat <<\EOF >conftestsed
2019 s,\\,\\\\,g; s,\$,$$,g
2021 program_transform_name=`echo $program_transform_name | sed -f conftestsed`
2024 test "$program_prefix" != NONE &&
2025 program_transform_name="s,^,${program_prefix},;$program_transform_name"
2026 # Use a double $ so make ignores it.
2027 test "$program_suffix" != NONE &&
2028 program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
2030 # sed with no file args requires a program.
2031 test -z "$program_transform_name" && program_transform_name="s,x,x,"
2038 ## ------------------------- ##
2039 ## Finding auxiliary files. ##
2040 ## ------------------------- ##
2043 # AC_CONFIG_AUX_DIR(DIR)
2044 # ----------------------
2045 # Find install-sh, config.sub, config.guess, and Cygnus configure
2046 # in directory DIR. These are auxiliary files used in configuration.
2047 # DIR can be either absolute or relative to $srcdir.
2048 AC_DEFUN([AC_CONFIG_AUX_DIR],
2049 [AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])
2052 # AC_CONFIG_AUX_DIR_DEFAULT
2053 # -------------------------
2054 # The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
2055 # There's no need to call this macro explicitly; just AC_REQUIRE it.
2056 AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
2057 [AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])
2060 # AC_CONFIG_AUX_DIRS(DIR ...)
2061 # ---------------------------
2062 # Internal subroutine.
2063 # Search for the configuration auxiliary files in directory list $1.
2064 # We look only for install-sh, so users of AC_PROG_INSTALL
2065 # do not automatically need to distribute the other auxiliary files.
2066 AC_DEFUN([AC_CONFIG_AUX_DIRS],
2068 for ac_dir in $1; do
2069 if test -f $ac_dir/install-sh; then
2071 ac_install_sh="$ac_aux_dir/install-sh -c"
2073 elif test -f $ac_dir/install.sh; then
2075 ac_install_sh="$ac_aux_dir/install.sh -c"
2077 elif test -f $ac_dir/shtool; then
2079 ac_install_sh="$ac_aux_dir/shtool install -c"
2083 if test -z "$ac_aux_dir"; then
2084 AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
2086 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
2087 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
2088 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
2089 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2090 ])# AC_CONFIG_AUX_DIRS
2095 ## ----------------------------------- ##
2096 ## Getting the canonical system type. ##
2097 ## ----------------------------------- ##
2100 # configure --host=HOST --target=TARGET --build=BUILD
2103 # 1. Build defaults to the current host, as determined by config.guess.
2104 # 2. Host defaults to build.
2105 # 3. Target defaults to host.
2108 # _AC_CANONICAL_SPLIT(THING)
2109 # --------------------------
2110 # Generate the variables THING, THING_{alias cpu vendor os}.
2111 define([_AC_CANONICAL_SPLIT],
2112 [AC_SUBST([$1], [$ac_cv_$1])dnl
2113 dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
2115 [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])dnl
2116 AC_SUBST([$1_vendor],
2117 [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])dnl
2119 [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])dnl
2120 ])# _AC_CANONICAL_SPLIT
2123 # AC_CANONICAL_BUILD
2124 # ------------------
2125 AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
2126 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2127 AC_DIVERT([HELP_CANON],
2130 --build=BUILD configure for building on BUILD [guessed]]])dnl
2131 # Make sure we can run config.sub.
2132 $ac_config_sub sun4 >/dev/null 2>&1 ||
2133 AC_MSG_ERROR([cannot run $ac_config_sub])
2135 AC_CACHE_CHECK([build system type], [ac_cv_build],
2136 [ac_cv_build_alias=$build_alias
2137 test -z "$ac_cv_build_alias" &&
2138 ac_cv_build_alias=`$ac_config_guess`
2139 test -z "$ac_cv_build_alias" &&
2140 AC_MSG_ERROR([cannot guess build type; you must specify one])
2141 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
2143 _AC_CANONICAL_SPLIT(build)
2144 ])# AC_CANONICAL_BUILD
2149 AC_DEFUN_ONCE([AC_CANONICAL_HOST],
2150 [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2151 AC_DIVERT([HELP_CANON],
2152 [[ --host=HOST cross-compile to build programs running on HOST [BUILD]]])dnl
2153 AC_CACHE_CHECK([host system type], [ac_cv_host],
2154 [ac_cv_host_alias=$host_alias
2155 test -z "$ac_cv_host_alias" &&
2156 ac_cv_host_alias=$ac_cv_build_alias
2157 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || exit 1
2159 _AC_CANONICAL_SPLIT([host])
2160 ])# AC_CANONICAL_HOST
2163 # AC_CANONICAL_TARGET
2164 # -------------------
2165 AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
2166 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2167 AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
2168 AC_DIVERT([HELP_CANON],
2169 [[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
2170 AC_CACHE_CHECK([target system type], [ac_cv_target],
2171 [dnl Set target_alias.
2172 ac_cv_target_alias=$target_alias
2173 test "x$ac_cv_target_alias" = "x" &&
2174 ac_cv_target_alias=$ac_cv_host_alias
2175 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || exit 1
2177 _AC_CANONICAL_SPLIT([target])
2179 # The aliases save the names the user supplied, while $host etc.
2180 # will get canonicalized.
2181 test -n "$target_alias" &&
2182 test "$program_prefix$program_suffix$program_transform_name" = \
2184 program_prefix=${target_alias}-[]dnl
2185 ])# AC_CANONICAL_TARGET
2188 AU_DEFUN([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
2191 # AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
2192 # --------------------------------------
2193 # If the cache file is inconsistent with the current host,
2194 # target and build system types, execute CMD or print a default
2196 AC_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE],
2197 [AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
2198 AC_MSG_CHECKING([cached system tuple])
2199 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
2200 test x"$ac_cv_host_system_type" != x"$host"; } ||
2201 { test x"${ac_cv_build_system_type+set}" = x"set" &&
2202 test x"$ac_cv_build_system_type" != x"$build"; } ||
2203 { test x"${ac_cv_target_system_type+set}" = x"set" &&
2204 test x"$ac_cv_target_system_type" != x"$target"; }; then
2205 AC_MSG_RESULT([different])
2207 [AC_MSG_ERROR([remove config.cache and re-run configure])])
2211 ac_cv_host_system_type=$host
2212 ac_cv_build_system_type=$build
2213 ac_cv_target_system_type=$target[]dnl
2217 ## ---------------------- ##
2218 ## Caching test results. ##
2219 ## ---------------------- ##
2224 # Look for site or system specific initialization scripts.
2225 define([AC_SITE_LOAD],
2226 [# Prefer explicitly selected file to automatically selected ones.
2227 if test -z "$CONFIG_SITE"; then
2228 if test "x$prefix" != xNONE; then
2229 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
2231 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
2234 for ac_site_file in $CONFIG_SITE; do
2235 if test -r "$ac_site_file"; then
2236 echo "loading site script $ac_site_file"
2245 define([AC_CACHE_LOAD],
2246 [if test -r "$cache_file"; then
2247 test "x$cache_file" != "x/dev/null" && echo "loading cache $cache_file"
2248 dnl Some versions of bash will fail to source /dev/null, so we
2249 dnl avoid doing that.
2250 test -f "$cache_file" && . $cache_file
2252 echo "creating cache $cache_file"
2260 # Dump the cache to stdout. It can be in a pipe (this is a requirement).
2261 define([_AC_CACHE_DUMP],
2262 [# The following way of writing the cache mishandles newlines in values,
2263 # but we know of no workaround that is simple, portable, and efficient.
2264 # So, don't put newlines in cache variables' values.
2265 # Ultrix sh set writes to stderr and can't be redirected directly,
2266 # and sets the high bit in the cache file unless we assign to the vars.
2269 case `(ac_space=' '; set | grep ac_space) 2>&1` in
2271 # `set' does not quote correctly, so add quotes (double-quote substitution
2272 # turns \\\\ into \\, and sed turns \\ into \).
2274 -e "s/'/'\\\\''/g" \
2275 -e ["s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1='\\2'/p"]
2278 # `set' quotes correctly as required by POSIX, so do not add quotes.
2279 sed -n -e '[s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\2/p]'
2289 # Allow a site initialization script to override cache values.
2290 define([AC_CACHE_SAVE],
2291 [cat >confcache <<\EOF
2292 # This file is a shell script that caches the results of configure
2293 # tests run on this system so they can be shared between configure
2294 # scripts and configure runs. It is not useful on other systems.
2295 # If it contains results you don't want to keep, you may remove or edit it.
2297 # By default, configure uses ./config.cache as the cache file,
2298 # creating it if it does not exist already. You can give configure
2299 # the --cache-file=FILE option to use a different cache file; that is
2300 # what configure does when it calls configure scripts in
2301 # subdirectories, so they share the cache.
2302 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2303 # config.status only pays attention to the cache file if you give it the
2304 # --recheck option to rerun configure.
2308 sed -e 's/^\([[^=]]*\)=\(.*\)$/\1=${\1=\2}/' >>confcache
2309 if cmp -s $cache_file confcache; then :; else
2310 if test -w $cache_file; then
2311 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
2312 cat confcache >$cache_file
2314 echo "not updating unwritable cache $cache_file"
2317 rm -f confcache[]dnl
2321 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
2322 # ------------------------------------------
2323 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
2324 # Should be dnl'ed. Try to catch common mistakes.
2325 define([AC_CACHE_VAL],
2326 [ifelse(regexp([$2], [AC_DEFINE]), [-1],
2327 [AC_DIAGNOSE(syntax,
2328 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
2329 [where no actions should be taken])])dnl
2331 [echo $ECHO_N "(cached) $ECHO_C" >&AC_FD_MSG],
2335 # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
2336 # -------------------------------------------
2337 # Do not call this macro with a dnl right behind.
2338 define([AC_CACHE_CHECK],
2339 [AC_MSG_CHECKING([$1])
2340 AC_CACHE_VAL([$2], [$3])dnl
2341 AC_MSG_RESULT_UNQUOTED(AC_VAR_GET([$2]))])
2345 ## ---------------------- ##
2346 ## Defining CPP symbols. ##
2347 ## ---------------------- ##
2350 # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
2351 # -------------------------------------------
2352 # Set VARIABLE to VALUE, verbatim, or 1. Remember the value
2353 # and if VARIABLE is affected the same VALUE, do nothing, else
2354 # die. The third argument is used by autoheader.
2356 [ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
2357 cat >>confdefs.h <<\EOF
2358 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
2364 # AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
2365 # ----------------------------------------------------
2366 # Similar, but perform shell substitutions $ ` \ once on VALUE.
2367 define([AC_DEFINE_UNQUOTED],
2368 [ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
2369 cat >>confdefs.h <<EOF
2370 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
2376 ## -------------------------- ##
2377 ## Setting output variables. ##
2378 ## -------------------------- ##
2381 # _AC_SUBST(VARIABLE, PROGRAM)
2382 # ----------------------------
2383 # If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM
2384 # to `_AC_SUBST_SED_PROGRAM'.
2386 [AC_EXPAND_ONCE([m4_append([_AC_SUBST_SED_PROGRAM],
2392 define([_AC_SUBST_SED_PROGRAM])
2395 # AC_SUBST(VARIABLE, [VALUE])
2396 # ---------------------------
2397 # Create an output variable from a shell VARIABLE. If VALUE is given
2398 # assign it to VARIABLE. Use `""' is you want to set VARIABLE to an
2399 # empty value, not an empty second argument.
2401 # Beware that if you change this macro, you also have to change the
2402 # sed script at the top of _AC_OUTPUT_FILES.
2406 _AC_SUBST([$1], [s%@$1@%[$]$1%;t t])dnl
2410 # AC_SUBST_FILE(VARIABLE)
2411 # -----------------------
2412 # Read the comments of the preceding macro.
2413 define([AC_SUBST_FILE],
2414 [_AC_SUBST([$1], [/@$1@/r [$]$1
2419 ## --------------------------------------- ##
2420 ## Printing messages at autoconf runtime. ##
2421 ## --------------------------------------- ##
2423 # In fact, I think we should promote the use of m4_warn and m4_fatal
2424 # directly. This will also avoid to some people to get it wrong
2425 # between AC_FATAL and AC_MSG_ERROR.
2428 # AC_WARNING_IFELSE(CATEGORY, IF-TRUE, IF-FALSE)
2429 # ----------------------------------------------
2430 # If the CATEGORY of warnings is enabled, expand IF_TRUE otherwise
2431 # IF-FALSE. CATEGORY is enabled iff `AC_WARNING_ENABLE(CATEGORY)' or
2432 # `AC_WARNING_ENABLE(all)' is defined.
2433 define([AC_WARNING_IFELSE],
2434 [ifdef([AC_WARNING_ENABLE($1)], [$2],
2435 [ifdef([AC_WARNING_ENABLE(all)], [$2], [$3])])])
2438 # _AC_DIAGNOSE(MESSAGE)
2439 # ---------------------
2440 # Report MESSAGE as a warning, unless the user requested -W error,
2441 # in which case report a fatal error.
2442 define([_AC_DIAGNOSE],
2443 [ifdef([AC_WARNING_ENABLE(error)],
2448 # AC_DIAGNOSE(CATEGORY, MESSAGE)
2449 # ------------------------------
2450 # Report a MESSAGE to the autoconf user if the CATEGORY of warnings
2451 # is requested (in fact, not disabled).
2452 define([AC_DIAGNOSE],
2453 [AC_WARNING_IFELSE([$1], [_AC_DIAGNOSE([$2])])])
2456 # AC_WARNING(MESSAGE)
2457 # -------------------
2458 # Report a MESSAGE to the user of autoconf if `-W' or `-W all' was
2460 define([AC_WARNING], [AC_DIAGNOSE([], [$1])])
2463 # AC_FATAL(MESSAGE, [EXIT-STATUS])
2464 # --------------------------------
2465 define([AC_FATAL], [m4_fatal([$1], [$2])])
2470 ## ---------------------------------------- ##
2471 ## Printing messages at configure runtime. ##
2472 ## ---------------------------------------- ##
2475 # _AC_SH_QUOTE_IFELSE(STRING, IF-MODERN-QUOTATION, IF-OLD-QUOTATION)
2476 # ------------------------------------------------------------------
2477 # Compatibility glue between the old AC_MSG suite which did not
2478 # quote anything, and the modern suite which quotes the quotes.
2479 # If STRING contains `\\' or `\$', it's modern.
2480 # If STRING contains `\"' or `\`', it's old.
2481 # Otherwise it's modern.
2482 # We use two quotes in the pattern to keep highlighting tools at peace.
2483 define([_AC_SH_QUOTE_IFELSE],
2484 [ifelse(regexp([$1], [\\[\\$]]),
2485 [-1], [ifelse(regexp([$1], [\\[`""]]),
2491 # _AC_SH_QUOTE(STRING)
2492 # --------------------
2493 # If there are quoted (via backslash) backquotes do nothing, else
2494 # backslash all the quotes.
2495 define([_AC_SH_QUOTE],
2496 [_AC_SH_QUOTE_IFELSE([$1],
2497 [patsubst([$1], [\([`""]\)], [\\\1])],
2498 [AC_DIAGNOSE([syntax],
2499 [backquotes and double quotes should not be backslashed in: $1])dnl
2503 # _AC_ECHO_UNQUOTED(STRING, [FD = AC_FD_MSG])
2504 # -------------------------------------------
2505 # Perform shell expansions on STRING and echo the string to FD.
2506 define([_AC_ECHO_UNQUOTED],
2507 [echo "$1" >&m4_default([$2], [AC_FD_MSG])])
2510 # _AC_ECHO(STRING, [FD = AC_FD_MSG])
2511 # ----------------------------------
2512 # Protect STRING from backquote expansion, echo the result to FD.
2514 [_AC_ECHO_UNQUOTED([_AC_SH_QUOTE([$1])], $2)])
2517 # _AC_ECHO_N(STRING, [FD = AC_FD_MSG])
2518 # ------------------------------------
2519 # Same as _AC_ECHO, but echo doesn't return to a new line.
2520 define([_AC_ECHO_N],
2521 [echo $ECHO_N "_AC_SH_QUOTE([$1])$ECHO_C" >&m4_default([$2], [AC_FD_MSG])])
2524 # AC_MSG_CHECKING(FEATURE)
2525 # ------------------------
2526 define([AC_MSG_CHECKING],
2527 [_AC_ECHO([configure:__oline__: checking $1], AC_FD_LOG)
2528 _AC_ECHO_N([checking $1... ])[]dnl
2532 # autoupdate::AC_CHECKING(FEATURE)
2533 # --------------------------------
2534 AU_DEFUN([AC_CHECKING],
2535 [AC_MSG_CHECKING([$1])])
2538 # AC_MSG_RESULT(RESULT)
2539 # ---------------------
2540 define([AC_MSG_RESULT],
2541 [_AC_ECHO([configure:__oline__: result: $1], AC_FD_LOG)
2542 _AC_ECHO([${ECHO_T}$1])[]dnl
2546 # AC_MSG_RESULT_UNQUOTED(RESULT)
2547 # ------------------------------
2548 # Likewise, but perform $ ` \ shell substitutions.
2549 define([AC_MSG_RESULT_UNQUOTED],
2550 [_AC_ECHO_UNQUOTED([configure:__oline__: result: $1], AC_FD_LOG)
2551 _AC_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
2555 # autoupdate::AC_VERBOSE(RESULT)
2556 # ------------------------------
2557 AU_DEFUN([AC_VERBOSE],
2558 [AC_MSG_RESULT([ $1])])
2561 # AC_MSG_WARN(PROBLEM)
2562 # --------------------
2563 define([AC_MSG_WARN],
2564 [_AC_ECHO([configure: WARNING: $1], 2)])
2567 # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
2568 # --------------------------------------
2569 define([AC_MSG_ERROR],
2570 [{ _AC_ECHO([configure: error: $1], 2); exit m4_default([$2], 1); }])
2578 ## ---------------------------- ##
2579 ## Compiler-running mechanics. ##
2580 ## ---------------------------- ##
2583 # AC_TRY_EVAL(VARIABLE)
2584 # ---------------------
2585 # The purpose of this macro is to "configure:123: command line"
2586 # written into config.log for every test run.
2587 AC_DEFUN([AC_TRY_EVAL],
2588 [{ (eval echo configure:__oline__: \"[$]$1\") >&AC_FD_LOG; dnl
2589 (eval [$]$1) 2>&AC_FD_LOG; }])
2592 # AC_TRY_COMMAND(COMMAND)
2593 # -----------------------
2594 AC_DEFUN([AC_TRY_COMMAND],
2595 [{ ac_try='$1'; AC_TRY_EVAL(ac_try); }])
2598 ## ------------------ ##
2599 ## Default includes. ##
2600 ## ------------------ ##
2602 # Always use the same set of default headers for all the generic
2603 # macros. It is easier to document, to extend, and to understand than
2604 # having specific defaults for each macro.
2606 # Of course, one would like to issue these default headers only if
2607 # they were used, i.e.., AC_INCLUDES_DEFAULT was called, and the
2608 # default `branch' was run. Unfortunately AC_INCLUDES_DEFAULT is
2609 # called unquoted, so it is unsafe to try to divert from there.
2610 # Therefore, the following *is* buggy, but this is the kind of
2611 # tradeoff we accept in order to improve configure.
2613 # See _AC_INIT_PREPARE to see the value of `ac_includes_default'.
2616 # AC_INCLUDES_DEFAULT([INCLUDES])
2617 # -------------------------------
2618 # If INCLUDES is empty, expand in default includes, otherwise in
2621 # The end-of-line after `$[1]' below is meant, and it is actually
2622 # because this new line is meant that we don't use m4_default. The
2623 # problem is that this macro is used *unquoted* in AC_TRY_COMPILE
2624 # etc. It is used unquoted because unfortunately (this is a real
2625 # pain), AC_TRY_COMPILE is over quoting some of its arguments. This
2626 # is a sad decision.
2628 # Still, there are calls such as this
2630 # AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([#include <pwd.h>]),
2633 # Because AC_INCLUDES_DEFAULT *has* to be unquoted, after evaluation,
2634 # if there were no end of line, you'd get
2636 # AC_TRY_COMPILE(#include <pwd.h>,
2638 # AC_MORE_BLAH_BLAH)
2640 # i.e. the first argument given to AC_TRY_COMPILE is
2645 # (note how the comma was swallowed because of the comment mark) and
2650 # so all the arguments are shifted.
2652 # Because I don't see any backward compatible means to fix the
2653 # brokenness of AC_TRY_COMPILE, we are doomed to leave a extra new
2655 define([AC_INCLUDES_DEFAULT],
2656 [ifelse([$1], [], [$ac_includes_default], [$1
2663 ## -------------------------- ##
2664 ## Generic structure checks. ##
2665 ## -------------------------- ##
2668 # AC_CHECK_MEMBER(AGGREGATE.MEMBER,
2669 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2671 # ---------------------------------------------------------
2672 # AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
2673 # variables are not a valid argument.
2674 AC_DEFUN([AC_CHECK_MEMBER],
2675 [AC_VAR_IF_INDIR([$1], [AC_FATAL([$0: requires literal arguments])])dnl
2676 ifelse(regexp([$1], [\.]), -1,
2677 [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
2678 AC_REQUIRE([AC_HEADER_STDC])dnl
2679 AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
2680 dnl Extract the aggregate name, and the member name
2681 AC_CACHE_CHECK([for $1], ac_Member,
2682 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
2684 patsubst([$1], [\..*]) foo;
2686 foo.patsubst([$1], [^[^.]*\.]);])],
2687 AC_VAR_SET(ac_Member, yes),
2688 AC_VAR_SET(ac_Member, no))])
2689 AC_SHELL_IFELSE([test AC_VAR_GET(ac_Member) = yes],
2691 AC_VAR_POPDEF([ac_Member])dnl
2695 # AC_CHECK_MEMBERS([AGGREGATE.MEMBER, ...],
2696 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]
2698 # ---------------------------------------------------------
2699 # The first argument is an m4 list.
2700 AC_DEFUN([AC_CHECK_MEMBERS],
2701 [m4_foreach([AC_Member], [$1],
2702 [AC_CHECK_MEMBER(AC_Member,
2703 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
2704 [Define if `]patsubst(AC_Member, [^[^.]*\.])[' is
2705 member of `]patsubst(AC_Member, [\..*])['.])
2714 ## ----------------------- ##
2715 ## Checking for programs. ##
2716 ## ----------------------- ##
2719 # AC_SHELL_PATH_WALK([PATH = $PATH], BODY)
2720 # ----------------------------------------
2721 # Walk through PATH running BODY for each `ac_dir'.
2723 # `$ac_dummy' forces splitting on constant user-supplied paths.
2724 # POSIX.2 word splitting is done only on the output of word
2725 # expansions, not every word. This closes a longstanding sh security
2727 define([AC_SHELL_PATH_WALK],
2728 [ac_save_IFS=$IFS; IFS=':'
2729 ac_dummy="m4_default([$1], [$PATH])"
2730 for ac_dir in $ac_dummy; do
2732 test -z "$ac_dir" && ac_dir=.
2738 # AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR,
2739 # [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND],
2741 # -----------------------------------------------------
2742 AC_DEFUN([AC_CHECK_PROG],
2743 [# Extract the first word of "$2", so it can be a program name with args.
2744 set dummy $2; ac_word=$[2]
2745 AC_MSG_CHECKING([for $ac_word])
2746 AC_CACHE_VAL(ac_cv_prog_$1,
2747 [if test -n "$$1"; then
2748 ac_cv_prog_$1="$$1" # Let the user override the test.
2751 [ ac_prog_rejected=no
2753 AC_SHELL_PATH_WALK([$5],
2754 [test -f $ac_dir/$ac_word || continue
2756 [if test "$ac_dir/$ac_word" = "$6"; then
2757 ac_prog_rejected=yes
2764 [if test $ac_prog_rejected = yes; then
2765 # We found a bogon in the path, so make sure we never use it.
2766 set dummy $ac_cv_prog_$1
2768 if test $[@%:@] != 0; then
2769 # We chose a different compiler from the bogus one.
2770 # However, it has the same basename, so the bogon will be chosen
2771 # first if we set $1 to just the basename; use the full file name.
2773 set dummy "$ac_dir/$ac_word" ${1+"$[@]"}
2775 ac_cv_prog_$1="$[@]"
2778 # Default is a loser.
2779 AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
2780 m4_default([$5], [\$PATH])])
2785 dnl If no 4th arg is given, leave the cache variable unset,
2786 dnl so AC_CHECK_PROGS will keep looking.
2788 [ test -z "$ac_cv_prog_$1" && ac_cv_prog_$1="$4"
2792 if test -n "$$1"; then
2793 AC_MSG_RESULT([$$1])
2801 # AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],
2803 # ------------------------------------------------------------------
2804 AC_DEFUN([AC_CHECK_PROGS],
2807 AC_CHECK_PROG([$1], $ac_prog, $ac_prog, , [$4])
2808 test -n "$$1" && break
2810 ifval([$3], [test -n "$$1" || $1="$3"
2814 # AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
2815 # -----------------------------------------------------------------------
2816 AC_DEFUN([AC_PATH_PROG],
2817 [# Extract the first word of "$2", so it can be a program name with args.
2818 set dummy $2; ac_word=$[2]
2819 AC_MSG_CHECKING([for $ac_word])
2820 AC_CACHE_VAL(ac_cv_path_$1,
2822 [[\\/]]* | ?:[[\\/]]*)
2823 ac_cv_path_$1="$$1" # Let the user override the test with a path.
2826 AC_SHELL_PATH_WALK([$4],
2827 [if test -f "$ac_dir/$ac_word"; then
2828 ac_cv_path_$1=$ac_dir/$ac_word
2831 dnl If no 3rd arg is given, leave the cache variable unset,
2832 dnl so AC_PATH_PROGS will keep looking.
2834 [ test -z "$ac_cv_path_$1" && ac_cv_path_$1="$3"
2839 if test -n "$$1"; then
2848 # AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],
2850 # -----------------------------------------------------------------
2851 AC_DEFUN([AC_PATH_PROGS],
2854 AC_PATH_PROG($1, $ac_prog, , $4)
2855 test -n "$$1" && break
2857 ifval([$3], [test -n "$$1" || $1="$3"
2863 ## -------------------- ##
2864 ## Checking for tools. ##
2865 ## -------------------- ##
2868 # AC_CHECK_TOOL_PREFIX
2869 # --------------------
2870 AU_DEFUN([AC_CHECK_TOOL_PREFIX])
2873 # AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
2874 # -----------------------------------------------------------------------
2875 # (Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.)
2876 AC_DEFUN([AC_PATH_TOOL],
2877 [AC_PATH_PROG($1, ${ac_tool_prefix}$2, , $4)
2878 if test -z "$ac_cv_path_$1"; then
2879 if test -n "$ac_tool_prefix"; then
2880 AC_PATH_PROG([ac_pt_$1], [$2], [$3], [$4])
2889 # AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
2890 # ------------------------------------------------------------------------
2891 # (Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.)
2892 AC_DEFUN([AC_CHECK_TOOL],
2893 [AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, , $4)
2894 if test -z "$ac_cv_prog_$1"; then
2895 if test -n "$ac_tool_prefix"; then
2896 AC_CHECK_PROG([ac_ct_$1], [$2], [$2], [$3], [$4])
2905 # AC_CHECK_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],
2907 # ------------------------------------------------------------------
2908 # Check for each tool in PROGS-TO-CHECK-FOR with the cross prefix. If
2909 # none can be found with a cross prefix, then use the first one that
2910 # was found without the cross prefix.
2911 AC_DEFUN([AC_CHECK_TOOLS],
2914 AC_CHECK_PROG([$1], $ac_tool_prefix$ac_prog, $ac_tool_prefix$ac_prog, [$3])
2915 test "$$1" != "$3" && break
2917 if test "$$1" = "$3"; then
2918 AC_CHECK_PROGS([$1], [$2], [$3])
2923 # AC_PREFIX_PROGRAM(PROGRAM)
2924 # --------------------------
2925 # Guess the value for the `prefix' variable by looking for
2926 # the argument program along PATH and taking its parent.
2927 # Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
2928 # set `prefix' to /usr/local/gnu.
2929 # This comes too late to find a site file based on the prefix,
2930 # and it might use a cached value for the path.
2931 # No big loss, I think, since most configures don't use this macro anyway.
2932 AC_DEFUN([AC_PREFIX_PROGRAM],
2933 [dnl Get an upper case version of $[1].
2934 pushdef(AC_Prog, translit($1, a-z, A-Z))dnl
2935 if test "x$prefix" = xNONE; then
2936 dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
2937 echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
2938 AC_PATH_PROG(AC_Prog, $1)
2939 if test -n "$ac_cv_path_[]AC_Prog"; then
2940 prefix=`echo $ac_cv_path_[]AC_Prog | [sed 's%/[^/][^/]*//*[^/][^/]*$%%']`
2943 popdef([AC_Prog])dnl
2944 ])# AC_PREFIX_PROGRAM
2949 ## ------------------------ ##
2950 ## Checking for libraries. ##
2951 ## ------------------------ ##
2954 # AC_TRY_LINK_FUNC(FUNC, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
2955 # ------------------------------------------------------------
2956 # Try to link a program that calls FUNC, handling GCC builtins. If
2957 # the link succeeds, execute ACTION-IF-FOUND; otherwise, execute
2958 # ACTION-IF-NOT-FOUND.
2959 AC_DEFUN([AC_TRY_LINK_FUNC],
2960 [AC_LINK_IFELSE([AC_LANG_CALL([], [$1])], [$2], [$3])])
2963 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2964 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2965 # [OTHER-LIBRARIES])
2966 # --------------------------------------------------------
2967 # Search for a library defining FUNC, if it's not already available.
2968 AC_DEFUN([AC_SEARCH_LIBS],
2969 [AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2970 [ac_func_search_save_LIBS=$LIBS
2972 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
2973 test "$ac_cv_search_$1" = no && for ac_lib in $2; do
2974 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2975 AC_TRY_LINK_FUNC([$1],
2976 [ac_cv_search_$1="-l$ac_lib"
2979 LIBS=$ac_func_search_save_LIBS])
2980 AC_SHELL_IFELSE([test "$ac_cv_search_$1" != no],
2981 [test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS"
2988 # AC_CHECK_LIB(LIBRARY, FUNCTION,
2989 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2990 # [OTHER-LIBRARIES])
2991 # ------------------------------------------------------
2993 # Use a cache variable name containing both the library and function name,
2994 # because the test really is for library $1 defining function $2, not
2995 # just for library $1. Separate tests with the same $1 and different $2s
2996 # may have different results.
2998 # FIXME: This macro is extremely suspicious. It DEFINEs unconditionnally,
2999 # whatever the FUNCTION, in addition to not being a *S macro. Note
3000 # that the cache does depend upon the function we are looking for.
3002 # It is on purpose we used `ac_check_lib_save_LIBS' and not just
3003 # `ac_save_LIBS': there are many macros which don't want to see `LIBS'
3004 # changed but still want to use AC_CHECK_LIB, so they save `LIBS'.
3005 # And ``ac_save_LIBS' is too tempting a name, so let's leave them some
3007 AC_DEFUN([AC_CHECK_LIB],
3008 [AH_CHECK_LIB([$1])dnl
3009 AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
3010 AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
3011 [ac_check_lib_save_LIBS=$LIBS
3012 LIBS="-l$1 $5 $LIBS"
3013 AC_TRY_LINK_FUNC([$2],
3014 [AC_VAR_SET(ac_Lib, yes)],
3015 [AC_VAR_SET(ac_Lib, no)])
3016 LIBS=$ac_check_lib_save_LIBS])
3017 AC_SHELL_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
3019 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
3023 AC_VAR_POPDEF([ac_Lib])dnl
3027 # AH_CHECK_LIB(LIBNAME)
3028 # ---------------------
3029 # FIXME: To be rigorous, this should not be systematic: depending
3030 # upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
3031 define([AH_CHECK_LIB],
3032 [AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
3033 [Define if you have the `]$1[' library (-l]$1[).])])
3036 # AC_HAVE_LIBRARY(LIBRARY,
3037 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3038 # [OTHER-LIBRARIES])
3039 # ---------------------------------------------------------
3041 # This macro is equivalent to calling `AC_CHECK_LIB' with a FUNCTION
3042 # argument of `main'. In addition, LIBRARY can be written as any of
3043 # `foo', `-lfoo', or `libfoo.a'. In all of those cases, the compiler
3044 # is passed `-lfoo'. However, LIBRARY cannot be a shell variable;
3045 # it must be a literal name.
3046 AU_DEFUN([AC_HAVE_LIBRARY],
3047 [pushdef([AC_Lib_Name],
3048 patsubst(patsubst([[$1]], [lib\([^\.]*\)\.a], [\1]), [-l], []))dnl
3049 AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl
3050 ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
3051 popdef([AC_Lib_Name])dnl
3056 ## ------------------------ ##
3057 ## Examining declarations. ##
3058 ## ------------------------ ##
3061 # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
3062 # ---------------------------------------------------------
3063 # INCLUDES are not defaulted.
3064 AC_DEFUN([AC_TRY_CPP],
3065 [AC_REQUIRE_CPP()dnl
3066 cat >conftest.$ac_ext <<EOF
3067 AC_LANG_SOURCE([[$1]])
3069 dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
3070 dnl We used to copy stderr to stdout and capture it in a variable, but
3071 dnl that breaks under sh -x, which writes compile commands starting
3072 dnl with ` +' to stderr in eval and subshells.
3073 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3075 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3076 if test -z "$ac_err"; then
3079 echo "$ac_err" >&AC_FD_LOG
3080 echo "configure: failed program was:" >&AC_FD_LOG
3081 cat conftest.$ac_ext >&AC_FD_LOG
3087 # AC_EGREP_HEADER(PATTERN, HEADER-FILE,
3088 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3089 # --------------------------------------------------------
3090 AC_DEFUN([AC_EGREP_HEADER],
3096 # AC_EGREP_CPP(PATTERN, PROGRAM,
3097 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3098 # ------------------------------------------------------
3099 # Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
3100 # come early, it is not included in AC_BEFORE checks.
3101 AC_DEFUN([AC_EGREP_CPP],
3102 [AC_REQUIRE_CPP()dnl
3103 cat >conftest.$ac_ext <<EOF
3104 AC_LANG_SOURCE([[$2]])
3106 dnl eval is necessary to expand ac_cpp.
3107 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
3108 if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_LOG |
3109 dnl Prevent m4 from eating character classes:
3111 egrep "$1" >/dev/null 2>&1; then
3112 changequote([, ])dnl
3123 ## ------------------ ##
3124 ## Examining syntax. ##
3125 ## ------------------ ##
3128 # AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3129 # --------------------------------------------------------------------
3130 # Try to compile PROGRAM.
3131 AC_DEFUN([AC_COMPILE_IFELSE],
3132 [cat >conftest.$ac_ext <<EOF
3135 if AC_TRY_EVAL(ac_compile); then
3138 echo "configure: failed program was:" >&AC_FD_LOG
3139 cat conftest.$ac_ext >&AC_FD_LOG
3144 rm -f conftest*[]dnl
3145 ])# AC_COMPILE_IFELSE
3148 # AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
3149 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3150 # --------------------------------------------------------
3151 AC_DEFUN([AC_TRY_COMPILE],
3152 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
3156 ## --------------------- ##
3157 ## Examining libraries. ##
3158 ## --------------------- ##
3161 # AC_LINK_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3162 # -----------------------------------------------------------------
3163 # Try to link PROGRAM.
3164 AC_DEFUN([AC_LINK_IFELSE],
3165 [cat >conftest.$ac_ext <<EOF
3168 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3171 echo "configure: failed program was:" >&AC_FD_LOG
3172 cat conftest.$ac_ext >&AC_FD_LOG
3177 rm -f conftest*[]dnl
3181 # AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
3182 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3183 # -----------------------------------------------------
3184 # Should the INCLUDES be defaulted here?
3185 # Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
3186 # FIXME: WARNING: The code to compile was different in the case of
3187 # Fortran between AC_TRY_COMPILE and AC_TRY_LINK, though they should
3188 # equivalent as far as I can tell from the semantics and the docs. In
3189 # the former, $[2] is used as is, in the latter, it is `call' ed.
3190 # Remove these FIXME: once truth established.
3191 AC_DEFUN([AC_TRY_LINK],
3192 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
3195 # AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
3196 # ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND])
3197 # --------------------------------------------------------
3198 AU_DEFUN([AC_COMPILE_CHECK],
3199 [ifval([$1], [AC_CHECKING([for $1])
3201 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])
3207 ## -------------------------------- ##
3208 ## Checking for run-time features. ##
3209 ## -------------------------------- ##
3212 # AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
3213 # -----------------------------------------------------------
3214 # Compile, link, and run.
3215 AC_DEFUN([AC_RUN_IFELSE],
3216 [cat >conftest.$ac_ext <<EOF
3219 if AC_TRY_EVAL(ac_link) &&
3220 test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null; then
3223 echo "configure: failed program was:" >&AC_FD_LOG
3224 cat conftest.$ac_ext >&AC_FD_LOG
3229 rm -f conftest*[]dnl
3233 # AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE],
3234 # [ACTION-IF-CROSS-COMPILING])
3235 # --------------------------------------------------------
3236 AC_DEFUN([AC_TRY_RUN],
3237 [if test $cross_compiling = yes; then
3239 [AC_DIAGNOSE([cross],
3240 [AC_TRY_RUN called without default to allow cross compiling])dnl
3241 AC_MSG_ERROR(cannot run test program while cross compiling)])
3243 AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])
3249 ## --------------------------- ##
3250 ## Checking for header files. ##
3251 ## --------------------------- ##
3254 # AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3255 # ----------------------------------------------------------------------
3256 AC_DEFUN([AC_CHECK_HEADER],
3257 [AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
3258 AC_CACHE_CHECK([for $1], ac_Header,
3259 [AC_TRY_CPP([#include <$1>
3261 AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
3262 AC_SHELL_IFELSE([test AC_VAR_GET(ac_Header) = yes],
3264 AC_VAR_POPDEF([ac_Header])dnl
3268 define([AH_CHECK_HEADERS],
3269 [AC_FOREACH([AC_Header], [$1],
3270 [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
3271 [Define if you have the <]AC_Header[> header file.])])])
3273 # AC_CHECK_HEADERS(HEADER-FILE...
3274 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3275 # ----------------------------------------------------------
3276 AC_DEFUN([AC_CHECK_HEADERS],
3277 [AH_CHECK_HEADERS([$1])dnl
3280 AC_CHECK_HEADER($ac_header,
3281 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_header)) $2],
3287 ## ------------------------------------- ##
3288 ## Checking for the existence of files. ##
3289 ## ------------------------------------- ##
3291 # AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3292 # -------------------------------------------------------------
3294 # Check for the existence of FILE.
3295 AC_DEFUN([AC_CHECK_FILE],
3296 [AC_DIAGNOSE([cross],
3297 [Cannot check for file existence when cross compiling])dnl
3298 AC_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
3299 dnl FIXME: why was there this line? AC_REQUIRE([AC_PROG_CC])dnl
3300 AC_CACHE_CHECK([for $1], ac_File,
3301 [test $cross_compiling = yes &&
3302 AC_MSG_ERROR([Cannot check for file existence when cross compiling])
3303 if test -r "[$1]"; then
3304 AC_VAR_SET(ac_File, yes)
3306 AC_VAR_SET(ac_File, no)
3308 AC_SHELL_IFELSE([test AC_VAR_GET(ac_File) = yes],
3310 AC_VAR_POPDEF([ac_File])dnl
3314 # AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3315 # -----------------------------------------------------------------
3316 AC_DEFUN([AC_CHECK_FILES],
3317 [AC_FOREACH([AC_FILE_NAME], [$1],
3318 [AC_CHECK_FILE(AC_FILE_NAME,
3319 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
3320 [Define if you have the file `]AC_File['.])
3325 ## ------------------------------- ##
3326 ## Checking for declared symbols. ##
3327 ## ------------------------------- ##
3330 # AC_CHECK_DECL(SYMBOL,
3331 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3333 # -------------------------------------------------------
3334 # Check if SYMBOL (a variable or a function) is declared.
3335 AC_DEFUN([AC_CHECK_DECL],
3336 [AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
3337 AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
3338 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
3340 char *p = (char *) $1;
3343 AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
3344 AC_SHELL_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
3346 AC_VAR_POPDEF([ac_Symbol])dnl
3350 # AC_CHECK_DECLS(SYMBOLS,
3351 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3353 # --------------------------------------------------------
3354 # Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the
3355 # documentation for a detailed explanation of this difference with
3356 # other AC_CHECK_*S macros. SYMBOLS is an m4 list.
3357 AC_DEFUN([AC_CHECK_DECLS],
3358 [m4_foreach([AC_Symbol], [$1],
3359 [AC_CHECK_DECL(AC_Symbol,
3360 [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
3361 [Define to 1 if you have the declaration
3362 of `]AC_Symbol[', and to 0 if you don't.])
3364 [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
3370 ## -------------------------------- ##
3371 ## Checking for library functions. ##
3372 ## -------------------------------- ##
3375 # AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3376 # -----------------------------------------------------------------
3377 AC_DEFUN([AC_CHECK_FUNC],
3378 [AC_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
3379 AC_CACHE_CHECK([for $1], ac_var,
3380 [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
3381 [AC_VAR_SET(ac_var, yes)],
3382 [AC_VAR_SET(ac_var, no)])])
3383 AC_SHELL_IFELSE([test AC_VAR_GET(ac_var) = yes],
3385 AC_VAR_POPDEF([ac_var])dnl
3389 # AC_CHECK_FUNCS(FUNCTION..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3390 # ---------------------------------------------------------------------
3391 # FIXME: Should we die if there are not enough arguments, or just
3393 AC_DEFUN([AC_CHECK_FUNCS],
3394 [AC_FOREACH([AC_Func], [$1],
3395 [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
3396 [Define if you have the `]AC_Func[' function.])])dnl
3399 AC_CHECK_FUNC($ac_func,
3400 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
3406 # AC_LIBOBJ_DECL(FILENAME-NOEXT)
3407 # ------------------------------
3408 # Announce we might need the file `FILENAME-NOEXT.c'.
3409 define([AC_LIBOBJ_DECL], [])
3412 # AC_LIBOBJ(FILENAME-NOEXT)
3413 # -------------------------
3414 # We need `FILENAME-NOEXT.o', save this into `LIBOBJS'.
3415 # We don't use AC_SUBST/2 because it forces an unneeded eol.
3417 [AC_VAR_IF_INDIR([$1],
3418 [AC_DIAGNOSE(syntax,
3419 [$0: you should use literals])],
3420 [AC_LIBOBJ_DECL([$1])])dnl
3421 AC_SUBST([LIBOBJS])dnl
3422 LIBOBJS="$LIBOBJS $1.${ac_objext}"])
3425 # AC_REPLACE_FUNCS(FUNCTION...)
3426 # -----------------------------
3427 AC_DEFUN([AC_REPLACE_FUNCS],
3428 [AC_FOREACH([AC_Func], [$1], [AC_LIBOBJ_DECL(AC_Func)])dnl
3429 AC_CHECK_FUNCS([$1], , [AC_LIBOBJ(${ac_func})])
3434 ## ----------------------------------- ##
3435 ## Checking compiler characteristics. ##
3436 ## ----------------------------------- ##
3439 # _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, [INCLUDES])
3440 # ---------------------------------------------------------
3441 # Compute the integer EXPRESSION and store the result in the VARIABLE.
3442 # Works OK if cross compiling.
3443 define([_AC_COMPUTE_INT_COMPILE],
3444 [# Depending upon the size, compute the lo and hi bounds.
3445 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
3448 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_try])],
3449 [ac_hi=$ac_try; break],
3450 [ac_lo=`expr $ac_try + 1`; ac_try=`expr 2 '*' $ac_try + 1`])
3454 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_try])],
3455 [ac_lo=$ac_try; break],
3456 [ac_hi=`expr $ac_try - 1`; ac_try=`expr 2 '*' $ac_try`])
3458 # Binary search between lo and hi bounds.
3459 while test "x$ac_lo" != "x$ac_hi"; do
3460 ac_try=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
3461 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_try])],
3462 [ac_hi=$ac_try], [ac_lo=`expr $ac_try + 1`])
3465 ])# _AC_COMPUTE_INT_COMPILE
3468 # _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, [INCLUDES], [IF-FAILS])
3469 # -----------------------------------------------------------------
3470 # Store the evaluation of the integer EXPRESSION in VARIABLE.
3471 define([_AC_COMPUTE_INT_RUN],
3472 [AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
3473 [$2=`cat conftestval`], [$4])])
3476 # _AC_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
3477 # ---------------------------------------------------------
3478 define([_AC_COMPUTE_INT],
3479 [if test "$cross_compiling" = yes; then
3480 _AC_COMPUTE_INT_COMPILE([$1], [$2], [$3])
3482 _AC_COMPUTE_INT_RUN([$1], [$2], [$3], [$4])
3487 # AC_CHECK_SIZEOF(TYPE, [IGNORED], [INCLUDES])
3488 # --------------------------------------------
3489 AC_DEFUN([AC_CHECK_SIZEOF],
3490 [AC_VAR_IF_INDIR([$1], [AC_FATAL([$0: requires literal arguments])])dnl
3491 AC_CHECK_TYPE([$1], [], [], [$3])
3492 AC_CACHE_CHECK([size of $1], AC_TR_SH([ac_cv_sizeof_$1]),
3493 [if test "$AC_TR_SH([ac_cv_type_$1])" = yes; then
3494 _AC_COMPUTE_INT([sizeof ($1)],
3495 [AC_TR_SH([ac_cv_sizeof_$1])],
3496 [AC_INCLUDES_DEFAULT([$3])])
3498 AC_TR_SH([ac_cv_sizeof_$1])=0
3500 AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), $AC_TR_SH([ac_cv_sizeof_$1]),
3501 [The size of a `$1', as computed by sizeof.])
3506 ## -------------------- ##
3507 ## Checking for types. ##
3508 ## -------------------- ##
3510 # Up to 2.13 included, Autoconf used to provide the macro
3512 # AC_CHECK_TYPE(TYPE, DEFAULT)
3514 # Since, it provides another version which fits better with the other
3515 # AC_CHECK_ families:
3517 # AC_CHECK_TYPE(TYPE,
3518 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3521 # In order to provide backward compatibility, the new scheme is
3522 # implemented as _AC_CHECK_TYPE_NEW, the old scheme as _AC_CHECK_TYPE_OLD,
3523 # and AC_CHECK_TYPE branches to one or the other, depending upon its
3528 # _AC_CHECK_TYPE_NEW(TYPE,
3529 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3531 # ------------------------------------------------------------
3532 # Check whether the type TYPE is supported by the system, maybe via the
3533 # the provided includes. This macro implements the former task of
3534 # AC_CHECK_TYPE, with one big difference though: AC_CHECK_TYPE was
3535 # grepping in the headers, which, BTW, led to many problems until
3536 # the egrep expression was correct and did not given false positives.
3537 # It turned out there are even portability issues with egrep...
3539 # The most obvious way to check for a TYPE is just to compile a variable
3544 # Unfortunately this does not work for const qualified types in C++,
3545 # where you need an initializer. So you think of
3547 # TYPE my_var = (TYPE) 0;
3549 # Unfortunately, again, this is not valid for some C++ classes.
3551 # Then you look for another scheme. For instance you think of declaring
3552 # a function which uses a parameter of type TYPE:
3554 # int foo (TYPE param);
3556 # but of course you soon realize this does not make it with K&R
3557 # compilers. And by no ways you want to
3563 # since this time it's C++ who is not happy.
3565 # Don't even think of the return type of a function, since K&R cries
3566 # there too. So you start thinking of declaring a *pointer* to this TYPE:
3570 # but you know fairly well that this is legal in C for aggregates which
3571 # are unknown (TYPE = struct does-not-exist).
3573 # Then you think of using sizeof to make sure the TYPE is really
3578 # But this succeeds if TYPE is a variable: you get the size of the
3579 # variable's type!!!
3581 # This time you tell yourself the last two options *together* will make
3582 # it. And indeed this is the solution invented by Alexandre Oliva.
3584 # Also note that we use
3586 # if (sizeof (TYPE))
3588 # to `read' sizeof (to avoid warnings), while not depending on its type
3589 # (not necessarily size_t etc.). Equally, instead of defining an unused
3590 # variable, we just use a cast to avoid warnings from the compiler.
3591 # Suggested by Paul Eggert.
3592 define([_AC_CHECK_TYPE_NEW],
3593 [AC_REQUIRE([AC_HEADER_STDC])dnl
3594 AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
3595 AC_CACHE_CHECK([for $1], ac_Type,
3596 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
3601 AC_VAR_SET(ac_Type, yes),
3602 AC_VAR_SET(ac_Type, no))])
3603 AC_SHELL_IFELSE([test AC_VAR_GET(ac_Type) = yes],
3605 AC_VAR_POPDEF([ac_Type])dnl
3606 ])# _AC_CHECK_TYPE_NEW
3609 # AC_CHECK_TYPES(TYPES,
3610 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3612 # --------------------------------------------------------
3613 # TYPES is an m4 list. There are no ambiguities here, we mean the newer
3615 AC_DEFUN([AC_CHECK_TYPES],
3616 [m4_foreach([AC_Type], [$1],
3617 [_AC_CHECK_TYPE_NEW(AC_Type,
3618 [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type), 1,
3619 [Define if the system has the type
3626 # _AC_CHECK_TYPE_OLD(TYPE, DEFAULT)
3627 # ---------------------------------
3628 # FIXME: This is an extremely badly chosen name, since this
3629 # macro actually performs an AC_REPLACE_TYPE. Some day we
3630 # have to clean this up.
3631 define([_AC_CHECK_TYPE_OLD],
3632 [_AC_CHECK_TYPE_NEW([$1],,
3633 [AC_DEFINE_UNQUOTED([$1], [$2],
3634 [Define to `$2' if <sys/types.h> does not define.])])dnl
3635 ])# _AC_CHECK_TYPE_OLD
3638 # _AC_CHECK_TYPE_BUILTIN_P(STRING)
3639 # --------------------------------
3640 # Return `1' if STRING seems to be a builtin C/C++ type, i.e., if it
3641 # starts with `_Bool', `bool', `char', `double', `float', `int',
3642 # `long', `short', `signed', or `unsigned' followed by characters
3643 # that are defining types.
3644 define([_AC_CHECK_TYPE_BUILTIN_P],
3645 [ifelse(regexp([$1], [^\(_Bool\|bool|\char\|double\|float\|int\|long\|short\|\(un\)?signed\)\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
3647 ])# _AC_CHECK_TYPE_BUILTIN_P
3650 # AC_CHECK_TYPE(TYPE, DEFAULT)
3652 # AC_CHECK_TYPE(TYPE,
3653 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
3655 # -------------------------------------------------------
3657 # Dispatch respectively to _AC_CHECK_TYPE_OLD or _AC_CHECK_TYPE_NEW.
3658 # 1. More than two arguments => NEW
3659 # 2. $2 seems to be builtin type => OLD
3660 # 3. $2 seems to be a type => NEW plus a warning
3662 AC_DEFUN([AC_CHECK_TYPE],
3663 [ifelse($#, 3, [_AC_CHECK_TYPE_NEW($@)],
3664 $#, 4, [_AC_CHECK_TYPE_NEW($@)],
3665 _AC_CHECK_TYPE_BUILTIN_P([$2]), 1, [_AC_CHECK_TYPE_OLD($@)],
3666 regexp([$2], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]), 0, [m4_warn([$0: assuming `$2' is not a type])_AC_CHECK_TYPE_NEW($@)],
3667 [_AC_CHECK_TYPE_NEW($@)])[]dnl
3672 ## ----------------------- ##
3673 ## Creating output files. ##
3674 ## ----------------------- ##
3677 # This section handles about all the preparation aspects for
3678 # `config.status': registering the configuration files, the headers,
3679 # the links, and the commands `config.status' will run. There is a
3680 # little mixture though of things actually handled by `configure',
3681 # such as running the `configure' in the sub directories. Minor
3684 # There are two kinds of commands:
3688 # They are output into `config.status' via a quoted here doc. These
3689 # commands are always associated to a tag which the user can use to
3690 # tell `config.status' what are the commands she wants to run.
3694 # They are output via an *unquoted* here-doc. As a consequence $var
3695 # will be output as the value of VAR. This is typically used by
3696 # `configure' to give `config,.status' some variables it needs to run
3697 # the COMMANDS. At the difference of `COMMANDS', the INIT-CMDS are
3701 # Some uniformity exists around here, please respect it!
3703 # A macro named AC_CONFIG_FOOS has three args: the `TAG...' (or
3704 # `FILE...' when it applies), the `COMMANDS' and the `INIT-CMDS'. It
3705 # first checks that TAG was not registered elsewhere thanks to
3706 # AC_CONFIG_UNIQUE. Then it registers `TAG...' in AC_LIST_FOOS, and for
3707 # each `TAG', a special line in AC_LIST_FOOS_COMMANDS which is used in
3708 # `config.status' like this:
3711 # AC_LIST_FOOS_COMMANDS
3714 # Finally, the `INIT-CMDS' are dumped into a special diversion, via
3715 # `_AC_CONFIG_COMMANDS_INIT'. While `COMMANDS' are output once per TAG,
3716 # `INIT-CMDS' are dumped only once per call to AC_CONFIG_FOOS.
3718 # It also leave the TAG in the shell variable ac_config_foo which contains
3719 # those which will actually be executed. In other words:
3722 # AC_CONFIG_FOOS(bar, [touch bar])
3725 # will not create bar.
3727 # AC_CONFIG_FOOS can be called several times (with different TAGs of
3730 # Because these macros should not output anything, there should be `dnl'
3731 # everywhere. A pain my friend, a pain. So instead in each macro we
3732 # divert(-1) and restore the diversion at the end.
3735 # Honorable members of this family are AC_CONFIG_FILES,
3736 # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
3737 # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
3738 # arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
3739 # and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
3740 # AC_CONFIG_COMMANDS_POST.
3744 # AC_CONFIG_IF_MEMBER(DEST, LIST, ACTION-IF-TRUE, ACTION-IF-FALSE)
3745 # ----------------------------------------------------------------
3746 # If DEST is member of LIST, expand to ACTION-IF-TRUE, else ACTION-IF-FALSE.
3748 # LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated
3751 # FIXME: This macro is badly designed, but I'm not guilty: m4 is. There
3752 # is just no way to simply compare two strings in m4, but to use pattern
3753 # matching. The big problem is then that the active characters should
3754 # be quoted. Currently `+*.' are quoted.
3755 define([AC_CONFIG_IF_MEMBER],
3756 [ifelse(regexp($2, [\(^\| \)]patsubst([$1],
3757 [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
3761 # AT_FILE_DEPENDENCY(DEST, SOURCE1, [SOURCE2...])
3762 # -----------------------------------------------
3763 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
3764 # It announces DEST depends upon the SOURCE1 etc.
3765 define([AT_FILE_DEPENDENCY], [])
3768 # _AC_CONFIG_DEPENDENCY(DEST, [SOURCE1], [SOURCE2...])
3769 # ----------------------------------------------------
3770 # Be sure that a missing dependency is expressed as a dependency upon
3772 define([_AC_CONFIG_DEPENDENCY],
3774 [AT_FILE_DEPENDENCY($@)],
3775 [AT_FILE_DEPENDENCY([$1], [$1.in])])])
3778 # _AC_CONFIG_DEPENDENCIES(DEST[:SOURCE1[:SOURCE2...]]...)
3779 # -------------------------------------------------------
3780 # Declare the DESTs depend upon their SOURCE1 etc.
3781 define([_AC_CONFIG_DEPENDENCIES],
3782 [AC_DIVERT_PUSH([KILL])
3783 AC_FOREACH([AC_File], [$1],
3784 [_AC_CONFIG_DEPENDENCY(patsubst(AC_File, [:], [,]))])
3789 # _AC_CONFIG_UNIQUE(DEST[:SOURCE]...)
3790 # -----------------------------------
3792 # Verify that there is no double definition of an output file
3793 # (precisely, guarantees there is no common elements between
3794 # CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS).
3796 # Note that this macro does not check if the list $[1] itself
3798 define([_AC_CONFIG_UNIQUE],
3799 [AC_DIVERT_PUSH([KILL])
3800 AC_FOREACH([AC_File], [$1],
3801 [pushdef([AC_Dest], patsubst(AC_File, [:.*]))
3802 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS],
3803 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])])
3804 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS],
3805 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])])
3806 AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS],
3807 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])])
3808 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS],
3809 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])
3810 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES],
3811 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])])
3817 # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
3818 # -----------------------------------------
3820 # Register INIT-COMMANDS as command pasted *unquoted* in
3821 # `config.status'. This is typically used to pass variables from
3822 # `configure' to `config.status'. Note that $[1] is not over quoted as
3823 # was the case in AC_OUTPUT_COMMANDS.
3824 define([_AC_CONFIG_COMMANDS_INIT],
3826 [m4_append([_AC_OUTPUT_COMMANDS_INIT], [$1
3830 define([_AC_OUTPUT_COMMANDS_INIT])
3833 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
3834 # ---------------------------------------------------
3836 # Specify additional commands to be run by config.status. This
3837 # commands must be associated with a NAME, which should be thought
3838 # as the name of a file the COMMANDS create.
3839 AC_DEFUN([AC_CONFIG_COMMANDS],
3840 [AC_DIVERT_PUSH([KILL])
3841 _AC_CONFIG_UNIQUE([$1])
3842 m4_append([AC_LIST_COMMANDS], [ $1])
3844 ifelse([$2],,, [AC_FOREACH([AC_Name], [$1],
3845 [m4_append([AC_LIST_COMMANDS_COMMANDS],
3846 [ ]patsubst(AC_Name, [:.*])[ ) $2 ;;
3848 _AC_CONFIG_COMMANDS_INIT([$3])
3850 ac_config_commands="$ac_config_commands $1"
3853 # Initialize the lists.
3854 define([AC_LIST_COMMANDS])
3855 define([AC_LIST_COMMANDS_COMMANDS])
3858 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
3859 # -----------------------------------------
3861 # Add additional commands for AC_OUTPUT to put into config.status.
3863 # This macro is an obsolete version of AC_CONFIG_COMMANDS. The only
3864 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
3865 # to give a unique key. The scheme we have chosen is `default-1',
3866 # `default-2' etc. for each call.
3868 # Unfortunately this scheme is fragile: bad things might happen
3869 # if you update an included file and configure.in: you might have
3870 # clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
3871 # depending upon __file__ or the pid).
3872 AU_DEFUN([AC_OUTPUT_COMMANDS],
3873 [define([_AC_OUTPUT_COMMANDS_CNT], incr(_AC_OUTPUT_COMMANDS_CNT))dnl
3874 dnl Double quoted since that was the case in the original macro.
3875 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
3879 AU_DEFUN([_AC_OUTPUT_COMMANDS_CNT], 0)
3882 # AC_CONFIG_COMMANDS_PRE(CMDS)
3883 # ----------------------------
3884 # Commands to run right before config.status is created. Accumulates.
3885 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
3886 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
3890 define([AC_OUTPUT_COMMANDS_PRE])
3893 # AC_CONFIG_COMMANDS_POST(CMDS)
3894 # -----------------------------
3895 # Commands to run after config.status was created. Accumulates.
3896 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
3897 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
3901 define([AC_OUTPUT_COMMANDS_POST])
3904 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
3905 # ------------------------------------------------------
3906 # Specify that the HEADERS are to be created by instantiation of the
3907 # AC_DEFINEs. Associate the COMMANDS to the HEADERS. This macro
3908 # accumulates if called several times.
3910 # The commands are stored in a growing string AC_LIST_HEADERS_COMMANDS
3911 # which should be used like this:
3914 # AC_LIST_HEADERS_COMMANDS
3916 AC_DEFUN([AC_CONFIG_HEADERS],
3917 [AC_DIVERT_PUSH([KILL])
3918 _AC_CONFIG_UNIQUE([$1])
3919 _AC_CONFIG_DEPENDENCIES([$1])
3920 m4_append([AC_LIST_HEADERS], [ $1])
3921 dnl Register the commands
3922 ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
3923 [m4_append([AC_LIST_HEADERS_COMMANDS],
3924 [ ]patsubst(AC_File, [:.*])[ ) $2 ;;
3926 _AC_CONFIG_COMMANDS_INIT([$3])
3928 ac_config_headers="$ac_config_headers $1"
3931 # Initialize to empty. It is much easier and uniform to have a config
3932 # list expand to empty when undefined, instead of special casing when
3933 # not defined (since in this case, AC_CONFIG_FOO expands to AC_CONFIG_FOO).
3934 define([AC_LIST_HEADERS])
3935 define([AC_LIST_HEADERS_COMMANDS])
3938 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
3939 # --------------------------------------
3940 # FIXME: Make it obsolete?
3941 AC_DEFUN([AC_CONFIG_HEADER],
3942 [AC_CONFIG_HEADERS([$1])])
3945 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
3946 # --------------------------------------------------------
3947 # Specify that config.status should establish a (symbolic if possible)
3948 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
3949 # Reject DEST=., because it is makes it hard for ./config.status
3950 # to guess the links to establish (`./config.status .').
3951 AC_DEFUN([AC_CONFIG_LINKS],
3952 [AC_DIVERT_PUSH([KILL])
3953 _AC_CONFIG_UNIQUE([$1])
3954 _AC_CONFIG_DEPENDENCIES([$1])
3955 ifelse(regexp([$1], [^\.:\| \.:]), -1,,
3956 [AC_FATAL([$0: invalid destination: `.'])])
3957 m4_append([AC_LIST_LINKS], [ $1])
3958 dnl Register the commands
3959 ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
3960 [m4_append([AC_LIST_LINKS_COMMANDS],
3961 [ ]patsubst(AC_File, [:.*])[ ) $2 ;;
3963 _AC_CONFIG_COMMANDS_INIT([$3])
3965 ac_config_links="$ac_config_links $1"
3969 # Initialize the list.
3970 define([AC_LIST_LINKS])
3971 define([AC_LIST_LINKS_COMMANDS])
3974 # AC_LINK_FILES(SOURCE..., DEST...)
3975 # ---------------------------------
3976 # Link each of the existing files SOURCE... to the corresponding
3977 # link name in DEST...
3979 # Unfortunately we can't provide a very good autoupdate service here,
3980 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
3981 # and `$to' are actually lists. It would then be completely wrong to
3982 # replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the
3983 # case of literal values though, but because I don't think there is any
3984 # interest in creating config links with literal values, no special
3985 # mechanism is implemented to handle them.
3987 # _AC_LINK_CNT is used to be robust to multiple calls.
3988 AU_DEFUN([AC_LINK_FILES],
3990 [m4_fatal([$0: incorrect number of arguments])])dnl
3991 define([_AC_LINK_FILES_CNT], incr(_AC_LINK_FILES_CNT))dnl
3994 while test -n "$ac_sources"; do
3995 set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
3996 set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
3997 [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
3999 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
4002 It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
4003 to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant
4004 update, you should probably tune the result yourself.])# AC_LINK_FILES
4008 AU_DEFUN([_AC_LINK_FILES_CNT], 0)
4012 # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
4013 # -------------------------------------------------
4014 # Specify output files, as with AC_OUTPUT, i.e., files that are
4015 # configured with AC_SUBST. Associate the COMMANDS to each FILE,
4016 # i.e., when config.status creates FILE, run COMMANDS afterwards.
4018 # The commands are stored in a growing string AC_LIST_FILES_COMMANDS
4019 # which should be used like this:
4022 # AC_LIST_FILES_COMMANDS
4024 AC_DEFUN([AC_CONFIG_FILES],
4025 [AC_DIVERT_PUSH([KILL])
4026 _AC_CONFIG_UNIQUE([$1])
4027 _AC_CONFIG_DEPENDENCIES([$1])
4028 m4_append([AC_LIST_FILES], [ $1])
4029 dnl Register the commands.
4030 ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
4031 [m4_append([AC_LIST_FILES_COMMANDS],
4032 [ ]patsubst(AC_File, [:.*])[ ) $2 ;;
4034 _AC_CONFIG_COMMANDS_INIT([$3])
4036 ac_config_files="$ac_config_files $1"
4039 # Initialize the lists.
4040 define([AC_LIST_FILES])
4041 define([AC_LIST_FILES_COMMANDS])
4044 # AC_CONFIG_SUBDIRS(DIR ...)
4045 # --------------------------
4046 # We define two variables:
4048 # is built in the `default' section, and should contain *all*
4049 # the arguments of AC_CONFIG_SUBDIRS. It is used for --help=recursive.
4050 # It makes no sense for arguments which are sh variables.
4052 # which is built at runtime, so some of these dirs might not be
4053 # included, if for instance the user refused a part of the tree.
4054 # This is used in _AC_OUTPUT_SUBDIRS.
4055 # _AC_LIST_SUBDIRS is used only for _AC_CONFIG_UNIQUE.
4056 AC_DEFUN([AC_CONFIG_SUBDIRS],
4057 [_AC_CONFIG_UNIQUE([$1])dnl
4058 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
4059 m4_append([_AC_LIST_SUBDIRS], [ $1])dnl
4060 AC_VAR_IF_INDIR([$1],
4061 [AC_DIAGNOSE(syntax,
4062 [$0: you should use literals])])
4063 AC_DIVERT([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"])
4064 AC_SUBST(subdirs, "$subdirs $1")dnl
4067 # Initialize the list.
4068 define([_AC_LIST_SUBDIRS])
4071 # autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
4072 # -------------------------------------------------------------------
4074 # If there are arguments given to AC_OUTPUT, dispatch them to the
4075 # proper modern macros.
4077 AU_DEFUN([AC_OUTPUT],
4079 [AC_CONFIG_FILES([$1])
4082 [AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])
4085 [`AC_OUTPUT' should be used without arguments.])
4088 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
4089 # -------------------------------------------------------
4091 # Produce config.status, config.h, and links; and configure subdirs.
4092 # The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
4093 # Pay special attention not to have too long here docs: some old
4094 # shells die. Unfortunately the limit is not known precisely...
4096 [dnl Dispatch the extra arguments to their native macros.
4098 [AC_CONFIG_FILES([$1])])dnl
4100 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
4103 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
4105 test "x$prefix" = xNONE && prefix=$ac_default_prefix
4106 # Let make expand exec_prefix.
4107 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
4109 # Any assignment to VPATH causes Sun make to only execute
4110 # the first set of double-colon rules, so remove it if not needed.
4111 # If there is a colon in the path, we need to keep it.
4112 if test "x$srcdir" = x.; then
4113 ac_vpsub=['/^[ ]*VPATH[ ]*=[^:]*$/d']
4116 ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
4118 dnl Commands to run before creating config.status.
4119 AC_OUTPUT_COMMANDS_PRE()dnl
4121 # Save into config.log some information that might help in debugging.
4123 echo "Cache variables:" >&AC_FD_LOG
4124 _AC_CACHE_DUMP | sed -e 's/^/| /' >&AC_FD_LOG
4126 echo "confdefs.h:" >&AC_FD_LOG
4127 cat confdefs.h | sed -e 's/^/| /' >&AC_FD_LOG
4129 : ${CONFIG_STATUS=./config.status}
4130 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
4131 _AC_OUTPUT_CONFIG_STATUS()dnl
4132 rm -fr confdefs* $ac_clean_files
4133 trap 'exit 1' 1 2 15
4135 dnl Commands to run after config.status was created
4136 AC_OUTPUT_COMMANDS_POST()dnl
4138 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
4139 dnl config.status should not do recursion.
4140 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
4144 # _AC_OUTPUT_CONFIG_STATUS
4145 # ------------------------
4146 # Produce config.status. Called by AC_OUTPUT.
4147 # Pay special attention not to have too long here docs: some old
4148 # shells die. Unfortunately the limit is not known precisely...
4149 define([_AC_OUTPUT_CONFIG_STATUS],
4150 [echo creating $CONFIG_STATUS
4151 cat >$CONFIG_STATUS <<\EOF
4153 # Generated automatically by configure.
4154 # Run this file to recreate the current configuration.
4155 # Compiler output produced by configure, useful for debugging
4156 # configure, is in ./config.log if it exists.
4159 me=`echo "$[0]" | sed -e 's,.*/,,'`
4160 SHELL=${CONFIG_SHELL-/bin/sh}
4164 # Files that config.status was made for.
4165 if test -n "$ac_config_files"; then
4166 echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
4169 if test -n "$ac_config_headers"; then
4170 echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
4173 if test -n "$ac_config_links"; then
4174 echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
4177 if test -n "$ac_config_commands"; then
4178 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
4181 cat >>$CONFIG_STATUS <<\EOF
4184 \`$me' instantiates files from templates according to the
4185 current configuration.
4187 Usage: $[0] [[OPTIONS]] FILE...
4189 -h, --help print this help, then exit
4190 -V, --version print version number, then exit
4191 -d, --debug don't remove temporary files
4192 --recheck update $me by reconfiguring in the same conditions
4193 ifset([AC_LIST_FILES],
4194 [[ --file=FILE[:TEMPLATE]
4195 instantiate the configuration file FILE
4197 ifset([AC_LIST_HEADERS],
4198 [[ --header=FILE[:TEMPLATE]
4199 instantiate the configuration header FILE
4202 ifset([AC_LIST_FILES],
4203 [Configuration files:
4207 ifset([AC_LIST_HEADERS],
4208 [Configuration headers:
4212 ifset([AC_LIST_LINKS],
4213 [Configuration links:
4217 ifset([AC_LIST_COMMANDS],
4218 [Configuration commands:
4222 Report bugs to <bug-autoconf@gnu.org>."
4225 dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
4226 dnl so uname gets run too. Use two double quotes for font-lock.
4227 cat >>$CONFIG_STATUS <<EOF
4229 $CONFIG_STATUS generated by autoconf version AC_ACVERSION.
4230 Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
4231 `echo "[$]0 $ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
4233 ac_given_srcdir=$srcdir
4234 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
4235 [dnl Leave those double quotes here: this $INSTALL is evaluated in a
4236 dnl here document, wbich might result in `ac_given_srcdir=/bin/install -c'.
4237 ac_given_INSTALL="$INSTALL"
4241 cat >>$CONFIG_STATUS <<\EOF
4242 # If no file are specified by the user, then we need to provide default
4243 # value. By we need to know if files were specified by the user.
4245 while test $[#] != 0
4249 ac_option=`expr "x$[1]" : 'x\([[^=]]*\)='`
4250 ac_optarg=`expr "x$[1]" : 'x[[^=]]*=\(.*\)'`
4252 set dummy "$ac_option" "$ac_optarg" ${1+"$[@]"}
4256 *) # This is not an option, so the user has probably given explicit
4258 ac_need_defaults=false;;
4262 # Handling of the options.
4264 cat >>$CONFIG_STATUS <<EOF
4265 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4266 echo "running $SHELL $[0] " $ac_configure_args " --no-create --no-recursion"
4267 exec $SHELL $[0] $ac_configure_args --no-create --no-recursion ;;
4269 cat >>$CONFIG_STATUS <<\EOF
4270 --version | --vers* | -V )
4271 echo "$ac_cs_version"; exit 0 ;;
4273 # Conflict between --help and --header
4274 echo "$me: ambiguous option: $ac_option
4275 Try \`$me --help' for more information."; exit 1 ;;
4276 --help | --hel | -h )
4277 echo "$ac_cs_usage"; exit 0 ;;
4278 --debug | --d* | -d )
4280 --file | --fil | --fi | --f )
4282 CONFIG_FILES="$CONFIG_FILES $[1]"
4283 ac_need_defaults=false;;
4284 --header | --heade | --head | --hea )
4286 CONFIG_HEADERS="$CONFIG_HEADERS $[1]"
4287 ac_need_defaults=false;;
4289 # Handling of arguments.
4290 AC_FOREACH([AC_File], AC_LIST_FILES,
4291 [ 'patsubst(AC_File, [:.*])' )dnl
4292 CONFIG_FILES="$CONFIG_FILES AC_File" ;;
4294 AC_FOREACH([AC_File], AC_LIST_LINKS,
4295 [ 'patsubst(AC_File, [:.*])' )dnl
4296 CONFIG_LINKS="$CONFIG_LINKS AC_File" ;;
4298 AC_FOREACH([AC_File], AC_LIST_COMMANDS,
4299 [ 'patsubst(AC_File, [:.*])' )dnl
4300 CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;;
4302 AC_FOREACH([AC_File], AC_LIST_HEADERS,
4303 [ 'patsubst(AC_File, [:.*])' )dnl
4304 CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;;
4308 -*) echo "$me: unrecognized option: $[1]
4309 Try \`$me --help' for more information."; exit 1 ;;
4310 *) echo "$me: invalid argument: $[1]"; exit 1 ;;
4317 dnl Issue this section only if there were actually config files.
4318 dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS,
4319 dnl or AC_LIST_LINKS is set.
4320 ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(),
4321 [cat >>$CONFIG_STATUS <<\EOF
4322 # If the user did not use the arguments to specify the items to instantiate,
4323 # then the envvar interface is used. Set only those that are not.
4324 if $ac_need_defaults; then
4325 ifset([AC_LIST_FILES], [ : ${CONFIG_FILES=$config_files}
4327 ifset([AC_LIST_HEADERS], [ : ${CONFIG_HEADERS=$config_headers}
4329 ifset([AC_LIST_LINKS], [ : ${CONFIG_LINKS=$config_links}
4331 ifset([AC_LIST_COMMANDS], [ : ${CONFIG_COMMANDS=$config_commands}
4335 _AC_SHELL_TMPDIR(cs)
4340 dnl We output the INIT-CMDS first for obvious reasons :)
4341 ifset([_AC_OUTPUT_COMMANDS_INIT],
4342 [cat >>$CONFIG_STATUS <<EOF
4344 # INIT-COMMANDS section.
4347 _AC_OUTPUT_COMMANDS_INIT()
4351 dnl The following four sections are in charge of their own here
4352 dnl documenting into $CONFIG_STATUS.
4353 ifset([AC_LIST_FILES], [_AC_OUTPUT_FILES()])dnl
4354 ifset([AC_LIST_HEADERS], [_AC_OUTPUT_HEADERS()])dnl
4355 ifset([AC_LIST_LINKS], [_AC_OUTPUT_LINKS()])dnl
4356 ifset([AC_LIST_COMMANDS], [_AC_OUTPUT_COMMANDS()])dnl
4358 cat >>$CONFIG_STATUS <<\EOF
4362 chmod +x $CONFIG_STATUS
4363 ])# _AC_OUTPUT_CONFIG_STATUS
4366 # AC_OUTPUT_MAKE_DEFS
4367 # -------------------
4368 # Set the DEFS variable to the -D options determined earlier.
4369 # This is a subroutine of AC_OUTPUT.
4370 # It is called inside configure, outside of config.status.
4371 # Using a here document instead of a string reduces the quoting nightmare.
4372 define([AC_OUTPUT_MAKE_DEFS],
4373 [[# Transform confdefs.h into DEFS.
4374 # Protect against shell expansion while executing Makefile rules.
4375 # Protect against Makefile macro expansion.
4377 # If the first sed substitution is executed (which looks for macros that
4378 # take arguments), then we branch to the cleanup section. Otherwise,
4379 # look for a macro that doesn't take arguments.
4380 cat >confdef2opt.sed <<\EOF
4383 s%^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
4385 s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\1=\2%g
4387 s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
4392 # We use echo to avoid assuming a particular line-breaking character.
4393 # The extra dot is to prevent the shell from consuming trailing
4394 # line-breaks from the sub-command output. A line-break within
4395 # single-quotes doesn't work because, if this script is created in a
4396 # platform that uses two characters for line-breaks (e.g., DOS), tr
4398 ac_LF_and_DOT=`echo; echo .`
4399 DEFS=`sed -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
4400 rm -f confdef2opt.sed
4401 ]])# AC_OUTPUT_MAKE_DEFS
4406 # Do the variable substitutions to create the Makefiles or whatever.
4407 # This is a subroutine of AC_OUTPUT.
4409 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
4410 # Upon exit, no here document shall be opened.
4411 define([_AC_OUTPUT_FILES],
4412 [cat >>$CONFIG_STATUS <<EOF
4415 # CONFIG_FILES section.
4418 # No need to generate the scripts if there are no CONFIG_FILES.
4419 # This happens for instance when ./config.status config.h
4420 if test -n "\$CONFIG_FILES"; then
4421 # Protect against being on the right side of a sed subst in config.status.
4422 dnl Please, pay attention that this sed code depends a lot on the shape
4423 dnl of the sed commands issued by AC_SUBST. So if you change one, change
4425 [ sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
4426 s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$tmp/subs.sed <<\\CEOF]
4427 dnl These here document variables are unquoted when configure runs
4428 dnl but quoted when config.status runs, so variables are expanded once.
4429 dnl Insert the sed substitutions of variables.
4430 _AC_SUBST_SED_PROGRAM()dnl
4435 cat >>$CONFIG_STATUS <<\EOF
4436 # Split the substitutions into bite-sized pieces for seds with
4437 # small command number limits, like on Digital OSF/1 and HP-UX.
4438 dnl One cannot portably go further than 100 commands because of HP-UX.
4439 dnl Here, there are 2 cmd per line, and two cmd are added later.
4441 ac_sed_frag=1 # Number of current file.
4442 ac_beg=1 # First line for current file.
4443 ac_end=$ac_max_sed_lines # Line after last line for current file.
4446 while $ac_more_lines; do
4447 if test $ac_beg -gt 1; then
4448 sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
4450 sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
4452 if test ! -s $tmp/subs.frag; then
4455 # The purpose of the label and of the branching condition is to
4456 # speed up the sed processing (if there are no `@' at all, there
4457 # is no need to browse any of the substitutions).
4458 # These are the two extra sed commands mentioned above.
4460 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b'] && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
4461 if test -z "$ac_sed_cmds"; then
4462 ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
4464 ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
4466 ac_sed_frag=`expr $ac_sed_frag + 1`
4468 ac_end=`expr $ac_end + $ac_max_sed_lines`
4471 if test -z "$ac_sed_cmds"; then
4474 fi # test -n "$CONFIG_FILES"
4477 cat >>$CONFIG_STATUS <<\EOF
4478 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
4479 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4481 *:*) ac_file_in=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
4482 ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4483 *) ac_file_in=$ac_file.in ;;
4486 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
4488 # Remove last slash and all that follows it. Not all systems have dirname.
4489 ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
4490 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4491 # The file is in a subdirectory.
4492 dnl FIXME: should actually be mkinstalldirs (parents may have
4493 dnl to be created too).
4494 test -d "$ac_dir" || mkdir "$ac_dir"
4495 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
4496 # A "../" for each directory in $ac_dir_suffix.
4497 ac_dots=`echo "$ac_dir_suffix" | sed 's%/[[^/]]*%../%g'`
4499 ac_dir_suffix= ac_dots=
4502 case $ac_given_srcdir in
4504 if test -z "$ac_dots"; then top_srcdir=.
4505 else top_srcdir=`echo $ac_dots | sed 's%/$%%'`; fi ;;
4506 [[\\/]]* | ?:[[\\/]]* )
4507 srcdir=$ac_given_srcdir$ac_dir_suffix;
4508 top_srcdir=$ac_given_srcdir ;;
4510 srcdir=$ac_dots$ac_given_srcdir$ac_dir_suffix
4511 top_srcdir=$ac_dots$ac_given_srcdir ;;
4514 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
4515 [ case $ac_given_INSTALL in
4516 [[\\/$]]* | ?:[[\\/]]* ) INSTALL=$ac_given_INSTALL ;;
4517 *) INSTALL=$ac_dots$ac_given_INSTALL ;;
4521 echo creating "$ac_file"
4523 configure_input="Generated automatically from `echo $ac_file_in |
4524 sed 's%.*/%%'` by configure."
4526 # Don't redirect the output to AC_FILE directly: use `mv' so that
4527 # updating is atomic, and doesn't need trapping.
4528 ac_file_inputs=`IFS=:
4529 for f in $ac_file_in; do echo $ac_given_srcdir/$f; done`
4530 for ac_file_input in $ac_file_inputs;
4532 test -f "$ac_file_input" ||
4533 AC_MSG_ERROR(cannot find input file `$ac_file_input')
4536 cat >>$CONFIG_STATUS <<EOF
4537 dnl Neutralize VPATH when `$srcdir' = `.'.
4539 dnl Shell code in configure.in might set extrasub.
4540 dnl FIXME: do we really want to maintain this feature?
4543 cat >>$CONFIG_STATUS <<\EOF
4545 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
4546 s%@configure_input@%$configure_input%;t t
4547 s%@srcdir@%$srcdir%;t t
4548 s%@top_srcdir@%$top_srcdir%;t t
4549 AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%;t t
4551 dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
4552 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
4553 dnl This would break Makefile dependencies.
4554 dnl if cmp -s $ac_file $tmp/out 2>/dev/null; then
4555 dnl echo "$ac_file is unchanged"
4558 dnl mv $tmp/out $ac_file
4560 mv $tmp/out $ac_file
4562 ifset([AC_LIST_FILES_COMMANDS],
4563 [ # Run the commands associated with the file.
4565 AC_LIST_FILES_COMMANDS()dnl
4570 ])# _AC_OUTPUT_FILES
4573 # _AC_OUTPUT_HEADERS
4574 # ------------------
4576 # Output the code which instantiates the `config.h' files from their
4579 # This is a subroutine of _AC_OUTPUT_CONFIG_STATUS. It has to send
4580 # itself into $CONFIG_STATUS (eg, via here documents). Upon exit, no
4581 # here document shall be opened.
4584 # The code produced used to be extremely costly: there are was a
4585 # single sed script (n lines) handling both `#define' templates,
4586 # `#undef' templates with trailing space, and `#undef' templates
4587 # without trailing spaces. The full script was run on each of the m
4588 # lines of `config.h.in', i.e., about n x m.
4590 # Now there are two scripts: `conftest.defines' for the `#define'
4591 # templates, and `conftest.undef' for the `#undef' templates.
4593 # Optimization 1. It is incredibly costly to run two `#undef'
4594 # scripts, so just remove trailing spaces first. Removes about a
4595 # third of the cost.
4597 # Optimization 2. Since `#define' are rare and obsoleted,
4598 # `conftest.defines' is built and run only if grep says there are
4599 # `#define'. Improves by at least a factor 2, since in addition we
4600 # avoid the cost of *producing* the sed script.
4602 # Optimization 3. In each script, first check that the current input
4603 # line is a template. This avoids running the full sed script on
4604 # empty lines and comments (divides the cost by about 3 since each
4605 # template chunk is typically a comment, a template, an empty line).
4607 # Optimization 4. Once a substitution performed, since there can be
4608 # only one per line, immediately restart the script on the next input
4609 # line (using the `t' sed instruction). Divides by about 2.
4610 # *Note:* In the case of the AC_SUBST sed script (_AC_OUTPUT_FILES)
4611 # this optimization cannot be applied as is, because there can be
4612 # several substitutions per line.
4615 # The result is about, hm, ... times blah... plus.... Ahem. The
4616 # result is about much faster.
4617 define([_AC_OUTPUT_HEADERS],
4618 [cat >>$CONFIG_STATUS <<\EOF
4621 # CONFIG_HEADER section.
4624 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
4625 # NAME is the cpp macro being defined and VALUE is the value it is being given.
4627 # ac_d sets the value in "#define NAME VALUE" lines.
4628 dnl Double quote for the `[ ]' and `define'.
4629 [ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
4630 ac_dB='[ ].*$%\1#\2'
4633 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
4634 ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
4635 ac_uB='$%\1#\2define\3'
4639 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
4640 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4642 *:*) ac_file_in=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
4643 ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4644 *) ac_file_in=$ac_file.in ;;
4647 echo creating $ac_file
4649 ac_file_inputs=`echo "$ac_file_in" |
4650 sed -e "s%^%$ac_given_srcdir/%;s%:% $ac_given_srcdir/%g"`
4651 for ac_file_input in $ac_file_inputs;
4653 test -f "$ac_file_input" ||
4654 AC_MSG_ERROR(cannot find input file `$ac_file_input')
4656 # Remove the trailing spaces.
4657 sed -e 's/[[ ]]*$//' $ac_file_inputs >$tmp/in
4661 # Transform confdefs.h into two sed scripts, `conftest.defines' and
4662 # `conftest.undefs', that substitutes the proper values into
4663 # config.h.in to produce config.h. The first handles `#define'
4664 # templates, and the second `#undef' templates.
4665 # And first: Protect against being on the right side of a sed subst in
4666 # config.status. Protect against being in an unquoted here document
4668 rm -f conftest.defines conftest.undefs
4669 # Using a here document instead of a string reduces the quoting nightmare.
4670 # Putting comments in sed scripts is not portable.
4672 # `cleanup' is used to avoid that the second main sed command (meant for
4673 # 0-ary CPP macros) applies to n-ary macro definitions. So we use
4674 # `t cleanup' to jump over the second main sed command when it succeeded.
4675 # See the Autoconf documentation for `clear'.
4676 cat >confdef2sed.sed <<\EOF
4677 dnl Double quote for `[ ]' and `define'.
4682 s%^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
4684 s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
4687 # If some macros were called several times there might be several times
4688 # the same #defines, which is useless. Nevertheless, we may not want to
4689 # sort them, since we want the *last* AC_DEFINE to be honored.
4690 uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
4691 sed -e 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
4692 rm -f confdef2sed.sed
4694 # This sed command replaces #undef with comments. This is necessary, for
4695 # example, in the case of _POSIX_SOURCE, which is predefined and required
4696 # on some systems where configure will not decide to define it.
4697 cat >>conftest.undefs <<\EOF
4698 [s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%]
4701 # Break up conftest.defines because some shells have a limit on the size
4702 # of here documents, and old seds have small limits too (100 cmds).
4703 echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
4704 echo ' if egrep ["^[ ]*#[ ]*define"] $tmp/in >/dev/null; then' >>$CONFIG_STATUS
4705 echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
4706 echo ' :' >>$CONFIG_STATUS
4708 while grep . conftest.defines >/dev/null
4710 # Write a limited-size here document to $tmp/frag.
4711 echo ' cat >$tmp/frag <<CEOF' >>$CONFIG_STATUS
4712 dnl Speed up: don't consider the non `#define' lines.
4713 echo ['/^[ ]*#[ ]*define/!b'] >>$CONFIG_STATUS
4714 sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
4716 sed -f $tmp/frag $tmp/in >$tmp/out
4720 sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
4721 rm -f conftest.defines
4722 mv conftest.tail conftest.defines
4724 rm -f conftest.defines
4725 echo ' fi # egrep' >>$CONFIG_STATUS
4726 echo >>$CONFIG_STATUS
4728 # Break up conftest.undefs because some shells have a limit on the size
4729 # of here documents, and old seds have small limits too (100 cmds).
4730 echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
4732 while grep . conftest.undefs >/dev/null
4734 # Write a limited-size here document to $tmp/frag.
4735 echo ' cat >$tmp/frag <<CEOF' >>$CONFIG_STATUS
4736 dnl Speed up: don't consider the non `#undef'
4737 echo ['/^[ ]*#[ ]*undef/!b'] >>$CONFIG_STATUS
4738 sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
4740 sed -f $tmp/frag $tmp/in >$tmp/out
4744 sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
4745 rm -f conftest.undefs
4746 mv conftest.tail conftest.undefs
4748 rm -f conftest.undefs
4750 dnl Now back to your regularly scheduled config.status.
4751 cat >>$CONFIG_STATUS <<\EOF
4752 echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h
4753 cat $tmp/in >>$tmp/config.h
4755 if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
4756 echo "$ac_file is unchanged"
4758 # Remove last slash and all that follows it. Not all systems have dirname.
4759 ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
4760 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4761 # The file is in a subdirectory.
4762 dnl FIXME: should actually be mkinstalldirs (parents may have
4763 dnl to be created too).
4764 test -d "$ac_dir" || mkdir "$ac_dir"
4767 mv $tmp/config.h $ac_file
4769 ifset([AC_LIST_HEADERS_COMMANDS],
4770 [ # Run the commands associated with the file.
4772 AC_LIST_HEADERS_COMMANDS()dnl
4777 ])# _AC_OUTPUT_HEADERS
4782 # This is a subroutine of AC_OUTPUT.
4784 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
4785 # Upon exit, no here document shall be opened.
4786 define([_AC_OUTPUT_LINKS],
4787 [cat >>$CONFIG_STATUS <<\EOF
4790 # CONFIG_LINKS section.
4792 srcdir=$ac_given_srcdir
4794 dnl Here we use : instead of .. because if AC_LINK_FILES was used
4795 dnl with empty parameters (as in gettext.m4), then we obtain here
4796 dnl `:', which we want to skip. So let's keep a single exception: `:'.
4797 for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
4798 ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
4799 ac_source=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
4801 echo "linking $srcdir/$ac_source to $ac_dest"
4803 if test ! -r $srcdir/$ac_source; then
4804 AC_MSG_ERROR($srcdir/$ac_source: File not found)
4808 # Make relative symlinks.
4809 # Remove last slash and all that follows it. Not all systems have dirname.
4810 ac_dest_dir=`echo $ac_dest | sed 's%/[[^/][^/]]*$%%'`
4811 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
4812 # The dest file is in a subdirectory.
4813 dnl FIXME: should actually be mkinstalldirs (parents may have
4814 dnl to be created too).
4815 test -d "$ac_dest_dir" || mkdir "$ac_dest_dir"
4816 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
4817 # A "../" for each directory in $ac_dest_dir_suffix.
4818 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[[^/]]*%../%g'`
4820 ac_dest_dir_suffix= ac_dots=
4824 [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
4825 *) ac_rel_source=$ac_dots$srcdir/$ac_source ;;
4828 # Make a symlink if possible; otherwise try a hard link.
4829 if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
4830 ln $srcdir/$ac_source $ac_dest; then :
4832 AC_MSG_ERROR(cannot link $ac_dest to $srcdir/$ac_source)
4834 ifset([AC_LIST_LINKS_COMMANDS],
4835 [ # Run the commands associated with the file.
4837 AC_LIST_LINKS_COMMANDS()dnl
4842 ])# _AC_OUTPUT_LINKS
4845 # _AC_OUTPUT_COMMANDS
4846 # -------------------
4847 # This is a subroutine of AC_OUTPUT, in charge of issuing the code
4848 # related to AC_CONFIG_COMMANDS.
4850 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
4851 # Upon exit, no here document shall be opened.
4852 define([_AC_OUTPUT_COMMANDS],
4853 [cat >>$CONFIG_STATUS <<\EOF
4856 # CONFIG_COMMANDS section.
4858 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
4859 ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
4860 ac_source=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
4862 dnl FIXME: Until Automake uses the new features of config.status, we
4863 dnl should keep this silent. Otherwise, because Automake runs this in
4864 dnl each directory, it quickly becomes annoying.
4865 dnl echo "executing commands of $ac_dest"
4867 AC_LIST_COMMANDS_COMMANDS()dnl
4871 ])# _AC_OUTPUT_COMMANDS
4874 # _AC_OUTPUT_SUBDIRS
4875 # ------------------
4876 # This is a subroutine of AC_OUTPUT, but it does not go into
4877 # config.status, rather, it is called after running config.status.
4878 define([_AC_OUTPUT_SUBDIRS],
4881 # CONFIG_SUBDIRS section.
4883 if test "$no_recursion" != yes; then
4885 # Remove --cache-file and --srcdir arguments so they do not pile up.
4886 ac_sub_configure_args=
4888 for ac_arg in $ac_configure_args; do
4889 if test -n "$ac_prev"; then
4894 -cache-file | --cache-file | --cache-fil | --cache-fi \
4895 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
4896 ac_prev=cache_file ;;
4897 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
4898 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
4901 --config-cache | -C)
4903 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
4905 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
4907 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
4911 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
4912 [ ac_given_INSTALL=$INSTALL
4915 for ac_subdir in : $subdirs; do test "x$ac_subdir" = x: && continue
4917 # Do not complain, so a configure script can configure whichever
4918 # parts of a large source tree are present.
4919 test -d $srcdir/$ac_subdir || continue
4921 echo configuring in $ac_subdir
4925 dnl FIXME: should actually be mkinstalldirs (parents may have
4926 dnl to be created too).
4927 if test -d ./$ac_subdir || mkdir ./$ac_subdir; then :;
4929 AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
4937 # A "../" for each directory in /$ac_subdir.
4938 ac_dots=`echo $ac_subdir |
4939 sed -e 's%^\./%%;s%[[^/]]$%&/%;s%[[^/]]*/%../%g'`
4942 .) # No --srcdir option. We are building in place.
4943 ac_sub_srcdir=$srcdir ;;
4944 [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
4945 ac_sub_srcdir=$srcdir/$ac_subdir ;;
4947 ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
4950 # Check for guested configure; otherwise get Cygnus style configure.
4951 if test -f $ac_sub_srcdir/configure; then
4952 ac_sub_configure="$SHELL $ac_sub_srcdir/configure"
4953 elif test -f $ac_sub_srcdir/configure.in; then
4954 ac_sub_configure=$ac_configure
4956 AC_MSG_WARN(no configuration information is in $ac_subdir)
4960 # The recursion is here.
4961 if test -n "$ac_sub_configure"; then
4962 # Make the cache file name correct relative to the subdirectory.
4964 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
4966 ac_sub_cache_file=$ac_dots$cache_file ;;
4968 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
4969 [ case $ac_given_INSTALL in
4970 [[\\/$]]* | ?:[[\\/]]*) INSTALL=$ac_given_INSTALL ;;
4971 *) INSTALL=$ac_dots$ac_given_INSTALL ;;
4975 echo "[running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
4976 # The eval makes quoting arguments work.
4977 if eval $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
4980 AC_MSG_ERROR($ac_sub_configure failed for $ac_subdir)
4987 ])# _AC_OUTPUT_SUBDIRS
4990 # AC_LINKER_OPTION(LINKER-OPTIONS, SHELL-VARIABLE)
4991 # ------------------------------------------------
4993 # Specifying options to the compiler (whether it be the C, C++ or
4994 # Fortran 77 compiler) that are meant for the linker is compiler
4995 # dependent. This macro lets you give options to the compiler that
4996 # are meant for the linker in a portable, compiler-independent way.
4998 # This macro take two arguments, a list of linker options that the
4999 # compiler should pass to the linker (LINKER-OPTIONS) and the name of
5000 # a shell variable (SHELL-VARIABLE). The list of linker options are
5001 # appended to the shell variable in a compiler-dependent way.
5003 # For example, if the selected language is C, then this:
5005 # AC_LINKER_OPTION([-R /usr/local/lib/foo], foo_LDFLAGS)
5007 # will expand into this if the selected C compiler is gcc:
5009 # foo_LDFLAGS="-Xlinker -R -Xlinker /usr/local/lib/foo"
5011 # otherwise, it will expand into this:
5013 # foo_LDFLAGS"-R /usr/local/lib/foo"
5015 # You are encouraged to add support for compilers that this macro
5016 # doesn't currently support.
5017 # FIXME: Get rid of this macro.
5018 AC_DEFUN([AC_LINKER_OPTION],
5019 [AC_LANG_CASE([C], [test x"$GCC" = xyes && using_gnu_compiler=yes],
5020 [C++], [test x"$GXX" = xyes && using_gnu_compiler=yes],
5021 [FORTRAN77], [test x"$G77" = xyes && using_gnu_compiler=yes],
5022 [using_gnu_compiler=])
5024 dnl I don't understand the point of having the test inside of the
5026 for ac_link_opt in $1; do
5027 if test x"$using_gnu_compiler" = xyes; then
5028 $2="[$]$2 -Xlinker $ac_link_opt"
5030 $2="[$]$2 $ac_link_opt"
5035 # AC_LIST_MEMBER_OF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
5036 # --------------------------------------------------------------------------
5038 # Processing the elements of a list is tedious in shell programming,
5039 # as lists tend to be implemented as space delimited strings.
5041 # This macro searches LIST for ELEMENT, and executes ACTION-IF-FOUND
5042 # if ELEMENT is a member of LIST, otherwise it executes
5043 # ACTION-IF-NOT-FOUND.
5044 AC_DEFUN([AC_LIST_MEMBER_OF],
5045 [dnl Do some sanity checking of the arguments.
5046 ifelse([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
5047 ifelse([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
5051 if test x"$1" = x"$ac_i"; then
5057 AC_SHELL_IFELSE([test x"$ac_exists" = xtrue], [$3], [$4])