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 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 # As a special exception, the Free Software Foundation gives unlimited
22 # permission to copy, distribute and modify the configure scripts that
23 # are the output of Autoconf. You need not follow the terms of the GNU
24 # General Public License when using or distributing such scripts, even
25 # though portions of the text of Autoconf appear in them. The GNU
26 # General Public License (GPL) does govern all other use of the material
27 # that constitutes the Autoconf program.
29 # Certain portions of the Autoconf source text are designed to be copied
30 # (in certain cases, depending on the input) into the output of
31 # Autoconf. We call these the "data" portions. The rest of the Autoconf
32 # source text consists of comments plus executable code that decides which
33 # of the data portions to output in any given case. We call these
34 # comments and executable code the "non-data" portions. Autoconf never
35 # copies any of the non-data portions into its output.
37 # This special exception to the GPL applies to versions of Autoconf
38 # released by the Free Software Foundation. When you make and
39 # distribute a modified version of Autoconf, you may extend this special
40 # exception to the GPL to apply to your modified version as well, *unless*
41 # your modified version has the potential to copy into its output some
42 # of the text that was the non-data portion of the version that you started
43 # with. (In other words, unless your change moves or copies text from
44 # the non-data portions to the data portions.) If your modification has
45 # such potential, you must delete any notice of this special exception
46 # to the GPL from your modified version.
48 # Written by David MacKenzie, with help from
49 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
50 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
53 # This file handles about all the preparation aspects for
54 # `config.status': registering the configuration files, the headers,
55 # the links, and the commands `config.status' will run. There is a
56 # little mixture though of things actually handled by `configure',
57 # such as running the `configure' in the sub directories. Minor
60 # There are two kinds of commands:
64 # They are output into `config.status' via a quoted here doc. These
65 # commands are always associated to a tag which the user can use to
66 # tell `config.status' what are the commands she wants to run.
70 # They are output via an *unquoted* here-doc. As a consequence $var
71 # will be output as the value of VAR. This is typically used by
72 # `configure' to give `config,.status' some variables it needs to run
73 # the COMMANDS. At the difference of `COMMANDS', the INIT-CMDS are
77 # Some uniformity exists around here, please respect it!
79 # A macro named AC_CONFIG_FOOS has three args: the `TAG...' (or
80 # `FILE...' when it applies), the `COMMANDS' and the `INIT-CMDS'. It
81 # first checks that TAG was not registered elsewhere thanks to
82 # AC_CONFIG_UNIQUE. Then it registers `TAG...' in AC_LIST_FOOS, and for
83 # each `TAG', a special line in AC_LIST_FOOS_COMMANDS which is used in
84 # `config.status' like this:
87 # AC_LIST_FOOS_COMMANDS
90 # Finally, the `INIT-CMDS' are dumped into a special diversion, via
91 # `_AC_CONFIG_COMMANDS_INIT'. While `COMMANDS' are output once per TAG,
92 # `INIT-CMDS' are dumped only once per call to AC_CONFIG_FOOS.
94 # It also leave the TAG in the shell variable ac_config_foo which contains
95 # those which will actually be executed. In other words:
98 # AC_CONFIG_FOOS(bar, [touch bar])
101 # will not create bar.
103 # AC_CONFIG_FOOS can be called several times (with different TAGs of
106 # Because these macros should not output anything, there should be `dnl'
107 # everywhere. A pain my friend, a pain. So instead in each macro we
108 # divert(-1) and restore the diversion at the end.
111 # Honorable members of this family are AC_CONFIG_FILES,
112 # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
113 # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
114 # arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
115 # and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
116 # AC_CONFIG_COMMANDS_POST.
119 ## ------------------ ##
120 ## Auxiliary macros. ##
121 ## ------------------ ##
123 # _AC_SRCPATHS(BUILD-DIR-NAME)
124 # ----------------------------
126 # - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
127 # - `$srcdir' is `top-build -> top-src'
130 # - `ac_builddir' is `.', for symmetry only.
131 # - `ac_top_builddir' is `build -> top_build'.
132 # If not empty, has a trailing slash.
133 # - `ac_srcdir' is `build -> src'.
134 # - `ac_top_srcdir' is `build -> top-src'.
136 # and `ac_abs_builddir' etc., the absolute paths.
137 m4_define([_AC_SRCPATHS],
140 if test $1 != .; then
141 ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
142 # A "../" for each directory in $ac_dir_suffix.
143 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,../,g'`
145 ac_dir_suffix= ac_top_builddir=
149 .) # No --srcdir option. We are building in place.
151 if test -z "$ac_top_builddir"; then
154 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
156 [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
157 ac_srcdir=$srcdir$ac_dir_suffix;
158 ac_top_srcdir=$srcdir ;;
160 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
161 ac_top_srcdir=$ac_top_builddir$srcdir ;;
164 # Do not use `cd foo && pwd` to compute absolute paths, because
165 # the directories may not exist.
166 AS_SET_CATFILE([ac_abs_builddir], [`pwd`], [$1])
167 AS_SET_CATFILE([ac_abs_top_builddir],
168 [$ac_abs_builddir], [${ac_top_builddir}.])
169 AS_SET_CATFILE([ac_abs_srcdir], [$ac_abs_builddir], [$ac_srcdir])
170 AS_SET_CATFILE([ac_abs_top_srcdir], [$ac_abs_builddir], [$ac_top_srcdir])
175 ## ------------------------------------- ##
176 ## Ensuring the uniqueness of the tags. ##
177 ## ------------------------------------- ##
179 # AC_CONFIG_IF_MEMBER(DEST, LIST-NAME, ACTION-IF-TRUE, ACTION-IF-FALSE)
180 # ----------------------------------------------------------------
181 # If DEST is member of LIST-NAME, expand to ACTION-IF-TRUE, else
184 # LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated
187 # FIXME: This macro is badly designed, but I'm not guilty: m4 is. There
188 # is just no way to simply compare two strings in m4, but to use pattern
189 # matching. The big problem is then that the active characters should
190 # be quoted. Currently `+*.' are quoted.
191 m4_define([AC_CONFIG_IF_MEMBER],
192 [m4_bmatch(m4_defn([$2]), [\(^\| \)]m4_re_escape([$1])[\([: ]\|$\)],
196 # AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
197 # -----------------------------------------------------
198 # This macro does nothing, it's a hook to be read with `autoconf --trace'.
199 # It announces DEST depends upon the SOURCE1 etc.
200 m4_define([AC_FILE_DEPENDENCY_TRACE], [])
203 # _AC_CONFIG_DEPENDENCY(DEST, [SOURCE1], [SOURCE2...])
204 # ----------------------------------------------------
205 # Be sure that a missing dependency is expressed as a dependency upon
207 m4_define([_AC_CONFIG_DEPENDENCY],
209 [AC_FILE_DEPENDENCY_TRACE($@)],
210 [AC_FILE_DEPENDENCY_TRACE([$1], [$1.in])])])
213 # _AC_CONFIG_DEPENDENCIES(DEST[:SOURCE1[:SOURCE2...]]...)
214 # -------------------------------------------------------
215 # Declare the DESTs depend upon their SOURCE1 etc.
216 m4_define([_AC_CONFIG_DEPENDENCIES],
217 [AC_FOREACH([AC_File], [$1],
218 [_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])dnl
222 # _AC_CONFIG_UNIQUE(DEST[:SOURCE]...)
223 # -----------------------------------
225 # Verify that there is no double definition of an output file
226 # (precisely, guarantees there is no common elements between
227 # CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS).
229 # Note that this macro does not check if the list $[1] itself
231 m4_define([_AC_CONFIG_UNIQUE],
232 [AC_FOREACH([AC_File], [$1],
233 [m4_pushdef([AC_Dest], m4_bpatsubst(AC_File, [:.*]))dnl
234 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS],
235 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADERS.])])dnl
236 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS],
237 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])])dnl
238 AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS],
239 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])])dnl
240 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS],
241 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])dnl
242 AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES],
243 [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES.])])dnl
244 m4_popdef([AC_Dest])])dnl
249 ## ------------------------ ##
250 ## Configuration commands. ##
251 ## ------------------------ ##
254 # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
255 # -----------------------------------------
257 # Register INIT-COMMANDS as command pasted *unquoted* in
258 # `config.status'. This is typically used to pass variables from
259 # `configure' to `config.status'. Note that $[1] is not over quoted as
260 # was the case in AC_OUTPUT_COMMANDS.
261 m4_define([_AC_CONFIG_COMMANDS_INIT],
263 [m4_append([_AC_OUTPUT_COMMANDS_INIT],
268 m4_define([_AC_OUTPUT_COMMANDS_INIT])
271 # _AC_CONFIG_COMMAND(NAME, [COMMANDS])
272 # ------------------------------------
274 m4_define([_AC_CONFIG_COMMAND],
275 [_AC_CONFIG_UNIQUE([$1])dnl
276 m4_append([AC_LIST_COMMANDS], [ $1])dnl
278 [m4_append([AC_LIST_COMMANDS_COMMANDS],
279 [ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
283 # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
284 # ---------------------------------------------------
286 # Specify additional commands to be run by config.status. This
287 # commands must be associated with a NAME, which should be thought
288 # as the name of a file the COMMANDS create.
289 AC_DEFUN([AC_CONFIG_COMMANDS],
290 [AC_FOREACH([AC_Name], [$1], [_AC_CONFIG_COMMAND(m4_defn([AC_Name]), [$2])])dnl
291 _AC_CONFIG_COMMANDS_INIT([$3])dnl
292 ac_config_commands="$ac_config_commands $1"
295 # Initialize the lists.
296 m4_define([AC_LIST_COMMANDS])
297 m4_define([AC_LIST_COMMANDS_COMMANDS])
300 # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
301 # -----------------------------------------
303 # Add additional commands for AC_OUTPUT to put into config.status.
305 # This macro is an obsolete version of AC_CONFIG_COMMANDS. The only
306 # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
307 # to give a unique key. The scheme we have chosen is `default-1',
308 # `default-2' etc. for each call.
310 # Unfortunately this scheme is fragile: bad things might happen
311 # if you update an included file and configure.ac: you might have
312 # clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
313 # depending upon __file__ or the pid).
314 AU_DEFUN([AC_OUTPUT_COMMANDS],
315 [m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
316 dnl Double quoted since that was the case in the original macro.
317 AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
321 AU_DEFUN([_AC_OUTPUT_COMMANDS_CNT], 0)
324 # AC_CONFIG_COMMANDS_PRE(CMDS)
325 # ----------------------------
326 # Commands to run right before config.status is created. Accumulates.
327 AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
328 [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
332 # AC_OUTPUT_COMMANDS_PRE
333 # ----------------------
334 # A *variable* in which we append all the actions that must be
335 # performed before *creating* config.status. For a start, clean
336 # up all the LIBOBJ mess.
337 m4_define([AC_OUTPUT_COMMANDS_PRE],
338 [_AC_LIBOBJS_NORMALIZE()
342 # AC_CONFIG_COMMANDS_POST(CMDS)
343 # -----------------------------
344 # Commands to run after config.status was created. Accumulates.
345 AC_DEFUN([AC_CONFIG_COMMANDS_POST],
346 [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
350 m4_define([AC_OUTPUT_COMMANDS_POST])
354 # _AC_OUTPUT_COMMANDS
355 # -------------------
356 # This is a subroutine of AC_OUTPUT, in charge of issuing the code
357 # related to AC_CONFIG_COMMANDS.
359 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
360 # Upon exit, no here document shall be opened.
361 m4_define([_AC_OUTPUT_COMMANDS],
362 [cat >>$CONFIG_STATUS <<\_ACEOF
365 # CONFIG_COMMANDS section.
367 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
368 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
369 ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
370 ac_dir=`AS_DIRNAME(["$ac_dest"])`
371 AS_MKDIR_P(["$ac_dir"])
372 _AC_SRCPATHS(["$ac_dir"])
374 AC_MSG_NOTICE([executing $ac_dest commands])
375 dnl Some shells don't like empty case/esac
376 m4_ifset([AC_LIST_COMMANDS_COMMANDS],
378 AC_LIST_COMMANDS_COMMANDS()dnl
383 ])# _AC_OUTPUT_COMMANDS
388 ## ----------------------- ##
389 ## Configuration headers. ##
390 ## ----------------------- ##
393 # _AC_CONFIG_HEADER(HEADER, [COMMANDS])
394 # -------------------------------------
396 m4_define([_AC_CONFIG_HEADER],
397 [_AC_CONFIG_UNIQUE([$1])dnl
398 m4_append([AC_LIST_HEADERS], [ $1])dnl
399 _AC_CONFIG_DEPENDENCIES([$1])dnl
400 dnl Register the commands
402 [m4_append([AC_LIST_HEADERS_COMMANDS],
403 [ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
408 # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
409 # ------------------------------------------------------
410 # Specify that the HEADERS are to be created by instantiation of the
411 # AC_DEFINEs. Associate the COMMANDS to the HEADERS. This macro
412 # accumulates if called several times.
414 # The commands are stored in a growing string AC_LIST_HEADERS_COMMANDS
415 # which should be used like this:
418 # AC_LIST_HEADERS_COMMANDS
420 AC_DEFUN([AC_CONFIG_HEADERS],
421 [AC_FOREACH([AC_File], [$1], [_AC_CONFIG_HEADER(m4_defn([AC_File]), [$2])])dnl
422 _AC_CONFIG_COMMANDS_INIT([$3])dnl
423 ac_config_headers="$ac_config_headers m4_normalize([$1])"
426 # Initialize to empty. It is much easier and uniform to have a config
427 # list expand to empty when undefined, instead of special casing when
428 # not defined (since in this case, AC_CONFIG_FOO expands to AC_CONFIG_FOO).
429 m4_define([AC_LIST_HEADERS])
430 m4_define([AC_LIST_HEADERS_COMMANDS])
433 # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
434 # --------------------------------------
435 # FIXME: Make it obsolete?
436 AC_DEFUN([AC_CONFIG_HEADER],
437 [AC_CONFIG_HEADERS([$1])])
443 # Output the code which instantiates the `config.h' files from their
446 # This is a subroutine of _AC_OUTPUT_CONFIG_STATUS. It has to send
447 # itself into $CONFIG_STATUS (eg, via here documents). Upon exit, no
448 # here document shall be opened.
451 # The code produced used to be extremely costly: there are was a
452 # single sed script (n lines) handling both `#define' templates,
453 # `#undef' templates with trailing space, and `#undef' templates
454 # without trailing spaces. The full script was run on each of the m
455 # lines of `config.h.in', i.e., about n x m.
457 # Now there are two scripts: `conftest.defines' for the `#define'
458 # templates, and `conftest.undef' for the `#undef' templates.
460 # Optimization 1. It is incredibly costly to run two `#undef'
461 # scripts, so just remove trailing spaces first. Removes about a
464 # Optimization 2. Since `#define' are rare and obsoleted,
465 # `conftest.defines' is built and run only if grep says there are
466 # `#define'. Improves by at least a factor 2, since in addition we
467 # avoid the cost of *producing* the sed script.
469 # Optimization 3. In each script, first check that the current input
470 # line is a template. This avoids running the full sed script on
471 # empty lines and comments (divides the cost by about 3 since each
472 # template chunk is typically a comment, a template, an empty line).
474 # Optimization 4. Once a substitution performed, since there can be
475 # only one per line, immediately restart the script on the next input
476 # line (using the `t' sed instruction). Divides by about 2.
477 # *Note:* In the case of the AC_SUBST sed script (_AC_OUTPUT_FILES)
478 # this optimization cannot be applied as is, because there can be
479 # several substitutions per line.
482 # The result is about, hm, ... times blah... plus.... Ahem. The
483 # result is about much faster.
484 m4_define([_AC_OUTPUT_HEADERS],
485 [cat >>$CONFIG_STATUS <<\_ACEOF
488 # CONFIG_HEADER section.
491 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
492 # NAME is the cpp macro being defined and VALUE is the value it is being given.
494 # ac_d sets the value in "#define NAME VALUE" lines.
495 dnl Double quote for the `[ ]' and `define'.
496 [ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
500 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
501 ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
502 ac_uB='$,\1#\2define\3'
506 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
507 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
509 - | *:- | *:-:* ) # input from stdin
511 ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
512 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
513 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
514 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
515 * ) ac_file_in=$ac_file.in ;;
518 test x"$ac_file" != x- && AC_MSG_NOTICE([creating $ac_file])
520 # First look for the input files in the build tree, otherwise in the
522 ac_file_inputs=`IFS=:
523 for f in $ac_file_in; do
525 -) echo $tmp/stdin ;;
527 # Absolute (can't be DOS-style, as IFS=:)
528 test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
529 # Do quote $f, to prevent DOS paths from being IFS'd.
532 if test -f "$f"; then
535 elif test -f "$srcdir/$f"; then
540 AC_MSG_ERROR([cannot find input file: $f])
543 done` || AS_EXIT([1])
544 # Remove the trailing spaces.
545 sed 's/[[ ]]*$//' $ac_file_inputs >$tmp/in
549 # Transform confdefs.h into two sed scripts, `conftest.defines' and
550 # `conftest.undefs', that substitutes the proper values into
551 # config.h.in to produce config.h. The first handles `#define'
552 # templates, and the second `#undef' templates.
553 # And first: Protect against being on the right side of a sed subst in
554 # config.status. Protect against being in an unquoted here document
556 rm -f conftest.defines conftest.undefs
557 # Using a here document instead of a string reduces the quoting nightmare.
558 # Putting comments in sed scripts is not portable.
560 # `end' is used to avoid that the second main sed command (meant for
561 # 0-ary CPP macros) applies to n-ary macro definitions.
562 # See the Autoconf documentation for `clear'.
563 cat >confdef2sed.sed <<\_ACEOF
564 dnl Double quote for `[ ]' and `define'.
569 s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
571 s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
574 # If some macros were called several times there might be several times
575 # the same #defines, which is useless. Nevertheless, we may not want to
576 # sort them, since we want the *last* AC-DEFINE to be honored.
577 uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
578 sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
579 rm -f confdef2sed.sed
581 # This sed command replaces #undef with comments. This is necessary, for
582 # example, in the case of _POSIX_SOURCE, which is predefined and required
583 # on some systems where configure will not decide to define it.
584 cat >>conftest.undefs <<\_ACEOF
585 [s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,]
588 # Break up conftest.defines because some shells have a limit on the size
589 # of here documents, and old seds have small limits too (100 cmds).
590 echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
591 echo ' if grep ["^[ ]*#[ ]*define"] $tmp/in >/dev/null; then' >>$CONFIG_STATUS
592 echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
593 echo ' :' >>$CONFIG_STATUS
595 while grep . conftest.defines >/dev/null
597 # Write a limited-size here document to $tmp/defines.sed.
598 echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
599 # Speed up: don't consider the non `#define' lines.
600 echo ['/^[ ]*#[ ]*define/!b'] >>$CONFIG_STATUS
601 # Work around the forget-to-reset-the-flag bug.
602 echo 't clr' >>$CONFIG_STATUS
603 echo ': clr' >>$CONFIG_STATUS
604 sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
606 sed -f $tmp/defines.sed $tmp/in >$tmp/out
610 sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
611 rm -f conftest.defines
612 mv conftest.tail conftest.defines
614 rm -f conftest.defines
615 echo ' fi # grep' >>$CONFIG_STATUS
616 echo >>$CONFIG_STATUS
618 # Break up conftest.undefs because some shells have a limit on the size
619 # of here documents, and old seds have small limits too (100 cmds).
620 echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
622 while grep . conftest.undefs >/dev/null
624 # Write a limited-size here document to $tmp/undefs.sed.
625 echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
626 # Speed up: don't consider the non `#undef'
627 echo ['/^[ ]*#[ ]*undef/!b'] >>$CONFIG_STATUS
628 # Work around the forget-to-reset-the-flag bug.
629 echo 't clr' >>$CONFIG_STATUS
630 echo ': clr' >>$CONFIG_STATUS
631 sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
633 sed -f $tmp/undefs.sed $tmp/in >$tmp/out
637 sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
638 rm -f conftest.undefs
639 mv conftest.tail conftest.undefs
641 rm -f conftest.undefs
643 dnl Now back to your regularly scheduled config.status.
644 cat >>$CONFIG_STATUS <<\_ACEOF
645 # Let's still pretend it is `configure' which instantiates (i.e., don't
646 # use $as_me), people would be surprised to read:
647 # /* config.h. Generated by config.status. */
648 if test x"$ac_file" = x-; then
649 echo "/* Generated by configure. */" >$tmp/config.h
651 echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
653 cat $tmp/in >>$tmp/config.h
655 if test x"$ac_file" != x-; then
656 if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
657 AC_MSG_NOTICE([$ac_file is unchanged])
659 ac_dir=`AS_DIRNAME(["$ac_file"])`
660 AS_MKDIR_P(["$ac_dir"])
662 mv $tmp/config.h $ac_file
668 dnl If running for Automake, be ready to perform additional
669 dnl commands to set up the timestamp files.
670 m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
671 [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])
673 m4_ifset([AC_LIST_HEADERS_COMMANDS],
674 [ # Run the commands associated with the file.
676 AC_LIST_HEADERS_COMMANDS()dnl
681 ])# _AC_OUTPUT_HEADERS
685 ## --------------------- ##
686 ## Configuration links. ##
687 ## --------------------- ##
690 # _AC_CONFIG_LINK(DEST:SOURCE, [COMMANDS])
691 # ----------------------------------------
693 m4_define([_AC_CONFIG_LINK],
694 [_AC_CONFIG_UNIQUE([$1])dnl
695 m4_append([AC_LIST_LINKS], [ $1])dnl
696 _AC_CONFIG_DEPENDENCIES([$1])dnl
697 m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])dnl
698 dnl Register the commands
700 [m4_append([AC_LIST_LINKS_COMMANDS],
701 [ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
705 # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
706 # --------------------------------------------------------
707 # Specify that config.status should establish a (symbolic if possible)
708 # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
709 # Reject DEST=., because it is makes it hard for ./config.status
710 # to guess the links to establish (`./config.status .').
711 AC_DEFUN([AC_CONFIG_LINKS],
712 [AC_FOREACH([AC_File], [$1], [_AC_CONFIG_LINK(m4_defn([AC_File]), [$2])])dnl
713 _AC_CONFIG_COMMANDS_INIT([$3])dnl
714 ac_config_links="$ac_config_links m4_normalize([$1])"
718 # Initialize the list.
719 m4_define([AC_LIST_LINKS])
720 m4_define([AC_LIST_LINKS_COMMANDS])
723 # AC_LINK_FILES(SOURCE..., DEST...)
724 # ---------------------------------
725 # Link each of the existing files SOURCE... to the corresponding
726 # link name in DEST...
728 # Unfortunately we can't provide a very good autoupdate service here,
729 # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
730 # and `$to' are actually lists. It would then be completely wrong to
731 # replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the
732 # case of literal values though, but because I don't think there is any
733 # interest in creating config links with literal values, no special
734 # mechanism is implemented to handle them.
736 # _AC_LINK_CNT is used to be robust to multiple calls.
737 AU_DEFUN([AC_LINK_FILES],
739 [m4_fatal([$0: incorrect number of arguments])])dnl
740 m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
743 while test -n "$ac_sources"; do
744 set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
745 set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
746 [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
748 AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
751 It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
752 to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant
753 update, you should probably tune the result yourself.])# AC_LINK_FILES
757 AU_DEFUN([_AC_LINK_FILES_CNT], 0)
761 # This is a subroutine of AC_OUTPUT.
763 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
764 # Upon exit, no here document shall be opened.
765 m4_define([_AC_OUTPUT_LINKS],
766 [cat >>$CONFIG_STATUS <<\_ACEOF
769 # CONFIG_LINKS section.
772 dnl Here we use : instead of .. because if AC_LINK_FILES was used
773 dnl with empty parameters (as in gettext.m4), then we obtain here
774 dnl `:', which we want to skip. So let's keep a single exception: `:'.
775 for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
776 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
777 ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
779 AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_dest])
781 if test ! -r $srcdir/$ac_source; then
782 AC_MSG_ERROR([$srcdir/$ac_source: file not found])
786 # Make relative symlinks.
787 ac_dest_dir=`AS_DIRNAME(["$ac_dest"])`
788 AS_MKDIR_P(["$ac_dest_dir"])
789 _AC_SRCPATHS(["$ac_dest_dir"])
792 [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
793 *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
796 # Try a symlink, then a hard link, then a copy.
797 ln -s $ac_rel_source $ac_dest 2>/dev/null ||
798 ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
799 cp -p $srcdir/$ac_source $ac_dest ||
800 AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest])
801 m4_ifset([AC_LIST_LINKS_COMMANDS],
802 [ # Run the commands associated with the file.
804 AC_LIST_LINKS_COMMANDS()dnl
813 ## --------------------- ##
814 ## Configuration files. ##
815 ## --------------------- ##
818 # _AC_CONFIG_FILE(FILE..., [COMMANDS])
819 # ------------------------------------
821 m4_define([_AC_CONFIG_FILE],
822 [_AC_CONFIG_UNIQUE([$1])dnl
823 m4_append([AC_LIST_FILES], [ $1])dnl
824 _AC_CONFIG_DEPENDENCIES([$1])dnl
825 dnl Register the commands.
827 [m4_append([AC_LIST_FILES_COMMANDS],
828 [ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
832 # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
833 # -------------------------------------------------
834 # Specify output files, as with AC_OUTPUT, i.e., files that are
835 # configured with AC_SUBST. Associate the COMMANDS to each FILE,
836 # i.e., when config.status creates FILE, run COMMANDS afterwards.
838 # The commands are stored in a growing string AC_LIST_FILES_COMMANDS
839 # which should be used like this:
842 # AC_LIST_FILES_COMMANDS
844 AC_DEFUN([AC_CONFIG_FILES],
845 [AC_FOREACH([AC_File], [$1], [_AC_CONFIG_FILE(m4_defn([AC_File]), [$2])])dnl
846 _AC_CONFIG_COMMANDS_INIT([$3])dnl
847 ac_config_files="$ac_config_files m4_normalize([$1])"
850 # Initialize the lists.
851 m4_define([AC_LIST_FILES])
852 m4_define([AC_LIST_FILES_COMMANDS])
858 # Do the variable substitutions to create the Makefiles or whatever.
859 # This is a subroutine of AC_OUTPUT.
861 # It has to send itself into $CONFIG_STATUS (eg, via here documents).
862 # Upon exit, no here document shall be opened.
863 m4_define([_AC_OUTPUT_FILES],
864 [cat >>$CONFIG_STATUS <<_ACEOF
867 # CONFIG_FILES section.
870 # No need to generate the scripts if there are no CONFIG_FILES.
871 # This happens for instance when ./config.status config.h
872 if test -n "\$CONFIG_FILES"; then
873 # Protect against being on the right side of a sed subst in config.status.
874 dnl Please, pay attention that this sed code depends a lot on the shape
875 dnl of the sed commands issued by AC_SUBST. So if you change one, change
877 [ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
878 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF]
879 dnl These here document variables are unquoted when configure runs
880 dnl but quoted when config.status runs, so variables are expanded once.
881 dnl Insert the sed substitutions of variables.
882 m4_ifdef([_AC_SUBST_VARS],
883 [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]),
884 [s,@AC_Var@,$AC_Var,;t t
886 m4_ifdef([_AC_SUBST_FILES],
887 [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_FILES]),
895 cat >>$CONFIG_STATUS <<\_ACEOF
896 # Split the substitutions into bite-sized pieces for seds with
897 # small command number limits, like on Digital OSF/1 and HP-UX.
898 dnl One cannot portably go further than 100 commands because of HP-UX.
899 dnl Here, there are 2 cmd per line, and two cmd are added later.
901 ac_sed_frag=1 # Number of current file.
902 ac_beg=1 # First line for current file.
903 ac_end=$ac_max_sed_lines # Line after last line for current file.
906 while $ac_more_lines; do
907 if test $ac_beg -gt 1; then
908 sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
910 sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
912 if test ! -s $tmp/subs.frag; then
915 # The purpose of the label and of the branching condition is to
916 # speed up the sed processing (if there are no `@' at all, there
917 # is no need to browse any of the substitutions).
918 # These are the two extra sed commands mentioned above.
920 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b'] && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
921 if test -z "$ac_sed_cmds"; then
922 ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
924 ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
926 ac_sed_frag=`expr $ac_sed_frag + 1`
928 ac_end=`expr $ac_end + $ac_max_sed_lines`
931 if test -z "$ac_sed_cmds"; then
934 fi # test -n "$CONFIG_FILES"
937 cat >>$CONFIG_STATUS <<\_ACEOF
938 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
939 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
941 - | *:- | *:-:* ) # input from stdin
943 ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
944 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
945 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
946 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
947 * ) ac_file_in=$ac_file.in ;;
950 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
951 ac_dir=`AS_DIRNAME(["$ac_file"])`
952 AS_MKDIR_P(["$ac_dir"])
953 _AC_SRCPATHS(["$ac_dir"])
955 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
957 [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
958 *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
962 # Let's still pretend it is `configure' which instantiates (i.e., don't
963 # use $as_me), people would be surprised to read:
964 # /* config.h. Generated by config.status. */
965 if test x"$ac_file" = x-; then
968 configure_input="$ac_file. "
970 configure_input=$configure_input"Generated from `echo $ac_file_in |
971 sed 's,.*/,,'` by configure."
973 # First look for the input files in the build tree, otherwise in the
975 ac_file_inputs=`IFS=:
976 for f in $ac_file_in; do
978 -) echo $tmp/stdin ;;
980 # Absolute (can't be DOS-style, as IFS=:)
981 test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
984 if test -f "$f"; then
987 elif test -f "$srcdir/$f"; then
992 AC_MSG_ERROR([cannot find input file: $f])
995 done` || AS_EXIT([1])
997 if test x"$ac_file" != x-; then
998 AC_MSG_NOTICE([creating $ac_file])
1002 cat >>$CONFIG_STATUS <<_ACEOF
1003 dnl Neutralize VPATH when `$srcdir' = `.'.
1005 dnl Shell code in configure.ac might set extrasub.
1006 dnl FIXME: do we really want to maintain this feature?
1009 cat >>$CONFIG_STATUS <<\_ACEOF
1011 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
1012 s,@configure_input@,$configure_input,;t t
1013 s,@srcdir@,$ac_srcdir,;t t
1014 s,@abs_srcdir@,$ac_abs_srcdir,;t t
1015 s,@top_srcdir@,$ac_top_srcdir,;t t
1016 s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
1017 s,@builddir@,$ac_builddir,;t t
1018 s,@abs_builddir@,$ac_abs_builddir,;t t
1019 s,@top_builddir@,$ac_top_builddir,;t t
1020 s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
1021 AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t
1023 dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
1024 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
1026 dnl This would break Makefile dependencies.
1027 dnl if diff $ac_file $tmp/out >/dev/null 2>&1; then
1028 dnl echo "$ac_file is unchanged"
1031 dnl mv $tmp/out $ac_file
1033 if test x"$ac_file" != x-; then
1034 mv $tmp/out $ac_file
1040 m4_ifset([AC_LIST_FILES_COMMANDS],
1041 [ # Run the commands associated with the file.
1043 AC_LIST_FILES_COMMANDS()dnl
1048 ])# _AC_OUTPUT_FILES
1052 ## ----------------------- ##
1053 ## Configuration subdirs. ##
1054 ## ----------------------- ##
1057 # AC_CONFIG_SUBDIRS(DIR ...)
1058 # --------------------------
1059 # We define two variables:
1061 # is built in the `default' section, and should contain *all*
1062 # the arguments of AC_CONFIG_SUBDIRS. It is used for --help=recursive.
1063 # It makes no sense for arguments which are sh variables.
1065 # which is built at runtime, so some of these dirs might not be
1066 # included, if for instance the user refused a part of the tree.
1067 # This is used in _AC_OUTPUT_SUBDIRS.
1068 # _AC_LIST_SUBDIRS is used only for _AC_CONFIG_UNIQUE.
1069 AC_DEFUN([AC_CONFIG_SUBDIRS],
1070 [_AC_CONFIG_UNIQUE([$1])dnl
1071 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1072 m4_append([_AC_LIST_SUBDIRS], [ $1])dnl
1073 AS_LITERAL_IF([$1], [],
1074 [AC_DIAGNOSE(syntax, [$0: you should use literals])])
1075 m4_divert_text([DEFAULTS],
1076 [ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
1077 AC_SUBST(subdirs, "$subdirs $1")dnl
1080 # Initialize the list.
1081 m4_define([_AC_LIST_SUBDIRS])
1084 # _AC_OUTPUT_SUBDIRS
1085 # ------------------
1086 # This is a subroutine of AC_OUTPUT, but it does not go into
1087 # config.status, rather, it is called after running config.status.
1088 m4_define([_AC_OUTPUT_SUBDIRS],
1091 # CONFIG_SUBDIRS section.
1093 if test "$no_recursion" != yes; then
1095 # Remove --cache-file and --srcdir arguments so they do not pile up.
1096 ac_sub_configure_args=
1098 for ac_arg in $ac_configure_args; do
1099 if test -n "$ac_prev"; then
1104 -cache-file | --cache-file | --cache-fil | --cache-fi \
1105 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1106 ac_prev=cache_file ;;
1107 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1108 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
1111 --config-cache | -C)
1113 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1115 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1117 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1119 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1121 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
1125 # Always prepend --prefix to ensure using the same prefix
1126 # in subdir configurations.
1127 ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
1130 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
1132 # Do not complain, so a configure script can configure whichever
1133 # parts of a large source tree are present.
1134 test -d $srcdir/$ac_dir || continue
1136 AC_MSG_NOTICE([configuring in $ac_dir])
1137 AS_MKDIR_P(["$ac_dir"])
1138 _AC_SRCPATHS(["$ac_dir"])
1142 # Check for guested configure; otherwise get Cygnus style configure.
1143 if test -f $ac_srcdir/configure.gnu; then
1144 ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
1145 elif test -f $ac_srcdir/configure; then
1146 ac_sub_configure="$SHELL '$ac_srcdir/configure'"
1147 elif test -f $ac_srcdir/configure.in; then
1148 ac_sub_configure=$ac_configure
1150 AC_MSG_WARN([no configuration information is in $ac_dir])
1154 # The recursion is here.
1155 if test -n "$ac_sub_configure"; then
1156 # Make the cache file name correct relative to the subdirectory.
1158 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1160 ac_sub_cache_file=$ac_top_builddir$cache_file ;;
1163 AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
1164 # The eval makes quoting arguments work.
1165 eval $ac_sub_configure $ac_sub_configure_args \
1166 --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
1167 AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
1173 ])# _AC_OUTPUT_SUBDIRS
1178 ## -------------------------- ##
1179 ## Outputting config.status. ##
1180 ## -------------------------- ##
1183 # autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1184 # -------------------------------------------------------------------
1186 # If there are arguments given to AC_OUTPUT, dispatch them to the
1187 # proper modern macros.
1188 AU_DEFUN([AC_OUTPUT],
1190 [AC_CONFIG_FILES([$1])])dnl
1192 [AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])])dnl
1196 # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1197 # -------------------------------------------------------
1199 # Produce config.status, config.h, and links; and configure subdirs.
1200 # The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
1201 # Pay special attention not to have too long here docs: some old
1202 # shells die. Unfortunately the limit is not known precisely...
1203 m4_define([AC_OUTPUT],
1204 [dnl Dispatch the extra arguments to their native macros.
1206 [AC_CONFIG_FILES([$1])])dnl
1208 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1210 [AC_DIAGNOSE([obsolete],
1211 [$0 should be used without arguments.
1212 You should run autoupdate.])])dnl
1215 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1216 # Let make expand exec_prefix.
1217 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1219 # VPATH may cause trouble with some makes, so we remove $(srcdir),
1220 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
1221 # trailing colons and then remove the whole line if VPATH becomes empty
1222 # (actually we leave an empty line to preserve line numbers).
1223 if test "x$srcdir" = x.; then
1224 ac_vpsub=['/^[ ]*VPATH[ ]*=/{
1225 s/:*\$(srcdir):*/:/;
1226 s/:*\${srcdir}:*/:/;
1228 s/^\([^=]*=[ ]*\):*/\1/;
1234 m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1236 dnl Commands to run before creating config.status.
1237 AC_OUTPUT_COMMANDS_PRE()dnl
1239 : ${CONFIG_STATUS=./config.status}
1240 ac_clean_files_save=$ac_clean_files
1241 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1242 _AC_OUTPUT_CONFIG_STATUS()dnl
1243 ac_clean_files=$ac_clean_files_save
1245 dnl Commands to run after config.status was created
1246 AC_OUTPUT_COMMANDS_POST()dnl
1248 # configure is writing to config.log, and then calls config.status.
1249 # config.status does its own redirection, appending to config.log.
1250 # Unfortunately, on DOS this fails, as config.log is still kept open
1251 # by configure, so config.status won't be able to write to it; its
1252 # output is simply discarded. So we exec the FD to /dev/null,
1253 # effectively closing config.log, so it can be properly (re)opened and
1254 # appended to by config.status. When coming back to configure, we
1255 # need to make the FD available again.
1256 if test "$no_create" != yes; then
1258 ac_config_status_args=
1259 test "$silent" = yes &&
1260 ac_config_status_args="$ac_config_status_args --quiet"
1261 exec AS_MESSAGE_LOG_FD>/dev/null
1262 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
1263 exec AS_MESSAGE_LOG_FD>>config.log
1264 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
1265 # would make configure fail if this is the last instruction.
1266 $ac_cs_success || AS_EXIT([1])
1268 dnl config.status should not do recursion.
1269 AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1273 # _AC_OUTPUT_CONFIG_STATUS
1274 # ------------------------
1275 # Produce config.status. Called by AC_OUTPUT.
1276 # Pay special attention not to have too long here docs: some old
1277 # shells die. Unfortunately the limit is not known precisely...
1278 m4_define([_AC_OUTPUT_CONFIG_STATUS],
1279 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
1280 cat >$CONFIG_STATUS <<_ACEOF
1282 # Generated by $as_me.
1283 # Run this file to recreate the current configuration.
1284 # Compiler output produced by configure, useful for debugging
1285 # configure, is in config.log if it exists.
1290 SHELL=\${CONFIG_SHELL-$SHELL}
1293 cat >>$CONFIG_STATUS <<\_ACEOF
1295 dnl Watch out, this is directly the initializations, do not use
1296 dnl AS_PREPARE, otherwise you'd get it output in the initialization
1297 dnl of configure, not config.status.
1299 exec AS_MESSAGE_FD>&1
1301 # Open the log real soon, to keep \$[0] and so on meaningful, and to
1302 # report actual input values of CONFIG_FILES etc. instead of their
1303 # values after options handling. Logging --version etc. is OK.
1304 exec AS_MESSAGE_LOG_FD>>config.log
1307 AS_BOX([Running $as_me.])
1308 } >&AS_MESSAGE_LOG_FD
1309 cat >&AS_MESSAGE_LOG_FD <<_CSEOF
1311 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1312 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1313 generated by m4_PACKAGE_STRING. Invocation command line was
1315 CONFIG_FILES = $CONFIG_FILES
1316 CONFIG_HEADERS = $CONFIG_HEADERS
1317 CONFIG_LINKS = $CONFIG_LINKS
1318 CONFIG_COMMANDS = $CONFIG_COMMANDS
1322 echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&AS_MESSAGE_LOG_FD
1323 echo >&AS_MESSAGE_LOG_FD
1326 # Files that config.status was made for.
1327 if test -n "$ac_config_files"; then
1328 echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
1331 if test -n "$ac_config_headers"; then
1332 echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
1335 if test -n "$ac_config_links"; then
1336 echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
1339 if test -n "$ac_config_commands"; then
1340 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
1343 cat >>$CONFIG_STATUS <<\_ACEOF
1346 \`$as_me' instantiates files from templates according to the
1347 current configuration.
1349 Usage: $[0] [[OPTIONS]] [[FILE]]...
1351 -h, --help print this help, then exit
1352 -V, --version print version number, then exit
1353 -q, --quiet do not print progress messages
1354 -d, --debug don't remove temporary files
1355 --recheck update $as_me by reconfiguring in the same conditions
1356 m4_ifset([AC_LIST_FILES],
1357 [[ --file=FILE[:TEMPLATE]
1358 instantiate the configuration file FILE
1360 m4_ifset([AC_LIST_HEADERS],
1361 [[ --header=FILE[:TEMPLATE]
1362 instantiate the configuration header FILE
1365 m4_ifset([AC_LIST_FILES],
1366 [Configuration files:
1370 m4_ifset([AC_LIST_HEADERS],
1371 [Configuration headers:
1375 m4_ifset([AC_LIST_LINKS],
1376 [Configuration links:
1380 m4_ifset([AC_LIST_COMMANDS],
1381 [Configuration commands:
1385 Report bugs to <bug-autoconf@gnu.org>."
1388 cat >>$CONFIG_STATUS <<_ACEOF
1390 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1391 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1392 configured by $[0], generated by m4_PACKAGE_STRING,
1393 with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
1395 Copyright (C) 2003 Free Software Foundation, Inc.
1396 This config.status script is free software; the Free Software Foundation
1397 gives unlimited permission to copy, distribute and modify it."
1399 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1400 [dnl Leave those double quotes here: this $INSTALL is evaluated in a
1401 dnl here document, which might result in `INSTALL=/bin/install -c'.
1406 cat >>$CONFIG_STATUS <<\_ACEOF
1407 # If no file are specified by the user, then we need to provide default
1408 # value. By we need to know if files were specified by the user.
1410 while test $[#] != 0
1414 ac_option=`expr "x$[1]" : 'x\([[^=]]*\)='`
1415 ac_optarg=`expr "x$[1]" : 'x[[^=]]*=\(.*\)'`
1423 *) # This is not an option, so the user has probably given explicit
1426 ac_need_defaults=false;;
1430 # Handling of the options.
1432 cat >>$CONFIG_STATUS <<\_ACEOF
1433 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1435 --version | --vers* | -V )
1436 echo "$ac_cs_version"; exit 0 ;;
1438 # Conflict between --help and --header
1439 AC_MSG_ERROR([ambiguous option: $[1]
1440 Try `$[0] --help' for more information.]);;
1441 --help | --hel | -h )
1442 echo "$ac_cs_usage"; exit 0 ;;
1443 --debug | --d* | -d )
1445 --file | --fil | --fi | --f )
1447 CONFIG_FILES="$CONFIG_FILES $ac_optarg"
1448 ac_need_defaults=false;;
1449 --header | --heade | --head | --hea )
1451 CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
1452 ac_need_defaults=false;;
1453 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1454 | -silent | --silent | --silen | --sile | --sil | --si | --s)
1458 -*) AC_MSG_ERROR([unrecognized option: $[1]
1459 Try `$[0] --help' for more information.]) ;;
1461 *) ac_config_targets="$ac_config_targets $[1]" ;;
1467 ac_configure_extra_args=
1469 if $ac_cs_silent; then
1470 exec AS_MESSAGE_FD>/dev/null
1471 ac_configure_extra_args="$ac_configure_extra_args --silent"
1475 cat >>$CONFIG_STATUS <<_ACEOF
1476 if \$ac_cs_recheck; then
1477 echo "running $SHELL $[0] " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
1478 exec $SHELL $[0] $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
1483 dnl We output the INIT-CMDS first for obvious reasons :)
1484 m4_ifset([_AC_OUTPUT_COMMANDS_INIT],
1485 [cat >>$CONFIG_STATUS <<_ACEOF
1487 # INIT-COMMANDS section.
1490 _AC_OUTPUT_COMMANDS_INIT()
1494 dnl Issue this section only if there were actually config files.
1495 dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS,
1496 dnl or AC_LIST_LINKS is set.
1497 m4_ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(),
1499 cat >>$CONFIG_STATUS <<\_ACEOF
1500 for ac_config_target in $ac_config_targets
1502 case "$ac_config_target" in
1503 # Handling of arguments.
1504 AC_FOREACH([AC_File], AC_LIST_FILES,
1505 [ "m4_bpatsubst(AC_File, [:.*])" )dnl
1506 CONFIG_FILES="$CONFIG_FILES AC_File" ;;
1508 AC_FOREACH([AC_File], AC_LIST_LINKS,
1509 [ "m4_bpatsubst(AC_File, [:.*])" )dnl
1510 CONFIG_LINKS="$CONFIG_LINKS AC_File" ;;
1512 AC_FOREACH([AC_File], AC_LIST_COMMANDS,
1513 [ "m4_bpatsubst(AC_File, [:.*])" )dnl
1514 CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;;
1516 AC_FOREACH([AC_File], AC_LIST_HEADERS,
1517 [ "m4_bpatsubst(AC_File, [:.*])" )dnl
1518 CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;;
1520 *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
1524 # If the user did not use the arguments to specify the items to instantiate,
1525 # then the envvar interface is used. Set only those that are not.
1526 # We use the long form for the default assignment because of an extremely
1527 # bizarre bug on SunOS 4.1.3.
1528 if $ac_need_defaults; then
1529 m4_ifset([AC_LIST_FILES],
1530 [ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1532 m4_ifset([AC_LIST_HEADERS],
1533 [ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1535 m4_ifset([AC_LIST_LINKS],
1536 [ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1538 m4_ifset([AC_LIST_COMMANDS],
1539 [ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1543 # Have a temporary directory for convenience. Make it in the build tree
1544 # simply because there is no reason to put it here, and in addition,
1545 # creating and moving files from /tmp can sometimes cause problems.
1546 AS_TMPDIR([confstat], [.])
1551 dnl The following four sections are in charge of their own here
1552 dnl documenting into $CONFIG_STATUS.
1553 m4_ifset([AC_LIST_FILES], [_AC_OUTPUT_FILES()])dnl
1554 m4_ifset([AC_LIST_HEADERS], [_AC_OUTPUT_HEADERS()])dnl
1555 m4_ifset([AC_LIST_LINKS], [_AC_OUTPUT_LINKS()])dnl
1556 m4_ifset([AC_LIST_COMMANDS], [_AC_OUTPUT_COMMANDS()])dnl
1558 cat >>$CONFIG_STATUS <<\_ACEOF
1562 chmod +x $CONFIG_STATUS
1563 ])# _AC_OUTPUT_CONFIG_STATUS
1566 # AC_OUTPUT_MAKE_DEFS
1567 # -------------------
1568 # Set the DEFS variable to the -D options determined earlier.
1569 # This is a subroutine of AC_OUTPUT.
1570 # It is called inside configure, outside of config.status.
1571 # Using a here document instead of a string reduces the quoting nightmare.
1572 m4_define([AC_OUTPUT_MAKE_DEFS],
1573 [[# Transform confdefs.h into DEFS.
1574 # Protect against shell expansion while executing Makefile rules.
1575 # Protect against Makefile macro expansion.
1577 # If the first sed substitution is executed (which looks for macros that
1578 # take arguments), then we branch to the quote section. Otherwise,
1579 # look for a macro that doesn't take arguments.
1580 cat >confdef2opt.sed <<\_ACEOF
1583 s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
1585 s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
1589 s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
1595 # We use echo to avoid assuming a particular line-breaking character.
1596 # The extra dot is to prevent the shell from consuming trailing
1597 # line-breaks from the sub-command output. A line-break within
1598 # single-quotes doesn't work because, if this script is created in a
1599 # platform that uses two characters for line-breaks (e.g., DOS), tr
1601 ac_LF_and_DOT=`echo; echo .`
1602 DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
1603 rm -f confdef2opt.sed
1604 ]])# AC_OUTPUT_MAKE_DEFS