Update to GPLv3.
[autoconf.git] / lib / autoconf / status.m4
blobed4800c8f16696cb4ba72bca7586be285e5e5c05
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, 2007 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 3, 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=/`AS_ECHO([$1]) | sed 's,^\.[[\\/]],,'`
111   # A ".." for each directory in $ac_dir_suffix.
112   ac_top_builddir_sub=`AS_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_AWK_LITERAL_LIMIT
315 # ---------------------
316 # Evaluate to the maximum number of characters to put in an awk
317 # string literal, not counting escape characters.
319 # Some awk's have small limits, such as Solaris and AIX awk.
320 m4_define([_AC_AWK_LITERAL_LIMIT],
321 [148])
324 # _AC_OUTPUT_FILES_PREPARE
325 # ------------------------
326 # Create the sed scripts needed for CONFIG_FILES.
327 # Support multiline substitutions and make sure that the substitutions are
328 # not evaluated recursively.
329 # The intention is to have readable config.status and configure, even
330 # though this m4 code might be scaring.
332 # This code was written by Dan Manthey and rewritten by Ralf Wildenhues.
334 # This macro is expanded inside a here document.  If the here document is
335 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
337 m4_define([_AC_OUTPUT_FILES_PREPARE],
338 [# Set up the scripts for CONFIG_FILES section.
339 # No need to generate them if there are no CONFIG_FILES.
340 # This happens for instance with `./config.status config.h'.
341 if test -n "$CONFIG_FILES"; then
343 dnl For AC_SUBST_FILE, check for usable getline support in awk,
344 dnl at config.status execution time.
345 dnl Otherwise, do the interpolation in sh, which is slower.
346 dnl Without any AC_SUBST_FILE, omit all related code.
347 dnl Note the expansion is double-quoted for readability.
348 m4_ifdef([_AC_SUBST_FILES],
349 [[if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
350   ac_cs_awk_getline=:
351   ac_cs_awk_pipe_init=
352   ac_cs_awk_read_file='
353       while ((getline aline < (F[key])) > 0)
354         print(aline)
355       close(F[key])'
356   ac_cs_awk_pipe_fini=
357 else
358   ac_cs_awk_getline=false
359   ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|'\""
360   ac_cs_awk_read_file='
361       print "|#_!!_#|"
362       print "cat " F[key]
363       '$ac_cs_awk_pipe_init
364   ac_cs_awk_pipe_fini='END { print "|#_!!_#|" }'
365 fi]])
366 ac_cr='\r'
367 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
368 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
369   ac_cs_awk_cr='\\r'
370 else
371   ac_cs_awk_cr=$ac_cr
374 dnl Define the pipe that does the substitution.
375 m4_ifdef([_AC_SUBST_FILES],
376 [m4_define([_AC_SUBST_CMDS], [|
377 if $ac_cs_awk_getline; then
378   $AWK -f "$tmp/subs.awk"
379 else
380   $AWK -f "$tmp/subs.awk" | $SHELL
381 fi])],
382 [m4_define([_AC_SUBST_CMDS],
383 [| $AWK -f "$tmp/subs.awk"])])dnl
385 echo 'BEGIN {' >"$tmp/subs1.awk"
386 _ACEOF
388 m4_ifdef([_AC_SUBST_FILES],
389 [# Create commands to substitute file output variables.
391   echo "cat >>$CONFIG_STATUS <<_ACEOF"
392   echo 'cat >>"\$tmp/subs1.awk" <<\CEOF'
393   echo "$ac_subst_files" | sed 's/.*/F@<:@"&"@:>@="$&"/'
394   echo "CEOF"
395   echo "_ACEOF"
396 } >conf$$files.sh
397 . ./conf$$files.sh
398 rm -f conf$$files.sh
399 ])dnl
402   echo "cat >conf$$subs.awk <<_ACEOF"
403   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/'
404   echo "_ACEOF"
405 } >conf$$subs.sh
406 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
407 ac_delim='%!_!# '
408 for ac_last_try in false false false false false :; do
409   . ./conf$$subs.sh
411 dnl Do not use grep on conf$$subs.awk, since AIX grep has a line length limit.
412   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
413     break
414   elif $ac_last_try; then
415     AC_MSG_ERROR([could not make $CONFIG_STATUS])
416   else
417     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
418   fi
419 done
420 rm -f conf$$subs.sh
422 dnl Initialize an awk array of substitutions, keyed by variable name.
424 dnl The initial line contains the variable name VAR, then a `!'.
425 dnl Construct `S["VAR"]=' from it.
426 dnl The rest of the line, and potentially further lines, contain the
427 dnl substituted value; the last of those ends with $ac_delim.  We split
428 dnl the output both along those substituted newlines and at intervals of
429 dnl length _AC_AWK_LITERAL_LIMIT.  The latter is done to comply with awk
430 dnl string literal limitations, the former for simplicity in doing so.
432 dnl We deal with one input line at a time to avoid sed pattern space
433 dnl limitations.  We kill the delimiter $ac_delim before splitting the
434 dnl string (otherwise we risk splitting the delimiter).  And we do the
435 dnl splitting before the quoting of awk special characters (otherwise we
436 dnl risk splitting an escape sequence).
438 dnl Output as separate string literals, joined with backslash-newline.
439 dnl Eliminate the newline after `=' in a second script, for readability.
441 dnl Notes to the main part of the awk script:
442 dnl - the unusual FS value helps prevent running into the limit of 99 fields,
443 dnl - we avoid sub/gsub because of the \& quoting issues, see
444 dnl   http://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html
445 dnl - Writing `$ 0' prevents expansion by both the shell and m4 here.
447 dnl m4-double-quote most of the scripting for readability.
448 [cat >>$CONFIG_STATUS <<_ACEOF
449 cat >>"\$tmp/subs1.awk" <<\CEOF
450 _ACEOF
451 sed -n '
453 s/^/S["/; s/!.*/"]=/
456 s/^[^!]*!//
457 :repl
458 t repl
459 s/'"$ac_delim"'$//
460 t delim
463 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\).*/\1/
464 t more1
465 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
468 b repl
469 :more1
470 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
473 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
474 t nl
475 :delim
477 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\).*/\1/
478 t more2
479 s/["\\]/\\&/g; s/^/"/; s/$/"/
482 :more2
483 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
486 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
487 t delim
488 ' <conf$$subs.awk | sed '
489 /^[^"]/{
490   N
491   s/\n//
493 ' >>$CONFIG_STATUS
494 rm -f conf$$subs.awk
495 cat >>$CONFIG_STATUS <<_ACEOF
496 CEOF
497 cat >>"\$tmp/subs1.awk" <<CEOF
498   for (key in S) S_is_set[key] = 1
499   FS = "\a"
500 ]m4_ifdef([_AC_SUBST_FILES],
501 [  \$ac_cs_awk_pipe_init])[
504   line = $ 0
505   nfields = split(line, field, "@")
506   substed = 0
507   len = length(field[1])
508   for (i = 2; i < nfields; i++) {
509     key = field[i]
510     keylen = length(key)
511     if (S_is_set[key]) {
512       value = S[key]
513       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
514       len += length(value) + length(field[++i])
515       substed = 1
516     } else
517       len += 1 + keylen
518   }
519 ]m4_ifdef([_AC_SUBST_FILES],
520 [[  if (nfields == 3 && !substed) {
521     key = field[2]
522     if (F[key] != "" && line ~ /^[       ]*@.*@[         ]*$/) {
523       \$ac_cs_awk_read_file
524       next
525     }
526   }]])[
527   print line
529 ]m4_ifdef([_AC_SUBST_FILES],
530 [\$ac_cs_awk_pipe_fini])[
531 CEOF
532 sed "s/\$ac_cr\\\$//; s/\$ac_cr/\$ac_cs_awk_cr/g" < "\$tmp/subs1.awk" > "\$tmp/subs.awk"
533 _ACEOF
534 ]dnl end of double-quoted part
536 # VPATH may cause trouble with some makes, so we remove $(srcdir),
537 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
538 # trailing colons and then remove the whole line if VPATH becomes empty
539 # (actually we leave an empty line to preserve line numbers).
540 if test "x$srcdir" = x.; then
541   ac_vpsub=['/^[         ]*VPATH[        ]*=/{
542 s/:*\$(srcdir):*/:/
543 s/:*\${srcdir}:*/:/
544 s/:*@srcdir@:*/:/
545 s/^\([^=]*=[     ]*\):*/\1/
546 s/:*$//
547 s/^[^=]*=[       ]*$//
551 cat >>$CONFIG_STATUS <<\_ACEOF
552 fi # test -n "$CONFIG_FILES"
554 ])# _AC_OUTPUT_FILES_PREPARE
557 # _AC_OUTPUT_FILE
558 # ---------------
559 # Do the variable substitutions to create the Makefiles or whatever.
561 # This macro is expanded inside a here document.  If the here document is
562 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
564 m4_define([_AC_OUTPUT_FILE],
566   #
567   # CONFIG_FILE
568   #
570 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
571 [  case $INSTALL in
572   [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
573   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
574   esac
575 ])dnl
576 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
577 [  ac_MKDIR_P=$MKDIR_P
578   case $MKDIR_P in
579   [[\\/$]]* | ?:[[\\/]]* ) ;;
580   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
581   esac
582 ])dnl
583 _ACEOF
585 m4_ifndef([AC_DATAROOTDIR_CHECKED],
586 [cat >>$CONFIG_STATUS <<\_ACEOF
587 # If the template does not know about datarootdir, expand it.
588 # FIXME: This hack should be removed a few years after 2.60.
589 ac_datarootdir_hack=; ac_datarootdir_seen=
590 m4_define([_AC_datarootdir_vars],
591           [datadir, docdir, infodir, localedir, mandir])
592 case `sed -n '/datarootdir/ {
593   p
594   q
596 m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
597            [/@_AC_Var@/p
598 ])' $ac_file_inputs` in
599 *datarootdir*) ac_datarootdir_seen=yes;;
600 *@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
601   AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
602 _ACEOF
603 cat >>$CONFIG_STATUS <<_ACEOF
604   ac_datarootdir_hack='
605   m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
606                [s&@_AC_Var@&$_AC_Var&g
607   ])dnl
608   s&\\\${datarootdir}&$datarootdir&g' ;;
609 esac
610 _ACEOF
611 ])dnl
613 # Neutralize VPATH when `$srcdir' = `.'.
614 # Shell code in configure.ac might set extrasub.
615 # FIXME: do we really want to maintain this feature?
616 cat >>$CONFIG_STATUS <<_ACEOF
617   sed "$ac_vpsub
618 $extrasub
619 _ACEOF
620 cat >>$CONFIG_STATUS <<\_ACEOF
622 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
623 dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
624 s&@configure_input@&$configure_input&;t t
625 dnl During the transition period, this is a special case:
626 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
627 m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
628                         builddir, abs_builddir,
629                         abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [[, MKDIR_P]]),
630            [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
631 ])dnl
632 m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
633 ])dnl
634 " $ac_file_inputs m4_defn([_AC_SUBST_CMDS]) >$tmp/out
636 m4_ifndef([AC_DATAROOTDIR_CHECKED],
637 [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
638   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
639   { ac_out=`sed -n '/^[[         ]]*datarootdir[[        ]]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
640   AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
641 which seems to be undefined.  Please make sure it is defined.])
642 ])dnl
644   rm -f "$tmp/stdin"
645   case $ac_file in
646   -) cat "$tmp/out"; rm -f "$tmp/out";;
647   *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
648   esac
649 dnl This would break Makefile dependencies:
650 dnl  if diff $ac_file "$tmp/out" >/dev/null 2>&1; then
651 dnl    echo "$ac_file is unchanged"
652 dnl  else
653 dnl     rm -f $ac_file; mv "$tmp/out" $ac_file
654 dnl  fi
655 ])# _AC_OUTPUT_FILE
660 ## ----------------------- ##
661 ## Configuration headers.  ##
662 ## ----------------------- ##
665 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
666 # ------------------------------------------------------
667 # Specify that the HEADERS are to be created by instantiation of the
668 # AC_DEFINEs.
670 AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])
673 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
674 # --------------------------------------
675 # FIXME: Make it obsolete?
676 AC_DEFUN([AC_CONFIG_HEADER],
677 [AC_CONFIG_HEADERS([$1])])
680 # _AC_OUTPUT_HEADER
681 # -----------------
683 # Output the code which instantiates the `config.h' files from their
684 # `config.h.in'.
686 # This macro is expanded inside a here document.  If the here document is
687 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
689 m4_define([_AC_OUTPUT_HEADER],
691   #
692   # CONFIG_HEADER
693   #
694 _ACEOF
696 # Transform confdefs.h into a sed script `conftest.defines', that
697 # substitutes the proper values into config.h.in to produce config.h.
698 rm -f conftest.defines conftest.tail
699 # First, append a space to every undef/define line, to ease matching.
700 echo 's/$/ /' >conftest.defines
701 # Then, protect against being on the right side of a sed subst, or in
702 # an unquoted here document, in config.status.  If some macros were
703 # called several times there might be several #defines for the same
704 # symbol, which is useless.  But do not sort them, since the last
705 # AC_DEFINE must be honored.
707 dnl Quote, for `[ ]' and `define'.
708 [ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
709 # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
710 # NAME is the cpp macro being defined, VALUE is the value it is being given.
711 # PARAMS is the parameter list in the macro definition--in most cases, it's
712 # just an empty string.
713 ac_dA='s,^\\([   #]*\\)[^        ]*\\([  ]*'
714 ac_dB='\\)[      (].*,\\1define\\2'
715 ac_dC=' '
716 ac_dD=' ,']
717 dnl ac_dD used to contain `;t' at the end, but that was both slow and incorrect.
718 dnl 1) Since the script must be broken into chunks containing 100 commands,
719 dnl the extra command meant extra calls to sed.
720 dnl 2) The code was incorrect: in the unusual case where a symbol has multiple
721 dnl different AC_DEFINEs, the last one should be honored.
723 dnl ac_dB works because every line has a space appended.  ac_dD reinserts
724 dnl the space, because some symbol may have been AC_DEFINEd several times.
726 dnl The first use of ac_dA has a space prepended, so that the second
727 dnl use does not match the initial 's' of $ac_dA.
729 uniq confdefs.h |
730   sed -n '
731         t rset
732         :rset
733         s/^[     ]*#[    ]*define[       ][      ]*//
734         t ok
735         d
736         :ok
737         s/[\\&,]/\\&/g
738         s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
739         s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
740   ' >>conftest.defines
742 # Remove the space that was appended to ease matching.
743 # Then replace #undef with comments.  This is necessary, for
744 # example, in the case of _POSIX_SOURCE, which is predefined and required
745 # on some systems where configure will not decide to define it.
746 # (The regexp can be short, since the line contains either #define or #undef.)
747 echo 's/ $//
748 [s,^[    #]*u.*,/* & */,]' >>conftest.defines
750 # Break up conftest.defines:
751 dnl If we cared only about not exceeding line count limits, we would use this:
752 dnl ac_max_sed_lines=m4_eval(_AC_SED_CMD_LIMIT - 3)
753 dnl But in practice this can generate scripts that contain too many bytes;
754 dnl and this can cause obscure 'sed' failures, e.g.,
755 dnl http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00127.html
756 dnl So instead, we use the following, which is about half the size we'd like:
757 ac_max_sed_lines=50
758 dnl In the future, let's use awk or sh instead of sed to do substitutions,
759 dnl since we have so many problems with sed.
761 # First sed command is:  sed -f defines.sed $ac_file_inputs >"$tmp/out1"
762 # Second one is:         sed -f defines.sed "$tmp/out1" >"$tmp/out2"
763 # Third one will be:     sed -f defines.sed "$tmp/out2" >"$tmp/out1"
764 # et cetera.
765 ac_in='$ac_file_inputs'
766 ac_out='"$tmp/out1"'
767 ac_nxt='"$tmp/out2"'
769 while :
771   # Write a here document:
772   dnl Quote, for the `[ ]' and `define'.
773 [  cat >>$CONFIG_STATUS <<_ACEOF
774     # First, check the format of the line:
775     cat >"\$tmp/defines.sed" <<\\CEOF
776 /^[      ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
777 /^[      ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
779 :def
780 _ACEOF]
781   sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
782   echo 'CEOF
783     sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
784   ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
785   sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
786   grep . conftest.tail >/dev/null || break
787   rm -f conftest.defines
788   mv conftest.tail conftest.defines
789 done
790 rm -f conftest.defines conftest.tail
792 dnl Now back to your regularly scheduled config.status.
793 echo "ac_result=$ac_in" >>$CONFIG_STATUS
794 cat >>$CONFIG_STATUS <<\_ACEOF
795   if test x"$ac_file" != x-; then
796     AS_ECHO(["/* $configure_input  */"]) >"$tmp/config.h"
797     cat "$ac_result" >>"$tmp/config.h"
798     if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
799       AC_MSG_NOTICE([$ac_file is unchanged])
800     else
801       rm -f $ac_file
802       mv "$tmp/config.h" $ac_file
803     fi
804   else
805     AS_ECHO(["/* $configure_input  */"])
806     cat "$ac_result"
807   fi
808   rm -f "$tmp/out[12]"
809 dnl If running for Automake, be ready to perform additional
810 dnl commands to set up the timestamp files.
811 m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
812          [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])
813 ])dnl
814 ])# _AC_OUTPUT_HEADER
818 ## --------------------- ##
819 ## Configuration links.  ##
820 ## --------------------- ##
823 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
824 # --------------------------------------------------------
825 # Specify that config.status should establish a (symbolic if possible)
826 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
827 # Reject DEST=., because it is makes it hard for ./config.status
828 # to guess the links to establish (`./config.status .').
830 AC_DEFUN([AC_CONFIG_LINKS], [_AC_CONFIG_FOOS([LINKS], $@)])
833 # AC_LINK_FILES(SOURCE..., DEST...)
834 # ---------------------------------
835 # Link each of the existing files SOURCE... to the corresponding
836 # link name in DEST...
838 # Unfortunately we can't provide a very good autoupdate service here,
839 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
840 # and `$to' are actually lists.  It would then be completely wrong to
841 # replace it with `AC_CONFIG_LINKS($to:$from).  It is possible in the
842 # case of literal values though, but because I don't think there is any
843 # interest in creating config links with literal values, no special
844 # mechanism is implemented to handle them.
846 # _AC_LINK_FILES_CNT is used to be robust to multiple calls.
847 AU_DEFUN([AC_LINK_FILES],
848 [m4_if($#, 2, ,
849        [m4_fatal([$0: incorrect number of arguments])])dnl
850 m4_define_default([_AC_LINK_FILES_CNT], 0)dnl
851 m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
852 ac_sources="$1"
853 ac_dests="$2"
854 while test -n "$ac_sources"; do
855   set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
856   set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
857   [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
858 done
859 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
861 [It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
862 to AC_CONFIG_LINKS.  `autoupdate' provides a functional but inelegant
863 update, you should probably tune the result yourself.])# AC_LINK_FILES
866 # _AC_OUTPUT_LINK
867 # ---------------
868 # This macro is expanded inside a here document.  If the here document is
869 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
870 m4_define([_AC_OUTPUT_LINK],
872   #
873   # CONFIG_LINK
874   #
876   test -r "$ac_source" || ac_source=$srcdir/$ac_source
878   AC_MSG_NOTICE([linking $ac_source to $ac_file])
880   if test ! -r "$ac_source"; then
881     AC_MSG_ERROR([$ac_source: file not found])
882   fi
883   rm -f "$ac_file"
885   # Try a relative symlink, then a hard link, then a copy.
886   case $srcdir in
887   [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$ac_source ;;
888       *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
889   esac
890   ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
891     ln "$ac_source" "$ac_file" 2>/dev/null ||
892     cp -p "$ac_source" "$ac_file" ||
893     AC_MSG_ERROR([cannot link or copy $ac_source to $ac_file])
894 ])# _AC_OUTPUT_LINK
898 ## ------------------------ ##
899 ## Configuration commands.  ##
900 ## ------------------------ ##
903 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
904 # ---------------------------------------------------
906 # Specify additional commands to be run by config.status.  This
907 # commands must be associated with a NAME, which should be thought
908 # as the name of a file the COMMANDS create.
910 AC_DEFUN([AC_CONFIG_COMMANDS], [_AC_CONFIG_FOOS([COMMANDS], $@)])
913 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
914 # -----------------------------------------
916 # Add additional commands for AC_OUTPUT to put into config.status.
918 # This macro is an obsolete version of AC_CONFIG_COMMANDS.  The only
919 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
920 # to give a unique key.  The scheme we have chosen is `default-1',
921 # `default-2' etc. for each call.
923 # Unfortunately this scheme is fragile: bad things might happen
924 # if you update an included file and configure.ac: you might have
925 # clashes :(  On the other hand, I'd like to avoid weird keys (e.g.,
926 # depending upon __file__ or the pid).
927 AU_DEFUN([AC_OUTPUT_COMMANDS],
928 [m4_define_default([_AC_OUTPUT_COMMANDS_CNT], 0)dnl
929 m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
930 dnl Double quoted since that was the case in the original macro.
931 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
935 # _AC_OUTPUT_COMMAND
936 # ------------------
937 # This macro is expanded inside a here document.  If the here document is
938 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
939 m4_define([_AC_OUTPUT_COMMAND],
940 [  AC_MSG_NOTICE([executing $ac_file commands])
945 ## -------------------------------------- ##
946 ## Pre- and post-config.status commands.  ##
947 ## -------------------------------------- ##
950 # AC_CONFIG_COMMANDS_PRE(CMDS)
951 # ----------------------------
952 # Commands to run right before config.status is created. Accumulates.
953 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
954 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
955 ])])
958 # AC_OUTPUT_COMMANDS_PRE
959 # ----------------------
960 # A *variable* in which we append all the actions that must be
961 # performed before *creating* config.status.  For a start, clean
962 # up all the LIBOBJ mess.
963 m4_define([AC_OUTPUT_COMMANDS_PRE],
964 [_AC_LIBOBJS_NORMALIZE
968 # AC_CONFIG_COMMANDS_POST(CMDS)
969 # -----------------------------
970 # Commands to run after config.status was created.  Accumulates.
971 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
972 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
973 ])])
975 # Initialize.
976 m4_define([AC_OUTPUT_COMMANDS_POST])
980 ## ----------------------- ##
981 ## Configuration subdirs.  ##
982 ## ----------------------- ##
985 # AC_CONFIG_SUBDIRS(DIR ...)
986 # --------------------------
987 # We define two variables:
988 # - _AC_LIST_SUBDIRS
989 #   A statically built list, should contain *all* the arguments of
990 #   AC_CONFIG_SUBDIRS.  The final value is assigned to ac_subdirs_all in
991 #   the `default' section, and used for --help=recursive.
992 #   It makes no sense for arguments which are sh variables.
993 # - subdirs
994 #   Shell variable built at runtime, so some of these dirs might not be
995 #   included, if for instance the user refused a part of the tree.
996 #   This is used in _AC_OUTPUT_SUBDIRS.
997 AC_DEFUN([AC_CONFIG_SUBDIRS],
998 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
999 AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])dnl
1000 m4_foreach_w([_AC_Sub], [$1],
1001              [_AC_CONFIG_UNIQUE([SUBDIRS],
1002                                 m4_bpatsubst(m4_defn([_AC_Sub]), [:.*]))])dnl
1003 m4_append([_AC_LIST_SUBDIRS], [$1], [
1004 ])dnl
1005 AS_LITERAL_IF([$1], [],
1006               [AC_DIAGNOSE([syntax], [$0: you should use literals])])dnl
1007 AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])dnl
1011 # _AC_OUTPUT_SUBDIRS
1012 # ------------------
1013 # This is a subroutine of AC_OUTPUT, but it does not go into
1014 # config.status, rather, it is called after running config.status.
1015 m4_define([_AC_OUTPUT_SUBDIRS],
1018 # CONFIG_SUBDIRS section.
1020 if test "$no_recursion" != yes; then
1022   # Remove --cache-file, --srcdir, and --disable-option-checking arguments
1023   # so they do not pile up.
1024   ac_sub_configure_args=
1025   ac_prev=
1026   eval "set x $ac_configure_args"
1027   shift
1028   for ac_arg
1029   do
1030     if test -n "$ac_prev"; then
1031       ac_prev=
1032       continue
1033     fi
1034     case $ac_arg in
1035     -cache-file | --cache-file | --cache-fil | --cache-fi \
1036     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1037       ac_prev=cache_file ;;
1038     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1039     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
1040     | --c=*)
1041       ;;
1042     --config-cache | -C)
1043       ;;
1044     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1045       ac_prev=srcdir ;;
1046     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1047       ;;
1048     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1049       ac_prev=prefix ;;
1050     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1051       ;;
1052     --disable-option-checking)
1053       ;;
1054     *)
1055       case $ac_arg in
1056       *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1057       esac
1058       ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
1059     esac
1060   done
1062   # Always prepend --prefix to ensure using the same prefix
1063   # in subdir configurations.
1064   ac_arg="--prefix=$prefix"
1065   case $ac_arg in
1066   *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1067   esac
1068   ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
1070   # Pass --silent
1071   if test "$silent" = yes; then
1072     ac_sub_configure_args="--silent $ac_sub_configure_args"
1073   fi
1075   # Always prepend --disable-option-checking to silence warnings, since
1076   # different subdirs can have different --enable and --with options.
1077   ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
1079   ac_popdir=`pwd`
1080   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
1082     # Do not complain, so a configure script can configure whichever
1083     # parts of a large source tree are present.
1084     test -d "$srcdir/$ac_dir" || continue
1086     ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
1087     _AS_ECHO_LOG([$ac_msg])
1088     _AS_ECHO([$ac_msg])
1089     AS_MKDIR_P(["$ac_dir"])
1090     _AC_SRCDIRS(["$ac_dir"])
1092     cd "$ac_dir"
1094     # Check for guested configure; otherwise get Cygnus style configure.
1095     if test -f "$ac_srcdir/configure.gnu"; then
1096       ac_sub_configure=$ac_srcdir/configure.gnu
1097     elif test -f "$ac_srcdir/configure"; then
1098       ac_sub_configure=$ac_srcdir/configure
1099     elif test -f "$ac_srcdir/configure.in"; then
1100       # This should be Cygnus configure.
1101       ac_sub_configure=$ac_aux_dir/configure
1102     else
1103       AC_MSG_WARN([no configuration information is in $ac_dir])
1104       ac_sub_configure=
1105     fi
1107     # The recursion is here.
1108     if test -n "$ac_sub_configure"; then
1109       # Make the cache file name correct relative to the subdirectory.
1110       case $cache_file in
1111       [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1112       *) # Relative name.
1113         ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
1114       esac
1116       AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
1117       # The eval makes quoting arguments work.
1118       eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
1119            --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
1120         AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
1121     fi
1123     cd "$ac_popdir"
1124   done
1126 ])# _AC_OUTPUT_SUBDIRS
1131 ## -------------------------- ##
1132 ## Outputting config.status.  ##
1133 ## -------------------------- ##
1136 # AU::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1137 # -----------------------------------------------------------
1139 # If there are arguments given to AC_OUTPUT, dispatch them to the
1140 # proper modern macros.
1141 AU_DEFUN([AC_OUTPUT],
1142 [m4_ifvaln([$1],
1143            [AC_CONFIG_FILES([$1])])dnl
1144 m4_ifvaln([$2$3],
1145           [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1146 [AC_OUTPUT]])
1149 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1150 # -------------------------------------------------------
1151 # The big finish.
1152 # Produce config.status, config.h, and links; and configure subdirs.
1154 m4_define([AC_OUTPUT],
1155 [dnl Dispatch the extra arguments to their native macros.
1156 m4_ifvaln([$1],
1157           [AC_CONFIG_FILES([$1])])dnl
1158 m4_ifvaln([$2$3],
1159           [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1160 m4_ifval([$1$2$3],
1161          [AC_DIAGNOSE([obsolete],
1162                       [$0 should be used without arguments.
1163 You should run autoupdate.])])dnl
1164 AC_CACHE_SAVE
1166 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1167 # Let make expand exec_prefix.
1168 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1170 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1172 dnl Commands to run before creating config.status.
1173 AC_OUTPUT_COMMANDS_PRE()dnl
1175 : ${CONFIG_STATUS=./config.status}
1176 ac_clean_files_save=$ac_clean_files
1177 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1178 _AC_OUTPUT_CONFIG_STATUS()dnl
1179 ac_clean_files=$ac_clean_files_save
1181 dnl Commands to run after config.status was created
1182 AC_OUTPUT_COMMANDS_POST()dnl
1184 # configure is writing to config.log, and then calls config.status.
1185 # config.status does its own redirection, appending to config.log.
1186 # Unfortunately, on DOS this fails, as config.log is still kept open
1187 # by configure, so config.status won't be able to write to it; its
1188 # output is simply discarded.  So we exec the FD to /dev/null,
1189 # effectively closing config.log, so it can be properly (re)opened and
1190 # appended to by config.status.  When coming back to configure, we
1191 # need to make the FD available again.
1192 if test "$no_create" != yes; then
1193   ac_cs_success=:
1194   ac_config_status_args=
1195   test "$silent" = yes &&
1196     ac_config_status_args="$ac_config_status_args --quiet"
1197   exec AS_MESSAGE_LOG_FD>/dev/null
1198   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
1199   exec AS_MESSAGE_LOG_FD>>config.log
1200   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
1201   # would make configure fail if this is the last instruction.
1202   $ac_cs_success || AS_EXIT([1])
1204 dnl config.status should not do recursion.
1205 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1206 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
1207   AC_MSG_WARN([Unrecognized options: $ac_unrecognized_opts])
1209 ])# AC_OUTPUT
1212 # _AC_OUTPUT_CONFIG_STATUS
1213 # ------------------------
1214 # Produce config.status.  Called by AC_OUTPUT.
1215 # Pay special attention not to have too long here docs: some old
1216 # shells die.  Unfortunately the limit is not known precisely...
1217 m4_define([_AC_OUTPUT_CONFIG_STATUS],
1218 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
1219 dnl AS_MESSAGE_LOG_FD is not available yet:
1220 m4_rename([AS_MESSAGE_LOG_FD], [_AC_save_AS_MESSAGE_LOG_FD])dnl
1221 cat >$CONFIG_STATUS <<_ACEOF
1222 #! $SHELL
1223 # Generated by $as_me.
1224 # Run this file to recreate the current configuration.
1225 # Compiler output produced by configure, useful for debugging
1226 # configure, is in config.log if it exists.
1228 debug=false
1229 ac_cs_recheck=false
1230 ac_cs_silent=false
1231 SHELL=\${CONFIG_SHELL-$SHELL}
1232 _ACEOF
1234 cat >>$CONFIG_STATUS <<\_ACEOF
1235 AS_SHELL_SANITIZE
1236 dnl Watch out, this is directly the initializations, do not use
1237 dnl AS_PREPARE, otherwise you'd get it output in the initialization
1238 dnl of configure, not config.status.
1239 _AS_PREPARE
1240 exec AS_MESSAGE_FD>&1
1242 # Save the log message, to keep $[0] and so on meaningful, and to
1243 # report actual input values of CONFIG_FILES etc. instead of their
1244 # values after options handling.
1245 ac_log="
1246 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1247 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1248 generated by m4_PACKAGE_STRING.  Invocation command line was
1250   CONFIG_FILES    = $CONFIG_FILES
1251   CONFIG_HEADERS  = $CONFIG_HEADERS
1252   CONFIG_LINKS    = $CONFIG_LINKS
1253   CONFIG_COMMANDS = $CONFIG_COMMANDS
1254   $ $[0] $[@]
1256 on `(hostname || uname -n) 2>/dev/null | sed 1q`
1259 _ACEOF
1261 cat >>$CONFIG_STATUS <<_ACEOF
1262 # Files that config.status was made for.
1263 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1264 [config_files="$ac_config_files"
1265 ])dnl
1266 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1267 [config_headers="$ac_config_headers"
1268 ])dnl
1269 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1270 [config_links="$ac_config_links"
1271 ])dnl
1272 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1273 [config_commands="$ac_config_commands"
1274 ])dnl
1276 _ACEOF
1278 cat >>$CONFIG_STATUS <<\_ACEOF
1279 ac_cs_usage="\
1280 \`$as_me' instantiates files from templates according to the
1281 current configuration.
1283 Usage: $[0] [[OPTIONS]] [[FILE]]...
1285   -h, --help       print this help, then exit
1286   -V, --version    print version number and configuration settings, then exit
1287   -q, --quiet      do not print progress messages
1288   -d, --debug      don't remove temporary files
1289       --recheck    update $as_me by reconfiguring in the same conditions
1290 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1291 [[  --file=FILE[:TEMPLATE]
1292                    instantiate the configuration file FILE
1293 ]])dnl
1294 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1295 [[  --header=FILE[:TEMPLATE]
1296                    instantiate the configuration header FILE
1297 ]])dnl
1299 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1300 [Configuration files:
1301 $config_files
1303 ])dnl
1304 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1305 [Configuration headers:
1306 $config_headers
1308 ])dnl
1309 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1310 [Configuration links:
1311 $config_links
1313 ])dnl
1314 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1315 [Configuration commands:
1316 $config_commands
1318 ])dnl
1319 Report bugs to <bug-autoconf@gnu.org>."
1321 _ACEOF
1322 cat >>$CONFIG_STATUS <<_ACEOF
1323 ac_cs_version="\\
1324 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1325 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1326 configured by $[0], generated by m4_PACKAGE_STRING,
1327   with options \\"`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`\\"
1329 Copyright (C) 2007 Free Software Foundation, Inc.
1330 This config.status script is free software; the Free Software Foundation
1331 gives unlimited permission to copy, distribute and modify it."
1333 ac_pwd='$ac_pwd'
1334 srcdir='$srcdir'
1335 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1336 [INSTALL='$INSTALL'
1337 ])dnl
1338 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
1339 [MKDIR_P='$MKDIR_P'
1340 ])dnl
1341 AC_PROVIDE_IFELSE([AC_PROG_AWK],
1342 [AWK='$AWK'
1343 ])dnl
1344 test -n "\$AWK" || AWK=awk
1345 _ACEOF
1347 cat >>$CONFIG_STATUS <<\_ACEOF
1348 # The default lists apply if the user does not specify any file.
1349 ac_need_defaults=:
1350 while test $[#] != 0
1352   case $[1] in
1353   --*=*)
1354     ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
1355     ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
1356     ac_shift=:
1357     ;;
1358   *)
1359     ac_option=$[1]
1360     ac_optarg=$[2]
1361     ac_shift=shift
1362     ;;
1363   esac
1365   case $ac_option in
1366   # Handling of the options.
1367   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1368     ac_cs_recheck=: ;;
1369   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
1370     AS_ECHO(["$ac_cs_version"]); exit ;;
1371   --debug | --debu | --deb | --de | --d | -d )
1372     debug=: ;;
1373 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
1374   --file | --fil | --fi | --f )
1375     $ac_shift
1376     CONFIG_FILES="$CONFIG_FILES $ac_optarg"
1377     ac_need_defaults=false;;
1378 ])dnl
1379 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
1380   --header | --heade | --head | --hea )
1381     $ac_shift
1382     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
1383     ac_need_defaults=false;;
1384   --he | --h)
1385     # Conflict between --help and --header
1386     AC_MSG_ERROR([ambiguous option: $[1]
1387 Try `$[0] --help' for more information.]);;
1388 ], [  --he | --h |])dnl
1389   --help | --hel | -h )
1390     AS_ECHO(["$ac_cs_usage"]); exit ;;
1391   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1392   | -silent | --silent | --silen | --sile | --sil | --si | --s)
1393     ac_cs_silent=: ;;
1395   # This is an error.
1396   -*) AC_MSG_ERROR([unrecognized option: $[1]
1397 Try `$[0] --help' for more information.]) ;;
1399   *) ac_config_targets="$ac_config_targets $[1]"
1400      ac_need_defaults=false ;;
1402   esac
1403   shift
1404 done
1406 ac_configure_extra_args=
1408 if $ac_cs_silent; then
1409   exec AS_MESSAGE_FD>/dev/null
1410   ac_configure_extra_args="$ac_configure_extra_args --silent"
1413 _ACEOF
1414 cat >>$CONFIG_STATUS <<_ACEOF
1415 dnl Check this before opening the log, to avoid a bug on MinGW,
1416 dnl which prohibits the recursive instance from truncating an open log.
1417 if \$ac_cs_recheck; then
1418   set X '$SHELL' '$[0]' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
1419   shift
1420   \AS_ECHO(["running CONFIG_SHELL=$SHELL \$[*]"]) >&AS_MESSAGE_FD
1421   CONFIG_SHELL='$SHELL'
1422   export CONFIG_SHELL
1423   exec "\$[@]"
1426 _ACEOF
1427 cat >>$CONFIG_STATUS <<\_ACEOF
1428 dnl Open the log:
1429 m4_rename([_AC_save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
1430 exec AS_MESSAGE_LOG_FD>>config.log
1432   echo
1433   AS_BOX([Running $as_me.])
1434   AS_ECHO(["$ac_log"])
1435 } >&AS_MESSAGE_LOG_FD
1437 _ACEOF
1438 cat >>$CONFIG_STATUS <<_ACEOF
1439 m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
1441 # INIT-COMMANDS
1443 _AC_OUTPUT_COMMANDS_INIT
1444 ])dnl
1445 _ACEOF
1447 cat >>$CONFIG_STATUS <<\_ACEOF
1449 # Handling of arguments.
1450 for ac_config_target in $ac_config_targets
1452   case $ac_config_target in
1453 m4_ifdef([_AC_LIST_TAGS], [_AC_LIST_TAGS])
1454   *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
1455   esac
1456 done
1458 m4_ifdef([_AC_SEEN_CONFIG(ANY)], [_AC_OUTPUT_MAIN_LOOP])[]dnl
1460 AS_EXIT(0)
1461 _ACEOF
1462 chmod +x $CONFIG_STATUS
1463 ])# _AC_OUTPUT_CONFIG_STATUS
1465 # _AC_OUTPUT_MAIN_LOOP
1466 # --------------------
1467 # The main loop in $CONFIG_STATUS.
1469 # This macro is expanded inside a here document.  If the here document is
1470 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
1472 AC_DEFUN([_AC_OUTPUT_MAIN_LOOP],
1474 # If the user did not use the arguments to specify the items to instantiate,
1475 # then the envvar interface is used.  Set only those that are not.
1476 # We use the long form for the default assignment because of an extremely
1477 # bizarre bug on SunOS 4.1.3.
1478 if $ac_need_defaults; then
1479 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1480 [  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1481 ])dnl
1482 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1483 [  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1484 ])dnl
1485 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1486 [  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1487 ])dnl
1488 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1489 [  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1490 ])dnl
1493 # Have a temporary directory for convenience.  Make it in the build tree
1494 # simply because there is no reason against having it here, and in addition,
1495 # creating and moving files from /tmp can sometimes cause problems.
1496 # Hook for its removal unless debugging.
1497 # Note that there is a small window in which the directory will not be cleaned:
1498 # after its creation but before its name has been assigned to `$tmp'.
1499 $debug ||
1501   tmp=
1502   trap 'exit_status=$?
1503   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
1504 ' 0
1505   trap 'AS_EXIT([1])' 1 2 13 15
1507 dnl The comment above AS_TMPDIR says at most 4 chars are allowed.
1508 AS_TMPDIR([conf], [.])
1510 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [_AC_OUTPUT_FILES_PREPARE])[]dnl
1512 for ac_tag in[]dnl
1513   m4_ifdef([_AC_SEEN_CONFIG(FILES)],    [:F $CONFIG_FILES])[]dnl
1514   m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],  [:H $CONFIG_HEADERS])[]dnl
1515   m4_ifdef([_AC_SEEN_CONFIG(LINKS)],    [:L $CONFIG_LINKS])[]dnl
1516   m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C $CONFIG_COMMANDS])
1518   case $ac_tag in
1519   :[[FHLC]]) ac_mode=$ac_tag; continue;;
1520   esac
1521   case $ac_mode$ac_tag in
1522   :[[FHL]]*:*);;
1523   :L* | :C*:*) AC_MSG_ERROR([Invalid tag $ac_tag.]);;
1524   :[[FH]]-) ac_tag=-:-;;
1525   :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
1526   esac
1527   ac_save_IFS=$IFS
1528   IFS=:
1529   set x $ac_tag
1530   IFS=$ac_save_IFS
1531   shift
1532   ac_file=$[1]
1533   shift
1535   case $ac_mode in
1536   :L) ac_source=$[1];;
1537   :[[FH]])
1538     ac_file_inputs=
1539     for ac_f
1540     do
1541       case $ac_f in
1542       -) ac_f="$tmp/stdin";;
1543       *) # Look for the file first in the build tree, then in the source tree
1544          # (if the path is not absolute).  The absolute path cannot be DOS-style,
1545          # because $ac_f cannot contain `:'.
1546          test -f "$ac_f" ||
1547            case $ac_f in
1548            [[\\/$]]*) false;;
1549            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
1550            esac ||
1551            AC_MSG_ERROR([cannot find input file: $ac_f]);;
1552       esac
1553       ac_file_inputs="$ac_file_inputs $ac_f"
1554     done
1556     # Let's still pretend it is `configure' which instantiates (i.e., don't
1557     # use $as_me), people would be surprised to read:
1558     #    /* config.h.  Generated by config.status.  */
1559     configure_input='Generated from '`
1560           AS_ECHO(["$[*]"]) | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']
1561         `' by configure.'
1562     if test x"$ac_file" != x-; then
1563       configure_input="$ac_file.  $configure_input"
1564       AC_MSG_NOTICE([creating $ac_file])
1565     fi
1567     case $ac_tag in
1568     *:-:* | *:-) cat >"$tmp/stdin";;
1569     esac
1570     ;;
1571   esac
1573   ac_dir=`AS_DIRNAME(["$ac_file"])`
1574   AS_MKDIR_P(["$ac_dir"])
1575   _AC_SRCDIRS(["$ac_dir"])
1577   case $ac_mode in
1578   m4_ifdef([_AC_SEEN_CONFIG(FILES)],    [:F)_AC_OUTPUT_FILE ;;])
1579   m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],  [:H)_AC_OUTPUT_HEADER ;;])
1580   m4_ifdef([_AC_SEEN_CONFIG(LINKS)],    [:L)_AC_OUTPUT_LINK ;;])
1581   m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C)_AC_OUTPUT_COMMAND ;;])
1582   esac
1584 dnl Some shells don't like empty case/esac
1585 m4_ifdef([_AC_LIST_TAG_COMMANDS], [
1586   case $ac_file$ac_mode in
1587 _AC_LIST_TAG_COMMANDS
1588   esac
1589 ])dnl
1590 done # for ac_tag
1592 ])# _AC_OUTPUT_MAIN_LOOP
1595 # AC_OUTPUT_MAKE_DEFS
1596 # -------------------
1597 # Set the DEFS variable to the -D options determined earlier.
1598 # This is a subroutine of AC_OUTPUT.
1599 # It is called inside configure, outside of config.status.
1600 m4_define([AC_OUTPUT_MAKE_DEFS],
1601 [[# Transform confdefs.h into DEFS.
1602 # Protect against shell expansion while executing Makefile rules.
1603 # Protect against Makefile macro expansion.
1605 # If the first sed substitution is executed (which looks for macros that
1606 # take arguments), then branch to the quote section.  Otherwise,
1607 # look for a macro that doesn't take arguments.
1608 ac_script='
1609 t clear
1610 :clear
1611 s/^[     ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
1612 t quote
1613 s/^[     ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
1614 t quote
1615 b any
1616 :quote
1617 s/[      `~#$^&*(){}\\|;'\''"<>?]/\\&/g
1618 s/\[/\\&/g
1619 s/\]/\\&/g
1620 s/\$/$$/g
1622 :any
1624         g
1625         s/^\n//
1626         s/\n/ /g
1627         p
1630 DEFS=`sed -n "$ac_script" confdefs.h`
1631 ]])# AC_OUTPUT_MAKE_DEFS