_FILES],
[  \$ac_cs_awk_pipe_init])[
}
{
  line = $ 0
  nfields = split(line, field, "@")
  substed = 0
  len = length(field[1])
  for (i = 2; i < nfields; i++) {
    key = field[i]
    keylen = length(key)
    if (S_is_set[key]) {
      value = S[key]
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
      len += length(value) + length(field[++i])
      substed = 1
    } else
      len += 1 + keylen
  }
]m4_ifdef([_AC_SUBST_FILES],
[[  if (nfields == 3 && !substed) {
    key = field[2]
    if (F[key] != "" && line ~ /^[	 ]*@.*@[	 ]*$/) {
      \$ac_cs_awk_read_file
      next
    }
  }]])[
  print line
}
]dnl end of double-quoted part
m4_ifdef([_AC_SUBST_FILES],
[\$ac_cs_awk_pipe_fini])
_ACAWK
_ACEOF
dnl See if CR is the EOL marker.  If not, remove any EOL-related
dnl ^M bytes and escape any remaining ones.  If so, just use mv.
dnl In case you're wondering how ^M bytes can make it into subs1.awk,
dnl [from Ralf Wildenhues] one way is if you have e.g.,
dnl AC_SUBST([variable_that_contains_cr], ["
dnl "])
dnl The original aim was that users should be able to substitute any
dnl characters they like (except for \0).  And the above is not so
dnl unlikely if the configure script itself happens to be converted
dnl to w32 text mode.
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
  cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
  || AC_MSG_ERROR([could not setup config files machinery])
_ACEOF

# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub=['/^[	 ]*VPATH[	 ]*=[	 ]*/{
h
s///
s/^/:/
s/[	 ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[	 ]*\).*/\1/
G
s/\n//
s/^[^=]*=[	 ]*$//
}']
fi

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"

])# _AC_OUTPUT_FILES_PREPARE

# _AC_OUTPUT_FILE_ADJUST_DIR(VAR)
# -------------------------------
# Generate the sed snippet needed to output VAR relative to the
# top-level directory.
m4_define([_AC_OUTPUT_FILE_ADJUST_DIR],
[s&@$1@&$ac_$1&;t t[]AC_SUBST_TRACE([$1])])


# _AC_OUTPUT_FILE
# ---------------
# Do the variable substitutions to create the Makefiles or whatever.
#
# This macro is expanded inside a here document.  If the here document is
# closed, it has to be reopened with
# "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
#
m4_define([_AC_OUTPUT_FILE],
[
  #
  # CONFIG_FILE
  #

AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
[  case $INSTALL in
  [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
  esac
])dnl
AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
[  ac_MKDIR_P=$MKDIR_P
  case $MKDIR_P in
  [[\\/$]]* | ?:[[\\/]]* ) ;;
  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
  esac
])dnl
_ACEOF

m4_ifndef([AC_DATAROOTDIR_CHECKED],
[cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
m4_define([_AC_datarootdir_vars],
	  [datadir, docdir, infodir, localedir, mandir])]dnl
[m4_define([_AC_datarootdir_subst], [  s&@$][1@&$$][1&g])]dnl
[ac_sed_dataroot='
/datarootdir/ {
  p
  q
}
m4_map_args_sep([/@], [@/p], [
], _AC_datarootdir_vars)'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
  AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  ac_datarootdir_hack='
m4_map_args_sep([_AC_datarootdir_subst(], [)], [
], _AC_datarootdir_vars)
  s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
])dnl

# Neutralize VPATH when '$srcdir' = '.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
dnl Note if you change the s||| delimiter here, don't forget to adjust
dnl ac_sed_conf_input accordingly.  Using & is a bad idea if & appears in
dnl the replacement string.
s|@configure_input@|$ac_sed_conf_input|;t t
dnl During the transition period, this is a special case:
s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
dnl For this substitution see the witness macro _AC_HAVE_TOP_BUILD_PREFIX above.
s&@top_build_prefix@&$ac_top_build_prefix&;t t[]AC_SUBST_TRACE([top_build_prefix])
m4_map_args_sep([$0_ADJUST_DIR(], [)], [
], [srcdir], [abs_srcdir], [top_srcdir], [abs_top_srcdir],
   [builddir], [abs_builddir],
   [abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
     [, [INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [, [MKDIR_P]]))
m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
])dnl
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" m4_defn([_AC_SUBST_CMDS]) \
  >$ac_tmp/out || AC_MSG_ERROR([could not create $ac_file])

m4_ifndef([AC_DATAROOTDIR_CHECKED],
[test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
  { ac_out=`sed -n '/^[[	 ]]*datarootdir[[	 ]]*:*=/p' \
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
  AC_MSG_WARN([$ac_file contains a reference to the variable 'datarootdir'
which seems to be undefined.  Please make sure it is defined])
])dnl

  rm -f "$ac_tmp/stdin"
  case $ac_file in
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
  esac \
  || AC_MSG_ERROR([could not create $ac_file])
dnl This would break Makefile dependencies:
dnl  if diff "$ac_file" "$ac_tmp/out" >/dev/null 2>&1; then
dnl    echo "$ac_file is unchanged"
dnl  else
dnl     rm -f "$ac_file"; mv "$ac_tmp/out" "$ac_file"
dnl  fi
])# _AC_OUTPUT_FILE




## ----------------------- ##
## Configuration headers.  ##
## ----------------------- ##


# AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
# ------------------------------------------------------
# Specify that the HEADERS are to be created by instantiation of the
# AC_DEFINEs.
#
AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])


# AU::AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
# --------------------------------------
AU_ALIAS([AC_CONFIG_HEADER], [AC_CONFIG_HEADERS])


# _AC_OUTPUT_HEADERS_PREPARE
# --------------------------
# Create the awk scripts needed for CONFIG_HEADERS.
# Support multiline #defines.
#
# This macro is expanded inside a here document.  If the here document is
# closed, it has to be reopened with
# "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
#
m4_define([_AC_OUTPUT_HEADERS_PREPARE],
[# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with './config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
dnl This '||' list is finished at the end of _AC_OUTPUT_HEADERS_PREPARE.
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF

# Transform confdefs.h into an awk script 'defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.

# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
  if test -z "$ac_tt"; then
    break
  elif $ac_last_try; then
    AC_MSG_ERROR([could not make $CONFIG_HEADERS])
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any.  Preserve backslash
# newline sequences.
dnl
dnl Structure of the sed script that reads confdefs.h:
dnl rset:  main loop, searches for '#define' lines
dnl def:   deal with a '#define' line
dnl bsnl:  deal with a '#define' line that ends with backslash-newline
dnl cont:  handle a continuation line
dnl bsnlc: handle a continuation line that ends with backslash-newline
dnl
dnl Each sub part escapes the awk special characters and outputs a statement
dnl inserting the macro value into the array D, keyed by name.  If the macro
dnl uses parameters, they are added in the array P, keyed by name.
dnl
dnl Long values are split into several string literals with help of ac_delim.
dnl Assume nobody uses macro names of nearly 150 bytes length.
dnl
dnl The initial replace for '#define' lines inserts a leading space
dnl in order to ease later matching; otherwise, output lines may be
dnl repeatedly matched.
dnl
dnl m4-double-quote most of this for [, ], define, and substr:
[
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
t rset
:rset
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' <confdefs.h | sed '
s/'"$ac_delim"'/"\\\
"/g' >>$CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  for (key in D) D_is_set[key] = 1
  FS = "