]> git.saurik.com Git - wxWidgets.git/blame - build/autoconf_prepend-include/autoconf/status.m4
copy wxAutohacks into main tree
[wxWidgets.git] / build / autoconf_prepend-include / autoconf / status.m4
CommitLineData
194f742f
RD
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.
5
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
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.
15#
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
19# 02111-1307, USA.
20
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.
28#
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.
36#
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.
47#
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.
51
52
53# This file handles about all the preparation aspects for
54# `config.status': registering the configuration files, the headers,
55# the links, and the commands `config.status' will run. There is a
56# little mixture though of things actually handled by `configure',
57# such as running the `configure' in the sub directories. Minor
58# detail.
59#
60# There are two kinds of commands:
61#
62# COMMANDS:
63#
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.
67#
68# INIT-CMDS:
69#
70# They are output via an *unquoted* here-doc. As a consequence $var
71# will be output as the value of VAR. This is typically used by
72# `configure' to give `config,.status' some variables it needs to run
73# the COMMANDS. At the difference of `COMMANDS', the INIT-CMDS are
74# always run.
75#
76#
77# Some uniformity exists around here, please respect it!
78#
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:
85#
86# case $ac_tag in
87# AC_LIST_FOOS_COMMANDS
88# esac
89#
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.
93#
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:
96#
97# if false; then
98# AC_CONFIG_FOOS(bar, [touch bar])
99# fi
100#
101# will not create bar.
102#
103# AC_CONFIG_FOOS can be called several times (with different TAGs of
104# course).
105#
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.
109#
110#
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.
117
118
119## ------------------ ##
120## Auxiliary macros. ##
121## ------------------ ##
122
123# _AC_SRCPATHS(BUILD-DIR-NAME)
124# ----------------------------
125# Inputs:
126# - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
127# - `$srcdir' is `top-build -> top-src'
128#
129# Ouputs:
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'.
135#
136# and `ac_abs_builddir' etc., the absolute paths.
137m4_define([_AC_SRCPATHS],
138[ac_builddir=.
139
140if 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'`
144else
145 ac_dir_suffix= ac_top_builddir=
146fi
147
148case $srcdir in
149 .) # No --srcdir option. We are building in place.
150 ac_srcdir=.
151 if test -z "$ac_top_builddir"; then
152 ac_top_srcdir=.
153 else
154 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
155 fi ;;
156 [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
157 ac_srcdir=$srcdir$ac_dir_suffix;
158 ac_top_srcdir=$srcdir ;;
159 *) # Relative path.
160 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
161 ac_top_srcdir=$ac_top_builddir$srcdir ;;
162esac
163
164# Do not use `cd foo && pwd` to compute absolute paths, because
165# the directories may not exist.
166AS_SET_CATFILE([ac_abs_builddir], [`pwd`], [$1])
167AS_SET_CATFILE([ac_abs_top_builddir],
168 [$ac_abs_builddir], [${ac_top_builddir}.])
169AS_SET_CATFILE([ac_abs_srcdir], [$ac_abs_builddir], [$ac_srcdir])
170AS_SET_CATFILE([ac_abs_top_srcdir], [$ac_abs_builddir], [$ac_top_srcdir])
171])# _AC_SRCPATHS
172
173
174
175## ------------------------------------- ##
176## Ensuring the uniqueness of the tags. ##
177## ------------------------------------- ##
178
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
182# ACTION-IF-FALSE.
183#
184# LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated
185# with spaces.
186#
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.
191m4_define([AC_CONFIG_IF_MEMBER],
192[m4_bmatch(m4_defn([$2]), [\(^\| \)]m4_re_escape([$1])[\([: ]\|$\)],
193 [$3], [$4])])
194
195
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.
200m4_define([AC_FILE_DEPENDENCY_TRACE], [])
201
202
203# _AC_CONFIG_DEPENDENCY(DEST, [SOURCE1], [SOURCE2...])
204# ----------------------------------------------------
205# Be sure that a missing dependency is expressed as a dependency upon
206# `DEST.in'.
207m4_define([_AC_CONFIG_DEPENDENCY],
208[m4_ifval([$2],
209 [AC_FILE_DEPENDENCY_TRACE($@)],
210 [AC_FILE_DEPENDENCY_TRACE([$1], [$1.in])])])
211
212
213# _AC_CONFIG_DEPENDENCIES(DEST[:SOURCE1[:SOURCE2...]]...)
214# -------------------------------------------------------
215# Declare the DESTs depend upon their SOURCE1 etc.
216m4_define([_AC_CONFIG_DEPENDENCIES],
217[AC_FOREACH([AC_File], [$1],
218 [_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])dnl
219])
220
221
222# _AC_CONFIG_UNIQUE(DEST[:SOURCE]...)
223# -----------------------------------
224#
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).
228#
229# Note that this macro does not check if the list $[1] itself
230# contains doubles.
231m4_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
244m4_popdef([AC_Dest])])dnl
245])
246
247
248
249## ------------------------ ##
250## Configuration commands. ##
251## ------------------------ ##
252
253
254# _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
255# -----------------------------------------
256#
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.
261m4_define([_AC_CONFIG_COMMANDS_INIT],
262[m4_ifval([$1],
263 [m4_append([_AC_OUTPUT_COMMANDS_INIT],
264 [$1
265])])])
266
267# Initialize.
268m4_define([_AC_OUTPUT_COMMANDS_INIT])
269
270
271# _AC_CONFIG_COMMAND(NAME, [COMMANDS])
272# ------------------------------------
273# See below.
274m4_define([_AC_CONFIG_COMMAND],
275[_AC_CONFIG_UNIQUE([$1])dnl
276m4_append([AC_LIST_COMMANDS], [ $1])dnl
277m4_ifval([$2],
278[m4_append([AC_LIST_COMMANDS_COMMANDS],
279[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
280])])dnl
281])
282
283# AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
284# ---------------------------------------------------
285#
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.
289AC_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
292ac_config_commands="$ac_config_commands $1"
293])
294
295# Initialize the lists.
296m4_define([AC_LIST_COMMANDS])
297m4_define([AC_LIST_COMMANDS_COMMANDS])
298
299
300# AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
301# -----------------------------------------
302#
303# Add additional commands for AC_OUTPUT to put into config.status.
304#
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.
309#
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).
314AU_DEFUN([AC_OUTPUT_COMMANDS],
315[m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
316dnl Double quoted since that was the case in the original macro.
317AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
318])
319
320# Initialize.
321AU_DEFUN([_AC_OUTPUT_COMMANDS_CNT], 0)
322
323
324# AC_CONFIG_COMMANDS_PRE(CMDS)
325# ----------------------------
326# Commands to run right before config.status is created. Accumulates.
327AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
328[m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
329])])
330
331
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.
337m4_define([AC_OUTPUT_COMMANDS_PRE],
338[_AC_LIBOBJS_NORMALIZE()
339])
340
341
342# AC_CONFIG_COMMANDS_POST(CMDS)
343# -----------------------------
344# Commands to run after config.status was created. Accumulates.
345AC_DEFUN([AC_CONFIG_COMMANDS_POST],
346[m4_append([AC_OUTPUT_COMMANDS_POST], [$1
347])])
348
349# Initialize.
350m4_define([AC_OUTPUT_COMMANDS_POST])
351
352
353
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.
358#
359# It has to send itself into $CONFIG_STATUS (eg, via here documents).
360# Upon exit, no here document shall be opened.
361m4_define([_AC_OUTPUT_COMMANDS],
362[cat >>$CONFIG_STATUS <<\_ACEOF
363
364#
365# CONFIG_COMMANDS section.
366#
367for 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"])
373
374 AC_MSG_NOTICE([executing $ac_dest commands])
375dnl Some shells don't like empty case/esac
376m4_ifset([AC_LIST_COMMANDS_COMMANDS],
377[ case $ac_dest in
378AC_LIST_COMMANDS_COMMANDS()dnl
379 esac
380])dnl
381done
382_ACEOF
383])# _AC_OUTPUT_COMMANDS
384
385
386
387
388## ----------------------- ##
389## Configuration headers. ##
390## ----------------------- ##
391
392
393# _AC_CONFIG_HEADER(HEADER, [COMMANDS])
394# -------------------------------------
395# See below.
396m4_define([_AC_CONFIG_HEADER],
397[_AC_CONFIG_UNIQUE([$1])dnl
398m4_append([AC_LIST_HEADERS], [ $1])dnl
399_AC_CONFIG_DEPENDENCIES([$1])dnl
400dnl Register the commands
401m4_ifval([$2],
402[m4_append([AC_LIST_HEADERS_COMMANDS],
403[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
404])])dnl
405])
406
407
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.
413#
414# The commands are stored in a growing string AC_LIST_HEADERS_COMMANDS
415# which should be used like this:
416#
417# case $ac_file in
418# AC_LIST_HEADERS_COMMANDS
419# esac
420AC_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
423ac_config_headers="$ac_config_headers m4_normalize([$1])"
424])
425
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).
429m4_define([AC_LIST_HEADERS])
430m4_define([AC_LIST_HEADERS_COMMANDS])
431
432
433# AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
434# --------------------------------------
435# FIXME: Make it obsolete?
436AC_DEFUN([AC_CONFIG_HEADER],
437[AC_CONFIG_HEADERS([$1])])
438
439
440# _AC_OUTPUT_HEADERS
441# ------------------
442#
443# Output the code which instantiates the `config.h' files from their
444# `config.h.in'.
445#
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.
449#
450#
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.
456#
457# Now there are two scripts: `conftest.defines' for the `#define'
458# templates, and `conftest.undef' for the `#undef' templates.
459#
460# Optimization 1. It is incredibly costly to run two `#undef'
461# scripts, so just remove trailing spaces first. Removes about a
462# third of the cost.
463#
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.
468#
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).
473#
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.
480#
481#
482# The result is about, hm, ... times blah... plus.... Ahem. The
483# result is about much faster.
484m4_define([_AC_OUTPUT_HEADERS],
485[cat >>$CONFIG_STATUS <<\_ACEOF
486
487#
488# CONFIG_HEADER section.
489#
490
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.
493#
494# ac_d sets the value in "#define NAME VALUE" lines.
495dnl Double quote for the `[ ]' and `define'.
496[ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
497ac_dB='[ ].*$,\1#\2'
498ac_dC=' '
499ac_dD=',;t'
500# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
501ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
502ac_uB='$,\1#\2define\3'
503ac_uC=' '
504ac_uD=',;t']
505
506for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
507 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
508 case $ac_file in
509 - | *:- | *:-:* ) # input from stdin
510 cat >$tmp/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 ;;
516 esac
517
518 test x"$ac_file" != x- && AC_MSG_NOTICE([creating $ac_file])
519
520 # First look for the input files in the build tree, otherwise in the
521 # src tree.
522 ac_file_inputs=`IFS=:
523 for f in $ac_file_in; do
524 case $f in
525 -) echo $tmp/stdin ;;
526 [[\\/$]]*)
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.
530 echo "$f";;
531 *) # Relative
532 if test -f "$f"; then
533 # Build tree
534 echo "$f"
535 elif test -f "$srcdir/$f"; then
536 # Source tree
537 echo "$srcdir/$f"
538 else
539 # /dev/null tree
540 AC_MSG_ERROR([cannot find input file: $f])
541 fi;;
542 esac
543 done` || AS_EXIT([1])
544 # Remove the trailing spaces.
545 sed 's/[[ ]]*$//' $ac_file_inputs >$tmp/in
546
547_ACEOF
548
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
555# in config.status.
556rm -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.
559#
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'.
563cat >confdef2sed.sed <<\_ACEOF
564dnl Double quote for `[ ]' and `define'.
565[s/[\\&,]/\\&/g
566s,[\\$`],\\&,g
567t clear
568: clear
569s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
570t end
571s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
572: end]
573_ACEOF
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.
577uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
578sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
579rm -f confdef2sed.sed
580
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.
584cat >>conftest.undefs <<\_ACEOF
585[s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,]
586_ACEOF
587
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).
590echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
591echo ' if grep ["^[ ]*#[ ]*define"] $tmp/in >/dev/null; then' >>$CONFIG_STATUS
592echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
593echo ' :' >>$CONFIG_STATUS
594rm -f conftest.tail
595while grep . conftest.defines >/dev/null
596do
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
605 echo 'CEOF
606 sed -f $tmp/defines.sed $tmp/in >$tmp/out
607 rm -f $tmp/in
608 mv $tmp/out $tmp/in
609' >>$CONFIG_STATUS
610 sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
611 rm -f conftest.defines
612 mv conftest.tail conftest.defines
613done
614rm -f conftest.defines
615echo ' fi # grep' >>$CONFIG_STATUS
616echo >>$CONFIG_STATUS
617
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).
620echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
621rm -f conftest.tail
622while grep . conftest.undefs >/dev/null
623do
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
632 echo 'CEOF
633 sed -f $tmp/undefs.sed $tmp/in >$tmp/out
634 rm -f $tmp/in
635 mv $tmp/out $tmp/in
636' >>$CONFIG_STATUS
637 sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
638 rm -f conftest.undefs
639 mv conftest.tail conftest.undefs
640done
641rm -f conftest.undefs
642
643dnl Now back to your regularly scheduled config.status.
644cat >>$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
650 else
651 echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
652 fi
653 cat $tmp/in >>$tmp/config.h
654 rm -f $tmp/in
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])
658 else
659 ac_dir=`AS_DIRNAME(["$ac_file"])`
660 AS_MKDIR_P(["$ac_dir"])
661 rm -f $ac_file
662 mv $tmp/config.h $ac_file
663 fi
664 else
665 cat $tmp/config.h
666 rm -f $tmp/config.h
667 fi
668dnl If running for Automake, be ready to perform additional
669dnl commands to set up the timestamp files.
670m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
671 [_AC_AM_CONFIG_HEADER_HOOK([$ac_file])
672])dnl
673m4_ifset([AC_LIST_HEADERS_COMMANDS],
674[ # Run the commands associated with the file.
675 case $ac_file in
676AC_LIST_HEADERS_COMMANDS()dnl
677 esac
678])dnl
679done
680_ACEOF
681])# _AC_OUTPUT_HEADERS
682
683
684
685## --------------------- ##
686## Configuration links. ##
687## --------------------- ##
688
689
690# _AC_CONFIG_LINK(DEST:SOURCE, [COMMANDS])
691# ----------------------------------------
692# See below.
693m4_define([_AC_CONFIG_LINK],
694[_AC_CONFIG_UNIQUE([$1])dnl
695m4_append([AC_LIST_LINKS], [ $1])dnl
696_AC_CONFIG_DEPENDENCIES([$1])dnl
697m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])dnl
698dnl Register the commands
699m4_ifval([$2],
700[m4_append([AC_LIST_LINKS_COMMANDS],
701[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
702])])dnl
703])
704
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 .').
711AC_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
714ac_config_links="$ac_config_links m4_normalize([$1])"
715])
716
717
718# Initialize the list.
719m4_define([AC_LIST_LINKS])
720m4_define([AC_LIST_LINKS_COMMANDS])
721
722
723# AC_LINK_FILES(SOURCE..., DEST...)
724# ---------------------------------
725# Link each of the existing files SOURCE... to the corresponding
726# link name in DEST...
727#
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.
735#
736# _AC_LINK_CNT is used to be robust to multiple calls.
737AU_DEFUN([AC_LINK_FILES],
738[m4_if($#, 2, ,
739 [m4_fatal([$0: incorrect number of arguments])])dnl
740m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
741ac_sources="$1"
742ac_dests="$2"
743while 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"
747done
748AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
749],
750[
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
754
755
756# Initialize.
757AU_DEFUN([_AC_LINK_FILES_CNT], 0)
758
759# _AC_OUTPUT_LINKS
760# ----------------
761# This is a subroutine of AC_OUTPUT.
762#
763# It has to send itself into $CONFIG_STATUS (eg, via here documents).
764# Upon exit, no here document shall be opened.
765m4_define([_AC_OUTPUT_LINKS],
766[cat >>$CONFIG_STATUS <<\_ACEOF
767
768#
769# CONFIG_LINKS section.
770#
771
772dnl Here we use : instead of .. because if AC_LINK_FILES was used
773dnl with empty parameters (as in gettext.m4), then we obtain here
774dnl `:', which we want to skip. So let's keep a single exception: `:'.
775for 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,[[^:]]*:,,'`
778
779 AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_dest])
780
781 if test ! -r $srcdir/$ac_source; then
782 AC_MSG_ERROR([$srcdir/$ac_source: file not found])
783 fi
784 rm -f $ac_dest
785
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"])
790
791 case $srcdir in
792 [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
793 *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
794 esac
795
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])
801m4_ifset([AC_LIST_LINKS_COMMANDS],
802[ # Run the commands associated with the file.
803 case $ac_file in
804AC_LIST_LINKS_COMMANDS()dnl
805 esac
806])dnl
807done
808_ACEOF
809])# _AC_OUTPUT_LINKS
810
811
812
813## --------------------- ##
814## Configuration files. ##
815## --------------------- ##
816
817
818# _AC_CONFIG_FILE(FILE..., [COMMANDS])
819# ------------------------------------
820# See below.
821m4_define([_AC_CONFIG_FILE],
822[_AC_CONFIG_UNIQUE([$1])dnl
823m4_append([AC_LIST_FILES], [ $1])dnl
824_AC_CONFIG_DEPENDENCIES([$1])dnl
825dnl Register the commands.
826m4_ifval([$2],
827[m4_append([AC_LIST_FILES_COMMANDS],
828[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;;
829])])dnl
830])
831
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.
837#
838# The commands are stored in a growing string AC_LIST_FILES_COMMANDS
839# which should be used like this:
840#
841# case $ac_file in
842# AC_LIST_FILES_COMMANDS
843# esac
844AC_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
847ac_config_files="$ac_config_files m4_normalize([$1])"
848])
849
850# Initialize the lists.
851m4_define([AC_LIST_FILES])
852m4_define([AC_LIST_FILES_COMMANDS])
853
854
855
856# _AC_OUTPUT_FILES
857# ----------------
858# Do the variable substitutions to create the Makefiles or whatever.
859# This is a subroutine of AC_OUTPUT.
860#
861# It has to send itself into $CONFIG_STATUS (eg, via here documents).
862# Upon exit, no here document shall be opened.
863m4_define([_AC_OUTPUT_FILES],
864[cat >>$CONFIG_STATUS <<_ACEOF
865
866#
867# CONFIG_FILES section.
868#
869
870# No need to generate the scripts if there are no CONFIG_FILES.
871# This happens for instance when ./config.status config.h
872if test -n "\$CONFIG_FILES"; then
873 # Protect against being on the right side of a sed subst in config.status.
874dnl Please, pay attention that this sed code depends a lot on the shape
875dnl of the sed commands issued by AC_SUBST. So if you change one, change
876dnl the other too.
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]
879dnl These here document variables are unquoted when configure runs
880dnl but quoted when config.status runs, so variables are expanded once.
881dnl Insert the sed substitutions of variables.
882m4_ifdef([_AC_SUBST_VARS],
883 [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]),
884[s,@AC_Var@,$AC_Var,;t t
885])])dnl
886m4_ifdef([_AC_SUBST_FILES],
887 [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_FILES]),
888[/@AC_Var@/r $AC_Var
889s,@AC_Var@,,;t t
890])])dnl
891CEOF
892
893_ACEOF
894
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.
898dnl One cannot portably go further than 100 commands because of HP-UX.
899dnl Here, there are 2 cmd per line, and two cmd are added later.
900 ac_max_sed_lines=48
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.
904 ac_more_lines=:
905 ac_sed_cmds=
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
909 else
910 sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
911 fi
912 if test ! -s $tmp/subs.frag; then
913 ac_more_lines=false
914 else
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.
919 (echo [':t
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"
923 else
924 ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
925 fi
926 ac_sed_frag=`expr $ac_sed_frag + 1`
927 ac_beg=$ac_end
928 ac_end=`expr $ac_end + $ac_max_sed_lines`
929 fi
930 done
931 if test -z "$ac_sed_cmds"; then
932 ac_sed_cmds=cat
933 fi
934fi # test -n "$CONFIG_FILES"
935
936_ACEOF
937cat >>$CONFIG_STATUS <<\_ACEOF
938for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
939 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
940 case $ac_file in
941 - | *:- | *:-:* ) # input from stdin
942 cat >$tmp/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 ;;
948 esac
949
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"])
954
955AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
956[ case $INSTALL in
957 [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
958 *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
959 esac
960])dnl
961
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
966 configure_input=
967 else
968 configure_input="$ac_file. "
969 fi
970 configure_input=$configure_input"Generated from `echo $ac_file_in |
971 sed 's,.*/,,'` by configure."
972
973 # First look for the input files in the build tree, otherwise in the
974 # src tree.
975 ac_file_inputs=`IFS=:
976 for f in $ac_file_in; do
977 case $f in
978 -) echo $tmp/stdin ;;
979 [[\\/$]]*)
980 # Absolute (can't be DOS-style, as IFS=:)
981 test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
982 echo "$f";;
983 *) # Relative
984 if test -f "$f"; then
985 # Build tree
986 echo "$f"
987 elif test -f "$srcdir/$f"; then
988 # Source tree
989 echo "$srcdir/$f"
990 else
991 # /dev/null tree
992 AC_MSG_ERROR([cannot find input file: $f])
993 fi;;
994 esac
995 done` || AS_EXIT([1])
996
997 if test x"$ac_file" != x-; then
998 AC_MSG_NOTICE([creating $ac_file])
999 rm -f "$ac_file"
1000 fi
1001_ACEOF
1002cat >>$CONFIG_STATUS <<_ACEOF
1003dnl Neutralize VPATH when `$srcdir' = `.'.
1004 sed "$ac_vpsub
1005dnl Shell code in configure.ac might set extrasub.
1006dnl FIXME: do we really want to maintain this feature?
1007$extrasub
1008_ACEOF
1009cat >>$CONFIG_STATUS <<\_ACEOF
1010:t
1011[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
1012s,@configure_input@,$configure_input,;t t
1013s,@srcdir@,$ac_srcdir,;t t
1014s,@abs_srcdir@,$ac_abs_srcdir,;t t
1015s,@top_srcdir@,$ac_top_srcdir,;t t
1016s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
1017s,@builddir@,$ac_builddir,;t t
1018s,@abs_builddir@,$ac_abs_builddir,;t t
1019s,@top_builddir@,$ac_top_builddir,;t t
1020s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
1021AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t
1022])dnl
1023dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
1024" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
1025 rm -f $tmp/stdin
1026dnl This would break Makefile dependencies.
1027dnl if diff $ac_file $tmp/out >/dev/null 2>&1; then
1028dnl echo "$ac_file is unchanged"
1029dnl else
1030dnl rm -f $ac_file
1031dnl mv $tmp/out $ac_file
1032dnl fi
1033 if test x"$ac_file" != x-; then
1034 mv $tmp/out $ac_file
1035 else
1036 cat $tmp/out
1037 rm -f $tmp/out
1038 fi
1039
1040m4_ifset([AC_LIST_FILES_COMMANDS],
1041[ # Run the commands associated with the file.
1042 case $ac_file in
1043AC_LIST_FILES_COMMANDS()dnl
1044 esac
1045])dnl
1046done
1047_ACEOF
1048])# _AC_OUTPUT_FILES
1049
1050
1051
1052## ----------------------- ##
1053## Configuration subdirs. ##
1054## ----------------------- ##
1055
1056
1057# AC_CONFIG_SUBDIRS(DIR ...)
1058# --------------------------
1059# We define two variables:
1060# - ac_subdirs_all
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.
1064# - subdirs
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.
1069AC_DEFUN([AC_CONFIG_SUBDIRS],
1070[_AC_CONFIG_UNIQUE([$1])dnl
1071AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1072m4_append([_AC_LIST_SUBDIRS], [ $1])dnl
1073AS_LITERAL_IF([$1], [],
1074 [AC_DIAGNOSE(syntax, [$0: you should use literals])])
1075m4_divert_text([DEFAULTS],
1076 [ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
1077AC_SUBST(subdirs, "$subdirs $1")dnl
1078])
1079
1080# Initialize the list.
1081m4_define([_AC_LIST_SUBDIRS])
1082
1083
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.
1088m4_define([_AC_OUTPUT_SUBDIRS],
1089[
1090#
1091# CONFIG_SUBDIRS section.
1092#
1093if test "$no_recursion" != yes; then
1094
1095 # Remove --cache-file and --srcdir arguments so they do not pile up.
1096 ac_sub_configure_args=
1097 ac_prev=
1098 for ac_arg in $ac_configure_args; do
1099 if test -n "$ac_prev"; then
1100 ac_prev=
1101 continue
1102 fi
1103 case $ac_arg in
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=* \
1109 | --c=*)
1110 ;;
1111 --config-cache | -C)
1112 ;;
1113 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1114 ac_prev=srcdir ;;
1115 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1116 ;;
1117 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1118 ac_prev=prefix ;;
1119 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1120 ;;
1121 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
1122 esac
1123 done
1124
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"
1128
1129 ac_popdir=`pwd`
1130 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
1131
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
1135
1136 AC_MSG_NOTICE([configuring in $ac_dir])
1137 AS_MKDIR_P(["$ac_dir"])
1138 _AC_SRCPATHS(["$ac_dir"])
1139
1140 cd $ac_dir
1141
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
1149 else
1150 AC_MSG_WARN([no configuration information is in $ac_dir])
1151 ac_sub_configure=
1152 fi
1153
1154 # The recursion is here.
1155 if test -n "$ac_sub_configure"; then
1156 # Make the cache file name correct relative to the subdirectory.
1157 case $cache_file in
1158 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
1159 *) # Relative path.
1160 ac_sub_cache_file=$ac_top_builddir$cache_file ;;
1161 esac
1162
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])
1168 fi
1169
1170 cd "$ac_popdir"
1171 done
1172fi
1173])# _AC_OUTPUT_SUBDIRS
1174
1175
1176
1177
1178## -------------------------- ##
1179## Outputting config.status. ##
1180## -------------------------- ##
1181
1182
1183# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1184# -------------------------------------------------------------------
1185#
1186# If there are arguments given to AC_OUTPUT, dispatch them to the
1187# proper modern macros.
1188AU_DEFUN([AC_OUTPUT],
1189[m4_ifvaln([$1],
1190 [AC_CONFIG_FILES([$1])])dnl
1191m4_ifvaln([$2$3],
1192 [AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])])dnl
1193[AC_OUTPUT]])
1194
1195
1196# AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
1197# -------------------------------------------------------
1198# The big finish.
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...
1203m4_define([AC_OUTPUT],
1204[dnl Dispatch the extra arguments to their native macros.
1205m4_ifval([$1],
1206 [AC_CONFIG_FILES([$1])])dnl
1207m4_ifval([$2$3],
1208 [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
1209m4_ifval([$1$2$3],
1210 [AC_DIAGNOSE([obsolete],
1211 [$0 should be used without arguments.
1212You should run autoupdate.])])dnl
1213AC_CACHE_SAVE
1214
1215test "x$prefix" = xNONE && prefix=$ac_default_prefix
1216# Let make expand exec_prefix.
1217test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1218
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).
1223if test "x$srcdir" = x.; then
1224 ac_vpsub=['/^[ ]*VPATH[ ]*=/{
1225s/:*\$(srcdir):*/:/;
1226s/:*\${srcdir}:*/:/;
1227s/:*@srcdir@:*/:/;
1228s/^\([^=]*=[ ]*\):*/\1/;
1229s/:*$//;
1230s/^[^=]*=[ ]*$//;
1231}']
1232fi
1233
1234m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
1235
1236dnl Commands to run before creating config.status.
1237AC_OUTPUT_COMMANDS_PRE()dnl
1238
1239: ${CONFIG_STATUS=./config.status}
1240ac_clean_files_save=$ac_clean_files
1241ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1242_AC_OUTPUT_CONFIG_STATUS()dnl
1243ac_clean_files=$ac_clean_files_save
1244
1245dnl Commands to run after config.status was created
1246AC_OUTPUT_COMMANDS_POST()dnl
1247
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.
1256if test "$no_create" != yes; then
1257 ac_cs_success=:
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])
1267fi
1268dnl config.status should not do recursion.
1269AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
1270])# AC_OUTPUT
1271
1272
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...
1278m4_define([_AC_OUTPUT_CONFIG_STATUS],
1279[AC_MSG_NOTICE([creating $CONFIG_STATUS])
1280cat >$CONFIG_STATUS <<_ACEOF
1281#! $SHELL
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.
1286
1287debug=false
1288ac_cs_recheck=false
1289ac_cs_silent=false
1290SHELL=\${CONFIG_SHELL-$SHELL}
1291_ACEOF
1292
1293cat >>$CONFIG_STATUS <<\_ACEOF
1294AS_SHELL_SANITIZE
1295dnl Watch out, this is directly the initializations, do not use
1296dnl AS_PREPARE, otherwise you'd get it output in the initialization
1297dnl of configure, not config.status.
1298_AS_PREPARE
1299exec AS_MESSAGE_FD>&1
1300
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.
1304exec AS_MESSAGE_LOG_FD>>config.log
1305{
1306 echo
1307 AS_BOX([Running $as_me.])
1308} >&AS_MESSAGE_LOG_FD
1309cat >&AS_MESSAGE_LOG_FD <<_CSEOF
1310
1311This 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
1313generated by m4_PACKAGE_STRING. Invocation command line was
1314
1315 CONFIG_FILES = $CONFIG_FILES
1316 CONFIG_HEADERS = $CONFIG_HEADERS
1317 CONFIG_LINKS = $CONFIG_LINKS
1318 CONFIG_COMMANDS = $CONFIG_COMMANDS
1319 $ $[0] $[@]
1320
1321_CSEOF
1322echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&AS_MESSAGE_LOG_FD
1323echo >&AS_MESSAGE_LOG_FD
1324_ACEOF
1325
1326# Files that config.status was made for.
1327if test -n "$ac_config_files"; then
1328 echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
1329fi
1330
1331if test -n "$ac_config_headers"; then
1332 echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
1333fi
1334
1335if test -n "$ac_config_links"; then
1336 echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
1337fi
1338
1339if test -n "$ac_config_commands"; then
1340 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
1341fi
1342
1343cat >>$CONFIG_STATUS <<\_ACEOF
1344
1345ac_cs_usage="\
1346\`$as_me' instantiates files from templates according to the
1347current configuration.
1348
1349Usage: $[0] [[OPTIONS]] [[FILE]]...
1350
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
1356m4_ifset([AC_LIST_FILES],
1357[[ --file=FILE[:TEMPLATE]
1358 instantiate the configuration file FILE
1359]])dnl
1360m4_ifset([AC_LIST_HEADERS],
1361[[ --header=FILE[:TEMPLATE]
1362 instantiate the configuration header FILE
1363]])dnl
1364
1365m4_ifset([AC_LIST_FILES],
1366[Configuration files:
1367$config_files
1368
1369])dnl
1370m4_ifset([AC_LIST_HEADERS],
1371[Configuration headers:
1372$config_headers
1373
1374])dnl
1375m4_ifset([AC_LIST_LINKS],
1376[Configuration links:
1377$config_links
1378
1379])dnl
1380m4_ifset([AC_LIST_COMMANDS],
1381[Configuration commands:
1382$config_commands
1383
1384])dnl
1385Report bugs to <bug-autoconf@gnu.org>."
1386_ACEOF
1387
1388cat >>$CONFIG_STATUS <<_ACEOF
1389ac_cs_version="\\
1390m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
1391m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1392configured by $[0], generated by m4_PACKAGE_STRING,
1393 with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
1394
1395Copyright (C) 2003 Free Software Foundation, Inc.
1396This config.status script is free software; the Free Software Foundation
1397gives unlimited permission to copy, distribute and modify it."
1398srcdir=$srcdir
1399AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
1400[dnl Leave those double quotes here: this $INSTALL is evaluated in a
1401dnl here document, which might result in `INSTALL=/bin/install -c'.
1402INSTALL="$INSTALL"
1403])dnl
1404_ACEOF
1405
1406cat >>$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.
1409ac_need_defaults=:
1410while test $[#] != 0
1411do
1412 case $[1] in
1413 --*=*)
1414 ac_option=`expr "x$[1]" : 'x\([[^=]]*\)='`
1415 ac_optarg=`expr "x$[1]" : 'x[[^=]]*=\(.*\)'`
1416 ac_shift=:
1417 ;;
1418 -*)
1419 ac_option=$[1]
1420 ac_optarg=$[2]
1421 ac_shift=shift
1422 ;;
1423 *) # This is not an option, so the user has probably given explicit
1424 # arguments.
1425 ac_option=$[1]
1426 ac_need_defaults=false;;
1427 esac
1428
1429 case $ac_option in
1430 # Handling of the options.
1431_ACEOF
1432cat >>$CONFIG_STATUS <<\_ACEOF
1433 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1434 ac_cs_recheck=: ;;
1435 --version | --vers* | -V )
1436 echo "$ac_cs_version"; exit 0 ;;
1437 --he | --h)
1438 # Conflict between --help and --header
1439 AC_MSG_ERROR([ambiguous option: $[1]
1440Try `$[0] --help' for more information.]);;
1441 --help | --hel | -h )
1442 echo "$ac_cs_usage"; exit 0 ;;
1443 --debug | --d* | -d )
1444 debug=: ;;
1445 --file | --fil | --fi | --f )
1446 $ac_shift
1447 CONFIG_FILES="$CONFIG_FILES $ac_optarg"
1448 ac_need_defaults=false;;
1449 --header | --heade | --head | --hea )
1450 $ac_shift
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)
1455 ac_cs_silent=: ;;
1456
1457 # This is an error.
1458 -*) AC_MSG_ERROR([unrecognized option: $[1]
1459Try `$[0] --help' for more information.]) ;;
1460
1461 *) ac_config_targets="$ac_config_targets $[1]" ;;
1462
1463 esac
1464 shift
1465done
1466
1467ac_configure_extra_args=
1468
1469if $ac_cs_silent; then
1470 exec AS_MESSAGE_FD>/dev/null
1471 ac_configure_extra_args="$ac_configure_extra_args --silent"
1472fi
1473
1474_ACEOF
1475cat >>$CONFIG_STATUS <<_ACEOF
1476if \$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
1479fi
1480
1481_ACEOF
1482
1483dnl We output the INIT-CMDS first for obvious reasons :)
1484m4_ifset([_AC_OUTPUT_COMMANDS_INIT],
1485[cat >>$CONFIG_STATUS <<_ACEOF
1486#
1487# INIT-COMMANDS section.
1488#
1489
1490_AC_OUTPUT_COMMANDS_INIT()
1491_ACEOF])
1492
1493
1494dnl Issue this section only if there were actually config files.
1495dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS,
1496dnl or AC_LIST_LINKS is set.
1497m4_ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(),
1498[
1499cat >>$CONFIG_STATUS <<\_ACEOF
1500for ac_config_target in $ac_config_targets
1501do
1502 case "$ac_config_target" in
1503 # Handling of arguments.
1504AC_FOREACH([AC_File], AC_LIST_FILES,
1505[ "m4_bpatsubst(AC_File, [:.*])" )dnl
1506 CONFIG_FILES="$CONFIG_FILES AC_File" ;;
1507])dnl
1508AC_FOREACH([AC_File], AC_LIST_LINKS,
1509[ "m4_bpatsubst(AC_File, [:.*])" )dnl
1510 CONFIG_LINKS="$CONFIG_LINKS AC_File" ;;
1511])dnl
1512AC_FOREACH([AC_File], AC_LIST_COMMANDS,
1513[ "m4_bpatsubst(AC_File, [:.*])" )dnl
1514 CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;;
1515])dnl
1516AC_FOREACH([AC_File], AC_LIST_HEADERS,
1517[ "m4_bpatsubst(AC_File, [:.*])" )dnl
1518 CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;;
1519])dnl
1520 *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
1521 esac
1522done
1523
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.
1528if $ac_need_defaults; then
1529m4_ifset([AC_LIST_FILES],
1530[ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
1531])dnl
1532m4_ifset([AC_LIST_HEADERS],
1533[ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
1534])dnl
1535m4_ifset([AC_LIST_LINKS],
1536[ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
1537])dnl
1538m4_ifset([AC_LIST_COMMANDS],
1539[ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
1540])dnl
1541fi
1542
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.
1546AS_TMPDIR([confstat], [.])
1547
1548_ACEOF
1549])[]dnl m4_ifval
1550
1551dnl The following four sections are in charge of their own here
1552dnl documenting into $CONFIG_STATUS.
1553m4_ifset([AC_LIST_FILES], [_AC_OUTPUT_FILES()])dnl
1554m4_ifset([AC_LIST_HEADERS], [_AC_OUTPUT_HEADERS()])dnl
1555m4_ifset([AC_LIST_LINKS], [_AC_OUTPUT_LINKS()])dnl
1556m4_ifset([AC_LIST_COMMANDS], [_AC_OUTPUT_COMMANDS()])dnl
1557
1558cat >>$CONFIG_STATUS <<\_ACEOF
1559
1560AS_EXIT(0)
1561_ACEOF
1562chmod +x $CONFIG_STATUS
1563])# _AC_OUTPUT_CONFIG_STATUS
1564
1565
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.
1572m4_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.
1576#
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.
1580cat >confdef2opt.sed <<\_ACEOF
1581t clear
1582: clear
1583s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
1584t quote
1585s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
1586t quote
1587d
1588: quote
1589s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
1590s,\[,\\&,g
1591s,\],\\&,g
1592s,\$,$$,g
1593p
1594_ACEOF
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
1600# would break.
1601ac_LF_and_DOT=`echo; echo .`
1602DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
1603rm -f confdef2opt.sed
1604]])# AC_OUTPUT_MAKE_DEFS