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 of the License, or
9 # (at your option) 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, see <http://www.gnu.org/licenses/>.
19 # As a special exception, the Free Software Foundation gives unlimited
20 # permission to copy, distribute and modify the configure scripts that
21 # are the output of Autoconf. You need not follow the terms of the GNU
22 # General Public License when using or distributing such scripts, even
23 # though portions of the text of Autoconf appear in them. The GNU
24 # General Public License (GPL) does govern all other use of the material
25 # that constitutes the Autoconf program.
27 # Certain portions of the Autoconf source text are designed to be copied
28 # (in certain cases, depending on the input) into the output of
29 # Autoconf. We call these the "data" portions. The rest of the Autoconf
30 # source text consists of comments plus executable code that decides which
31 # of the data portions to output in any given case. We call these
32 # comments and executable code the "non-data" portions. Autoconf never
33 # copies any of the non-data portions into its output.
35 # This special exception to the GPL applies to versions of Autoconf
36 # released by the Free Software Foundation. When you make and
37 # distribute a modified version of Autoconf, you may extend this special
38 # exception to the GPL to apply to your modified version as well, *unless*
39 # your modified version has the potential to copy into its output some
40 # of the text that was the non-data portion of the version that you started
41 # with. (In other words, unless your change moves or copies text from
42 # the non-data portions to the data portions.) If your modification has
43 # such potential, you must delete any notice of this special exception
44 # to the GPL from your modified version.
46 # Written by David MacKenzie, with help from
47 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
48 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
51 # This file handles about all the preparation aspects for
52 # `config.status': registering the configuration files, the headers,
53 # the links, and the commands `config.status' will run. There is a
54 # little mixture though of things actually handled by `configure',
55 # such as running the `configure' in the sub directories. Minor
58 # There are two kinds of commands:
62 # They are output into `config.status' via a quoted here doc. These
63 # commands are always associated to a tag which the user can use to
64 # tell `config.status' what are the commands she wants to run.
68 # They are output via an *unquoted* here-doc. As a consequence $var
69 # will be output as the value of VAR. This is typically used by
70 # `configure' to give `config.status' some variables it needs to run
71 # the COMMANDS. At the difference of COMMANDS, the INIT-CMDS are
75 # Honorable members of this family are AC_CONFIG_FILES,
76 # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
77 # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
78 # arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
79 # and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
80 # AC_CONFIG_COMMANDS_POST.
83 ## ------------------ ##
84 ## Auxiliary macros. ##
85 ## ------------------ ##
87 # _AC_SRCDIRS(BUILD-DIR-NAME)
88 # ---------------------------
90 # - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
91 # - `$srcdir' is `top-build -> top-src'
94 # - `ac_builddir' is `.', for symmetry only.
95 # - `ac_top_builddir_sub' is `build -> top_build'.
96 # This is used for @top_builddir@.
97 # - `ac_top_build_prefix' is `build -> top_build'.
98 # If not empty, has a trailing slash.
99 # - `ac_srcdir' is `build -> src'.
100 # - `ac_top_srcdir' is `build -> top-src'.
101 # and `ac_abs_builddir' etc., the absolute directory names.
102 m4_define([_AC_SRCDIRS],
106 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
108 ac_dir_suffix=/`AS_ECHO([$1]) | sed 's,^\.[[\\/]],,'`
109 # A ".." for each directory in $ac_dir_suffix.
110 ac_top_builddir_sub=`AS_ECHO(["$ac_dir_suffix"]) | sed 's,/[[^\\/]]*,/..,g;s,/,,'`
111 case $ac_top_builddir_sub in
112 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
113 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
116 ac_abs_top_builddir=$ac_pwd
117 ac_abs_builddir=$ac_pwd$ac_dir_suffix
118 # for backward compatibility:
119 ac_top_builddir=$ac_top_build_prefix
122 .) # We are building in place.
124 ac_top_srcdir=$ac_top_builddir_sub
125 ac_abs_top_srcdir=$ac_pwd ;;
126 [[\\/]]* | ?:[[\\/]]* ) # Absolute name.
127 ac_srcdir=$srcdir$ac_dir_suffix;
128 ac_top_srcdir=$srcdir
129 ac_abs_top_srcdir=$srcdir ;;
131 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
132 ac_top_srcdir=$ac_top_build_prefix$srcdir
133 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
135 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
140 ## ---------------------- ##
141 ## Registering the tags. ##
142 ## ---------------------- ##
145 # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
146 # -----------------------------------------
148 # Register INIT-COMMANDS as command pasted *unquoted* in
149 # `config.status'. This is typically used to pass variables from
150 # `configure' to `config.status'. Note that $[1] is not over quoted as
151 # was the case in AC_OUTPUT_COMMANDS.
152 m4_define([_AC_CONFIG_COMMANDS_INIT],
154 [m4_append([_AC_OUTPUT_COMMANDS_INIT],
159 # AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
160 # -----------------------------------------------------
161 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
163 # It announces DEST depends upon the SOURCE1 etc.
164 m4_define([AC_FILE_DEPENDENCY_TRACE], [])
167 # _AC_FILE_DEPENDENCY_TRACE_COLON(DEST:SOURCE1[:SOURCE2...])
168 # ----------------------------------------------------------
169 # Declare that DEST depends upon SOURCE1 etc.
171 m4_define([_AC_FILE_DEPENDENCY_TRACE_COLON],
172 [AC_FILE_DEPENDENCY_TRACE(m4_bpatsubst([$1], [:], [,]))dnl
176 # _AC_CONFIG_DEPENDENCY(MODE, DEST[:SOURCE1...])
177 # ---------------------------------------------
178 # MODE is `FILES', `HEADERS', or `LINKS'.
180 # Be sure that a missing dependency is expressed as a dependency upon
181 # `DEST.in' (except with config links).
183 m4_define([_AC_CONFIG_DEPENDENCY],
184 [_AC_FILE_DEPENDENCY_TRACE_COLON([$2]_AC_CONFIG_DEPENDENCY_DEFAULT($@))dnl
188 # _AC_CONFIG_DEPENDENCY_DEFAULT(MODE, DEST[:SOURCE1...])
189 # ------------------------------------------------------
190 # Expand to `:DEST.in' if appropriate, or to empty string otherwise.
192 # More detailed edscription:
193 # If the tag contains `:', expand to nothing.
194 # Otherwise, for a config file or header, add `:DEST.in'.
195 # For config link, DEST.in is not appropriate:
196 # - if the tag is literal, complain.
197 # - otherwise, just expand to nothing and proceed with fingers crossed.
198 # (We get to this case from the obsolete AC_LINK_FILES, for example.)
200 m4_define([_AC_CONFIG_DEPENDENCY_DEFAULT],
201 [m4_bmatch([$2], [:], [],
202 [m4_if([$1], [LINKS],
203 [AS_LITERAL_IF([$2], [AC_FATAL([Invalid AC_CONFIG_LINKS tag: `$2'])])],
208 # _AC_CONFIG_UNIQUE(MODE, DEST)
209 # -----------------------------
210 # MODE is `FILES', `HEADERS', `LINKS', `COMMANDS', or `SUBDIRS'.
212 # Verify that there is no double definition of an output file.
214 m4_define([_AC_CONFIG_UNIQUE],
215 [m4_ifdef([_AC_SEEN_TAG($2)],
216 [AC_FATAL([`$2' is already registered with AC_CONFIG_]m4_defn([_AC_SEEN_TAG($2)]).)],
217 [m4_define([_AC_SEEN_TAG($2)], [$1])])dnl
221 # _AC_CONFIG_FOOS(MODE, TAGS..., [COMMANDS], [INIT-CMDS])
222 # -------------------------------------------------------
223 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
225 # Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,
226 # run COMMANDS afterwards. (This is done in _AC_CONFIG_REGISTER_DEST.)
228 # For COMMANDS, do not m4_normalize TAGS before adding it to ac_config_commands.
229 # This historical difference allows macro calls in TAGS.
231 m4_define([_AC_CONFIG_FOOS],
232 [m4_foreach_w([AC_File], [$2],
233 [_AC_CONFIG_REGISTER([$1], m4_defn([AC_File]), [$3])])dnl
234 m4_define([_AC_SEEN_CONFIG(ANY)])dnl
235 m4_define([_AC_SEEN_CONFIG($1)])dnl
236 _AC_CONFIG_COMMANDS_INIT([$4])dnl
237 ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) dnl
238 m4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"
242 # _AC_CONFIG_REGISTER(MODE, TAG, [COMMANDS])
243 # ------------------------------------------
244 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
246 m4_define([_AC_CONFIG_REGISTER],
247 [m4_if([$1], [COMMANDS],
249 [_AC_CONFIG_DEPENDENCY([$1], [$2])])dnl
250 _AC_CONFIG_REGISTER_DEST([$1], [$2], m4_bpatsubst([[$2]], [:.*\(.\)$], [\1]), [$3])dnl
254 # _AC_CONFIG_REGISTER_DEST(MODE, TAG, DEST, [COMMANDS])
255 # -----------------------------------------------------
256 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
257 # TAG is in the form DEST[:SOURCE...].
258 # Thus parameter $3 is the first part of $2.
260 # With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status
261 # to guess the links to establish (`./config.status .').
263 # Save the name of the first config header to AH_HEADER.
265 m4_define([_AC_CONFIG_REGISTER_DEST],
266 [_AC_CONFIG_UNIQUE([$1], [$3])dnl
267 m4_if([$1 $3], [LINKS .],
268 [AC_FATAL([invalid destination of a config link: `.'])])dnl
269 m4_if([$1], [HEADERS],
270 [m4_define_default([AH_HEADER], [$3])])dnl
272 dnl Recognize TAG as an argument to config.status:
274 m4_append([_AC_LIST_TAGS],
275 [ "$3") CONFIG_$1="$CONFIG_$1 $2" ;;
278 dnl Register the associated commands, if any:
281 [m4_append([_AC_LIST_TAG_COMMANDS],
282 [ "$3":]m4_bpatsubst([$1], [^\(.\).*$], [\1])[) $4 ;;
284 ])# _AC_CONFIG_REGISTER_DEST
289 ## --------------------- ##
290 ## Configuration files. ##
291 ## --------------------- ##
294 # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
295 # -------------------------------------------------
296 # Specify output files, i.e., files that are configured with AC_SUBST.
298 AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)])
303 # Evaluate to an m4 number equal to the maximum number of commands to put
304 # in any single sed program, not counting ":" commands.
306 # Some seds have small command number limits, like on Digital OSF/1 and HP-UX.
307 m4_define([_AC_SED_CMD_LIMIT],
308 dnl One cannot portably go further than 99 commands because of HP-UX.
312 # _AC_AWK_LITERAL_LIMIT
313 # ---------------------
314 # Evaluate to the maximum number of characters to put in an awk
315 # string literal, not counting escape characters.
317 # Some awk's have small limits, such as Solaris and AIX awk.
318 m4_define([_AC_AWK_LITERAL_LIMIT],
322 # _AC_OUTPUT_FILES_PREPARE
323 # ------------------------
324 # Create the sed scripts needed for CONFIG_FILES.
325 # Support multiline substitutions and make sure that the substitutions are
326 # not evaluated recursively.
327 # The intention is to have readable config.status and configure, even
328 # though this m4 code might be scaring.
330 # This code was written by Dan Manthey and rewritten by Ralf Wildenhues.
332 # This macro is expanded inside a here document. If the here document is
333 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
335 m4_define([_AC_OUTPUT_FILES_PREPARE],
336 [# Set up the scripts for CONFIG_FILES section.
337 # No need to generate them if there are no CONFIG_FILES.
338 # This happens for instance with `./config.status config.h'.
339 if test -n "$CONFIG_FILES"; then
341 dnl For AC_SUBST_FILE, check for usable getline support in awk,
342 dnl at config.status execution time.
343 dnl Otherwise, do the interpolation in sh, which is slower.
344 dnl Without any AC_SUBST_FILE, omit all related code.
345 dnl Note the expansion is double-quoted for readability.
346 m4_ifdef([_AC_SUBST_FILES],
347 [[if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
350 ac_cs_awk_read_file='
351 while ((getline aline < (F[key])) > 0)
356 ac_cs_awk_getline=false
357 ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|'\""
358 ac_cs_awk_read_file='
361 '$ac_cs_awk_pipe_init
362 ac_cs_awk_pipe_fini='END { print "|#_!!_#|" }'
365 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
366 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
372 dnl Define the pipe that does the substitution.
373 m4_ifdef([_AC_SUBST_FILES],
374 [m4_define([_AC_SUBST_CMDS], [|
375 if $ac_cs_awk_getline; then
376 $AWK -f "$tmp/subs.awk"
378 $AWK -f "$tmp/subs.awk" | $SHELL
380 [m4_define([_AC_SUBST_CMDS],
381 [| $AWK -f "$tmp/subs.awk"])])dnl
383 echo 'BEGIN {' >"$tmp/subs1.awk"
386 m4_ifdef([_AC_SUBST_FILES],
387 [# Create commands to substitute file output variables.
389 echo "cat >>$CONFIG_STATUS <<_ACEOF"
390 echo 'cat >>"\$tmp/subs1.awk" <<\CEOF'
391 echo "$ac_subst_files" | sed 's/.*/F@<:@"&"@:>@="$&"/'
400 echo "cat >conf$$subs.awk <<_ACEOF"
401 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/'
404 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
406 for ac_last_try in false false false false false :; do
409 dnl Do not use grep on conf$$subs.awk, since AIX grep has a line length limit.
410 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
412 elif $ac_last_try; then
413 AC_MSG_ERROR([could not make $CONFIG_STATUS])
415 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
420 dnl Initialize an awk array of substitutions, keyed by variable name.
422 dnl The initial line contains the variable name VAR, then a `!'.
423 dnl Construct `S["VAR"]=' from it.
424 dnl The rest of the line, and potentially further lines, contain the
425 dnl substituted value; the last of those ends with $ac_delim. We split
426 dnl the output both along those substituted newlines and at intervals of
427 dnl length _AC_AWK_LITERAL_LIMIT. The latter is done to comply with awk
428 dnl string literal limitations, the former for simplicity in doing so.
430 dnl We deal with one input line at a time to avoid sed pattern space
431 dnl limitations. We kill the delimiter $ac_delim before splitting the
432 dnl string (otherwise we risk splitting the delimiter). And we do the
433 dnl splitting before the quoting of awk special characters (otherwise we
434 dnl risk splitting an escape sequence).
436 dnl Output as separate string literals, joined with backslash-newline.
437 dnl Eliminate the newline after `=' in a second script, for readability.
439 dnl Notes to the main part of the awk script:
440 dnl - the unusual FS value helps prevent running into the limit of 99 fields,
441 dnl - we avoid sub/gsub because of the \& quoting issues, see
442 dnl http://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html
443 dnl - Writing `$ 0' prevents expansion by both the shell and m4 here.
445 dnl m4-double-quote most of the scripting for readability.
446 [cat >>$CONFIG_STATUS <<_ACEOF
447 cat >>"\$tmp/subs1.awk" <<\CEOF
461 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\).*/\1/
463 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
468 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
471 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
475 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\).*/\1/
477 s/["\\]/\\&/g; s/^/"/; s/$/"/
481 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
484 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
486 ' <conf$$subs.awk | sed '
493 cat >>$CONFIG_STATUS <<_ACEOF
495 cat >>"\$tmp/subs1.awk" <<CEOF
496 for (key in S) S_is_set[key] = 1
498 ]m4_ifdef([_AC_SUBST_FILES],
499 [ \$ac_cs_awk_pipe_init])[
503 nfields = split(line, field, "@")
505 len = length(field[1])
506 for (i = 2; i < nfields; i++) {
511 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
512 len += length(value) + length(field[++i])
517 ]m4_ifdef([_AC_SUBST_FILES],
518 [[ if (nfields == 3 && !substed) {
520 if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
521 \$ac_cs_awk_read_file
527 ]m4_ifdef([_AC_SUBST_FILES],
528 [\$ac_cs_awk_pipe_fini])[
530 sed "s/\$ac_cr\\\$//; s/\$ac_cr/\$ac_cs_awk_cr/g" < "\$tmp/subs1.awk" > "\$tmp/subs.awk"
532 ]dnl end of double-quoted part
534 # VPATH may cause trouble with some makes, so we remove $(srcdir),
535 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
536 # trailing colons and then remove the whole line if VPATH becomes empty
537 # (actually we leave an empty line to preserve line numbers).
538 if test "x$srcdir" = x.; then
539 ac_vpsub=['/^[ ]*VPATH[ ]*=/{
543 s/^\([^=]*=[ ]*\):*/\1/
549 cat >>$CONFIG_STATUS <<\_ACEOF
550 fi # test -n "$CONFIG_FILES"
552 ])# _AC_OUTPUT_FILES_PREPARE
557 # Do the variable substitutions to create the Makefiles or whatever.
559 # This macro is expanded inside a here document. If the here document is
560 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
562 m4_define([_AC_OUTPUT_FILE],
568 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
570 [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
571 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
574 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
575 [ ac_MKDIR_P=$MKDIR_P
577 [[\\/$]]* | ?:[[\\/]]* ) ;;
578 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
583 m4_ifndef([AC_DATAROOTDIR_CHECKED],
584 [cat >>$CONFIG_STATUS <<\_ACEOF
585 # If the template does not know about datarootdir, expand it.
586 # FIXME: This hack should be removed a few years after 2.60.
587 ac_datarootdir_hack=; ac_datarootdir_seen=
588 m4_define([_AC_datarootdir_vars],
589 [datadir, docdir, infodir, localedir, mandir])
590 case `sed -n '/datarootdir/ {
594 m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
596 ])' $ac_file_inputs` in
597 *datarootdir*) ac_datarootdir_seen=yes;;
598 *@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
599 AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
601 cat >>$CONFIG_STATUS <<_ACEOF
602 ac_datarootdir_hack='
603 m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]),
604 [s&@_AC_Var@&$_AC_Var&g
606 s&\\\${datarootdir}&$datarootdir&g' ;;
611 # Neutralize VPATH when `$srcdir' = `.'.
612 # Shell code in configure.ac might set extrasub.
613 # FIXME: do we really want to maintain this feature?
614 cat >>$CONFIG_STATUS <<_ACEOF
618 cat >>$CONFIG_STATUS <<\_ACEOF
620 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
621 dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
622 s&@configure_input@&$configure_input&;t t
623 dnl During the transition period, this is a special case:
624 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
625 m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
626 builddir, abs_builddir,
627 abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [[, MKDIR_P]]),
628 [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
630 m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
632 " $ac_file_inputs m4_defn([_AC_SUBST_CMDS]) >$tmp/out
634 m4_ifndef([AC_DATAROOTDIR_CHECKED],
635 [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
636 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
637 { ac_out=`sed -n '/^[[ ]]*datarootdir[[ ]]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
638 AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
639 which seems to be undefined. Please make sure it is defined.])
644 -) cat "$tmp/out"; rm -f "$tmp/out";;
645 *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
647 dnl This would break Makefile dependencies:
648 dnl if diff $ac_file "$tmp/out" >/dev/null 2>&1; then
649 dnl echo "$ac_file is unchanged"
651 dnl rm -f $ac_file; mv "$tmp/out" $ac_file
658 ## ----------------------- ##
659 ## Configuration headers. ##
660 ## ----------------------- ##
663 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
664 # ------------------------------------------------------
665 # Specify that the HEADERS are to be created by instantiation of the
668 AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])
671 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
672 # --------------------------------------
673 # FIXME: Make it obsolete?
674 AC_DEFUN([AC_CONFIG_HEADER],
675 [AC_CONFIG_HEADERS([$1])])
681 # Output the code which instantiates the `config.h' files from their
684 # This macro is expanded inside a here document. If the here document is
685 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
687 m4_define([_AC_OUTPUT_HEADER],
694 # Transform confdefs.h into a sed script `conftest.defines', that
695 # substitutes the proper values into config.h.in to produce config.h.
696 rm -f conftest.defines conftest.tail
697 # First, append a space to every undef/define line, to ease matching.
698 echo 's/$/ /' >conftest.defines
699 # Then, protect against being on the right side of a sed subst, or in
700 # an unquoted here document, in config.status. If some macros were
701 # called several times there might be several #defines for the same
702 # symbol, which is useless. But do not sort them, since the last
703 # AC_DEFINE must be honored.
705 dnl Quote, for `[ ]' and `define'.
706 [ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
707 # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
708 # NAME is the cpp macro being defined, VALUE is the value it is being given.
709 # PARAMS is the parameter list in the macro definition--in most cases, it's
710 # just an empty string.
711 ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
712 ac_dB='\\)[ (].*,\\1define\\2'
715 dnl ac_dD used to contain `;t' at the end, but that was both slow and incorrect.
716 dnl 1) Since the script must be broken into chunks containing 100 commands,
717 dnl the extra command meant extra calls to sed.
718 dnl 2) The code was incorrect: in the unusual case where a symbol has multiple
719 dnl different AC_DEFINEs, the last one should be honored.
721 dnl ac_dB works because every line has a space appended. ac_dD reinserts
722 dnl the space, because some symbol may have been AC_DEFINEd several times.
724 dnl The first use of ac_dA has a space prepended, so that the second
725 dnl use does not match the initial 's' of $ac_dA.
731 s/^[ ]*#[ ]*define[ ][ ]*//
736 s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
737 s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
740 # Remove the space that was appended to ease matching.
741 # Then replace #undef with comments. This is necessary, for
742 # example, in the case of _POSIX_SOURCE, which is predefined and required
743 # on some systems where configure will not decide to define it.
744 # (The regexp can be short, since the line contains either #define or #undef.)
746 [s,^[ #]*u.*,/* & */,]' >>conftest.defines
748 # Break up conftest.defines:
749 dnl If we cared only about not exceeding line count limits, we would use this:
750 dnl ac_max_sed_lines=m4_eval(_AC_SED_CMD_LIMIT - 3)
751 dnl But in practice this can generate scripts that contain too many bytes;
752 dnl and this can cause obscure 'sed' failures, e.g.,
753 dnl http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00127.html
754 dnl So instead, we use the following, which is about half the size we'd like:
756 dnl In the future, let's use awk or sh instead of sed to do substitutions,
757 dnl since we have so many problems with sed.
759 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
760 # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
761 # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
763 ac_in='$ac_file_inputs'
769 # Write a here document:
770 dnl Quote, for the `[ ]' and `define'.
771 [ cat >>$CONFIG_STATUS <<_ACEOF
772 # First, check the format of the line:
773 cat >"\$tmp/defines.sed" <<\\CEOF
774 /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
775 /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
779 sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
781 sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
782 ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
783 sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
784 grep . conftest.tail >/dev/null || break
785 rm -f conftest.defines
786 mv conftest.tail conftest.defines
788 rm -f conftest.defines conftest.tail
790 dnl Now back to your regularly scheduled config.status.
791 echo "ac_result=$ac_in" >>$CONFIG_STATUS
792 cat >>$CONFIG_STATUS <<\_ACEOF
793 if test x"$ac_file" != x-; then
794 AS_ECHO(["/* $configure_input */"]) >"$tmp/config.h"
795 cat "$ac_result" >>"$tmp/config.h"
796 if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
797 AC_MSG_NOTICE([$ac_file is unchanged])
800 mv "$tmp/config.h" $ac_file
803 AS_ECHO(["/* $configure_input */"])
807 dnl If running for Automake, be ready to perform additional
808 dnl commands to set up the timestamp files.
809 m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
810 [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])
812 ])# _AC_OUTPUT_HEADER
816 ## --------------------- ##
817 ## Configuration links. ##
818 ## --------------------- ##
821 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
822 # --------------------------------------------------------
823 # Specify that config.status should establish a (symbolic if possible)
824 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
825 # Reject DEST=., because it is makes it hard for ./config.status
826 # to guess the links to establish (`./config.status .').
828 AC_DEFUN([AC_CONFIG_LINKS], [_AC_CONFIG_FOOS([LINKS], $@)])
831 # AC_LINK_FILES(SOURCE..., DEST...)
832 # ---------------------------------
833 # Link each of the existing files SOURCE... to the corresponding
834 # link name in DEST...
836 # Unfortunately we can't provide a very good autoupdate service here,
837 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
838 # and `$to' are actually lists. It would then be completely wrong to
839 # replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the
840 # case of literal values though, but because I don't think there is any
841 # interest in creating config links with literal values, no special
842 # mechanism is implemented to handle them.
844 # _AC_LINK_FILES_CNT is used to be robust to multiple calls.
845 AU_DEFUN([AC_LINK_FILES],
847 [m4_fatal([$0: incorrect number of arguments])])dnl
848 m4_define_default([_AC_LINK_FILES_CNT], 0)dnl
849 m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
852 while test -n "$ac_sources"; do
853 set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
854 set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
855 [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
857 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
859 [It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
860 to AC_CONFIG_LINKS. `autoupdate' provides a functional but inelegant
861 update, you should probably tune the result yourself.])# AC_LINK_FILES
866 # This macro is expanded inside a here document. If the here document is
867 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
868 m4_define([_AC_OUTPUT_LINK],
874 test -r "$ac_source" || ac_source=$srcdir/$ac_source
876 AC_MSG_NOTICE([linking $ac_source to $ac_file])
878 if test ! -r "$ac_source"; then
879 AC_MSG_ERROR([$ac_source: file not found])
883 # Try a relative symlink, then a hard link, then a copy.
885 [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$ac_source ;;
886 *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
888 ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
889 ln "$ac_source" "$ac_file" 2>/dev/null ||
890 cp -p "$ac_source" "$ac_file" ||
891 AC_MSG_ERROR([cannot link or copy $ac_source to $ac_file])
896 ## ------------------------ ##
897 ## Configuration commands. ##
898 ## ------------------------ ##
901 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
902 # ---------------------------------------------------
904 # Specify additional commands to be run by config.status. This
905 # commands must be associated with a NAME, which should be thought
906 # as the name of a file the COMMANDS create.
908 AC_DEFUN([AC_CONFIG_COMMANDS], [_AC_CONFIG_FOOS([COMMANDS], $@)])
911 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
912 # -----------------------------------------
914 # Add additional commands for AC_OUTPUT to put into config.status.
916 # This macro is an obsolete version of AC_CONFIG_COMMANDS. The only
917 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
918 # to give a unique key. The scheme we have chosen is `default-1',
919 # `default-2' etc. for each call.
921 # Unfortunately this scheme is fragile: bad things might happen
922 # if you update an included file and configure.ac: you might have
923 # clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
924 # depending upon __file__ or the pid).
925 AU_DEFUN([AC_OUTPUT_COMMANDS],
926 [m4_define_default([_AC_OUTPUT_COMMANDS_CNT], 0)dnl
927 m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
928 dnl Double quoted since that was the case in the original macro.
929 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
935 # This macro is expanded inside a here document. If the here document is
936 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
937 m4_define([_AC_OUTPUT_COMMAND],
938 [ AC_MSG_NOTICE([executing $ac_file commands])
943 ## -------------------------------------- ##
944 ## Pre- and post-config.status commands. ##
945 ## -------------------------------------- ##
948 # AC_CONFIG_COMMANDS_PRE(CMDS)
949 # ----------------------------
950 # Commands to run right before config.status is created. Accumulates.
951 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
952 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
956 # AC_OUTPUT_COMMANDS_PRE
957 # ----------------------
958 # A *variable* in which we append all the actions that must be
959 # performed before *creating* config.status. For a start, clean
960 # up all the LIBOBJ mess.
961 m4_define([AC_OUTPUT_COMMANDS_PRE],
962 [_AC_LIBOBJS_NORMALIZE
966 # AC_CONFIG_COMMANDS_POST(CMDS)
967 # -----------------------------
968 # Commands to run after config.status was created. Accumulates.
969 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
970 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
974 m4_define([AC_OUTPUT_COMMANDS_POST])
978 ## ----------------------- ##
979 ## Configuration subdirs. ##
980 ## ----------------------- ##
983 # AC_CONFIG_SUBDIRS(DIR ...)
984 # --------------------------
985 # We define two variables:
987 # A statically built list, should contain *all* the arguments of
988 # AC_CONFIG_SUBDIRS. The final value is assigned to ac_subdirs_all in
989 # the `default' section, and used for --help=recursive.
990 # It makes no sense for arguments which are sh variables.
992 # Shell variable built at runtime, so some of these dirs might not be
993 # included, if for instance the user refused a part of the tree.
994 # This is used in _AC_OUTPUT_SUBDIRS.
995 AC_DEFUN([AC_CONFIG_SUBDIRS],
996 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
997 AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])dnl
998 m4_foreach_w([_AC_Sub], [$1],
999 [_AC_CONFIG_UNIQUE([SUBDIRS],
1000 m4_bpatsubst(m4_defn([_AC_Sub]), [:.*]))])dnl
1001 m4_append([_AC_LIST_SUBDIRS], [$1], [
1003 AS_LITERAL_IF([$1], [],
1004 [AC_DIAGNOSE([syntax], [$0: you should use literals])])dnl
1005 AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])dnl
1009 # _AC_OUTPUT_SUBDIRS
1010 # ------------------
1011 # This is a subroutine of AC_OUTPUT, but it does not go into
1012 # config.status, rather, it is called after running config.status.
1013 m4_define([_AC_OUTPUT_SUBDIRS],
1016 # CONFIG_SUBDIRS section.
1018 if test "$no_recursion" != yes; then
1020 # Remove --cache-file, --srcdir, and --disable-option-checking arguments
1021 # so they do not pile up.
1022 ac_sub_configure_args=
1024 eval "set x $ac_configure_args"
1028 if test -n "$ac_prev"; then
1033 -cache-file | --cache-file | --cache-fil | --cache-fi \
1034 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1035 ac_prev=cache_file ;;
1036 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1037 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
1040 --config-cache | -C)
1042 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1044 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1046 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1048 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1050 --disable-option-checking)
1054 *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1056 ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
1060 # Always prepend --prefix to ensure using the same prefix
1061 # in subdir configurations.
1062 ac_arg="--prefix=$prefix"
1064 *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1066 ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
1069 if test "$silent" = yes; then
1070 ac_sub_configure_args="--silent $ac_sub_configure_args"
1073 # Always prepend --disable-option-checking to silence warnings, since
1074 # different subdirs can have different --enable and --with options.
1075 ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
1078 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
1080 # Do not complain, so a configure script can configure whichever
1081 # parts of a large source tree are present.
1082 test -d "$srcdir/$ac_dir" || continue
1084 ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
1085 _AS_ECHO_LOG([$ac_msg])
1087 AS_MKDIR_P(["$ac_dir"])
1088 _AC_SRCDIRS(["$ac_dir"])
1092 # Check for guested configure; otherwise get Cygnus style configure.
1093 if test -f "$ac_srcdir/configure.gnu"; then
1094 ac_sub_configure=$ac_srcdir/configure.gnu
1095 elif test -f "$ac_srcdir/configure"; then
1096 ac_sub_configure=$ac_srcdir/configure
1097 elif test -f "$ac_srcdir/configure.in"; then
1098 # This should be Cygnus configure.
1099 ac_sub_configure=$ac_aux_dir/configure
1101 AC_MSG_WARN([no configuration information is in $ac_dir])
1105 # The recursion is here.
1106 if test -n "$ac_sub_configure"; then
1107 # Make the cache file name correct relative to the subdirectory.
1109 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1111 ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
1114 AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
1115 # The eval makes quoting arguments work.
1116 eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
1117 --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
1118 AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
1124 ])# _AC_OUTPUT_SUBDIRS
1129 ## -------------------------- ##
1130 ## Outputting config.status. ##
1131 ## -------------------------- ##
1134 # AU::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1135 # -----------------------------------------------------------
1137 # If there are arguments given to AC_OUTPUT, dispatch them to the
1138 # proper modern macros.
1139 AU_DEFUN([AC_OUTPUT],
1141 [AC_CONFIG_FILES([$1])])dnl
1143 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1147 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1148 # -------------------------------------------------------
1150 # Produce config.status, config.h, and links; and configure subdirs.
1152 m4_define([AC_OUTPUT],
1153 [dnl Dispatch the extra arguments to their native macros.
1155 [AC_CONFIG_FILES([$1])])dnl
1157 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1159 [AC_DIAGNOSE([obsolete],
1160 [$0 should be used without arguments.
1161 You should run autoupdate.])])dnl
1164 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1165 # Let make expand exec_prefix.
1166 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1168 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1170 dnl Commands to run before creating config.status.
1171 AC_OUTPUT_COMMANDS_PRE()dnl
1173 : ${CONFIG_STATUS=./config.status}
1174 ac_clean_files_save=$ac_clean_files
1175 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1176 _AC_OUTPUT_CONFIG_STATUS()dnl
1177 ac_clean_files=$ac_clean_files_save
1179 dnl Commands to run after config.status was created
1180 AC_OUTPUT_COMMANDS_POST()dnl
1182 # configure is writing to config.log, and then calls config.status.
1183 # config.status does its own redirection, appending to config.log.
1184 # Unfortunately, on DOS this fails, as config.log is still kept open
1185 # by configure, so config.status won't be able to write to it; its
1186 # output is simply discarded. So we exec the FD to /dev/null,
1187 # effectively closing config.log, so it can be properly (re)opened and
1188 # appended to by config.status. When coming back to configure, we
1189 # need to make the FD available again.
1190 if test "$no_create" != yes; then
1192 ac_config_status_args=
1193 test "$silent" = yes &&
1194 ac_config_status_args="$ac_config_status_args --quiet"
1195 exec AS_MESSAGE_LOG_FD>/dev/null
1196 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
1197 exec AS_MESSAGE_LOG_FD>>config.log
1198 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
1199 # would make configure fail if this is the last instruction.
1200 $ac_cs_success || AS_EXIT([1])
1202 dnl config.status should not do recursion.
1203 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1204 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
1205 AC_MSG_WARN([Unrecognized options: $ac_unrecognized_opts])
1210 # _AC_OUTPUT_CONFIG_STATUS
1211 # ------------------------
1212 # Produce config.status. Called by AC_OUTPUT.
1213 # Pay special attention not to have too long here docs: some old
1214 # shells die. Unfortunately the limit is not known precisely...
1215 m4_define([_AC_OUTPUT_CONFIG_STATUS],
1216 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
1217 dnl AS_MESSAGE_LOG_FD is not available yet:
1218 m4_rename([AS_MESSAGE_LOG_FD], [_AC_save_AS_MESSAGE_LOG_FD])dnl
1219 cat >$CONFIG_STATUS <<_ACEOF
1221 # Generated by $as_me.
1222 # Run this file to recreate the current configuration.
1223 # Compiler output produced by configure, useful for debugging
1224 # configure, is in config.log if it exists.
1229 SHELL=\${CONFIG_SHELL-$SHELL}
1232 cat >>$CONFIG_STATUS <<\_ACEOF
1234 dnl Watch out, this is directly the initializations, do not use
1235 dnl AS_PREPARE, otherwise you'd get it output in the initialization
1236 dnl of configure, not config.status.
1238 exec AS_MESSAGE_FD>&1
1240 # Save the log message, to keep $[0] and so on meaningful, and to
1241 # report actual input values of CONFIG_FILES etc. instead of their
1242 # values after options handling.
1244 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1245 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1246 generated by m4_PACKAGE_STRING. Invocation command line was
1248 CONFIG_FILES = $CONFIG_FILES
1249 CONFIG_HEADERS = $CONFIG_HEADERS
1250 CONFIG_LINKS = $CONFIG_LINKS
1251 CONFIG_COMMANDS = $CONFIG_COMMANDS
1254 on `(hostname || uname -n) 2>/dev/null | sed 1q`
1259 cat >>$CONFIG_STATUS <<_ACEOF
1260 # Files that config.status was made for.
1261 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1262 [config_files="$ac_config_files"
1264 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1265 [config_headers="$ac_config_headers"
1267 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1268 [config_links="$ac_config_links"
1270 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1271 [config_commands="$ac_config_commands"
1276 cat >>$CONFIG_STATUS <<\_ACEOF
1278 \`$as_me' instantiates files from templates according to the
1279 current configuration.
1281 Usage: $[0] [[OPTIONS]] [[FILE]]...
1283 -h, --help print this help, then exit
1284 -V, --version print version number and configuration settings, then exit
1285 -q, --quiet do not print progress messages
1286 -d, --debug don't remove temporary files
1287 --recheck update $as_me by reconfiguring in the same conditions
1288 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1289 [[ --file=FILE[:TEMPLATE]
1290 instantiate the configuration file FILE
1292 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1293 [[ --header=FILE[:TEMPLATE]
1294 instantiate the configuration header FILE
1297 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1298 [Configuration files:
1302 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1303 [Configuration headers:
1307 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1308 [Configuration links:
1312 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1313 [Configuration commands:
1317 Report bugs to <bug-autoconf@gnu.org>."
1320 cat >>$CONFIG_STATUS <<_ACEOF
1322 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1323 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1324 configured by $[0], generated by m4_PACKAGE_STRING,
1325 with options \\"`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`\\"
1327 Copyright (C) 2007 Free Software Foundation, Inc.
1328 This config.status script is free software; the Free Software Foundation
1329 gives unlimited permission to copy, distribute and modify it."
1333 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1336 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
1339 AC_PROVIDE_IFELSE([AC_PROG_AWK],
1342 test -n "\$AWK" || AWK=awk
1345 cat >>$CONFIG_STATUS <<\_ACEOF
1346 # The default lists apply if the user does not specify any file.
1348 while test $[#] != 0
1352 ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
1353 ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
1364 # Handling of the options.
1365 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1367 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
1368 AS_ECHO(["$ac_cs_version"]); exit ;;
1369 --debug | --debu | --deb | --de | --d | -d )
1371 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
1372 --file | --fil | --fi | --f )
1374 CONFIG_FILES="$CONFIG_FILES $ac_optarg"
1375 ac_need_defaults=false;;
1377 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
1378 --header | --heade | --head | --hea )
1380 CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
1381 ac_need_defaults=false;;
1383 # Conflict between --help and --header
1384 AC_MSG_ERROR([ambiguous option: $[1]
1385 Try `$[0] --help' for more information.]);;
1386 ], [ --he | --h |])dnl
1387 --help | --hel | -h )
1388 AS_ECHO(["$ac_cs_usage"]); exit ;;
1389 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1390 | -silent | --silent | --silen | --sile | --sil | --si | --s)
1394 -*) AC_MSG_ERROR([unrecognized option: $[1]
1395 Try `$[0] --help' for more information.]) ;;
1397 *) ac_config_targets="$ac_config_targets $[1]"
1398 ac_need_defaults=false ;;
1404 ac_configure_extra_args=
1406 if $ac_cs_silent; then
1407 exec AS_MESSAGE_FD>/dev/null
1408 ac_configure_extra_args="$ac_configure_extra_args --silent"
1412 cat >>$CONFIG_STATUS <<_ACEOF
1413 dnl Check this before opening the log, to avoid a bug on MinGW,
1414 dnl which prohibits the recursive instance from truncating an open log.
1415 if \$ac_cs_recheck; then
1416 set X '$SHELL' '$[0]' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
1418 \AS_ECHO(["running CONFIG_SHELL=$SHELL \$[*]"]) >&AS_MESSAGE_FD
1419 CONFIG_SHELL='$SHELL'
1425 cat >>$CONFIG_STATUS <<\_ACEOF
1427 m4_rename([_AC_save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
1428 exec AS_MESSAGE_LOG_FD>>config.log
1431 AS_BOX([Running $as_me.])
1432 AS_ECHO(["$ac_log"])
1433 } >&AS_MESSAGE_LOG_FD
1436 cat >>$CONFIG_STATUS <<_ACEOF
1437 m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
1441 _AC_OUTPUT_COMMANDS_INIT
1445 cat >>$CONFIG_STATUS <<\_ACEOF
1447 # Handling of arguments.
1448 for ac_config_target in $ac_config_targets
1450 case $ac_config_target in
1451 m4_ifdef([_AC_LIST_TAGS], [_AC_LIST_TAGS])
1452 *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
1456 m4_ifdef([_AC_SEEN_CONFIG(ANY)], [_AC_OUTPUT_MAIN_LOOP])[]dnl
1460 chmod +x $CONFIG_STATUS
1461 ])# _AC_OUTPUT_CONFIG_STATUS
1463 # _AC_OUTPUT_MAIN_LOOP
1464 # --------------------
1465 # The main loop in $CONFIG_STATUS.
1467 # This macro is expanded inside a here document. If the here document is
1468 # closed, it has to be reopened with "cat >>$CONFIG_STATUS <<\_ACEOF".
1470 AC_DEFUN([_AC_OUTPUT_MAIN_LOOP],
1472 # If the user did not use the arguments to specify the items to instantiate,
1473 # then the envvar interface is used. Set only those that are not.
1474 # We use the long form for the default assignment because of an extremely
1475 # bizarre bug on SunOS 4.1.3.
1476 if $ac_need_defaults; then
1477 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1478 [ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1480 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1481 [ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1483 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1484 [ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1486 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1487 [ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1491 # Have a temporary directory for convenience. Make it in the build tree
1492 # simply because there is no reason against having it here, and in addition,
1493 # creating and moving files from /tmp can sometimes cause problems.
1494 # Hook for its removal unless debugging.
1495 # Note that there is a small window in which the directory will not be cleaned:
1496 # after its creation but before its name has been assigned to `$tmp'.
1500 trap 'exit_status=$?
1501 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
1503 trap 'AS_EXIT([1])' 1 2 13 15
1505 dnl The comment above AS_TMPDIR says at most 4 chars are allowed.
1506 AS_TMPDIR([conf], [.])
1508 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [_AC_OUTPUT_FILES_PREPARE])[]dnl
1511 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F $CONFIG_FILES])[]dnl
1512 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H $CONFIG_HEADERS])[]dnl
1513 m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L $CONFIG_LINKS])[]dnl
1514 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C $CONFIG_COMMANDS])
1517 :[[FHLC]]) ac_mode=$ac_tag; continue;;
1519 case $ac_mode$ac_tag in
1521 :L* | :C*:*) AC_MSG_ERROR([Invalid tag $ac_tag.]);;
1522 :[[FH]]-) ac_tag=-:-;;
1523 :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
1534 :L) ac_source=$[1];;
1540 -) ac_f="$tmp/stdin";;
1541 *) # Look for the file first in the build tree, then in the source tree
1542 # (if the path is not absolute). The absolute path cannot be DOS-style,
1543 # because $ac_f cannot contain `:'.
1547 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
1549 AC_MSG_ERROR([cannot find input file: $ac_f]);;
1551 ac_file_inputs="$ac_file_inputs $ac_f"
1554 # Let's still pretend it is `configure' which instantiates (i.e., don't
1555 # use $as_me), people would be surprised to read:
1556 # /* config.h. Generated by config.status. */
1557 configure_input='Generated from '`
1558 AS_ECHO(["$[*]"]) | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']
1560 if test x"$ac_file" != x-; then
1561 configure_input="$ac_file. $configure_input"
1562 AC_MSG_NOTICE([creating $ac_file])
1566 *:-:* | *:-) cat >"$tmp/stdin";;
1571 ac_dir=`AS_DIRNAME(["$ac_file"])`
1572 AS_MKDIR_P(["$ac_dir"])
1573 _AC_SRCDIRS(["$ac_dir"])
1576 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F)_AC_OUTPUT_FILE ;;])
1577 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H)_AC_OUTPUT_HEADER ;;])
1578 m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L)_AC_OUTPUT_LINK ;;])
1579 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C)_AC_OUTPUT_COMMAND ;;])
1582 dnl Some shells don't like empty case/esac
1583 m4_ifdef([_AC_LIST_TAG_COMMANDS], [
1584 case $ac_file$ac_mode in
1585 _AC_LIST_TAG_COMMANDS
1590 ])# _AC_OUTPUT_MAIN_LOOP
1593 # AC_OUTPUT_MAKE_DEFS
1594 # -------------------
1595 # Set the DEFS variable to the -D options determined earlier.
1596 # This is a subroutine of AC_OUTPUT.
1597 # It is called inside configure, outside of config.status.
1598 m4_define([AC_OUTPUT_MAKE_DEFS],
1599 [[# Transform confdefs.h into DEFS.
1600 # Protect against shell expansion while executing Makefile rules.
1601 # Protect against Makefile macro expansion.
1603 # If the first sed substitution is executed (which looks for macros that
1604 # take arguments), then branch to the quote section. Otherwise,
1605 # look for a macro that doesn't take arguments.
1609 s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
1611 s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
1615 s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
1628 DEFS=`sed -n "$ac_script" confdefs.h`
1629 ]])# AC_OUTPUT_MAKE_DEFS