1 # This file is part of Autoconf. -*- Autoconf -*-
2 # Parameterizing and creating config.status.
3 # Copyright (C) 1992-1996, 1998-2011 Free Software Foundation, Inc.
5 # This file is part of Autoconf. This program is free
6 # software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the
8 # 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 # Under Section 7 of GPL version 3, you are granted additional
17 # permissions described in the Autoconf Configure Script Exception,
18 # version 3.0, as published by the Free Software Foundation.
20 # You should have received a copy of the GNU General Public License
21 # and a copy of the Autoconf Configure Script Exception along with
22 # this program; see the files COPYINGv3 and COPYING.EXCEPTION
23 # respectively. If not, see <http://www.gnu.org/licenses/>.
26 # Written by David MacKenzie, with help from
27 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
28 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
31 # This file handles about all the preparation aspects for
32 # `config.status': registering the configuration files, the headers,
33 # the links, and the commands `config.status' will run. There is a
34 # little mixture though of things actually handled by `configure',
35 # such as running the `configure' in the sub directories. Minor
38 # There are two kinds of commands:
42 # They are output into `config.status' via a quoted here doc. These
43 # commands are always associated to a tag which the user can use to
44 # tell `config.status' what are the commands she wants to run.
48 # They are output via an *unquoted* here-doc. As a consequence $var
49 # will be output as the value of VAR. This is typically used by
50 # `configure' to give `config.status' some variables it needs to run
51 # the COMMANDS. At the difference of COMMANDS, the INIT-CMDS are
55 # Honorable members of this family are AC_CONFIG_FILES,
56 # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
57 # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
58 # arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
59 # and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
60 # AC_CONFIG_COMMANDS_POST.
63 ## ------------------ ##
64 ## Auxiliary macros. ##
65 ## ------------------ ##
67 # _AC_SRCDIRS(BUILD-DIR-NAME)
68 # ---------------------------
70 # - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
71 # - `$srcdir' is `top-build -> top-src'
74 # - `ac_builddir' is `.', for symmetry only.
75 # - `ac_top_builddir_sub' is `build -> top_build'.
76 # This is used for @top_builddir@.
77 # - `ac_top_build_prefix' is `build -> top_build'.
78 # If not empty, has a trailing slash.
79 # - `ac_srcdir' is `build -> src'.
80 # - `ac_top_srcdir' is `build -> top-src'.
81 # and `ac_abs_builddir' etc., the absolute directory names.
82 m4_define([_AC_SRCDIRS],
86 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
88 ac_dir_suffix=/`AS_ECHO([$1]) | sed 's|^\.[[\\/]]||'`
89 # A ".." for each directory in $ac_dir_suffix.
90 ac_top_builddir_sub=`AS_ECHO(["$ac_dir_suffix"]) | sed 's|/[[^\\/]]*|/..|g;s|/||'`
91 case $ac_top_builddir_sub in
92 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
93 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
96 ac_abs_top_builddir=$ac_pwd
97 ac_abs_builddir=$ac_pwd$ac_dir_suffix
98 # for backward compatibility:
99 ac_top_builddir=$ac_top_build_prefix
102 .) # We are building in place.
104 ac_top_srcdir=$ac_top_builddir_sub
105 ac_abs_top_srcdir=$ac_pwd ;;
106 [[\\/]]* | ?:[[\\/]]* ) # Absolute name.
107 ac_srcdir=$srcdir$ac_dir_suffix;
108 ac_top_srcdir=$srcdir
109 ac_abs_top_srcdir=$srcdir ;;
111 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
112 ac_top_srcdir=$ac_top_build_prefix$srcdir
113 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
115 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
119 # _AC_HAVE_TOP_BUILD_PREFIX
120 # -------------------------
121 # Announce to the world (to Libtool) that we substitute @top_build_prefix@.
122 AC_DEFUN([_AC_HAVE_TOP_BUILD_PREFIX])
125 ## ---------------------- ##
126 ## Registering the tags. ##
127 ## ---------------------- ##
130 # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
131 # -----------------------------------------
133 # Register INIT-COMMANDS as command pasted *unquoted* in
134 # `config.status'. This is typically used to pass variables from
135 # `configure' to `config.status'. Note that $[1] is not over quoted as
136 # was the case in AC_OUTPUT_COMMANDS.
137 m4_define([_AC_CONFIG_COMMANDS_INIT],
139 [m4_append([_AC_OUTPUT_COMMANDS_INIT],
144 # AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
145 # -----------------------------------------------------
146 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
148 # It announces DEST depends upon the SOURCE1 etc.
149 m4_define([AC_FILE_DEPENDENCY_TRACE], [])
152 # _AC_FILE_DEPENDENCY_TRACE_COLON(DEST:SOURCE1[:SOURCE2...])
153 # ----------------------------------------------------------
154 # Declare that DEST depends upon SOURCE1 etc.
156 m4_define([_AC_FILE_DEPENDENCY_TRACE_COLON],
157 [AC_FILE_DEPENDENCY_TRACE(m4_translit([$1], [:], [,]))])
160 # _AC_CONFIG_DEPENDENCY(MODE, DEST[:SOURCE1...])
161 # ----------------------------------------------
162 # MODE is `FILES', `HEADERS', or `LINKS'.
164 # Be sure that a missing dependency is expressed as a dependency upon
165 # `DEST.in' (except with config links).
167 m4_define([_AC_CONFIG_DEPENDENCY],
168 [_AC_FILE_DEPENDENCY_TRACE_COLON([$2]_AC_CONFIG_DEPENDENCY_DEFAULT($@))dnl
172 # _AC_CONFIG_DEPENDENCY_DEFAULT(MODE, DEST[:SOURCE1...])
173 # ------------------------------------------------------
174 # Expand to `:DEST.in' if appropriate, or to empty string otherwise.
176 # More detailed description:
177 # If the tag contains `:', expand to nothing.
178 # Otherwise, for a config file or header, add `:DEST.in'.
179 # For a config link, DEST.in is not appropriate:
180 # - if the tag is literal, complain.
181 # - otherwise, just expand to nothing and proceed with fingers crossed.
182 # (We get to this case from the obsolete AC_LINK_FILES, for example.)
184 m4_define([_AC_CONFIG_DEPENDENCY_DEFAULT],
185 [m4_if(m4_index([$2], [:]), [-1],
186 [m4_if([$1], [LINKS],
188 [m4_fatal([Invalid AC_CONFIG_LINKS tag: `$2'])])],
192 # _AC_CONFIG_UNIQUE(MODE, DEST)
193 # -----------------------------
194 # MODE is `FILES', `HEADERS', `LINKS', `COMMANDS', or `SUBDIRS'.
196 # Verify that there is no double definition of an output file.
198 m4_define([_AC_CONFIG_UNIQUE],
199 [m4_ifdef([_AC_SEEN_TAG($2)],
200 [m4_fatal([`$2' is already registered with AC_CONFIG_]m4_defn(
201 [_AC_SEEN_TAG($2)]).)],
202 [m4_define([_AC_SEEN_TAG($2)], [$1])])dnl
206 # _AC_CONFIG_FOOS(MODE, TAGS..., [COMMANDS], [INIT-CMDS])
207 # -------------------------------------------------------
208 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
210 # Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,
211 # run COMMANDS afterwards. (This is done in _AC_CONFIG_REGISTER_DEST.)
213 # For COMMANDS, do not m4_normalize TAGS before adding it to ac_config_commands.
214 # This historical difference allows macro calls in TAGS.
216 m4_define([_AC_CONFIG_FOOS],
217 [m4_map_args_w([$2], [_AC_CONFIG_REGISTER([$1],], [, [$3])])]dnl
218 [m4_define([_AC_SEEN_CONFIG(ANY)])]dnl
219 [m4_define([_AC_SEEN_CONFIG($1)])]dnl
220 [_AC_CONFIG_COMMANDS_INIT([$4])]dnl
221 [ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) ]dnl
222 [m4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"
225 # _AC_CONFIG_COMPUTE_DEST(STRING)
226 # -------------------------------
227 # Compute the DEST from STRING by stripping any : and following
228 # characters. Guarantee a match in m4_index, so as to avoid a bug
229 # with precision -1 in m4_format in older m4.
230 m4_define([_AC_CONFIG_COMPUTE_DEST],
231 [m4_format([[%.*s]], m4_index([$1:], [:]), [$1])])
233 # _AC_CONFIG_REGISTER(MODE, TAG, [COMMANDS])
234 # ------------------------------------------
235 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
237 m4_define([_AC_CONFIG_REGISTER],
238 [m4_if([$1], [COMMANDS],
240 [_AC_CONFIG_DEPENDENCY([$1], [$2])])]dnl
241 [_AC_CONFIG_REGISTER_DEST([$1], [$2],
242 _AC_CONFIG_COMPUTE_DEST([$2]), [$3])])
245 # _AC_CONFIG_REGISTER_DEST(MODE, TAG, DEST, [COMMANDS])
246 # -----------------------------------------------------
247 # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
248 # TAG is in the form DEST[:SOURCE...].
249 # Thus parameter $3 is the first part of $2.
251 # With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status
252 # to guess the links to establish (`./config.status .').
254 # Save the name of the first config header to AH_HEADER.
256 m4_define([_AC_CONFIG_REGISTER_DEST],
257 [_AC_CONFIG_UNIQUE([$1], [$3])]dnl
258 [m4_if([$1 $3], [LINKS .],
259 [m4_fatal([invalid destination of a config link: `.'])],
261 [m4_define_default([AH_HEADER], [$3])])]dnl
263 dnl Recognize TAG as an argument to config.status:
265 [m4_append([_AC_LIST_TAGS],
266 [ "$3") CONFIG_$1="$CONFIG_$1 $2" ;;
269 dnl Register the associated commands, if any:
272 [m4_append([_AC_LIST_TAG_COMMANDS],
273 [ "$3":]m4_format([[%.1s]], [$1])[) $4 ;;
274 ])])])# _AC_CONFIG_REGISTER_DEST
279 ## --------------------- ##
280 ## Configuration files. ##
281 ## --------------------- ##
284 # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
285 # -------------------------------------------------
286 # Specify output files, i.e., files that are configured with AC_SUBST.
288 AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)])
293 # Evaluate to an m4 number equal to the maximum number of commands to put
294 # in any single sed program, not counting ":" commands.
296 # Some seds have small command number limits, like on Digital OSF/1 and HP-UX.
297 m4_define([_AC_SED_CMD_LIMIT],
298 dnl One cannot portably go further than 99 commands because of HP-UX.
302 # _AC_AWK_LITERAL_LIMIT
303 # ---------------------
304 # Evaluate to the maximum number of characters to put in an awk
305 # string literal, not counting escape characters.
307 # Some awk's have small limits, such as Solaris and AIX awk.
308 m4_define([_AC_AWK_LITERAL_LIMIT],
312 # _AC_OUTPUT_FILES_PREPARE
313 # ------------------------
314 # Create the awk scripts needed for CONFIG_FILES.
315 # Support multiline substitutions and make sure that the substitutions are
316 # not evaluated recursively.
317 # The intention is to have readable config.status and configure, even
318 # though this m4 code might be scary.
320 # This code was written by Dan Manthey and rewritten by Ralf Wildenhues.
322 # This macro is expanded inside a here document. If the here document is
323 # closed, it has to be reopened with
324 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
326 m4_define([_AC_OUTPUT_FILES_PREPARE],
327 [# Set up the scripts for CONFIG_FILES section.
328 # No need to generate them if there are no CONFIG_FILES.
329 # This happens for instance with `./config.status config.h'.
330 if test -n "$CONFIG_FILES"; then
332 dnl For AC_SUBST_FILE, check for usable getline support in awk,
333 dnl at config.status execution time.
334 dnl Otherwise, do the interpolation in sh, which is slower.
335 dnl Without any AC_SUBST_FILE, omit all related code.
336 dnl Note the expansion is double-quoted for readability.
337 m4_ifdef([_AC_SUBST_FILES],
338 [[if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
341 ac_cs_awk_read_file='
342 while ((getline aline < (F[key])) > 0)
347 ac_cs_awk_getline=false
348 ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
349 ac_cs_awk_read_file='
351 print "cat " F[key] " &&"
352 '$ac_cs_awk_pipe_init
353 # The final `:' finishes the AND list.
354 ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
356 ac_cr=`echo X | tr X '\015'`
357 # On cygwin, bash can eat \r inside `` if the user requested igncr.
358 # But we know of no other shell where ac_cr would be empty at this
359 # point, so we can use a bashism as a fallback.
360 if test "x$ac_cr" = x; then
363 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
364 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
370 dnl Define the pipe that does the substitution.
371 m4_ifdef([_AC_SUBST_FILES],
372 [m4_define([_AC_SUBST_CMDS], [|
373 if $ac_cs_awk_getline; then
374 $AWK -f "$ac_tmp/subs.awk"
376 $AWK -f "$ac_tmp/subs.awk" | $SHELL
378 [m4_define([_AC_SUBST_CMDS],
379 [| $AWK -f "$ac_tmp/subs.awk"])])dnl
381 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
384 m4_ifdef([_AC_SUBST_FILES],
385 [# Create commands to substitute file output variables.
387 echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
388 echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
389 echo "$ac_subst_files" | sed 's/.*/F@<:@"&"@:>@="$&"/' &&
393 . ./conf$$files.sh ||
394 AC_MSG_ERROR([could not make $CONFIG_STATUS])
399 echo "cat >conf$$subs.awk <<_ACEOF" &&
400 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
403 AC_MSG_ERROR([could not make $CONFIG_STATUS])
404 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
406 for ac_last_try in false false false false false :; do
408 AC_MSG_ERROR([could not make $CONFIG_STATUS])
410 dnl Do not use grep on conf$$subs.awk, since AIX grep has a line length limit.
411 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
412 if test $ac_delim_n = $ac_delim_num; then
414 elif $ac_last_try; then
415 AC_MSG_ERROR([could not make $CONFIG_STATUS])
417 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
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 || ac_write_fail=1
449 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
463 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\)..*/\1/
465 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
470 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
473 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
477 s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\)..*/\1/
479 s/["\\]/\\&/g; s/^/"/; s/$/"/
483 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
486 s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
488 ' <conf$$subs.awk | sed '
493 ' >>$CONFIG_STATUS || ac_write_fail=1
495 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
497 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
498 for (key in S) S_is_set[key] = 1
500 ]m4_ifdef([_AC_SUBST_FILES],
501 [ \$ac_cs_awk_pipe_init])[
505 nfields = split(line, field, "@")
507 len = length(field[1])
508 for (i = 2; i < nfields; i++) {
513 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
514 len += length(value) + length(field[++i])
519 ]m4_ifdef([_AC_SUBST_FILES],
520 [[ if (nfields == 3 && !substed) {
522 if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
523 \$ac_cs_awk_read_file
529 ]dnl end of double-quoted part
530 m4_ifdef([_AC_SUBST_FILES],
531 [\$ac_cs_awk_pipe_fini])
534 dnl See if CR is the EOL marker. If not, remove any EOL-related
535 dnl ^M bytes and escape any remaining ones. If so, just use mv.
536 dnl In case you're wondering how ^M bytes can make it into subs1.awk,
537 dnl [from Ralf Wildenhues] one way is if you have e.g.,
538 dnl AC_SUBST([variable_that_contains_cr], ["
540 dnl The original aim was that users should be able to substitute any
541 dnl characters they like (except for \0). And the above is not so
542 dnl unlikely if the configure script itself happens to be converted
543 dnl to w32 text mode.
544 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
545 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
546 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
549 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
550 || AC_MSG_ERROR([could not setup config files machinery])
553 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
554 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
555 # trailing colons and then remove the whole line if VPATH becomes empty
556 # (actually we leave an empty line to preserve line numbers).
557 if test "x$srcdir" = x.; then
558 ac_vpsub=['/^[ ]*VPATH[ ]*=[ ]*/{
576 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
577 fi # test -n "$CONFIG_FILES"
579 ])# _AC_OUTPUT_FILES_PREPARE
581 # _AC_OUTPUT_FILE_ADJUST_DIR(VAR)
582 # -------------------------------
583 # Generate the sed snippet needed to output VAR relative to the
584 # top-level directory.
585 m4_define([_AC_OUTPUT_FILE_ADJUST_DIR],
586 [s&@$1@&$ac_$1&;t t[]AC_SUBST_TRACE([$1])])
591 # Do the variable substitutions to create the Makefiles or whatever.
593 # This macro is expanded inside a here document. If the here document is
594 # closed, it has to be reopened with
595 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
597 m4_define([_AC_OUTPUT_FILE],
603 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
605 [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
606 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
609 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
610 [ ac_MKDIR_P=$MKDIR_P
612 [[\\/$]]* | ?:[[\\/]]* ) ;;
613 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
618 m4_ifndef([AC_DATAROOTDIR_CHECKED],
619 [cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
620 # If the template does not know about datarootdir, expand it.
621 # FIXME: This hack should be removed a few years after 2.60.
622 ac_datarootdir_hack=; ac_datarootdir_seen=
623 m4_define([_AC_datarootdir_vars],
624 [datadir, docdir, infodir, localedir, mandir])]dnl
625 [m4_define([_AC_datarootdir_subst], [ s&@$][1@&$$][1&g])]dnl
631 m4_map_args_sep([/@], [@/p], [
632 ], _AC_datarootdir_vars)'
633 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
634 *datarootdir*) ac_datarootdir_seen=yes;;
635 *@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
636 AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
638 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
639 ac_datarootdir_hack='
640 m4_map_args_sep([_AC_datarootdir_subst(], [)], [
641 ], _AC_datarootdir_vars)
642 s&\\\${datarootdir}&$datarootdir&g' ;;
647 # Neutralize VPATH when `$srcdir' = `.'.
648 # Shell code in configure.ac might set extrasub.
649 # FIXME: do we really want to maintain this feature?
650 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
651 ac_sed_extra="$ac_vpsub
654 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
656 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
657 dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
658 dnl Note if you change the s||| delimiter here, don't forget to adjust
659 dnl ac_sed_conf_input accordingly. Using & is a bad idea if & appears in
660 dnl the replacement string.
661 s|@configure_input@|$ac_sed_conf_input|;t t
662 dnl During the transition period, this is a special case:
663 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
664 dnl For this substitution see the witness macro _AC_HAVE_TOP_BUILD_PREFIX above.
665 s&@top_build_prefix@&$ac_top_build_prefix&;t t[]AC_SUBST_TRACE([top_build_prefix])
666 m4_map_args_sep([$0_ADJUST_DIR(], [)], [
667 ], [srcdir], [abs_srcdir], [top_srcdir], [abs_top_srcdir],
668 [builddir], [abs_builddir],
669 [abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
670 [, [INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [, [MKDIR_P]]))
671 m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
674 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" m4_defn([_AC_SUBST_CMDS]) \
675 >$ac_tmp/out || AC_MSG_ERROR([could not create $ac_file])
677 m4_ifndef([AC_DATAROOTDIR_CHECKED],
678 [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
679 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
680 { ac_out=`sed -n '/^[[ ]]*datarootdir[[ ]]*:*=/p' \
681 "$ac_tmp/out"`; test -z "$ac_out"; } &&
682 AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
683 which seems to be undefined. Please make sure it is defined])
686 rm -f "$ac_tmp/stdin"
688 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
689 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
691 || AC_MSG_ERROR([could not create $ac_file])
692 dnl This would break Makefile dependencies:
693 dnl if diff "$ac_file" "$ac_tmp/out" >/dev/null 2>&1; then
694 dnl echo "$ac_file is unchanged"
696 dnl rm -f "$ac_file"; mv "$ac_tmp/out" "$ac_file"
703 ## ----------------------- ##
704 ## Configuration headers. ##
705 ## ----------------------- ##
708 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
709 # ------------------------------------------------------
710 # Specify that the HEADERS are to be created by instantiation of the
713 AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])
716 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
717 # --------------------------------------
718 # FIXME: Make it obsolete?
719 AC_DEFUN([AC_CONFIG_HEADER],
720 [AC_CONFIG_HEADERS([$1])])
723 # _AC_OUTPUT_HEADERS_PREPARE
724 # --------------------------
725 # Create the awk scripts needed for CONFIG_HEADERS.
726 # Support multiline #defines.
728 # This macro is expanded inside a here document. If the here document is
729 # closed, it has to be reopened with
730 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
732 m4_define([_AC_OUTPUT_HEADERS_PREPARE],
733 [# Set up the scripts for CONFIG_HEADERS section.
734 # No need to generate them if there are no CONFIG_HEADERS.
735 # This happens for instance with `./config.status Makefile'.
736 if test -n "$CONFIG_HEADERS"; then
737 dnl This `||' list is finished at the end of _AC_OUTPUT_HEADERS_PREPARE.
738 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
742 # Transform confdefs.h into an awk script `defines.awk', embedded as
743 # here-document in config.status, that substitutes the proper values into
744 # config.h.in to produce config.h.
746 # Create a delimiter string that does not exist in confdefs.h, to ease
747 # handling of long lines.
749 for ac_last_try in false false :; do
750 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
751 if test -z "$ac_tt"; then
753 elif $ac_last_try; then
754 AC_MSG_ERROR([could not make $CONFIG_HEADERS])
756 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
760 # For the awk script, D is an array of macro values keyed by name,
761 # likewise P contains macro parameters if any. Preserve backslash
764 dnl Structure of the sed script that reads confdefs.h:
765 dnl rset: main loop, searches for `#define' lines
766 dnl def: deal with a `#define' line
767 dnl bsnl: deal with a `#define' line that ends with backslash-newline
768 dnl cont: handle a continuation line
769 dnl bsnlc: handle a continuation line that ends with backslash-newline
771 dnl Each sub part escapes the awk special characters and outputs a statement
772 dnl inserting the macro value into the array D, keyed by name. If the macro
773 dnl uses parameters, they are added in the array P, keyed by name.
775 dnl Long values are split into several string literals with help of ac_delim.
776 dnl Assume nobody uses macro names of nearly 150 bytes length.
778 dnl The initial replace for `#define' lines inserts a leading space
779 dnl in order to ease later matching; otherwise, output lines may be
780 dnl repeatedly matched.
782 dnl m4-double-quote most of this for [, ], define, and substr:
784 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
786 s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
789 s/^[ ]*#[ ]*define[ ][ ]*/ /
796 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
798 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
802 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
803 D["\1"]=" \3\\\\\\n"\\/p
805 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
810 s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
815 s/["\\]/\\&/g; s/^/"/; s/$/"/p
818 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
820 ' <confdefs.h | sed '
822 "/g' >>$CONFIG_STATUS || ac_write_fail=1
824 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
825 for (key in D) D_is_set[key] = 1
828 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
830 split(line, arg, " ")
835 defundef = substr(arg[1], 2)
838 split(mac1, mac2, "(") #)
840 prefix = substr(line, 1, index(line, defundef) - 1)
841 if (D_is_set[macro]) {
842 # Preserve the white space surrounding the "#".
843 print prefix "define", macro P[macro] D[macro]
846 # Replace #undef with comments. This is necessary, for example,
847 # in the case of _POSIX_SOURCE, which is predefined and required
848 # on some systems where configure will not decide to define it.
849 if (defundef == "undef") {
850 print "/*", prefix defundef, macro, "*/"
856 ]dnl End of double-quoted section
859 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
860 dnl finish `||' list indicating write error:
861 AC_MSG_ERROR([could not setup config headers machinery])
862 fi # test -n "$CONFIG_HEADERS"
864 ])# _AC_OUTPUT_HEADERS_PREPARE
870 # Output the code which instantiates the `config.h' files from their
873 # This macro is expanded inside a here document. If the here document is
874 # closed, it has to be reopened with
875 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
877 m4_define([_AC_OUTPUT_HEADER],
882 if test x"$ac_file" != x-; then
884 AS_ECHO(["/* $configure_input */"]) \
885 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
886 } >"$ac_tmp/config.h" \
887 || AC_MSG_ERROR([could not create $ac_file])
888 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
889 AC_MSG_NOTICE([$ac_file is unchanged])
892 mv "$ac_tmp/config.h" "$ac_file" \
893 || AC_MSG_ERROR([could not create $ac_file])
896 AS_ECHO(["/* $configure_input */"]) \
897 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
898 || AC_MSG_ERROR([could not create -])
900 dnl If running for Automake, be ready to perform additional
901 dnl commands to set up the timestamp files.
902 m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
903 [_AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
905 ])# _AC_OUTPUT_HEADER
909 ## --------------------- ##
910 ## Configuration links. ##
911 ## --------------------- ##
914 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
915 # --------------------------------------------------------
916 # Specify that config.status should establish a (symbolic if possible)
917 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
918 # Reject DEST=., because it is makes it hard for ./config.status
919 # to guess the links to establish (`./config.status .').
921 AC_DEFUN([AC_CONFIG_LINKS], [_AC_CONFIG_FOOS([LINKS], $@)])
924 # AC_LINK_FILES(SOURCE..., DEST...)
925 # ---------------------------------
926 # Link each of the existing files SOURCE... to the corresponding
927 # link name in DEST...
929 # Unfortunately we can't provide a very good autoupdate service here,
930 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
931 # and `$to' are actually lists. It would then be completely wrong to
932 # replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the
933 # case of literal values though, but because I don't think there is any
934 # interest in creating config links with literal values, no special
935 # mechanism is implemented to handle them.
937 # _AC_LINK_FILES_CNT is used to be robust to multiple calls.
938 AU_DEFUN([AC_LINK_FILES],
940 [m4_fatal([$0: incorrect number of arguments])])dnl
941 m4_define_default([_AC_LINK_FILES_CNT], 0)dnl
942 m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
945 while test -n "$ac_sources"; do
946 set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
947 set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
948 [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
950 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
952 [It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
953 to AC_CONFIG_LINKS. `autoupdate' provides a functional but inelegant
954 update, you should probably tune the result yourself.])# AC_LINK_FILES
959 # This macro is expanded inside a here document. If the here document is
960 # closed, it has to be reopened with
961 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
962 m4_define([_AC_OUTPUT_LINK],
968 if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
971 # Prefer the file from the source tree if names are identical.
972 if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
973 ac_source=$srcdir/$ac_source
976 AC_MSG_NOTICE([linking $ac_source to $ac_file])
978 if test ! -r "$ac_source"; then
979 AC_MSG_ERROR([$ac_source: file not found])
983 # Try a relative symlink, then a hard link, then a copy.
985 [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$ac_source ;;
986 *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
988 ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
989 ln "$ac_source" "$ac_file" 2>/dev/null ||
990 cp -p "$ac_source" "$ac_file" ||
991 AC_MSG_ERROR([cannot link or copy $ac_source to $ac_file])
997 ## ------------------------ ##
998 ## Configuration commands. ##
999 ## ------------------------ ##
1002 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
1003 # ---------------------------------------------------
1005 # Specify additional commands to be run by config.status. This
1006 # commands must be associated with a NAME, which should be thought
1007 # as the name of a file the COMMANDS create.
1009 AC_DEFUN([AC_CONFIG_COMMANDS], [_AC_CONFIG_FOOS([COMMANDS], $@)])
1012 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
1013 # -----------------------------------------
1015 # Add additional commands for AC_OUTPUT to put into config.status.
1017 # This macro is an obsolete version of AC_CONFIG_COMMANDS. The only
1018 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
1019 # to give a unique key. The scheme we have chosen is `default-1',
1020 # `default-2' etc. for each call.
1022 # Unfortunately this scheme is fragile: bad things might happen
1023 # if you update an included file and configure.ac: you might have
1024 # clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
1025 # depending upon __file__ or the pid).
1026 AU_DEFUN([AC_OUTPUT_COMMANDS],
1027 [m4_define_default([_AC_OUTPUT_COMMANDS_CNT], 0)dnl
1028 m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
1029 dnl Double quoted since that was the case in the original macro.
1030 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
1034 # _AC_OUTPUT_COMMAND
1035 # ------------------
1036 # This macro is expanded inside a here document. If the here document is
1037 # closed, it has to be reopened with
1038 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
1039 m4_define([_AC_OUTPUT_COMMAND],
1040 [ AC_MSG_NOTICE([executing $ac_file commands])
1045 ## -------------------------------------- ##
1046 ## Pre- and post-config.status commands. ##
1047 ## -------------------------------------- ##
1050 # AC_CONFIG_COMMANDS_PRE(CMDS)
1051 # ----------------------------
1052 # Commands to run right before config.status is created. Accumulates.
1053 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
1054 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
1058 # AC_OUTPUT_COMMANDS_PRE
1059 # ----------------------
1060 # A *variable* in which we append all the actions that must be
1061 # performed before *creating* config.status. For a start, clean
1062 # up all the LIBOBJ mess.
1063 m4_define([AC_OUTPUT_COMMANDS_PRE],
1064 [_AC_LIBOBJS_NORMALIZE
1068 # AC_CONFIG_COMMANDS_POST(CMDS)
1069 # -----------------------------
1070 # Commands to run after config.status was created. Accumulates.
1071 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
1072 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
1076 m4_define([AC_OUTPUT_COMMANDS_POST])
1080 ## ----------------------- ##
1081 ## Configuration subdirs. ##
1082 ## ----------------------- ##
1085 # AC_CONFIG_SUBDIRS(DIR ...)
1086 # --------------------------
1087 # We define two variables:
1088 # - _AC_LIST_SUBDIRS
1089 # A statically built list, should contain *all* the arguments of
1090 # AC_CONFIG_SUBDIRS. The final value is assigned to ac_subdirs_all in
1091 # the `default' section, and used for --help=recursive.
1092 # It makes no sense for arguments which are sh variables.
1094 # Shell variable built at runtime, so some of these dirs might not be
1095 # included, if for instance the user refused a part of the tree.
1096 # This is used in _AC_OUTPUT_SUBDIRS.
1097 AC_DEFUN([AC_CONFIG_SUBDIRS],
1098 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])]dnl
1099 [AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])]dnl
1100 [m4_map_args_w([$1], [_AC_CONFIG_UNIQUE([SUBDIRS],
1101 _AC_CONFIG_COMPUTE_DEST(], [))])]dnl
1102 [m4_append([_AC_LIST_SUBDIRS], [$1], [
1104 [AS_LITERAL_IF([$1], [],
1105 [AC_DIAGNOSE([syntax], [$0: you should use literals])])]dnl
1106 [AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])])
1109 # _AC_OUTPUT_SUBDIRS
1110 # ------------------
1111 # This is a subroutine of AC_OUTPUT, but it does not go into
1112 # config.status, rather, it is called after running config.status.
1113 m4_define([_AC_OUTPUT_SUBDIRS],
1116 # CONFIG_SUBDIRS section.
1118 if test "$no_recursion" != yes; then
1120 # Remove --cache-file, --srcdir, and --disable-option-checking arguments
1121 # so they do not pile up.
1122 ac_sub_configure_args=
1124 eval "set x $ac_configure_args"
1128 if test -n "$ac_prev"; then
1133 -cache-file | --cache-file | --cache-fil | --cache-fi \
1134 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1135 ac_prev=cache_file ;;
1136 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1137 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
1140 --config-cache | -C)
1142 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1144 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1146 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1148 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1150 --disable-option-checking)
1154 *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1156 AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;;
1160 # Always prepend --prefix to ensure using the same prefix
1161 # in subdir configurations.
1162 ac_arg="--prefix=$prefix"
1164 *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1166 ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
1169 if test "$silent" = yes; then
1170 ac_sub_configure_args="--silent $ac_sub_configure_args"
1173 # Always prepend --disable-option-checking to silence warnings, since
1174 # different subdirs can have different --enable and --with options.
1175 ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
1178 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
1180 # Do not complain, so a configure script can configure whichever
1181 # parts of a large source tree are present.
1182 test -d "$srcdir/$ac_dir" || continue
1184 ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
1185 _AS_ECHO_LOG([$ac_msg])
1187 AS_MKDIR_P(["$ac_dir"])
1188 _AC_SRCDIRS(["$ac_dir"])
1192 # Check for guested configure; otherwise get Cygnus style configure.
1193 if test -f "$ac_srcdir/configure.gnu"; then
1194 ac_sub_configure=$ac_srcdir/configure.gnu
1195 elif test -f "$ac_srcdir/configure"; then
1196 ac_sub_configure=$ac_srcdir/configure
1197 elif test -f "$ac_srcdir/configure.in"; then
1198 # This should be Cygnus configure.
1199 ac_sub_configure=$ac_aux_dir/configure
1201 AC_MSG_WARN([no configuration information is in $ac_dir])
1205 # The recursion is here.
1206 if test -n "$ac_sub_configure"; then
1207 # Make the cache file name correct relative to the subdirectory.
1209 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1211 ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
1214 AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
1215 # The eval makes quoting arguments work.
1216 eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
1217 --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
1218 AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
1224 ])# _AC_OUTPUT_SUBDIRS
1229 ## -------------------------- ##
1230 ## Outputting config.status. ##
1231 ## -------------------------- ##
1234 # AU::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1235 # -----------------------------------------------------------
1237 # If there are arguments given to AC_OUTPUT, dispatch them to the
1238 # proper modern macros.
1239 AU_DEFUN([AC_OUTPUT],
1241 [AC_CONFIG_FILES([$1])])dnl
1243 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1247 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1248 # -------------------------------------------------------
1250 # Produce config.status, config.h, and links; and configure subdirs.
1252 m4_define([AC_OUTPUT],
1253 [dnl Dispatch the extra arguments to their native macros.
1255 [AC_CONFIG_FILES([$1])])dnl
1257 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1259 [AC_DIAGNOSE([obsolete],
1260 [$0 should be used without arguments.
1261 You should run autoupdate.])])dnl
1264 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1265 # Let make expand exec_prefix.
1266 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1268 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1270 dnl Commands to run before creating config.status.
1271 AC_OUTPUT_COMMANDS_PRE()dnl
1273 : "${CONFIG_STATUS=./config.status}"
1275 ac_clean_files_save=$ac_clean_files
1276 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1277 _AC_OUTPUT_CONFIG_STATUS()dnl
1278 ac_clean_files=$ac_clean_files_save
1280 test $ac_write_fail = 0 ||
1281 AC_MSG_ERROR([write failure creating $CONFIG_STATUS])
1283 dnl Commands to run after config.status was created
1284 AC_OUTPUT_COMMANDS_POST()dnl
1286 # configure is writing to config.log, and then calls config.status.
1287 # config.status does its own redirection, appending to config.log.
1288 # Unfortunately, on DOS this fails, as config.log is still kept open
1289 # by configure, so config.status won't be able to write to it; its
1290 # output is simply discarded. So we exec the FD to /dev/null,
1291 # effectively closing config.log, so it can be properly (re)opened and
1292 # appended to by config.status. When coming back to configure, we
1293 # need to make the FD available again.
1294 if test "$no_create" != yes; then
1296 ac_config_status_args=
1297 test "$silent" = yes &&
1298 ac_config_status_args="$ac_config_status_args --quiet"
1299 exec AS_MESSAGE_LOG_FD>/dev/null
1300 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
1301 exec AS_MESSAGE_LOG_FD>>config.log
1302 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
1303 # would make configure fail if this is the last instruction.
1304 $ac_cs_success || AS_EXIT([1])
1306 dnl config.status should not do recursion.
1307 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1308 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
1309 AC_MSG_WARN([unrecognized options: $ac_unrecognized_opts])
1314 # _AC_OUTPUT_CONFIG_STATUS
1315 # ------------------------
1316 # Produce config.status. Called by AC_OUTPUT.
1317 # Pay special attention not to have too long here docs: some old
1318 # shells die. Unfortunately the limit is not known precisely...
1319 m4_define([_AC_OUTPUT_CONFIG_STATUS],
1320 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
1321 dnl AS_MESSAGE_LOG_FD is not available yet:
1322 m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1323 [AS_INIT_GENERATED([$CONFIG_STATUS],
1324 [# Run this file to recreate the current configuration.
1325 # Compiler output produced by configure, useful for debugging
1326 # configure, is in config.log if it exists.
1331 ]) || ac_write_fail=1
1333 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1334 [#] Save the log message, to keep $[0] and so on meaningful, and to
1335 # report actual input values of CONFIG_FILES etc. instead of their
1336 # values after options handling.
1338 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1339 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1340 generated by m4_PACKAGE_STRING. Invocation command line was
1342 CONFIG_FILES = $CONFIG_FILES
1343 CONFIG_HEADERS = $CONFIG_HEADERS
1344 CONFIG_LINKS = $CONFIG_LINKS
1345 CONFIG_COMMANDS = $CONFIG_COMMANDS
1348 on `(hostname || uname -n) 2>/dev/null | sed 1q`
1353 dnl remove any newlines from these variables.
1354 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1355 [case $ac_config_files in *"
1356 "*) set x $ac_config_files; shift; ac_config_files=$[*];;
1359 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1360 [case $ac_config_headers in *"
1361 "*) set x $ac_config_headers; shift; ac_config_headers=$[*];;
1365 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1366 # Files that config.status was made for.
1367 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1368 [config_files="$ac_config_files"
1370 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1371 [config_headers="$ac_config_headers"
1373 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1374 [config_links="$ac_config_links"
1376 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1377 [config_commands="$ac_config_commands"
1382 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1384 \`$as_me' instantiates files and other configuration actions
1385 from templates according to the current configuration. Unless the files
1386 and actions are specified as TAGs, all are instantiated by default.
1388 Usage: $[0] [[OPTION]]... [[TAG]]...
1390 -h, --help print this help, then exit
1391 -V, --version print version number and configuration settings, then exit
1392 --config print configuration, then exit
1393 -q, --quiet, --silent
1394 [] do not print progress messages
1395 -d, --debug don't remove temporary files
1396 --recheck update $as_me by reconfiguring in the same conditions
1397 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1398 [AS_HELP_STRING([[ --file=FILE[:TEMPLATE]]],
1399 [instantiate the configuration file FILE], [ ])
1401 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1402 [AS_HELP_STRING([[ --header=FILE[:TEMPLATE]]],
1403 [instantiate the configuration header FILE], [ ])
1406 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1407 [Configuration files:
1411 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1412 [Configuration headers:
1416 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1417 [Configuration links:
1421 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1422 [Configuration commands:
1426 Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
1427 [the package provider]).dnl
1428 m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
1429 AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
1430 m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
1431 General help using GNU software: <http://www.gnu.org/gethelp/>.])])"
1434 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1435 ac_cs_config="`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`"
1437 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1438 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1439 configured by $[0], generated by m4_PACKAGE_STRING,
1440 with options \\"\$ac_cs_config\\"
1442 Copyright (C) m4_PACKAGE_YEAR Free Software Foundation, Inc.
1443 This config.status script is free software; the Free Software Foundation
1444 gives unlimited permission to copy, distribute and modify it."
1448 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1451 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
1454 AC_PROVIDE_IFELSE([AC_PROG_AWK],
1457 test -n "\$AWK" || AWK=awk
1460 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1461 # The default lists apply if the user does not specify any file.
1463 while test $[#] != 0
1467 ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
1468 ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
1472 ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
1484 # Handling of the options.
1485 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1487 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
1488 AS_ECHO(["$ac_cs_version"]); exit ;;
1489 --config | --confi | --conf | --con | --co | --c )
1490 AS_ECHO(["$ac_cs_config"]); exit ;;
1491 --debug | --debu | --deb | --de | --d | -d )
1493 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
1494 --file | --fil | --fi | --f )
1497 *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1498 '') AC_MSG_ERROR([missing file argument]) ;;
1500 AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
1501 ac_need_defaults=false;;
1503 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
1504 --header | --heade | --head | --hea )
1507 *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1509 AS_VAR_APPEND([CONFIG_HEADERS], [" '$ac_optarg'"])
1510 ac_need_defaults=false;;
1512 # Conflict between --help and --header
1513 AC_MSG_ERROR([ambiguous option: `$[1]'
1514 Try `$[0] --help' for more information.]);;
1515 ], [ --he | --h |])dnl
1516 --help | --hel | -h )
1517 AS_ECHO(["$ac_cs_usage"]); exit ;;
1518 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1519 | -silent | --silent | --silen | --sile | --sil | --si | --s)
1523 -*) AC_MSG_ERROR([unrecognized option: `$[1]'
1524 Try `$[0] --help' for more information.]) ;;
1526 *) AS_VAR_APPEND([ac_config_targets], [" $[1]"])
1527 ac_need_defaults=false ;;
1533 ac_configure_extra_args=
1535 if $ac_cs_silent; then
1536 exec AS_MESSAGE_FD>/dev/null
1537 ac_configure_extra_args="$ac_configure_extra_args --silent"
1541 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1542 dnl Check this before opening the log, to avoid a bug on MinGW,
1543 dnl which prohibits the recursive instance from truncating an open log.
1544 if \$ac_cs_recheck; then
1545 set X '$SHELL' '$[0]' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
1547 \AS_ECHO(["running CONFIG_SHELL=$SHELL \$[*]"]) >&AS_MESSAGE_FD
1548 CONFIG_SHELL='$SHELL'
1554 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1556 m4_popdef([AS_MESSAGE_LOG_FD])dnl
1557 exec AS_MESSAGE_LOG_FD>>config.log
1560 AS_BOX([Running $as_me.])
1561 AS_ECHO(["$ac_log"])
1562 } >&AS_MESSAGE_LOG_FD
1565 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1566 m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
1570 _AC_OUTPUT_COMMANDS_INIT
1574 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1576 # Handling of arguments.
1577 for ac_config_target in $ac_config_targets
1579 case $ac_config_target in
1580 m4_ifdef([_AC_LIST_TAGS], [_AC_LIST_TAGS])
1581 *) AC_MSG_ERROR([invalid argument: `$ac_config_target']);;
1585 m4_ifdef([_AC_SEEN_CONFIG(ANY)], [_AC_OUTPUT_MAIN_LOOP])[]dnl
1589 ])# _AC_OUTPUT_CONFIG_STATUS
1591 # _AC_OUTPUT_MAIN_LOOP
1592 # --------------------
1593 # The main loop in $CONFIG_STATUS.
1595 # This macro is expanded inside a here document. If the here document is
1596 # closed, it has to be reopened with
1597 # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
1599 AC_DEFUN([_AC_OUTPUT_MAIN_LOOP],
1601 # If the user did not use the arguments to specify the items to instantiate,
1602 # then the envvar interface is used. Set only those that are not.
1603 # We use the long form for the default assignment because of an extremely
1604 # bizarre bug on SunOS 4.1.3.
1605 if $ac_need_defaults; then
1606 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
1607 [ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1609 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
1610 [ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1612 m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
1613 [ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1615 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
1616 [ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1620 # Have a temporary directory for convenience. Make it in the build tree
1621 # simply because there is no reason against having it here, and in addition,
1622 # creating and moving files from /tmp can sometimes cause problems.
1623 # Hook for its removal unless debugging.
1624 # Note that there is a small window in which the directory will not be cleaned:
1625 # after its creation but before its name has been assigned to `$tmp'.
1626 dnl For historical reasons, AS_TMPDIR must continue to place the results
1627 dnl in $tmp; but we swap to the namespace-clean $ac_tmp to avoid issues
1628 dnl with any CONFIG_COMMANDS playing with the common variable name $tmp.
1632 trap 'exit_status=$?
1634 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
1636 trap 'AS_EXIT([1])' 1 2 13 15
1638 dnl The comment above AS_TMPDIR says at most 4 chars are allowed.
1639 AS_TMPDIR([conf], [.])
1642 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [_AC_OUTPUT_FILES_PREPARE])[]dnl
1643 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [_AC_OUTPUT_HEADERS_PREPARE])[]dnl
1646 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F $CONFIG_FILES])[]dnl
1647 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H $CONFIG_HEADERS])[]dnl
1648 m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L $CONFIG_LINKS])[]dnl
1649 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C $CONFIG_COMMANDS])[]dnl
1655 :[[FHLC]]) ac_mode=$ac_tag; continue;;
1657 case $ac_mode$ac_tag in
1659 :L* | :C*:*) AC_MSG_ERROR([invalid tag `$ac_tag']);;
1660 :[[FH]]-) ac_tag=-:-;;
1661 :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
1672 :L) ac_source=$[1];;
1678 -) ac_f="$ac_tmp/stdin";;
1679 *) # Look for the file first in the build tree, then in the source tree
1680 # (if the path is not absolute). The absolute path cannot be DOS-style,
1681 # because $ac_f cannot contain `:'.
1685 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
1687 AC_MSG_ERROR([cannot find input file: `$ac_f'], [1]);;
1689 case $ac_f in *\'*) ac_f=`AS_ECHO(["$ac_f"]) | sed "s/'/'\\\\\\\\''/g"`;; esac
1690 AS_VAR_APPEND([ac_file_inputs], [" '$ac_f'"])
1693 # Let's still pretend it is `configure' which instantiates (i.e., don't
1694 # use $as_me), people would be surprised to read:
1695 # /* config.h. Generated by config.status. */
1696 configure_input='Generated from '`
1697 AS_ECHO(["$[*]"]) | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']
1699 if test x"$ac_file" != x-; then
1700 configure_input="$ac_file. $configure_input"
1701 AC_MSG_NOTICE([creating $ac_file])
1703 # Neutralize special characters interpreted by sed in replacement strings.
1704 case $configure_input in #(
1705 *\&* | *\|* | *\\* )
1706 ac_sed_conf_input=`AS_ECHO(["$configure_input"]) |
1707 sed 's/[[\\\\&|]]/\\\\&/g'`;; #(
1708 *) ac_sed_conf_input=$configure_input;;
1712 *:-:* | *:-) cat >"$ac_tmp/stdin" \
1713 || AC_MSG_ERROR([could not create $ac_file]) ;;
1718 ac_dir=`AS_DIRNAME(["$ac_file"])`
1719 AS_MKDIR_P(["$ac_dir"])
1720 _AC_SRCDIRS(["$ac_dir"])
1723 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F)_AC_OUTPUT_FILE ;;])
1724 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H)_AC_OUTPUT_HEADER ;;])
1725 m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L)_AC_OUTPUT_LINK ;;])
1726 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C)_AC_OUTPUT_COMMAND ;;])
1729 dnl Some shells don't like empty case/esac
1730 m4_ifdef([_AC_LIST_TAG_COMMANDS], [
1731 case $ac_file$ac_mode in
1732 _AC_LIST_TAG_COMMANDS
1737 ])# _AC_OUTPUT_MAIN_LOOP
1740 # AC_OUTPUT_MAKE_DEFS
1741 # -------------------
1742 # Set the DEFS variable to the -D options determined earlier.
1743 # This is a subroutine of AC_OUTPUT.
1744 # It is called inside configure, outside of config.status.
1745 m4_define([AC_OUTPUT_MAKE_DEFS],
1746 [[# Transform confdefs.h into DEFS.
1747 # Protect against shell expansion while executing Makefile rules.
1748 # Protect against Makefile macro expansion.
1750 # If the first sed substitution is executed (which looks for macros that
1751 # take arguments), then branch to the quote section. Otherwise,
1752 # look for a macro that doesn't take arguments.
1762 s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
1764 s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
1768 s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
1781 DEFS=`sed -n "$ac_script" confdefs.h`
1782 ]])# AC_OUTPUT_MAKE_DEFS