Update autoconf to version 2.61
[msysgit.git] / share / autoconf / autoconf / status.m4
blob7f39190678e474376c64ac42728e3026738c6bda
1 # This file is part of Autoconf.                       -*- Autoconf -*-
2 # Parameterizing and creating config.status.
3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
4 # 2002, 2003, 2004, 2005, 2006 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)
9 # any later version.
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., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
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 # This file handles about all the preparation aspects for
54 # `config.status': registering the configuration files, the headers,
55 # the links, and the commands `config.status' will run.  There is a
56 # little mixture though of things actually handled by `configure',
57 # such as running the `configure' in the sub directories.  Minor
58 # detail.
60 # There are two kinds of commands:
62 # COMMANDS:
64 #   They are output into `config.status' via a quoted here doc.  These
65 #   commands are always associated to a tag which the user can use to
66 #   tell `config.status' what are the commands she wants to run.
68 # INIT-CMDS:
70 #   They are output via an *unquoted* here-doc.  As a consequence $var
71 #   will be output as the value of VAR.  This is typically used by
72 #   `configure' to give `config.status' some variables it needs to run
73 #   the COMMANDS.  At the difference of COMMANDS, the INIT-CMDS are
74 #   always run.
77 # Honorable members of this family are AC_CONFIG_FILES,
78 # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS.  Bad boys
79 # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
80 # arguments.  False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
81 # and AC_CONFIG_AUX_DIR.  Cousins are AC_CONFIG_COMMANDS_PRE and
82 # AC_CONFIG_COMMANDS_POST.
85 ## ------------------ ##
86 ## Auxiliary macros.  ##
87 ## ------------------ ##
89 # _AC_SRCDIRS(BUILD-DIR-NAME)
90 # ---------------------------
91 # Inputs:
92 #   - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
93 #   - `$srcdir' is `top-build -> top-src'
95 # Outputs:
96 # - `ac_builddir' is `.', for symmetry only.
97 # - `ac_top_builddir_sub' is `build -> top_build'.
98 #      This is used for @top_builddir@.
99 # - `ac_top_build_prefix' is `build -> top_build'.
100 #      If not empty, has a trailing slash.
101 # - `ac_srcdir' is `build -> src'.
102 # - `ac_top_srcdir' is `build -> top-src'.
103 # and `ac_abs_builddir' etc., the absolute directory names.
104 m4_define([_AC_SRCDIRS],
105 [ac_builddir=.
107 case $1 in
108 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
110   ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
111   # A ".." for each directory in $ac_dir_suffix.
112   ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,/..,g;s,/,,'`
113   case $ac_top_builddir_sub in
114   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
115   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
116   esac ;;
117 esac
118 ac_abs_top_builddir=$ac_pwd
119 ac_abs_builddir=$ac_pwd$ac_dir_suffix
120 # for backward compatibility:
121 ac_top_builddir=$ac_top_build_prefix
123 case $srcdir in
124   .)  # We are building in place.
125     ac_srcdir=.
126     ac_top_srcdir=$ac_top_builddir_sub
127     ac_abs_top_srcdir=$ac_pwd ;;
128   [[\\/]]* | ?:[[\\/]]* )  # Absolute name.
129     ac_srcdir=$srcdir$ac_dir_suffix;
130     ac_top_srcdir=$srcdir
131     ac_abs_top_srcdir=$srcdir ;;
132   *) # Relative name.
133     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
134     ac_top_srcdir=$ac_top_build_prefix$srcdir
135     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
136 esac
137 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
138 ])# _AC_SRCDIRS
142 ## ---------------------- ##
143 ## Registering the tags.  ##
144 ## ---------------------- ##
147 # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
148 # -----------------------------------------
150 # Register INIT-COMMANDS as command pasted *unquoted* in
151 # `config.status'.  This is typically used to pass variables from
152 # `configure' to `config.status'.  Note that $[1] is not over quoted as
153 # was the case in AC_OUTPUT_COMMANDS.
154 m4_define([_AC_CONFIG_COMMANDS_INIT],
155 [m4_ifval([$1],
156           [m4_append([_AC_OUTPUT_COMMANDS_INIT],
157                      [$1
158 ])])])
161 # AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
162 # -----------------------------------------------------
163 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
165 # It announces DEST depends upon the SOURCE1 etc.
166 m4_define([AC_FILE_DEPENDENCY_TRACE], [])
169 # _AC_FILE_DEPENDENCY_TRACE_COLON(DEST:SOURCE1[:SOURCE2...])
170 # ----------------------------------------------------------
171 # Declare that DEST depends upon SOURCE1 etc.
173 m4_define([_AC_FILE_DEPENDENCY_TRACE_COLON],
174 [AC_FILE_DEPENDENCY_TRACE(m4_bpatsubst([$1], [:], [,]))dnl
178 # _AC_CONFIG_DEPENDENCY(MODE, DEST[:SOURCE1...])
179 # ---------------------------------------------
180 # MODE is `FILES', `HEADERS', or `LINKS'.
182 # Be sure that a missing dependency is expressed as a dependency upon
183 # `DEST.in' (except with config links).
185 m4_define([_AC_CONFIG_DEPENDENCY],
186 [_AC_FILE_DEPENDENCY_TRACE_COLON([$2]_AC_CONFIG_DEPENDENCY_DEFAULT($@))dnl
190 # _AC_CONFIG_DEPENDENCY_DEFAULT(MODE, DEST[:SOURCE1...])
191 # ------------------------------------------------------
192 # Expand to `:DEST.in' if appropriate, or to empty string otherwise.
194 # More detailed edscription:
195 # If the tag contains `:', expand to nothing.
196 # Otherwise, for a config file or header, add `:DEST.in'.
197 # For config link, DEST.in is not appropriate:
198 #  - if the tag is literal, complain.
199 #  - otherwise, just expand to nothing and proceed with fingers crossed.
200 #    (We get to this case from the obsolete AC_LINK_FILES, for example.)
202 m4_define([_AC_CONFIG_DEPENDENCY_DEFAULT],
203 [m4_bmatch([$2], [:], [],
204            [m4_if([$1], [LINKS],
205                   [AS_LITERAL_IF([$2], [AC_FATAL([Invalid AC_CONFIG_LINKS tag: `$2'])])],
206                   [:$2.in])])dnl
210 # _AC_CONFIG_UNIQUE(MODE, DEST)
211 # -----------------------------
212 # MODE is `FILES', `HEADERS', `LINKS', `COMMANDS', or `SUBDIRS'.
214 # Verify that there is no double definition of an output file.
216 m4_define([_AC_CONFIG_UNIQUE],
217 [m4_ifdef([_AC_SEEN_TAG($2)],
218    [AC_FATAL([`$2' is already registered with AC_CONFIG_]m4_defn([_AC_SEEN_TAG($2)]).)],
219    [m4_define([_AC_SEEN_TAG($2)], [$1])])dnl
223 # _AC_CONFIG_FOOS(MODE, TAGS..., [COMMANDS], [INIT-CMDS])
224 # -------------------------------------------------------
225 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
227 # Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,
228 # run COMMANDS afterwards.  (This is done in _AC_CONFIG_REGISTER_DEST.)
230 # For COMMANDS, do not m4_normalize TAGS before adding it to ac_config_commands.
231 # This historical difference allows macro calls in TAGS.
233 m4_define([_AC_CONFIG_FOOS],
234 [m4_foreach_w([AC_File], [$2],
235               [_AC_CONFIG_REGISTER([$1], m4_defn([AC_File]), [$3])])dnl
236 m4_define([_AC_SEEN_CONFIG(ANY)])dnl
237 m4_define([_AC_SEEN_CONFIG($1)])dnl
238 _AC_CONFIG_COMMANDS_INIT([$4])dnl
239 ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) dnl
240 m4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"
244 # _AC_CONFIG_REGISTER(MODE, TAG, [COMMANDS])
245 # ------------------------------------------
246 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
248 m4_define([_AC_CONFIG_REGISTER],
249 [m4_if([$1], [COMMANDS],
250        [],
251        [_AC_CONFIG_DEPENDENCY([$1], [$2])])dnl
252 _AC_CONFIG_REGISTER_DEST([$1], [$2], m4_bpatsubst([[$2]], [:.*\(.\)$], [\1]), [$3])dnl
256 # _AC_CONFIG_REGISTER_DEST(MODE, TAG, DEST, [COMMANDS])
257 # -----------------------------------------------------
258 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
259 # TAG is in the form DEST[:SOURCE...].
260 # Thus parameter $3 is the first part of $2.
262 # With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status
263 # to guess the links to establish (`./config.status .').
265 # Save the name of the first config header to AH_HEADER.
267 m4_define([_AC_CONFIG_REGISTER_DEST],
268 [_AC_CONFIG_UNIQUE([$1], [$3])dnl
269 m4_if([$1 $3], [LINKS .],
270       [AC_FATAL([invalid destination of a config link: `.'])])dnl
271 m4_if([$1], [HEADERS],
272       [m4_define_default([AH_HEADER], [$3])])dnl
274 dnl Recognize TAG as an argument to config.status:
276 m4_append([_AC_LIST_TAGS],
277 [    "$3") CONFIG_$1="$CONFIG_$1 $2" ;;
278 ])dnl
280 dnl Register the associated commands, if any:
282 m4_ifval([$4],
283 [m4_append([_AC_LIST_TAG_COMMANDS],
284 [    "$3":]m4_bpatsubst([$1], [^\(.\).*$], [\1])[) $4 ;;
285 ])])dnl
286 ])# _AC_CONFIG_REGISTER_DEST
291 ## --------------------- ##
292 ## Configuration files.  ##
293 ## --------------------- ##
296 # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
297 # -------------------------------------------------
298 # Specify output files, i.e., files that are configured with AC_SUBST.
300 AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)])
303 # _AC_SED_CMD_LIMIT
304 # -----------------
305 # Evaluate to an m4 number equal to the maximum number of commands to put
306 # in any single sed program, not counting ":" commands.
308 # Some seds have small command number limits, like on Digital OSF/1 and HP-UX.
309 m4_define([_AC_SED_CMD_LIMIT],
310 dnl One cannot portably go further than 99 commands because of HP-UX.
311 [99])
314 # _AC_OUTPUT_FILES_PREPARE
315 # ------------------------
316 # Create the sed scripts needed for CONFIG_FILES.
317 # Support multiline substitutions and make sure that the substitutions are
318 # not evaluated recursively.
319 # The intention is to have readable config.status and configure, even
320 # though this m4 code might be scaring.
322 # This code was written by Dan Manthey.
324 # This macro is expanded inside a here document.  If the here document is
325 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
327 m4_define([_AC_OUTPUT_FILES_PREPARE],
329 # Set up the sed scripts for CONFIG_FILES section.
331 dnl ... and define _AC_SED_CMDS, the pipeline which executes them.
332 m4_define([_AC_SED_CMDS], [])dnl
334 # No need to generate the scripts if there are no CONFIG_FILES.
335 # This happens for instance when ./config.status config.h
336 if test -n "$CONFIG_FILES"; then
338 _ACEOF
340 m4_pushdef([_AC_SED_FRAG_NUM], 0)dnl Fragment number.
341 m4_pushdef([_AC_SED_CMD_NUM], 2)dnl Num of commands in current frag so far.
342 m4_pushdef([_AC_SED_DELIM_NUM], 0)dnl Expected number of delimiters in file.
343 m4_pushdef([_AC_SED_FRAG], [])dnl The constant part of the current fragment.
345 m4_ifdef([_AC_SUBST_FILES],
346 [# Create sed commands to just substitute file output variables.
348 m4_foreach_w([_AC_Var], m4_defn([_AC_SUBST_FILES]),
349 [dnl End fragments at beginning of loop so that last fragment is not ended.
350 m4_if(m4_eval(_AC_SED_CMD_NUM + 3 > _AC_SED_CMD_LIMIT), 1,
351 [dnl Fragment is full and not the last one, so no need for the final un-escape.
352 dnl Increment fragment number.
353 m4_define([_AC_SED_FRAG_NUM], m4_incr(_AC_SED_FRAG_NUM))dnl
354 dnl Record that this fragment will need to be used.
355 m4_define([_AC_SED_CMDS],
356   m4_defn([_AC_SED_CMDS])[| sed -f "$tmp/subs-]_AC_SED_FRAG_NUM[.sed" ])dnl
357 [cat >>$CONFIG_STATUS <<_ACEOF
358 cat >"\$tmp/subs-]_AC_SED_FRAG_NUM[.sed" <<\CEOF
359 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
360 ]m4_defn([_AC_SED_FRAG])dnl
361 [CEOF
363 _ACEOF
364 ]m4_define([_AC_SED_CMD_NUM], 2)m4_define([_AC_SED_FRAG])dnl
365 ])dnl Last fragment ended.
366 m4_define([_AC_SED_CMD_NUM], m4_eval(_AC_SED_CMD_NUM + 3))dnl
367 m4_define([_AC_SED_FRAG],
368 m4_defn([_AC_SED_FRAG])dnl
369 [/^[     ]*@]_AC_Var[@[  ]*$/{
370 r $]_AC_Var[
373 ])dnl
374 ])dnl
375 # Remaining file output variables are in a fragment that also has non-file
376 # output varibles.
380 m4_define([_AC_SED_FRAG], [
381 ]m4_defn([_AC_SED_FRAG]))dnl
382 m4_foreach_w([_AC_Var],
383 m4_ifdef([_AC_SUBST_VARS], [m4_defn([_AC_SUBST_VARS]) ])[@END@],
384 [m4_if(_AC_SED_DELIM_NUM, 0,
385 [m4_if(_AC_Var, [@END@],
386 [dnl The whole of the last fragment would be the final deletion of `|#_!!_#|'.
387 m4_define([_AC_SED_CMDS], m4_defn([_AC_SED_CMDS])[| sed 's/|#_!!_#|//g' ])],
389 ac_delim='%!_!# '
390 for ac_last_try in false false false false false :; do
391   cat >conf$$subs.sed <<_ACEOF
392 ])])dnl
393 m4_if(_AC_Var, [@END@],
394       [m4_if(m4_eval(_AC_SED_CMD_NUM + 2 <= _AC_SED_CMD_LIMIT), 1,
395              [m4_define([_AC_SED_FRAG], [ end]m4_defn([_AC_SED_FRAG]))])],
396 [m4_define([_AC_SED_CMD_NUM], m4_incr(_AC_SED_CMD_NUM))dnl
397 m4_define([_AC_SED_DELIM_NUM], m4_incr(_AC_SED_DELIM_NUM))dnl
398 _AC_Var!$_AC_Var$ac_delim
399 ])dnl
400 m4_if(_AC_SED_CMD_LIMIT,
401       m4_if(_AC_Var, [@END@], m4_if(_AC_SED_CMD_NUM, 2, 2, _AC_SED_CMD_LIMIT), _AC_SED_CMD_NUM),
402 [_ACEOF
404 dnl Do not use grep on conf$$subs.sed, since AIX grep has a line length limit.
405   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = _AC_SED_DELIM_NUM; then
406     break
407   elif $ac_last_try; then
408     AC_MSG_ERROR([could not make $CONFIG_STATUS])
409   else
410     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
411   fi
412 done
414 dnl Similarly, avoid grep here too.
415 ac_eof=`sed -n '/^CEOF[[0-9]]*$/s/CEOF/0/p' conf$$subs.sed`
416 if test -n "$ac_eof"; then
417   ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
418   ac_eof=`expr $ac_eof + 1`
421 dnl Increment fragment number.
422 m4_define([_AC_SED_FRAG_NUM], m4_incr(_AC_SED_FRAG_NUM))dnl
423 dnl Record that this fragment will need to be used.
424 m4_define([_AC_SED_CMDS],
425 m4_defn([_AC_SED_CMDS])[| sed -f "$tmp/subs-]_AC_SED_FRAG_NUM[.sed" ])dnl
426 [cat >>$CONFIG_STATUS <<_ACEOF
427 cat >"\$tmp/subs-]_AC_SED_FRAG_NUM[.sed" <<\CEOF$ac_eof
428 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b]m4_defn([_AC_SED_FRAG])dnl
429 [_ACEOF
430 sed '
431 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
432 s/^/s,@/; s/!/@,|#_!!_#|/
434 t n
435 s/'"$ac_delim"'$/,g/; t
436 s/$/\\/; p
437 N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
438 ' >>$CONFIG_STATUS <conf$$subs.sed
439 rm -f conf$$subs.sed
440 cat >>$CONFIG_STATUS <<_ACEOF
441 ]m4_if(_AC_Var, [@END@],
442 [m4_if(m4_eval(_AC_SED_CMD_NUM + 2 > _AC_SED_CMD_LIMIT), 1,
443 [m4_define([_AC_SED_CMDS], m4_defn([_AC_SED_CMDS])[| sed 's/|#_!!_#|//g' ])],
444 [[:end
445 s/|#_!!_#|//g
446 ]])])dnl
447 CEOF$ac_eof
448 _ACEOF
449 m4_define([_AC_SED_FRAG], [
450 ])m4_define([_AC_SED_DELIM_NUM], 0)m4_define([_AC_SED_CMD_NUM], 2)dnl
452 ])])dnl
454 m4_popdef([_AC_SED_FRAG_NUM])dnl
455 m4_popdef([_AC_SED_CMD_NUM])dnl
456 m4_popdef([_AC_SED_DELIM_NUM])dnl
457 m4_popdef([_AC_SED_FRAG])dnl
459 # VPATH may cause trouble with some makes, so we remove $(srcdir),
460 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
461 # trailing colons and then remove the whole line if VPATH becomes empty
462 # (actually we leave an empty line to preserve line numbers).
463 if test "x$srcdir" = x.; then
464   ac_vpsub=['/^[         ]*VPATH[        ]*=/{
465 s/:*\$(srcdir):*/:/
466 s/:*\${srcdir}:*/:/
467 s/:*@srcdir@:*/:/
468 s/^\([^=]*=[     ]*\):*/\1/
469 s/:*$//
470 s/^[^=]*=[       ]*$//
474 cat >>$CONFIG_STATUS <<\_ACEOF
475 fi # test -n "$CONFIG_FILES"
477 ])# _AC_OUTPUT_FILES_PREPARE
480 # _AC_OUTPUT_FILE
481 # ---------------
482 # Do the variable substitutions to create the Makefiles or whatever.
484 # This macro is expanded inside a here document.  If the here document is
485 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
487 m4_define([_AC_OUTPUT_FILE],
489   #
490   # CONFIG_FILE
491   #
493 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
494 [  case $INSTALL in
495   [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
496   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
497   esac
498 ])dnl
499 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
500 [  ac_MKDIR_P=$MKDIR_P
501   case $MKDIR_P in
502   [[\\/$]]* | ?:[[\\/]]* ) ;;
503   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
504   esac
505 ])dnl
506 _ACEOF
508 m4_ifndef([AC_DATAROOTDIR_CHECKED],
509 [cat >>$CONFIG_STATUS <<\_ACEOF
510 # If the template does not know about datarootdir, expand it.
511 # FIXME: This hack should be removed a few years after 2.60.
512 ac_datarootdir_hack=; ac_datarootdir_seen=
513 m4_define([_AC_datarootdir_vars],
514           [datadir, docdir, infodir, localedir, mandir])
515 case `sed -n '/datarootdir/ {
516   p
517   q
519 m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
520            [/@_AC_Var@/p
521 ])' $ac_file_inputs` in
522 *datarootdir*) ac_datarootdir_seen=yes;;
523 *@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
524   AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
525 _ACEOF
526 cat >>$CONFIG_STATUS <<_ACEOF
527   ac_datarootdir_hack='
528   m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
529                [s&@_AC_Var@&$_AC_Var&g
530   ])dnl
531   s&\\\${datarootdir}&$datarootdir&g' ;;
532 esac
533 _ACEOF
534 ])dnl
536 # Neutralize VPATH when `$srcdir' = `.'.
537 # Shell code in configure.ac might set extrasub.
538 # FIXME: do we really want to maintain this feature?
539 cat >>$CONFIG_STATUS <<_ACEOF
540   sed "$ac_vpsub
541 $extrasub
542 _ACEOF
543 cat >>$CONFIG_STATUS <<\_ACEOF
545 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
546 dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
547 s&@configure_input@&$configure_input&;t t
548 dnl During the transition period, this is a special case:
549 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
550 m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
551                         builddir, abs_builddir,
552                         abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [[, MKDIR_P]]),
553            [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
554 ])dnl
555 m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
556 ])dnl
557 " $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out
559 m4_ifndef([AC_DATAROOTDIR_CHECKED],
560 [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
561   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
562   { ac_out=`sed -n '/^[[         ]]*datarootdir[[        ]]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
563   AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
564 which seems to be undefined.  Please make sure it is defined.])
565 ])dnl
567   rm -f "$tmp/stdin"
568   case $ac_file in
569   -) cat "$tmp/out"; rm -f "$tmp/out";;
570   *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
571   esac
572 dnl This would break Makefile dependencies:
573 dnl  if diff $ac_file "$tmp/out" >/dev/null 2>&1; then
574 dnl    echo "$ac_file is unchanged"
575 dnl  else
576 dnl     rm -f $ac_file; mv "$tmp/out" $ac_file
577 dnl  fi
578 ])# _AC_OUTPUT_FILE
583 ## ----------------------- ##
584 ## Configuration headers.  ##
585 ## ----------------------- ##
588 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
589 # ------------------------------------------------------
590 # Specify that the HEADERS are to be created by instantiation of the
591 # AC_DEFINEs.
593 AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])
596 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
597 # --------------------------------------
598 # FIXME: Make it obsolete?
599 AC_DEFUN([AC_CONFIG_HEADER],
600 [AC_CONFIG_HEADERS([$1])])
603 # _AC_OUTPUT_HEADER
604 # -----------------
606 # Output the code which instantiates the `config.h' files from their
607 # `config.h.in'.
609 # This macro is expanded inside a here document.  If the here document is
610 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
612 m4_define([_AC_OUTPUT_HEADER],
614   #
615   # CONFIG_HEADER
616   #
617 _ACEOF
619 # Transform confdefs.h into a sed script `conftest.defines', that
620 # substitutes the proper values into config.h.in to produce config.h.
621 rm -f conftest.defines conftest.tail
622 # First, append a space to every undef/define line, to ease matching.
623 echo 's/$/ /' >conftest.defines
624 # Then, protect against being on the right side of a sed subst, or in
625 # an unquoted here document, in config.status.  If some macros were
626 # called several times there might be several #defines for the same
627 # symbol, which is useless.  But do not sort them, since the last
628 # AC_DEFINE must be honored.
630 dnl Quote, for `[ ]' and `define'.
631 [ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
632 # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
633 # NAME is the cpp macro being defined, VALUE is the value it is being given.
634 # PARAMS is the parameter list in the macro definition--in most cases, it's
635 # just an empty string.
636 ac_dA='s,^\\([   #]*\\)[^        ]*\\([  ]*'
637 ac_dB='\\)[      (].*,\\1define\\2'
638 ac_dC=' '
639 ac_dD=' ,']
640 dnl ac_dD used to contain `;t' at the end, but that was both slow and incorrect.
641 dnl 1) Since the script must be broken into chunks containing 100 commands,
642 dnl the extra command meant extra calls to sed.
643 dnl 2) The code was incorrect: in the unusual case where a symbol has multiple
644 dnl different AC_DEFINEs, the last one should be honored.
646 dnl ac_dB works because every line has a space appended.  ac_dD reinserts
647 dnl the space, because some symbol may have been AC_DEFINEd several times.
649 dnl The first use of ac_dA has a space prepended, so that the second
650 dnl use does not match the initial 's' of $ac_dA.
652 uniq confdefs.h |
653   sed -n '
654         t rset
655         :rset
656         s/^[     ]*#[    ]*define[       ][      ]*//
657         t ok
658         d
659         :ok
660         s/[\\&,]/\\&/g
661         s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
662         s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
663   ' >>conftest.defines
665 # Remove the space that was appended to ease matching.
666 # Then replace #undef with comments.  This is necessary, for
667 # example, in the case of _POSIX_SOURCE, which is predefined and required
668 # on some systems where configure will not decide to define it.
669 # (The regexp can be short, since the line contains either #define or #undef.)
670 echo 's/ $//
671 [s,^[    #]*u.*,/* & */,]' >>conftest.defines
673 # Break up conftest.defines:
674 dnl If we cared only about not exceeding line count limits, we would use this:
675 dnl ac_max_sed_lines=m4_eval(_AC_SED_CMD_LIMIT - 3)
676 dnl But in practice this can generate scripts that contain too many bytes;
677 dnl and this can cause obscure 'sed' failures, e.g.,
678 dnl http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00127.html
679 dnl So instead, we use the following, which is about half the size we'd like:
680 ac_max_sed_lines=50
681 dnl In the future, let's use awk or sh instead of sed to do substitutions,
682 dnl since we have so many problems with sed.
684 # First sed command is:  sed -f defines.sed $ac_file_inputs >"$tmp/out1"
685 # Second one is:         sed -f defines.sed "$tmp/out1" >"$tmp/out2"
686 # Third one will be:     sed -f defines.sed "$tmp/out2" >"$tmp/out1"
687 # et cetera.
688 ac_in='$ac_file_inputs'
689 ac_out='"$tmp/out1"'
690 ac_nxt='"$tmp/out2"'
692 while :
694   # Write a here document:
695   dnl Quote, for the `[ ]' and `define'.
696 [  cat >>$CONFIG_STATUS <<_ACEOF
697     # First, check the format of the line:
698     cat >"\$tmp/defines.sed" <<\\CEOF
699 /^[      ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
700 /^[      ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
702 :def
703 _ACEOF]
704   sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
705   echo 'CEOF
706     sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
707   ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
708   sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
709   grep . conftest.tail >/dev/null || break
710   rm -f conftest.defines
711   mv conftest.tail conftest.defines
712 done
713 rm -f conftest.defines conftest.tail
715 dnl Now back to your regularly scheduled config.status.
716 echo "ac_result=$ac_in" >>$CONFIG_STATUS
717 cat >>$CONFIG_STATUS <<\_ACEOF
718   if test x"$ac_file" != x-; then
719     echo "/* $configure_input  */" >"$tmp/config.h"
720     cat "$ac_result" >>"$tmp/config.h"
721     if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
722       AC_MSG_NOTICE([$ac_file is unchanged])
723     else
724       rm -f $ac_file
725       mv "$tmp/config.h" $ac_file
726     fi
727   else
728     echo "/* $configure_input  */"
729     cat "$ac_result"
730   fi
731   rm -f "$tmp/out[12]"
732 dnl If running for Automake, be ready to perform additional
733 dnl commands to set up the timestamp files.
734 m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
735          [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])
736 ])dnl
737 ])# _AC_OUTPUT_HEADER
741 ## --------------------- ##
742 ## Configuration links.  ##
743 ## --------------------- ##
746 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
747 # --------------------------------------------------------
748 # Specify that config.status should establish a (symbolic if possible)
749 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
750 # Reject DEST=., because it is makes it hard for ./config.status
751 # to guess the links to establish (`./config.status .').
753 AC_DEFUN([AC_CONFIG_LINKS], [_AC_CONFIG_FOOS([LINKS], $@)])
756 # AC_LINK_FILES(SOURCE..., DEST...)
757 # ---------------------------------
758 # Link each of the existing files SOURCE... to the corresponding
759 # link name in DEST...
761 # Unfortunately we can't provide a very good autoupdate service here,
762 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
763 # and `$to' are actually lists.  It would then be completely wrong to
764 # replace it with `AC_CONFIG_LINKS($to:$from).  It is possible in the
765 # case of literal values though, but because I don't think there is any
766 # interest in creating config links with literal values, no special
767 # mechanism is implemented to handle them.
769 # _AC_LINK_FILES_CNT is used to be robust to multiple calls.
770 AU_DEFUN([AC_LINK_FILES],
771 [m4_if($#, 2, ,
772        [m4_fatal([$0: incorrect number of arguments])])dnl
773 m4_define_default([_AC_LINK_FILES_CNT], 0)dnl
774 m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
775 ac_sources="$1"
776 ac_dests="$2"
777 while test -n "$ac_sources"; do
778   set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
779   set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
780   [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
781 done
782 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
784 [It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
785 to AC_CONFIG_LINKS.  `autoupdate' provides a functional but inelegant
786 update, you should probably tune the result yourself.])# AC_LINK_FILES
789 # _AC_OUTPUT_LINK
790 # ---------------
791 # This macro is expanded inside a here document.  If the here document is
792 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
793 m4_define([_AC_OUTPUT_LINK],
795   #
796   # CONFIG_LINK
797   #
799   AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_file])
801   if test ! -r "$srcdir/$ac_source"; then
802     AC_MSG_ERROR([$srcdir/$ac_source: file not found])
803   fi
804   rm -f "$ac_file"
806   # Try a relative symlink, then a hard link, then a copy.
807   case $srcdir in
808   [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
809       *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;;
810   esac
811   ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
812     ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null ||
813     cp -p "$srcdir/$ac_source" "$ac_file" ||
814     AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_file])
815 ])# _AC_OUTPUT_LINK
819 ## ------------------------ ##
820 ## Configuration commands.  ##
821 ## ------------------------ ##
824 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
825 # ---------------------------------------------------
827 # Specify additional commands to be run by config.status.  This
828 # commands must be associated with a NAME, which should be thought
829 # as the name of a file the COMMANDS create.
831 AC_DEFUN([AC_CONFIG_COMMANDS], [_AC_CONFIG_FOOS([COMMANDS], $@)])
834 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
835 # -----------------------------------------
837 # Add additional commands for AC_OUTPUT to put into config.status.
839 # This macro is an obsolete version of AC_CONFIG_COMMANDS.  The only
840 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
841 # to give a unique key.  The scheme we have chosen is `default-1',
842 # `default-2' etc. for each call.
844 # Unfortunately this scheme is fragile: bad things might happen
845 # if you update an included file and configure.ac: you might have
846 # clashes :(  On the other hand, I'd like to avoid weird keys (e.g.,
847 # depending upon __file__ or the pid).
848 AU_DEFUN([AC_OUTPUT_COMMANDS],
849 [m4_define_default([_AC_OUTPUT_COMMANDS_CNT], 0)dnl
850 m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
851 dnl Double quoted since that was the case in the original macro.
852 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
856 # _AC_OUTPUT_COMMAND
857 # ------------------
858 # This macro is expanded inside a here document.  If the here document is
859 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
860 m4_define([_AC_OUTPUT_COMMAND],
861 [  AC_MSG_NOTICE([executing $ac_file commands])
866 ## -------------------------------------- ##
867 ## Pre- and post-config.status commands.  ##
868 ## -------------------------------------- ##
871 # AC_CONFIG_COMMANDS_PRE(CMDS)
872 # ----------------------------
873 # Commands to run right before config.status is created. Accumulates.
874 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
875 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
876 ])])
879 # AC_OUTPUT_COMMANDS_PRE
880 # ----------------------
881 # A *variable* in which we append all the actions that must be
882 # performed before *creating* config.status.  For a start, clean
883 # up all the LIBOBJ mess.
884 m4_define([AC_OUTPUT_COMMANDS_PRE],
885 [_AC_LIBOBJS_NORMALIZE
889 # AC_CONFIG_COMMANDS_POST(CMDS)
890 # -----------------------------
891 # Commands to run after config.status was created.  Accumulates.
892 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
893 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
894 ])])
896 # Initialize.
897 m4_define([AC_OUTPUT_COMMANDS_POST])
901 ## ----------------------- ##
902 ## Configuration subdirs.  ##
903 ## ----------------------- ##
906 # AC_CONFIG_SUBDIRS(DIR ...)
907 # --------------------------
908 # We define two variables:
909 # - _AC_LIST_SUBDIRS
910 #   A statically built list, should contain *all* the arguments of
911 #   AC_CONFIG_SUBDIRS.  The final value is assigned to ac_subdirs_all in
912 #   the `default' section, and used for --help=recursive.
913 #   It is also used in _AC_CONFIG_UNIQUE.
914 #   It makes no sense for arguments which are sh variables.
915 # - subdirs
916 #   Shell variable built at runtime, so some of these dirs might not be
917 #   included, if for instance the user refused a part of the tree.
918 #   This is used in _AC_OUTPUT_SUBDIRS.
919 AC_DEFUN([AC_CONFIG_SUBDIRS],
920 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
921 m4_foreach_w([_AC_Sub], [$1],
922              [_AC_CONFIG_UNIQUE([SUBDIRS],
923                                 m4_bpatsubst(m4_defn([_AC_Sub]), [:.*]))])dnl
924 m4_append([_AC_LIST_SUBDIRS], [$1], [
925 ])dnl
926 AS_LITERAL_IF([$1], [],
927               [AC_DIAGNOSE([syntax], [$0: you should use literals])])dnl
928 AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])dnl
932 # _AC_OUTPUT_SUBDIRS
933 # ------------------
934 # This is a subroutine of AC_OUTPUT, but it does not go into
935 # config.status, rather, it is called after running config.status.
936 m4_define([_AC_OUTPUT_SUBDIRS],
939 # CONFIG_SUBDIRS section.
941 if test "$no_recursion" != yes; then
943   # Remove --cache-file and --srcdir arguments so they do not pile up.
944   ac_sub_configure_args=
945   ac_prev=
946   eval "set x $ac_configure_args"
947   shift
948   for ac_arg
949   do
950     if test -n "$ac_prev"; then
951       ac_prev=
952       continue
953     fi
954     case $ac_arg in
955     -cache-file | --cache-file | --cache-fil | --cache-fi \
956     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
957       ac_prev=cache_file ;;
958     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
959     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
960     | --c=*)
961       ;;
962     --config-cache | -C)
963       ;;
964     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
965       ac_prev=srcdir ;;
966     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
967       ;;
968     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
969       ac_prev=prefix ;;
970     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
971       ;;
972     *)
973       case $ac_arg in
974       *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
975       esac
976       ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
977     esac
978   done
980   # Always prepend --prefix to ensure using the same prefix
981   # in subdir configurations.
982   ac_arg="--prefix=$prefix"
983   case $ac_arg in
984   *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
985   esac
986   ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
988   # Pass --silent
989   if test "$silent" = yes; then
990     ac_sub_configure_args="--silent $ac_sub_configure_args"
991   fi
993   ac_popdir=`pwd`
994   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
996     # Do not complain, so a configure script can configure whichever
997     # parts of a large source tree are present.
998     test -d "$srcdir/$ac_dir" || continue
1000     ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
1001     _AS_ECHO_LOG([$ac_msg])
1002     _AS_ECHO([$ac_msg])
1003     AS_MKDIR_P(["$ac_dir"])
1004     _AC_SRCDIRS(["$ac_dir"])
1006     cd "$ac_dir"
1008     # Check for guested configure; otherwise get Cygnus style configure.
1009     if test -f "$ac_srcdir/configure.gnu"; then
1010       ac_sub_configure=$ac_srcdir/configure.gnu
1011     elif test -f "$ac_srcdir/configure"; then
1012       ac_sub_configure=$ac_srcdir/configure
1013     elif test -f "$ac_srcdir/configure.in"; then
1014       # This should be Cygnus configure.
1015       ac_sub_configure=$ac_aux_dir/configure
1016     else
1017       AC_MSG_WARN([no configuration information is in $ac_dir])
1018       ac_sub_configure=
1019     fi
1021     # The recursion is here.
1022     if test -n "$ac_sub_configure"; then
1023       # Make the cache file name correct relative to the subdirectory.
1024       case $cache_file in
1025       [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1026       *) # Relative name.
1027         ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
1028       esac
1030       AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
1031       # The eval makes quoting arguments work.
1032       eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
1033            --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
1034         AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
1035     fi
1037     cd "$ac_popdir"
1038   done
1040 ])# _AC_OUTPUT_SUBDIRS
1045 ## -------------------------- ##
1046 ## Outputting config.status.  ##
1047 ## -------------------------- ##
1050 # AU::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1051 # -----------------------------------------------------------
1053 # If there are arguments given to AC_OUTPUT, dispatch them to the
1054 # proper modern macros.
1055 AU_DEFUN([AC_OUTPUT],
1056 [m4_ifvaln([$1],
1057            [AC_CONFIG_FILES([$1])])dnl
1058 m4_ifvaln([$2$3],
1059           [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1060 [AC_OUTPUT]])
1063 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1064 # -------------------------------------------------------
1065 # The big finish.
1066 # Produce config.status, config.h, and links; and configure subdirs.
1068 m4_define([AC_OUTPUT],
1069 [dnl Dispatch the extra arguments to their native macros.
1070 m4_ifvaln([$1],
1071           [AC_CONFIG_FILES([$1])])dnl
1072 m4_ifvaln([$2$3],
1073           [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1074 m4_ifval([$1$2$3],
1075          [AC_DIAGNOSE([obsolete],
1076                       [$0 should be used without arguments.
1077 You should run autoupdate.])])dnl
1078 AC_CACHE_SAVE
1080 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1081 # Let make expand exec_prefix.
1082 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1084 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1086 dnl Commands to run before creating config.status.
1087 AC_OUTPUT_COMMANDS_PRE()dnl
1089 : ${CONFIG_STATUS=./config.status}
1090 ac_clean_files_save=$ac_clean_files
1091 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1092 _AC_OUTPUT_CONFIG_STATUS()dnl
1093 ac_clean_files=$ac_clean_files_save
1095 dnl Commands to run after config.status was created
1096 AC_OUTPUT_COMMANDS_POST()dnl
1098 # configure is writing to config.log, and then calls config.status.
1099 # config.status does its own redirection, appending to config.log.
1100 # Unfortunately, on DOS this fails, as config.log is still kept open
1101 # by configure, so config.status won't be able to write to it; its
1102 # output is simply discarded.  So we exec the FD to /dev/null,
1103 # effectively closing config.log, so it can be properly (re)opened and
1104 # appended to by config.status.  When coming back to configure, we
1105 # need to make the FD available again.
1106 if test "$no_create" != yes; then
1107   ac_cs_success=:
1108   ac_config_status_args=
1109   test "$silent" = yes &&
1110     ac_config_status_args="$ac_config_status_args --quiet"
1111   exec AS_MESSAGE_LOG_FD>/dev/null
1112   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
1113   exec AS_MESSAGE_LOG_FD>>config.log
1114   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
1115   # would make configure fail if this is the last instruction.
1116   $ac_cs_success || AS_EXIT([1])
1118 dnl config.status should not do recursion.
1119 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1120 ])# AC_OUTPUT
1123 # _AC_OUTPUT_CONFIG_STATUS
1124 # ------------------------
1125 # Produce config.status.  Called by AC_OUTPUT.
1126 # Pay special attention not to have too long here docs: some old
1127 # shells die.  Unfortunately the limit is not known precisely...
1128 m4_define([_AC_OUTPUT_CONFIG_STATUS],
1129 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
1130 dnl AS_MESSAGE_LOG_FD is not available yet:
1131 m4_rename([AS_MESSAGE_LOG_FD], [_AC_save_AS_MESSAGE_LOG_FD])dnl
1132 cat >$CONFIG_STATUS <<_ACEOF
1133 #! $SHELL
1134 # Generated by $as_me.
1135 # Run this file to recreate the current configuration.
1136 # Compiler output produced by configure, useful for debugging
1137 # configure, is in config.log if it exists.
1139 debug=false
1140 ac_cs_recheck=false
1141 ac_cs_silent=false
1142 SHELL=\${CONFIG_SHELL-$SHELL}
1143 _ACEOF
1145 cat >>$CONFIG_STATUS <<\_ACEOF
1146 AS_SHELL_SANITIZE
1147 dnl Watch out, this is directly the initializations, do not use
1148 dnl AS_PREPARE, otherwise you'd get it output in the initialization
1149 dnl of configure, not config.status.
1150 _AS_PREPARE
1151 exec AS_MESSAGE_FD>&1
1153 # Save the log message, to keep $[0] and so on meaningful, and to
1154 # report actual input values of CONFIG_FILES etc. instead of their
1155 # values after options handling.
1156 ac_log="
1157 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1158 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1159 generated by m4_PACKAGE_STRING.  Invocation command line was
1161   CONFIG_FILES    = $CONFIG_FILES
1162   CONFIG_HEADERS  = $CONFIG_HEADERS
1163   CONFIG_LINKS    = $CONFIG_LINKS
1164   CONFIG_COMMANDS = $CONFIG_COMMANDS
1165   $ $[0] $[@]
1167 on `(hostname || uname -n) 2>/dev/null | sed 1q`
1170 _ACEOF
1172 cat >>$CONFIG_STATUS <<_ACEOF
1173 # Files that config.status was made for.
1174 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1175 [config_files="$ac_config_files"
1176 ])dnl
1177 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1178 [config_headers="$ac_config_headers"
1179 ])dnl
1180 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1181 [config_links="$ac_config_links"
1182 ])dnl
1183 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1184 [config_commands="$ac_config_commands"
1185 ])dnl
1187 _ACEOF
1189 cat >>$CONFIG_STATUS <<\_ACEOF
1190 ac_cs_usage="\
1191 \`$as_me' instantiates files from templates according to the
1192 current configuration.
1194 Usage: $[0] [[OPTIONS]] [[FILE]]...
1196   -h, --help       print this help, then exit
1197   -V, --version    print version number and configuration settings, then exit
1198   -q, --quiet      do not print progress messages
1199   -d, --debug      don't remove temporary files
1200       --recheck    update $as_me by reconfiguring in the same conditions
1201 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1202 [[  --file=FILE[:TEMPLATE]
1203                    instantiate the configuration file FILE
1204 ]])dnl
1205 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1206 [[  --header=FILE[:TEMPLATE]
1207                    instantiate the configuration header FILE
1208 ]])dnl
1210 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1211 [Configuration files:
1212 $config_files
1214 ])dnl
1215 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1216 [Configuration headers:
1217 $config_headers
1219 ])dnl
1220 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1221 [Configuration links:
1222 $config_links
1224 ])dnl
1225 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1226 [Configuration commands:
1227 $config_commands
1229 ])dnl
1230 Report bugs to <bug-autoconf@gnu.org>."
1232 _ACEOF
1233 cat >>$CONFIG_STATUS <<_ACEOF
1234 ac_cs_version="\\
1235 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1236 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1237 configured by $[0], generated by m4_PACKAGE_STRING,
1238   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`\\"
1240 Copyright (C) 2006 Free Software Foundation, Inc.
1241 This config.status script is free software; the Free Software Foundation
1242 gives unlimited permission to copy, distribute and modify it."
1244 ac_pwd='$ac_pwd'
1245 srcdir='$srcdir'
1246 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1247 [INSTALL='$INSTALL'
1248 ])dnl
1249 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
1250 [MKDIR_P='$MKDIR_P'
1251 ])dnl
1252 _ACEOF
1254 cat >>$CONFIG_STATUS <<\_ACEOF
1255 # If no file are specified by the user, then we need to provide default
1256 # value.  By we need to know if files were specified by the user.
1257 ac_need_defaults=:
1258 while test $[#] != 0
1260   case $[1] in
1261   --*=*)
1262     ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
1263     ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
1264     ac_shift=:
1265     ;;
1266   *)
1267     ac_option=$[1]
1268     ac_optarg=$[2]
1269     ac_shift=shift
1270     ;;
1271   esac
1273   case $ac_option in
1274   # Handling of the options.
1275   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1276     ac_cs_recheck=: ;;
1277   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
1278     echo "$ac_cs_version"; exit ;;
1279   --debug | --debu | --deb | --de | --d | -d )
1280     debug=: ;;
1281 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
1282   --file | --fil | --fi | --f )
1283     $ac_shift
1284     CONFIG_FILES="$CONFIG_FILES $ac_optarg"
1285     ac_need_defaults=false;;
1286 ])dnl
1287 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
1288   --header | --heade | --head | --hea )
1289     $ac_shift
1290     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
1291     ac_need_defaults=false;;
1292   --he | --h)
1293     # Conflict between --help and --header
1294     AC_MSG_ERROR([ambiguous option: $[1]
1295 Try `$[0] --help' for more information.]);;
1296 ], [  --he | --h |])dnl
1297   --help | --hel | -h )
1298     echo "$ac_cs_usage"; exit ;;
1299   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1300   | -silent | --silent | --silen | --sile | --sil | --si | --s)
1301     ac_cs_silent=: ;;
1303   # This is an error.
1304   -*) AC_MSG_ERROR([unrecognized option: $[1]
1305 Try `$[0] --help' for more information.]) ;;
1307   *) ac_config_targets="$ac_config_targets $[1]"
1308      ac_need_defaults=false ;;
1310   esac
1311   shift
1312 done
1314 ac_configure_extra_args=
1316 if $ac_cs_silent; then
1317   exec AS_MESSAGE_FD>/dev/null
1318   ac_configure_extra_args="$ac_configure_extra_args --silent"
1321 _ACEOF
1322 cat >>$CONFIG_STATUS <<_ACEOF
1323 dnl Check this before opening the log, to avoid a bug on MinGW,
1324 dnl which prohibits the recursive instance from truncating an open log.
1325 if \$ac_cs_recheck; then
1326   echo "running CONFIG_SHELL=$SHELL $SHELL $[0] "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
1327   CONFIG_SHELL=$SHELL
1328   export CONFIG_SHELL
1329   exec $SHELL "$[0]"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
1332 _ACEOF
1333 cat >>$CONFIG_STATUS <<\_ACEOF
1334 dnl Open the log:
1335 m4_rename([_AC_save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
1336 exec AS_MESSAGE_LOG_FD>>config.log
1338   echo
1339   AS_BOX([Running $as_me.])
1340   echo "$ac_log"
1341 } >&AS_MESSAGE_LOG_FD
1343 _ACEOF
1344 cat >>$CONFIG_STATUS <<_ACEOF
1345 m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
1347 # INIT-COMMANDS
1349 _AC_OUTPUT_COMMANDS_INIT
1350 ])dnl
1351 _ACEOF
1353 cat >>$CONFIG_STATUS <<\_ACEOF
1355 # Handling of arguments.
1356 for ac_config_target in $ac_config_targets
1358   case $ac_config_target in
1359 m4_ifdef([_AC_LIST_TAGS], [_AC_LIST_TAGS])
1360   *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
1361   esac
1362 done
1364 m4_ifdef([_AC_SEEN_CONFIG(ANY)], [_AC_OUTPUT_MAIN_LOOP])[]dnl
1366 AS_EXIT(0)
1367 _ACEOF
1368 chmod +x $CONFIG_STATUS
1369 ])# _AC_OUTPUT_CONFIG_STATUS
1371 # _AC_OUTPUT_MAIN_LOOP
1372 # --------------------
1373 # The main loop in $CONFIG_STATUS.
1375 # This macro is expanded inside a here document.  If the here document is
1376 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
1378 AC_DEFUN([_AC_OUTPUT_MAIN_LOOP],
1380 # If the user did not use the arguments to specify the items to instantiate,
1381 # then the envvar interface is used.  Set only those that are not.
1382 # We use the long form for the default assignment because of an extremely
1383 # bizarre bug on SunOS 4.1.3.
1384 if $ac_need_defaults; then
1385 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1386 [  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1387 ])dnl
1388 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1389 [  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1390 ])dnl
1391 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1392 [  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1393 ])dnl
1394 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1395 [  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1396 ])dnl
1399 # Have a temporary directory for convenience.  Make it in the build tree
1400 # simply because there is no reason against having it here, and in addition,
1401 # creating and moving files from /tmp can sometimes cause problems.
1402 # Hook for its removal unless debugging.
1403 # Note that there is a small window in which the directory will not be cleaned:
1404 # after its creation but before its name has been assigned to `$tmp'.
1405 $debug ||
1407   tmp=
1408   trap 'exit_status=$?
1409   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
1410 ' 0
1411   trap 'AS_EXIT([1])' 1 2 13 15
1413 dnl The comment above AS_TMPDIR says at most 4 chars are allowed.
1414 AS_TMPDIR([conf], [.])
1416 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [_AC_OUTPUT_FILES_PREPARE])[]dnl
1418 for ac_tag in[]dnl
1419   m4_ifdef([_AC_SEEN_CONFIG(FILES)],    [:F $CONFIG_FILES])[]dnl
1420   m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],  [:H $CONFIG_HEADERS])[]dnl
1421   m4_ifdef([_AC_SEEN_CONFIG(LINKS)],    [:L $CONFIG_LINKS])[]dnl
1422   m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C $CONFIG_COMMANDS])
1424   case $ac_tag in
1425   :[[FHLC]]) ac_mode=$ac_tag; continue;;
1426   esac
1427   case $ac_mode$ac_tag in
1428   :[[FHL]]*:*);;
1429   :L* | :C*:*) AC_MSG_ERROR([Invalid tag $ac_tag.]);;
1430   :[[FH]]-) ac_tag=-:-;;
1431   :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
1432   esac
1433   ac_save_IFS=$IFS
1434   IFS=:
1435   set x $ac_tag
1436   IFS=$ac_save_IFS
1437   shift
1438   ac_file=$[1]
1439   shift
1441   case $ac_mode in
1442   :L) ac_source=$[1];;
1443   :[[FH]])
1444     ac_file_inputs=
1445     for ac_f
1446     do
1447       case $ac_f in
1448       -) ac_f="$tmp/stdin";;
1449       *) # Look for the file first in the build tree, then in the source tree
1450          # (if the path is not absolute).  The absolute path cannot be DOS-style,
1451          # because $ac_f cannot contain `:'.
1452          test -f "$ac_f" ||
1453            case $ac_f in
1454            [[\\/$]]*) false;;
1455            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
1456            esac ||
1457            AC_MSG_ERROR([cannot find input file: $ac_f]);;
1458       esac
1459       ac_file_inputs="$ac_file_inputs $ac_f"
1460     done
1462     # Let's still pretend it is `configure' which instantiates (i.e., don't
1463     # use $as_me), people would be surprised to read:
1464     #    /* config.h.  Generated by config.status.  */
1465     configure_input="Generated from "`IFS=:
1466           echo $[*] | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']`" by configure."
1467     if test x"$ac_file" != x-; then
1468       configure_input="$ac_file.  $configure_input"
1469       AC_MSG_NOTICE([creating $ac_file])
1470     fi
1472     case $ac_tag in
1473     *:-:* | *:-) cat >"$tmp/stdin";;
1474     esac
1475     ;;
1476   esac
1478   ac_dir=`AS_DIRNAME(["$ac_file"])`
1479   AS_MKDIR_P(["$ac_dir"])
1480   _AC_SRCDIRS(["$ac_dir"])
1482   case $ac_mode in
1483   m4_ifdef([_AC_SEEN_CONFIG(FILES)],    [:F)_AC_OUTPUT_FILE ;;])
1484   m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],  [:H)_AC_OUTPUT_HEADER ;;])
1485   m4_ifdef([_AC_SEEN_CONFIG(LINKS)],    [:L)_AC_OUTPUT_LINK ;;])
1486   m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C)_AC_OUTPUT_COMMAND ;;])
1487   esac
1489 dnl Some shells don't like empty case/esac
1490 m4_ifdef([_AC_LIST_TAG_COMMANDS], [
1491   case $ac_file$ac_mode in
1492 _AC_LIST_TAG_COMMANDS
1493   esac
1494 ])dnl
1495 done # for ac_tag
1497 ])# _AC_OUTPUT_MAIN_LOOP
1500 # AC_OUTPUT_MAKE_DEFS
1501 # -------------------
1502 # Set the DEFS variable to the -D options determined earlier.
1503 # This is a subroutine of AC_OUTPUT.
1504 # It is called inside configure, outside of config.status.
1505 m4_define([AC_OUTPUT_MAKE_DEFS],
1506 [[# Transform confdefs.h into DEFS.
1507 # Protect against shell expansion while executing Makefile rules.
1508 # Protect against Makefile macro expansion.
1510 # If the first sed substitution is executed (which looks for macros that
1511 # take arguments), then branch to the quote section.  Otherwise,
1512 # look for a macro that doesn't take arguments.
1513 ac_script='
1514 t clear
1515 :clear
1516 s/^[     ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
1517 t quote
1518 s/^[     ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
1519 t quote
1520 b any
1521 :quote
1522 s/[      `~#$^&*(){}\\|;'\''"<>?]/\\&/g
1523 s/\[/\\&/g
1524 s/\]/\\&/g
1525 s/\$/$$/g
1527 :any
1529         g
1530         s/^\n//
1531         s/\n/ /g
1532         p
1535 DEFS=`sed -n "$ac_script" confdefs.h`
1536 ]])# AC_OUTPUT_MAKE_DEFS